svn_revnum_t svn_sqlite__column_revnum(svn_sqlite__stmt_t *stmt, int column) { if (svn_sqlite__column_is_null(stmt, column)) return SVN_INVALID_REVNUM; return (svn_revnum_t) sqlite3_column_int64(stmt->s3stmt, column); }
svn_error_t * svn_wc__db_util_fetch_wc_id(apr_int64_t *wc_id, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool) { svn_sqlite__stmt_t *stmt; svn_boolean_t have_row; /* ### cheat. we know there is just one WORKING_COPY row, and it has a ### NULL value for local_abspath. */ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_WCROOT_NULL)); SVN_ERR(svn_sqlite__step(&have_row, stmt)); if (!have_row) return svn_error_createf(SVN_ERR_WC_CORRUPT, svn_sqlite__reset(stmt), _("Missing a row in WCROOT.")); SVN_ERR_ASSERT(!svn_sqlite__column_is_null(stmt, 0)); *wc_id = svn_sqlite__column_int64(stmt, 0); return svn_error_trace(svn_sqlite__reset(stmt)); }