Checkout Tools
  • last updated 4 hours ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 1542767 is being indexed.

* subversion/tests/libsvn_wc/wc-queries-test.c

(test_schema_statistics): Following up on r1542765 (which was tested on many

specific sqlite versions), remove some unused variables.

Teach Sqlite a bit of how we use our working copy database files, like that

we only have one true value in wc_id.

By adding this tiny bit of information Sqlite 3.8.0, 3.8.1 and the preview

of 3.8.2 use the intended query plans for our working copy queries, just

like Sqlite 3.7.12-3.7.17 already did without these hints.

(The older versions do use this information though!)

For more details on why this is important and how this works see

- the wc-metadata.sql patch



And for reference also check the users@sqlite archive where Richard Hipp

recommends this approach for our current use of Sqlite.

* subversion/libsvn_wc/upgrade.c

(svn_wc__upgrade_sdb): Call svn_wc__db_install_schema_statistics() after the

final format bump.

* subversion/libsvn_wc/wc-metadata.sql


* subversion/libsvn_wc/wc_db.c

(svn_wc__db_install_schema_statistics): New function.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_install_schema_statistics): New function.

* subversion/tests/libsvn_wc/wc-queries-test.c

(schema_statements): Install the statistics.

(parse_stat_data): New helper function.

(test_schema_statistics): New test.

(test_funcs): Add test_schema_statistics.

  1. … 4 more files in changeset.
Add a working copy query test to automatically find queries with an idential

query plan as not having duplicates reduces maintenance and helps avoiding

query planner costs.

* subversion/libsvn_wc/upgrade.c

(migrate_single_tree_conflict_data): Use existing instead of specialized


* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_MOVED_BACK): Remove duplicate.



* subversion/libsvn_wc/wc_db.c

(handle_move_back): Update query user.

* subversion/tests/libsvn_wc/wc-queries-test.c

(includes): Add svn_hash.h.

(test_query_duplicates): New function.

(test_funcs): Add test_query_duplicates.

  1. … 3 more files in changeset.
Don't compile the SQLite amalgamation twice. The WC test can use the same

wrapper as libsvn_subr.

* build.conf (wc-queries-test): Add sqlite3wrapper from libsvn_subr to sources.

* subversion/tests/libsvn_wc/wc-queries-test.c: Don't include sqlite3.c;

Instead, use the same method as libsvn_subr/sqlite.c to import the

wrapped functions from sqlite3wrapper.c

(test_sqlite_version): Call sqlite3_libversion instead of using the

sqlite3_version array directly, since the latter is not exported from


  1. … 1 more file in changeset.
* subversion/tests/libsvn_wc/wc-queries-test.c

(test_sqlite_version): Add missing newline.

Work around a problem on older OS X systems: sqlite3.c includes

<libkern/OSAtomic.h>, which uses 'inline' and thus cannot be compiled

with -std=c89 that we are using for all files.

* subversion/libsvn_subr/sqlite3wrapper.c

(toplevel): Define 'inline' as '__inline__' (which gcc accepts even in c89

mode) during a pre-emptive inclusion of <libkern/OSAtomic.h>.

* subversion/tests/libsvn_wc/wc-queries-test.c

(toplevel): Likewise.

Patch by: mattiase

  1. … 1 more file in changeset.
Make the switch detection code much easier to understand by introducing a few

more preprocessor sql functions.

This is partly a showcase of how we can reduce some c code complexity using

these functions.

* build/

(process_file): Add RELPATH_JOIN(x, y), RELPATH_SKIP_ANCESTOR(x, y) and

RELPATH_SKIP_JOIN(x, y, z) which is a combination of the

other two.

* subversion/libsvn_wc/wc-queries.sql

(STMT_HAS_SWITCHED): Simplify query. Use additional argument instead of




STMT_HAS_SWITCHED_WCROOT_REPOS_ROOT): Remove queries that can now be


* subversion/libsvn_wc/wc_db.c

(has_switched_subtrees): Use single query. Pass repository relative path.

* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove specialized selects on the entire wc.

  1. … 3 more files in changeset.
Make notifications during move-update transaction-safe, by only issuing

notifiations if the transaction actually succeeds.

We store notifications in a temporary wc.db table during the update-move

editor drive, and spool notifications from it when the edit completes.

* subversion/libsvn_wc/wc-queries.sql




* subversion/libsvn_wc/wc_db_update_move.c

(update_move_list_add, update_move_list_notify): New helper functions.

(tc_editor_alter_directory, update_working_file): Add notifiations to

the update-move notification list instead of sending them directly.

(update_moved_away_conflict_victim): Create the move-update notification

list before starting the editor drive.

* subversion/tests/libsvn_wc/wc-queries-test.c

