Author: hwright
Date: Mon May 16 00:14:39 2011
New Revision: 1103582

URL: http://svn.apache.org/viewvc?rev=1103582&view=rev
Log:
When populating the targets list, don't bother calculating the parent_relpath,
when we already have that information in the database.

We also have to relax the constraint slightly, since NULL parent relpaths are
acceptable (and documented as such).

* subversion/libsvn_wc/wc-queries.sql
  (STMT_CREATE_TARGETS_LIST): Don't require a non-NULL parent relpath.
  (STMT_INSERT_TARGET): Use the existing parent_relpath, rather than
    a bound parameter.

* subversion/libsvn_wc/wc_db.c
  (populate_targets_tree): Remove parent_relpath computation and binding.

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=1103582&r1=1103581&r2=1103582&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Mon May 16 00:14:39 
2011
@@ -432,7 +432,7 @@ ORDER BY wc_id, local_relpath
 DROP TABLE IF EXISTS targets_list;
 CREATE TEMPORARY TABLE targets_list (
   local_relpath TEXT NOT NULL,
-  parent_relpath TEXT NOT NULL,
+  parent_relpath TEXT,
   kind TEXT NOT NULL
   );
 CREATE INDEX targets_list_kind
@@ -443,7 +443,8 @@ DROP TABLE IF EXISTS targets_list;
 
 -- STMT_INSERT_TARGET
 INSERT INTO targets_list(local_relpath, parent_relpath, kind)
-SELECT ?2, ?3, kind FROM nodes_current WHERE wc_id = ?1 AND local_relpath = ?2
+SELECT ?2, parent_relpath, kind
+FROM nodes_current WHERE wc_id = ?1 AND local_relpath = ?2
 
 -- STMT_INSERT_TARGET_WITH_CHANGELIST
 INSERT INTO targets_list(local_relpath, parent_relpath, kind)

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1103582&r1=1103581&r2=1103582&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon May 16 00:14:39 2011
@@ -4962,9 +4962,6 @@ populate_targets_tree(svn_wc__db_wcroot_
                       apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
-  const char *parent_relpath;
-
-  parent_relpath = svn_relpath_dirname(local_relpath, scratch_pool);
 
   SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
                                       STMT_CREATE_TARGETS_LIST));
@@ -5005,8 +5002,8 @@ populate_targets_tree(svn_wc__db_wcroot_
             /* Insert this single path. */
             SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                               STMT_INSERT_TARGET));
-            SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
-                                      local_relpath, parent_relpath));
+            SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                                      local_relpath));
             SVN_ERR(svn_sqlite__step_done(stmt));
             break;
 


Reply via email to