Author: ehu Date: Mon Jul 19 17:42:21 2010 New Revision: 965571 URL: http://svn.apache.org/viewvc?rev=965571&view=rev Log: Add incomplete children to NODE_DATA, just like BASE_NODE and WORKING_NODE. Now every BASE_NODE and WORKING_NODE has at least one row in NODE_DATA.
* subversion/libsvn_wc/wc-queries.sql (STMT_INSERT_NODE_DATA_INCOMPLETE): New. * subversion/libsvn_wc/wc_db.c (insert_base_node, insert_incomplete_working_children): Do the insert. Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql subversion/trunk/subversion/libsvn_wc/wc_db.c Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=965571&r1=965570&r2=965571&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original) +++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Mon Jul 19 17:42:21 2010 @@ -102,6 +102,11 @@ INSERT OR IGNORE INTO WORKING_NODE ( wc_id, local_relpath, parent_relpath, presence, kind) VALUES (?1, ?2, ?3, 'incomplete', 'unknown'); +-- STMT_INSERT_NODE_DATA_INCOMPLETE +INSERT OR IGNORE INTO NODE_DATA ( + wc_id, local_relpath, op_depth, parent_relpath, presence, kind) +VALUES (?1, ?2, ?3, ?4, 'incomplete', 'unknown'); + -- STMT_COUNT_BASE_NODE_CHILDREN SELECT COUNT(*) FROM BASE_NODE WHERE wc_id = ?1 AND parent_relpath = ?2; Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=965571&r1=965570&r2=965571&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Jul 19 17:42:21 2010 @@ -724,6 +724,10 @@ insert_base_node(void *baton, svn_sqlite SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_BASE_NODE_INCOMPLETE)); +#ifdef SVN_WC__NODE_DATA + SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb, + STMT_INSERT_NODE_DATA_INCOMPLETE)); +#endif for (i = pibb->children->nelts; i--; ) { @@ -737,6 +741,17 @@ insert_base_node(void *baton, svn_sqlite pibb->local_relpath, (apr_int64_t)pibb->revision)); SVN_ERR(svn_sqlite__insert(NULL, stmt)); + +#ifdef SVN_WC__NODE_DATA + SVN_ERR(svn_sqlite__bindf(stmt_node, "isis", + pibb->wc_id, + svn_relpath_join(pibb->local_relpath, + name, + scratch_pool), + (apr_int64_t)0 /* BASE */, + pibb->local_relpath)); + SVN_ERR(svn_sqlite__insert(NULL, stmt_node)); +#endif } } @@ -765,10 +780,18 @@ insert_incomplete_working_children(svn_s apr_pool_t *scratch_pool) { svn_sqlite__stmt_t *stmt; +#ifdef SVN_WC__NODE_DATA + svn_sqlite__stmt_t *stmt_node; +#endif int i; SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_WORKING_NODE_INCOMPLETE)); +#ifdef SVN_WC__NODE_DATA + SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb, + STMT_INSERT_NODE_DATA_INCOMPLETE)); +#endif + for (i = children->nelts; i--; ) { @@ -780,6 +803,18 @@ insert_incomplete_working_children(svn_s scratch_pool), local_relpath)); SVN_ERR(svn_sqlite__insert(NULL, stmt)); + +#ifdef SVN_WC__NODE_DATA + SVN_ERR(svn_sqlite__bindf(stmt_node, "isis", + wc_id, + svn_relpath_join(local_relpath, name, + scratch_pool), +#ifndef SINGLE_DB + (apr_int64_t) 2, /* non-THIS_DIR working */ +#endif + local_relpath)); + SVN_ERR(svn_sqlite__insert(NULL, stmt_node)); +#endif } return SVN_NO_ERROR; @@ -918,13 +953,6 @@ insert_working_node(void *baton, scratch_pool)); SVN_ERR(svn_sqlite__insert(NULL, stmt_node)); - - /* ### Not inserting the children in NODE_DATA goes against the documentation - that for every row in WORKING_NODE, there should be a row in NODE_DATA. - - However, NODE_DATA wants to contain complete data, but the insertion - below is not... */ - #endif