(schema_statements): Add STMT_CREATE_UPDATE_MOVE_LIST to this list

of statements which create temporary tables.

(slow_statements): Add STMT_SELECT_UPDATE_MOVE_LIST to the list of

statements which fail if temporary tables don't exist.

  1. … 2 more files in changeset.
Temporarily revert part of the change from the tweak-build-take-two branch that

moved the expected location of the SQLite amalgamation directory and used

relative paths to include those files, because it conflicts with the use of

--with-sqlite to locate an amalgamation directory outside the build tree.

Note that this can cause builds to fail if non-amalgamated SQLite is found

elsewhere on the include path before the amalagamated files.


- Change expected location of the amalgamation package.

* build/ac-macros/sqlite.m4:

- Look for $abs_srcdir/sqlite-amalgamation.

- Do add include paths to wherever the amalgamation was found.

* subversion/libsvn_subr/sqlite.c, subversion/libsvn_subr/sqlite3wrapper.c,

subversion/tests/libsvn_wc/wc-queries-test.c: Do not use relative paths

to include amalgamation sources.

  1. … 7 more files in changeset.
Reintegrate tweak-build-take-two branch to trunk.

Summary of changes:

** Split standards-compliance mode and maintainer mode compiler flags

out of CFLAGS, so that compilation command lines that do not

generate (too many) warnings or are not forced to comply with ISO

C '90 can be constructed without having to resort to stripping

individual flags out of CFLAGS.

$ svn diff -r1424288:1424822 \

^/subversion/branches/tweak-build-take-two/ \

^/subversion/branches/tweak-build-take-two/aclocal.m4 \

^/subversion/branches/tweak-build-take-two/build/ac-macros/compiler.m4 \


** Now that warning and standards-compliance mode macros are no

longer part of CFLAGS, stop stripping them in the Swig wrapper

configury, except for Ruby, which is more delicate.

$ svn diff -r1424329:1425040 \


** Allow optimization and debugging to coexist, including in

maintainer mode, adding a new configure option

--enable-optimize. Neither --enable-optimize nor --enable-debug

will override any optimization or debugging flags set by the user

in C(XX)FLAGS at configure time. If debugging and optimization are

enabled at the same time, we will try to use -O1, then -O; if

debuggin is not enabled, we will try -O2 first.

$ svn diff -c1424860 \


** Remove an obsolete autoconf macro that was not used anywhere and

is superceded with SVN_CFLAGS_ADD_IFELSE.

$ svn diff -c1424297 \


** Move the sqlite-amalgamation directory from the root of the source tree

under subversion/include/private to make include paths safer from

possible collision with sqlite include files from other install locations.

$ svn diff -c1425050 \


** Allow a user to set a custom set of compiler flags at configure time that

are used for Subversion sources, but not, e.g., Swig-generated sources,

like this:

$ ./configure CUSERFLAGS=--flags-for-C CXXUSERFLAGS=--flags-for-C++

$ svn diff -c1425086 \


  1. … 14 more files in changeset.
Move an upgrade only sql statement to the upgrade file to avoid having to

classify it as a slow statement (and to avoid reusing it as proper statement).

* subversion/libsvn_wc/upgrade.c

(bump_to_23): Update caller.

* subversion/libsvn_wc/wc-metadata.sql

(STMT_UPGRADE_23_HAS_WORKING_NODES): New statement based on ...

* subversion/libsvn_wc/wc-queries.sql

(STMT_HAS_WORKING_NODES): ... this statement.

* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove STMT_HAS_WORKING_NODES.

  1. … 3 more files in changeset.
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


* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove upgrade query from this list.

  1. … 3 more files in changeset.
Merge the inheritable-props branch back to trunk.


  1. … 68 more files in changeset.
When done with temporary tables and triggers explicitly drop them, to avoid

dropping unintentional items (or forgetting to drop intentional items).

This leaves similar fixups for when creating the tables and triggers.

* subversion/libsvn_wc/wc-queries.sql

(STMT_FINALIZE_CHANGELIST): Drop the right trigger explicitly.





STMT_FINALIZE_DELETE): Drop explicitly.

* subversion/tests/libsvn_wc/wc-queries-test.c

(schema_statements): Add STMT_CREATE_CHANGELIST_TRIGGER.

  1. … 1 more file in changeset.
Following up on r1353676, introduce an index on the md5 checksum in the pristine


* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove STMT_SELECT_PRISTINE_BY_MD5, as this now

uses an index.

* subversion/tests/libsvn_wc/wc-queries-test.c

(STMT_CREATE_SCHEMA): Add new index for new wc.db instances.

(STMT_UPGRADE_TO_30): Add new index if it doesn't exist yet on the

