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/07/18 21:12:06 UTC

svn commit: r965275 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/libsvn_wc/db-test.c tests/libsvn_wc/entries-compat.c

Author: ehu
Date: Sun Jul 18 19:12:05 2010
New Revision: 965275

URL: http://svn.apache.org/viewvc?rev=965275&view=rev
Log:
Create NODE_DATA table as part of the experimental schema.


 * libsvn_wc/wc_db.c (create_db): Create additional table.
 * tests/libsvn_wc/db-test.c (create_fake_wc)
 * tests/libsvn_wc/entries-compat.c
   (create_fake_wc, make_one_db): Add STMT_CREATE_NODE_DATA to the list
    of statements, when testing the experimental schema. Also walk the
    full set of statements, instead of hardcoding the number of items in
    the array.


Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/libsvn_wc/db-test.c
    subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=965275&r1=965274&r2=965275&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun Jul 18 19:12:05 2010
@@ -1218,6 +1218,11 @@ create_db(svn_sqlite__db_t **sdb,
   /* Create the database's schema.  */
   SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_SCHEMA));
 
+#ifdef SVN_WC__NODE_DATA
+  /* Create the NODE_DATA table for the experimental schema */
+  SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_NODE_DATA));
+#endif  
+
   /* Insert the repository. */
   SVN_ERR(create_repos_id(repos_id, repos_root_url, repos_uuid, *sdb,
                           scratch_pool));

Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=965275&r1=965274&r2=965275&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Sun Jul 18 19:12:05 2010
@@ -321,9 +321,13 @@ create_fake_wc(const char *subdir, int f
   svn_sqlite__db_t *sdb;
   const char * const my_statements[] = {
     statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODE_DATA
+    statements[STMT_CREATE_NODE_DATA],
+#endif
     TESTING_DATA,
     NULL
   };
+  int i;
 
   SVN_ERR(svn_io_make_dir_recursively(dirpath, scratch_pool));
   svn_error_clear(svn_io_remove_file(dbpath, scratch_pool));
@@ -332,11 +336,8 @@ create_fake_wc(const char *subdir, int f
                            0, NULL,
                            scratch_pool, scratch_pool));
 
-  /* Create the database's schema.  */
-  SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 0));
-
-  /* Throw our extra data into the database.  */
-  SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 1));
+  for (i = 0; my_statements[i] != NULL; i++)
+    SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ i));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c?rev=965275&r1=965274&r2=965275&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c Sun Jul 18 19:12:05 2010
@@ -337,6 +337,7 @@ make_one_db(const char *dirpath,
 {
   const char *dbpath = svn_dirent_join(dirpath, "wc.db", scratch_pool);
   svn_sqlite__db_t *sdb;
+  int i;
 
   /* Create fake-wc/SUBDIR/.svn/ for placing the metadata. */
   SVN_ERR(svn_io_make_dir_recursively(dirpath, scratch_pool));
@@ -347,11 +348,8 @@ make_one_db(const char *dirpath,
                            0, NULL,
                            scratch_pool, scratch_pool));
 
-  /* Create the database's schema.  */
-  SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 0));
-
-  /* Throw our extra data into the database.  */
-  SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 1));
+  for (i = 0; my_statements[i] != NULL; i++)
+    SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ i));
 
   return SVN_NO_ERROR;
 }
@@ -364,11 +362,17 @@ create_fake_wc(const char *subdir, int f
   const char *dirpath;
   const char * const my_statements[] = {
     statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODE_DATA
+    statements[STMT_CREATE_NODE_DATA],
+#endif
     TESTING_DATA,
     NULL
   };
   const char * const M_statements[] = {
     statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODE_DATA
+    statements[STMT_CREATE_NODE_DATA],
+#endif
     M_TESTING_DATA,
     NULL
   };