subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1567080 - /subversion/trunk/subversion/libsvn_wc/wc-queries.sql
Date Tue, 11 Feb 2014 12:18:18 GMT
Author: rhuijben
Date: Tue Feb 11 12:18:17 2014
New Revision: 1567080

URL: http://svn.apache.org/r1567080
Log:
Update a query to work slightly faster and to reduce the dependency on
explicitly unspecified sqlite behavior.

This fixes 30 op-depth tests when running the tests with our verification
triggers in maintainer mode *combined with*
SVN_SQLITE_REVERSE_UNORDERED_SELECTS.

Note that this problem doesn't affect non maintainer mode behavior, as
we don't rely on the ordering there.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_INSERT_DELETE_FROM_NODE_RECURSIVE): Tweak query to force inserting
    the rows in a strict order. Assume that the op-root matches our check.

  (STMT_INSERT_DELETE_LIST): Update to match
    STMT_INSERT_DELETE_FROM_NODE_RECURSIVE, to make sure notifications
    match actual behavior.

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=1567080&r1=1567079&r2=1567080&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Tue Feb 11 12:18:17 2014
@@ -951,19 +951,25 @@ SELECT wc_id, local_relpath, op_depth, p
    AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
    AND op_depth = ?3
 
-/* If this query is updated, STMT_INSERT_DELETE_LIST should too. */
+/* If this query is updated, STMT_INSERT_DELETE_LIST should too.
+   Use UNION ALL instead of a simple 'OR' to avoid creating a temp table */
 -- STMT_INSERT_DELETE_FROM_NODE_RECURSIVE
 INSERT INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
 SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, MAP_BASE_DELETED,
        kind
 FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
+UNION ALL
+SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, MAP_BASE_DELETED,
+       kind
+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
   AND presence NOT IN (MAP_BASE_DELETED, MAP_NOT_PRESENT, MAP_EXCLUDED, MAP_SERVER_EXCLUDED)
   AND file_external IS NULL
+ORDER BY local_relpath
 
 -- STMT_INSERT_WORKING_NODE_FROM_BASE_COPY
 INSERT INTO nodes (
@@ -1397,16 +1403,18 @@ CREATE TEMPORARY TABLE delete_list (
    A subquery is used instead of nodes_current to avoid a table scan */
 -- STMT_INSERT_DELETE_LIST
 INSERT INTO delete_list(local_relpath)
+SELECT ?2
+UNION ALL
 SELECT local_relpath FROM nodes AS n
 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
   AND op_depth = (SELECT MAX(s.op_depth) FROM nodes AS s
                   WHERE s.wc_id = ?1
                     AND s.local_relpath = n.local_relpath)
   AND presence NOT IN (MAP_BASE_DELETED, MAP_NOT_PRESENT, MAP_EXCLUDED, MAP_SERVER_EXCLUDED)
   AND file_external IS NULL
+ORDER by local_relpath
 
 -- STMT_SELECT_DELETE_LIST
 SELECT local_relpath FROM delete_list



Mime
View raw message