future bump to format 30.

Patch by: rhuijben

  1. … 1 more file in changeset.
* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Fix a comment.

Resolve four wc-queries-test warnings by commenting one statement and moving

two others to wc-metadata.sql

* subversion/libsvn_wc/upgrade.c

(migrate_tree_conflict_data): Update statement references.

* subversion/libsvn_wc/wc-metadata.sql

(STMT_UPGRADE_TO_21): Add two bump specific statements.

(STMT_UPGRADE_TO_27): Add one bump specific statements.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_TARGETS): Comment statement, like its only caller in wc_db.c



STMT_HAS_ACTUAL_NODES_CONFLICTS): Move to wc-metadata.sql and add an upgrade

specific suffix to avoid new users.

* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove 4 statements. (upgrade statements are automatically

ignored). Add some comments.

  1. … 3 more files in changeset.
* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Following up on r1342984, remove STMT_SELECT_ALL_FILES as

the slowness has been resolved.

Make svn changelist --remove's performance relative to the size of the target

tree instead of relative to the number of ACTUAL records.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_ACTUAL_EMPTIES): Just delete unneeded ACTUAL nodes within

reach of the operation instead of globally to avoid a table scan.

* subversion/libsvn_wc/wc_db.c

(set_changelist_txn): Pass local_relpath to sql query.

* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove the last 'need review' item.

  1. … 2 more files in changeset.
Rewrite a query to allow using indexes even though Sqlite doesn't understand

a thing of what the query tries to perform.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_EXTERNAL_PROPERTIES): Rewrite using a UNION to allow using

indexes for all cases.

* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): And remove from the slow list.

  1. … 1 more file in changeset.
Avoid nested full table scans on two tables in a single query by rewriting the

query to a completely different pattern.

Only operate on the relevant subset of the actual table to avoid doing unneeded

work on all other nodes in the working copy.

The IN (select local_relpath FROM .. WHERE .. AND kind = 'qqq') style

queries are not optimized by Sqlite to use a select on local_relpath.

Depending on the number of affected nodes and nodes in the working copy, this

query is now orders of magnitude faster.

* subversion/libsvn_wc/wc-queries.sql


* subversion/libsvn_wc/wc_db.c

(set_changelist_txn): Pass the operation root as second argument.

* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove another slow statement from the list.

  1. … 2 more files in changeset.
* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove the move queries as these use an index now.

Use a #if for a compile-time check, rather than an if().

* subversion/tests/libsvn_wc/wc-queries-test.c

(test_sqlite_version): Use the preprocessor when determining which version

of SQLite we're building with, rather than doing so at runtime.

* subversion/tests/libsvn_wc/wc-queries-test.c

(supported_explain_query_plan): Following up on r1342243, don't return FALSE

when the query plan is empty, as that is the case for the dumb test query.

* subversion/tests/libsvn_wc/wc-queries-test.c

(supported_explain_query_plan): New function, extracted from


(test_query_expectations): Extract support detection code.

Don't produce errors for unexpected fast queries by adding the

query plan to the error chain.

[And I replaced some accidentally added tabs with spaces]

It is cheaper for us to read a few more Sqlite results that might even have

the answer we looking for than for Sqlite to collect all items and provide

them sorted.

Apply this knowledge on the is_wclocked check + query.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_ANCESTOR_WCLOCKS): Reorder some checks for sanity and remove

the order by, as Sqlite doesn't know that the passed arguments are related.

* subversion/tests/libsvn_wc/wc-queries-test.c

(STMT_SELECT_ANCESTOR_WCLOCKS): And another 'slow' query gone.

  1. … 1 more file in changeset.
Provide the Sqlite query plan as part of the error message, to avoid having

to install all kinds of Sqlite versions when problems are reported.

* subversion/tests/libsvn_wc/wc-queries-test.c

(test_query_expectations): Store the already copied rows in an array and

add them to created warnings.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_GE_OP_DEPTH_CHILDREN): Avoid creating a temporary table

by using UNION ALL instead of UNION.

(Without ALL duplicates are filtered by using a temp table)

* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Remove slow marker.

  1. … 1 more file in changeset.
* subversion/tests/libsvn_wc/wc-queries-test.c

(test_sqlite_version): Grammar tweak.

Wc-queries-test: Remove dependency on libsvn_wc itself. Add version check

as a separate test, to provide a bit more information.

* build.conf

(wc-queries-test): Remove dependency.

* subversion/tests/libsvn_wc/wc-queries-test.c

(includes): Add private/svn_dep_compat.h.

(test_sqlite_version): New function.

(test_parsable): Remove printf, that is now part of test_sqlite_version.

  1. … 1 more file in changeset.