Create '1.9.x-db-verify' branch as a starting point for backporting
several db stability fixes.

* build/transform_sql.py (Partial of r1660742)
  Make IS_STRICT_DESCENDANT_OF() usable between db columns

* build.conf (r1660874)
  (svn-wc-db-tester): New tool.
  (__MORE__): Add svn-wc-db-tester and x509-parser.
  (x509-parser): Add description.

* subversion/include/private/svn_sqlite.h (r1660659)
  (svn_sqlite__func_t): Update prototype.

* subversion/libsvn_subr/sqlite.c (r1660610, r1660641, r1660659, r1661890)
  (function_wrapper_baton_t): Remove pool.
  (wrapped_func): Update caller. (Different argument type)
  (svn_sqlite__create_scalar_function): Avoid init of state pool.
  (svn_sqlite__value_type,
   svn_sqlite__value_text): Handle different argument type.

* subversion/libsvn_wc/wc-checks.sql (many)
  (STMT_STATIC_VERIFY): Bring up to date with trunk.

* subversion/libsvn_wc/wc-queries.sql (1660758)
  (STMT_SELECT_DELETION_INFO): Use join make query more similar to other cases.
  (STMT_SELECT_DELETION_INFO_SCAN): Remove query that searched for moved
    information in multiple (including wrong) locations.

* subversion/libsvn_wc/wc_db.c
  (scan_deletion_txn): Update statement usage. Only search for moved_to in the
    intended layer. (r1660758)

  (svn_wc__db_verify_db_full_internal,
   svn_wc__db_verify_db_full): New functions. (r1660874)

* subversion/libsvn_wc/wc_db.h (r1660874)
  (svn_wc__db_verify_cb_t): New prototype.
  (svn_wc__db_verify_db_full): New function.

* subversion/libsvn_wc/wc_db_private.h (r1660874)
  (svn_wc__db_verify_db_full_internal): New function.

* subversion/libsvn_wc/wc_db_util.c (r1661890)
  (relpath_depth_sqlite): Update prototype.

* subversion/libsvn_wc/wc_db_wcroot.c (r1660874)
  (verify_sqlite): Rename to...
  (verify_db_cb): ... this. Implement svn_wc__db_verify_cb_t.
  (close_wcroot): Update caller.

* subversion/tests/libsvn_subr/sqlite-test.c
  (error_second): Update argument (r1660659).

* subversion/tests/libsvn_wc/db-test.c
  (r1658602,1660529,1660587,1660633,1660687,1660758,1660928)
  (TESTING_DATA): Convert sqlite statements to...
  (nodes_init_data,
   actual_init_data): New variables.
  (create_open): Update caller.
  (validate_abspath): Return svn_error_t * to provide details.
  (*): Minor expectation fixes.

* subversion/tests/libsvn_wc/entries-compat.c (r1660928,1660955,1660961)
  (TESTING_DATA): Convert sqlite statements to...
  (nodes,
   actuals): New variables.
  (create_fake_wc): Update callers.
  (test_entries_alloc): Assume a few more nodes, to make db valid.

* subversion/tests/libsvn_wc/op-depth-test.c (r1660587)
  (insert_actual): Ensure that pristine data exists before turning a directory
    in a file.

* subversion/tests/libsvn_wc/utils.c (r1660928)
  (includes): Add token-map.h.
  (svn_test__create_fake_wc): Add support for creating nodes from C structs.

* subversion/tests/libsvn_wc/utils.h (r1660928)
  (svn_test__nodes_data_t,
   svn_test__actual_data_t): New structs.
  (svn_test__create_fake_wc): Add arguments.

* subversion/tests/libsvn_wc/wc-queries-test.c (r1660587,1660610)
  (relpath_depth_sqlite,
   test_verify_parsable): New functions, to verify that the verify code is
     accepted by sqlite.
  (test_funcs): Add test_verify_parsable.

* subversion/tests/libsvn_wc/wc-test-queries.sql (r1660587)
  (STMT_ENSURE_EMPTY_PRISTINE): New statement.
  (STMT_NODES_SET_FILE): Really turn a directory into a file.



git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.9.x-db-verify@1661899 13f79535-47bb-0310-9956-ffa450edef68
20 files changed