You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by eh...@apache.org on 2010/08/27 19:42:50 UTC
svn commit: r990214 - in /subversion/trunk/subversion/libsvn_wc:
wc-queries.sql wc_db.c
Author: ehu
Date: Fri Aug 27 17:42:50 2010
New Revision: 990214
URL: http://svn.apache.org/viewvc?rev=990214&view=rev
Log:
Create two more wc db statements replacing a single WORKING_NODE table update
for WORKING_NODE and NODE_DATA updating.
* subversion/libsvn_wc/wc-queries.sql
(STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_1,
STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_2):
New statements.
* subversion/libsvn_wc/wc_db.c
(make_copy_txn): Use new statements inside SVN_WC__NODE_DATA blocks.
Modified:
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=990214&r1=990213&r2=990214&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Aug 27 17:42:50 2010
@@ -560,8 +560,6 @@ FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
-
-- STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE_NODE
INSERT INTO WORKING_NODE (
wc_id, local_relpath, parent_relpath, presence, kind, changed_rev,
@@ -572,6 +570,28 @@ SELECT wc_id, local_relpath, parent_relp
repos_relpath, revnum FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
+
+-- STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_1
+INSERT INTO NODE_DATA (
+ wc_id, local_relpath, op_depth, parent_relpath, presence, kind,
+ changed_revision, changed_date, changed_author, original_repos_id,
+ original_repos_path, original_revision )
+SELECT wc_id, local_relpath, ?3 as op_depth, parent_relpath, 'not-present',
+ kind, changed_rev, changed_date, changed_author, repos_id,
+ repos_relpath, revnum
+FROM BASE_NODE as b INNER JOIN NODE_DATA as n
+ ON b.local_relpath = n.local_relpath
+ AND b.wc_id = n.wc_id
+ AND n.op_depth = 0
+WHERE n.wc_id = ?1 AND n.local_relpath = ?2;
+
+
+-- STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_2
+INSERT INTO WORKING_NODE (
+ wc_id, local_relpath, parent_relpath)
+VALUES (?1, ?2, ?3);
+
+
-- ### the statement below should be setting copyfrom_revision!
-- STMT_UPDATE_COPYFROM
UPDATE WORKING_NODE set copyfrom_repos_id = ?3, copyfrom_repos_path = ?4
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=990214&r1=990213&r2=990214&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Aug 27 17:42:50 2010
@@ -8879,6 +8879,39 @@ make_copy_txn(void *baton,
mcb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+
+
+#ifdef SVN_WC__NODE_DATA
+
+ SVN_ERR(svn_sqlite__get_statement(
+ &stmt, sdb,
+ STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_1));
+
+ SVN_ERR(svn_sqlite__bindf(stmt, "isi",
+ mcb->pdh->wcroot->wc_id,
+ mcb->local_relpath,
+ (*mcb->local_relpath == '\0') ? 1 : 2));
+
+ SVN_ERR(svn_sqlite__step_done(stmt));
+
+#if 0
+ /* ### NODE_DATA we can't enable the bit below until we stop
+ running STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE_NODE above */
+ SVN_ERR(svn_sqlite__get_statement(
+ &stmt, sdb,
+ STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_2));
+
+ SVN_ERR(svn_sqlite__bindf(stmt, "iss",
+ mcb->pdh->wcroot->wc_id,
+ mcb->local_relpath,
+ (*mcb->local_relpath == '\0') ? NULL
+ : svn_relpath_dirname(pibb->local_relpath,
+ scratch_pool)));
+
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+#endif
+
}
if (mcb->is_root && (add_working_normal || add_working_not_present))
@@ -9034,6 +9067,32 @@ make_copy_txn(void *baton,
SVN_ERR(svn_sqlite__bindf(stmt, "is",
pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+
+#ifdef SVN_WC__NODE_DATA
+
+ SVN_ERR(svn_sqlite__get_statement(
+ &stmt, pdh->wcroot->sdb,
+ STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_1));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ pdh->wcroot->wc_id, local_relpath,
+ (apr_int64_t)2));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+
+#if 0
+ /* ### NODE_DATA we can't enable the bit below until we stop
+ running STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE
+ above */
+
+ SVN_ERR(svn_sqlite__get_statement(
+ &stmt, pdh->wcroot->sdb,
+ STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_2));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+
+#endif
+#endif
+
}
}
#endif