Author: rhuijben
Date: Thu Oct 11 11:02:54 2012
New Revision: 1396987
URL: http://svn.apache.org/viewvc?rev=1396987&view=rev
Log:
Move the working copy format 31 upgrade specific queries within a block
specific to that format bump like previous bump specific queries.
This makes wc-queries-test handle these queries as upgrade queries.
* subversion/libsvn_wc/upgrade.c
(bump_to_31): Update statement reference.
* subversion/libsvn_wc/wc-metadata.sql
(STMT_UPGRADE_TO_31): Move below the format 30 queries.
(STMT_UPGRADE_31_SELECT_WCROOT_NODES): Renamed and moved here from ...
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_WCROOT_NODES): ... here.
* subversion/tests/libsvn_wc/wc-queries-test.c
(slow_statements): Remove upgrade query from this list.
Modified:
subversion/trunk/subversion/libsvn_wc/upgrade.c
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1396987&r1=1396986&r2=1396987&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Thu Oct 11 11:02:54 2012
@@ -1577,7 +1577,7 @@ bump_to_31(void *baton,
switched subtrees in the WC. This allows subsequent updates
to recognize these roots as needing an iprops cache. */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_SELECT_WCROOT_NODES));
+ STMT_UPGRADE_31_SELECT_WCROOT_NODES));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
SVN_ERR(svn_sqlite__get_statement(&stmt_mark_switch_roots, sdb,
Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1396987&r1=1396986&r2=1396987&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Thu Oct 11 11:02:54
2012
@@ -795,12 +795,6 @@ UPDATE nodes SET presence = "server-excl
working copies that were never updated by 1.7.0+ style clients */
UPDATE nodes SET file_external=1 WHERE file_external IS NOT NULL;
-/* Format 31 adds the inherited_props column to the NODES table. */
--- STMT_UPGRADE_TO_31
-ALTER TABLE NODES ADD COLUMN inherited_props BLOB;
-
-PRAGMA user_version = 31;
-
-- STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE
SELECT wc_id, local_relpath,
conflict_old, conflict_working, conflict_new, prop_reject, tree_conflict_data
@@ -820,6 +814,38 @@ WHERE wc_id = ?1 and local_relpath = ?2
/* ------------------------------------------------------------------------- */
+/* Format 31 adds the inherited_props column to the NODES table. C code then
+ initializes the update/switch roots to make sure future updates fetch the
+ inherited properties */
+-- STMT_UPGRADE_TO_31
+ALTER TABLE NODES ADD COLUMN inherited_props BLOB;
+
+PRAGMA user_version = 31;
+
+-- STMT_UPGRADE_31_SELECT_WCROOT_NODES
+/* Select all base nodes which are the root of a WC, including
+ switched subtrees, but excluding those which map to the root
+ of the repos.
+
+ ### IPROPS: Is this query horribly inefficient? Quite likely,
+ ### but it only runs during an upgrade, so do we care? */
+SELECT l.wc_id, l.local_relpath FROM nodes as l
+LEFT OUTER JOIN nodes as r
+ON l.wc_id = r.wc_id
+ AND l.repos_id = r.repos_id
+ AND r.local_relpath = l.parent_relpath
+WHERE (l.local_relpath == '' AND l.repos_path != '')
+ OR (l.op_depth = 0
+ AND l.local_relpath != ''
+ AND l.repos_path != ltrim(r.repos_path
+ || '/'
+ || ltrim(substr(l.local_relpath,
+ length(l.parent_relpath) + 1),
+ '/'),
+ '/'))
+
+/* ------------------------------------------------------------------------- */
+
/* Format YYY introduces new handling for conflict information. */
-- format: YYY
Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1396987&r1=1396986&r2=1396987&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu Oct 11 11:02:54
2012
@@ -1073,28 +1073,6 @@ WHERE wc_id = ?1 AND local_relpath = ?2
SELECT 1 FROM nodes WHERE op_depth > 0
LIMIT 1
--- STMT_SELECT_WCROOT_NODES
-/* Select all base nodes which are the root of a WC, including
- switched subtrees, but excluding those which map to the root
- of the repos.
-
- ### IPROPS: Is this query horribly inefficient? Quite likely,
- ### but it only runs during an upgrade, so do we care? */
-SELECT l.wc_id, l.local_relpath FROM nodes as l
-LEFT OUTER JOIN nodes as r
-ON l.wc_id = r.wc_id
- AND l.repos_id = r.repos_id
- AND r.local_relpath = l.parent_relpath
-WHERE (l.local_relpath == '' AND l.repos_path != '')
- OR (l.op_depth = 0
- AND l.local_relpath != ''
- AND l.repos_path != ltrim(r.repos_path
- || '/'
- || ltrim(substr(l.local_relpath,
- length(l.parent_relpath) + 1),
- '/'),
- '/'))
-
/* --------------------------------------------------------------------------
* Complex queries for callback walks, caching results in a temporary table.
*
Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1396987&r1=1396986&r2=1396987&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c Thu Oct 11
11:02:54 2012
@@ -97,9 +97,6 @@ static const int slow_statements[] =
/* Designed as slow to avoid penalty on other queries */
STMT_SELECT_UNREFERENCED_PRISTINES,
- /* Only runs once during upgrade. */
- STMT_SELECT_WCROOT_NODES,
-
/* Slow, but just if foreign keys are enabled:
* STMT_DELETE_PRISTINE_IF_UNREFERENCED,
*/