You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/05/16 02:35:52 UTC

svn commit: r1103586 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c

Author: hwright
Date: Mon May 16 00:35:52 2011
New Revision: 1103586

URL: http://svn.apache.org/viewvc?rev=1103586&view=rev
Log:
Add a wc_id column to the targets_list, for correctness, and a bit of
simplification in C.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_UPDATE_ACTUAL_CHANGELISTS): Match both relpath and wc_id.
  (STMT_MARK_SKIPPED_CHANGELIST_DIRS): Use the provided wc_id from the
    targets_list.
  (STMT_CREATE_TARGETS_LIST): Add wc_id column.
  (STMT_INSERT_TARGET, STMT_INSERT_TARGET_WITH_CHANGELIST): Populate the wc_id
    column in the targets_list.
  (STMT_INSERT_ACTUAL_EMPTIES): Use the wc_id in the targets list.
 
* subversion/libsvn_wc/wc_db.c
  (set_changelist_txn): Simplify a couple of statements by no longer binding
    the wc_id.

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=1103586&r1=1103585&r2=1103586&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Mon May 16 00:35:52 2011
@@ -347,12 +347,12 @@ VALUES (?1, ?2, ?3, ?4)
 -- STMT_UPDATE_ACTUAL_CHANGELISTS
 UPDATE actual_node SET changelist = ?2
 WHERE wc_id = ?1 AND local_relpath IN
-(SELECT local_relpath FROM targets_list WHERE kind = 'file')
+(SELECT local_relpath FROM targets_list WHERE kind = 'file' AND wc_id = ?1)
 
 -- STMT_MARK_SKIPPED_CHANGELIST_DIRS
 /* 7 corresponds to svn_wc_notify_skip */
 INSERT INTO changelist_list (wc_id, local_relpath, notify, changelist)
-SELECT ?1, local_relpath, 7, ?2 FROM targets_list WHERE kind = 'dir'
+SELECT wc_id, local_relpath, 7, ?1 FROM targets_list WHERE kind = 'dir'
 
 -- STMT_RESET_ACTUAL_WITH_CHANGELIST
 REPLACE INTO actual_node (
@@ -431,24 +431,26 @@ ORDER BY wc_id, local_relpath
 -- STMT_CREATE_TARGETS_LIST
 DROP TABLE IF EXISTS targets_list;
 CREATE TEMPORARY TABLE targets_list (
+  wc_id  INTEGER NOT NULL,
   local_relpath TEXT NOT NULL,
   parent_relpath TEXT,
   kind TEXT NOT NULL
   );
 CREATE INDEX targets_list_kind
   ON targets_list (kind)
+/* need more indicies? */
 
 -- STMT_DROP_TARGETS_LIST
 DROP TABLE IF EXISTS targets_list;
 
 -- STMT_INSERT_TARGET
-INSERT INTO targets_list(local_relpath, parent_relpath, kind)
-SELECT ?2, parent_relpath, kind
+INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind)
+SELECT wc_id, local_relpath, parent_relpath, kind
 FROM nodes_current WHERE wc_id = ?1 AND local_relpath = ?2
 
 -- STMT_INSERT_TARGET_WITH_CHANGELIST
-INSERT INTO targets_list(local_relpath, parent_relpath, kind)
-SELECT N.local_relpath, N.parent_relpath, N.kind
+INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind)
+SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind
   FROM actual_node AS A JOIN nodes_current AS N
     ON A.wc_id = N.wc_id AND A.local_relpath = N.local_relpath
  WHERE N.wc_id = ?1 AND N.local_relpath = ?2 AND A.changelist = ?3
@@ -461,7 +463,7 @@ INSERT OR IGNORE INTO actual_node (
      wc_id, local_relpath, parent_relpath, properties,
      conflict_old, conflict_new, conflict_working,
      prop_reject, changelist, text_mod, tree_conflict_data )
-SELECT ?1, local_relpath, parent_relpath, NULL, NULL, NULL, NULL,
+SELECT wc_id, local_relpath, parent_relpath, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL
 FROM targets_list
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1103586&r1=1103585&r2=1103586&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon May 16 00:35:52 2011
@@ -5065,10 +5065,8 @@ set_changelist_txn(void *baton,
                                 scb->changelist_filter, scratch_pool));
 
   /* Ensure we have actual nodes for our targets. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_INSERT_ACTUAL_EMPTIES));
-  SVN_ERR(svn_sqlite__bind_int64(stmt, 1, wcroot->wc_id));
-  SVN_ERR(svn_sqlite__step_done(stmt));
+  SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
+                                      STMT_INSERT_ACTUAL_EMPTIES));
 
   /* Now create our notification table. */
   SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
@@ -5085,8 +5083,7 @@ set_changelist_txn(void *baton,
       /* We have to notify that we skipped directories, so do that now. */
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_MARK_SKIPPED_CHANGELIST_DIRS));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
-                                scb->new_changelist));
+      SVN_ERR(svn_sqlite__bind_text(stmt, 1, scb->new_changelist));
       SVN_ERR(svn_sqlite__step_done(stmt));
     }