You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/05/20 13:19:06 UTC

svn commit: r1340678 - /subversion/trunk/subversion/libsvn_wc/wc-queries.sql

Author: rhuijben
Date: Sun May 20 11:19:05 2012
New Revision: 1340678

URL: http://svn.apache.org/viewvc?rev=1340678&view=rev
Log:
* subversion/libsvn_wc/wc-queries.sql
  (STMT_DELETE_SHADOWED_RECURSIVE):
    Add comment. Don't try to fetch a record for the node itself as the
    only user would have removed it in the previous query.
  (STMT_SELECT_NOT_PRESENT_DESCENDANTS): Simplify query. No functional
    change, but more likely to be handled by the sqlite optimizer.
  (STMT_SELECT_BASE_NODE_LOCK_TOKENS_RECURSIVE): Remove working copy root
    support, to allow evaluating over the index.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1340678&r1=1340677&r2=1340678&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sun May 20 11:19:05 2012
@@ -178,19 +178,19 @@ UNION
 SELECT 1 FROM ACTUAL_NODE
 WHERE wc_id = ?1 AND parent_relpath = ?2
 
+/* Delete the nodes shadowed by local_relpath. Not valid for the wc-root */
 -- STMT_DELETE_SHADOWED_RECURSIVE
 DELETE FROM nodes
 WHERE wc_id = ?1
-  AND (local_relpath = ?2
-       OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND (op_depth < ?3
        OR (op_depth = ?3 AND presence = 'base-deleted'))
 
+/* Get not-present descendants of a copied node. Not valid for the wc-root */
 -- STMT_SELECT_NOT_PRESENT_DESCENDANTS
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1 AND op_depth = ?3
-  AND (parent_relpath = ?2
-       OR IS_STRICT_DESCENDANT_OF(parent_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND presence == 'not-present'
 
 -- STMT_COMMIT_DESCENDANT_TO_BASE
@@ -259,15 +259,14 @@ INSERT OR REPLACE INTO lock
  lock_date)
 VALUES (?1, ?2, ?3, ?4, ?5, ?6)
 
+/* Not valid for the working copy root */
 -- STMT_SELECT_BASE_NODE_LOCK_TOKENS_RECURSIVE
 SELECT nodes.repos_id, nodes.repos_path, lock_token
 FROM nodes
 LEFT JOIN lock ON nodes.repos_id = lock.repos_id
   AND nodes.repos_path = lock.repos_relpath
 WHERE wc_id = ?1 AND op_depth = 0
-  AND (?2 = ''
-       OR local_relpath = ?2
-       OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
 
 -- STMT_INSERT_WCROOT
 INSERT INTO wcroot (local_abspath)