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 2014/02/11 14:24:55 UTC

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

Author: rhuijben
Date: Tue Feb 11 13:24:55 2014
New Revision: 1567109

URL: http://svn.apache.org/r1567109
Log:
Resolve an unneeded dependency on undocumented and version specific Sqlite
behavior. Without this patch some moved nodes might not be bumped during
update.

This resolves two failures in the test suite when running the tests with
the SVN_SQLITE_REVERSE_UNORDERED_SELECTS compile time option. Without this
patch these same errors can also occur when Sqlite chooses an unexpected
query plan.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_MOVED_PAIR3): Use a UNION ALL and order by to make the query
    report the matched rows in the ordering we expect in the C code.
    (read: ancestor first)

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=1567109&r1=1567108&r2=1567109&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Tue Feb 11 13:24:55 2014
@@ -1581,10 +1581,15 @@ UPDATE nodes SET moved_to = NULL
 
 -- STMT_SELECT_MOVED_PAIR3
 SELECT local_relpath, moved_to, op_depth, kind FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3
+  AND moved_to IS NOT NULL
+UNION ALL
+SELECT local_relpath, moved_to, op_depth, 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 moved_to IS NOT NULL
+ORDER BY local_relpath
 
 -- STMT_SELECT_MOVED_OUTSIDE
 SELECT local_relpath, moved_to, op_depth FROM nodes