subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1658697 - in /subversion/trunk/subversion/tests/libsvn_wc: op-depth-test.c wc-test-queries.sql
Date Tue, 10 Feb 2015 12:33:20 GMT
Author: rhuijben
Date: Tue Feb 10 12:33:19 2015
New Revision: 1658697

URL: http://svn.apache.org/r1658697
Log:
In op-depth test: Use standard construct to select descendants.

* subversion/tests/libsvn_wc/op-depth-test.c
  (check_db_rows,
   check_db_conflicts): Update statement usage. Pass wc_id to allow using index.

* subversion/tests/libsvn_wc/wc-test-queries.sql
  (STMT_SELECT_NODES_INFO,
   STMT_SELECT_ACTUAL_INFO): Use IS_STRICT_DESCENDANT_OF instead of like
     and wc_id to allow using index.

Modified:
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/trunk/subversion/tests/libsvn_wc/wc-test-queries.sql

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1658697&r1=1658696&r2=1658697&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Tue Feb 10 12:33:19 2015
@@ -263,7 +263,6 @@ check_db_rows(svn_test__sandbox_t *b,
               const char *root_path,
               const nodes_row_t *expected_rows)
 {
-  const char *base_relpath = root_path;
   svn_sqlite__db_t *sdb;
   int i;
   svn_sqlite__stmt_t *stmt;
@@ -281,10 +280,8 @@ check_db_rows(svn_test__sandbox_t *b,
   /* Fill ACTUAL_HASH with data from the WC DB. */
   SVN_ERR(open_wc_db(&sdb, b->wc_abspath, b->pool, b->pool));
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_NODES_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "ss", base_relpath,
-                            (base_relpath[0]
-                             ? apr_psprintf(b->pool, "%s/%%", base_relpath)
-                             : "_%")));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", (apr_int64_t)1 /* wc_id */,
+                                        root_path));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   while (have_row)
     {
@@ -387,7 +384,6 @@ check_db_conflicts(svn_test__sandbox_t *
                    const char *root_path,
                    const conflict_info_t *expected_conflicts)
 {
-  const char *base_relpath = root_path;
   svn_sqlite__db_t *sdb;
   int i;
   svn_sqlite__stmt_t *stmt;
@@ -407,10 +403,8 @@ check_db_conflicts(svn_test__sandbox_t *
   /* Fill ACTUAL_HASH with data from the WC DB. */
   SVN_ERR(open_wc_db(&sdb, b->wc_abspath, b->pool, b->pool));
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_ACTUAL_INFO));
-  SVN_ERR(svn_sqlite__bindf(stmt, "ss", base_relpath,
-                            (base_relpath[0]
-                             ? apr_psprintf(b->pool, "%s/%%", base_relpath)
-                             : "_%")));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", (apr_int64_t)1 /* wc_id */,
+                                        root_path));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   while (have_row)
     {

Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-test-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-test-queries.sql?rev=1658697&r1=1658696&r2=1658697&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/wc-test-queries.sql (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-test-queries.sql Tue Feb 10 12:33:19 2015
@@ -22,19 +22,22 @@
  */
 
 -- STMT_SELECT_NODES_INFO
-SELECT op_depth, nodes.presence, nodes.local_relpath, revision,
+SELECT op_depth, n.presence, n.local_relpath, revision,
        repos_path, file_external, def_local_relpath, moved_to, moved_here,
        properties
-FROM nodes
-LEFT OUTER JOIN externals
-            ON nodes.wc_id = externals.wc_id
-                AND nodes.local_relpath = externals.local_relpath
-WHERE nodes.local_relpath = ?1 OR nodes.local_relpath LIKE ?2
+FROM nodes n
+LEFT OUTER JOIN externals e
+            ON n.wc_id = e.wc_id
+                AND n.local_relpath = e.local_relpath
+WHERE n.wc_id = ?1
+  AND (n.local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(n.local_relpath, ?2))
 
 -- STMT_SELECT_ACTUAL_INFO
 SELECT local_relpath
 FROM actual_node
-WHERE conflict_data is NOT NULL AND local_relpath = ?1 OR local_relpath LIKE ?2
+WHERE wc_id = ?1
+  AND conflict_data is NOT NULL
+  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
 
 -- STMT_DELETE_NODES
 DELETE FROM nodes;



Mime
View raw message