# # patch "ChangeLog" # from [232b63135226322660b916551871ee328c44e4f5] # to [9073b34996c7e5c3f5ba190e8ed1f6dd61b01bd5] # # patch "database.cc" # from [184060fcbaf07eb487e53a21e600235b49394290] # to [5b488d9296a1165037f850298c34720b5e4fb253] # # patch "schema_migration.cc" # from [9a892271e8cc99f14028876d9702d1f4c80c7a0e] # to [75444dd60f8b30e6572d184ced5299d97ff4649a] # ======================================================================== --- ChangeLog 232b63135226322660b916551871ee328c44e4f5 +++ ChangeLog 9073b34996c7e5c3f5ba190e8ed1f6dd61b01bd5 @@ -38,6 +38,16 @@ 2005-10-14 Matthew Gregan
+ * database.cc: Exclusively lock the database when performing a 'db + dump'. + * schema_migration.cc: Run an analyze at the end of a database + migration to help out the SQLite query optimizer. Also change + schema id calculation to match 'sqlite_stat%' rather than the + specific table 'sqlite_stat1'--the SQLite docs suggest that more + tables will be created in the future. + +2005-10-14 Matthew Gregan + * database.cc, schema.sql, schema_migration.cc: Use SQLite 3's exclusive locking whereever we start a new transaction; allows monotone to report database locking errors earlier if a second @@ -145,7 +155,7 @@ * configure.ac, Makefile.am: add {MONOTONE,LIB3RDPARTY}_C{,XX}FLAGS variables. -2005-10-10 Benoît Dejean +2005-10-10 Benoît Dejean * commands.cc: s/key store/keystore/g. @@ -194,7 +204,7 @@ * tests/t_automate_keys.at: Portability fixes. -2005-10-08 Benoît Dejean +2005-10-08 Benoît Dejean * commands.cc: One more i18n string. @@ -541,7 +551,7 @@ * tests/t_netsync_unrelated.at: passes, remove XFAIL -2005-09-26 Benoît Dejean +2005-09-26 Benoît Dejean * database.cc: Merged 3 strings. @@ -559,18 +569,18 @@ * sqlite/*: Update in-tree SQLite from 3.2.6 to 3.2.7. -2005-09-25 Benoît Dejean +2005-09-25 Benoît Dejean * netsync.cc: 3 more i18n strings. -2005-09-25 Benoît Dejean +2005-09-25 Benoît Dejean * cert.cc (cert_signable_text): F() vs. boost::format. * lua.cc (monotone_guess_binary_file_contents_for_lua), (monotone_include_for_lua), (monotone_includedir_for_lua): * rcs_import.cc (import_cvs_repo): Merged some strings. -2005-09-25 Benoît Dejean +2005-09-25 Benoît Dejean * lua.cc (monotone_guess_binary_file_contents_for_lua): Fixed signednes warning and istream usage. @@ -583,7 +593,7 @@ * botan/arc4.cpp: increase maximum keylength to 256 bytes. -2005-09-24 Benoît Dejean +2005-09-24 Benoît Dejean * ChangeLog: Fixed. I don't understand how xxdiff works :/ Please help. @@ -592,7 +602,7 @@ * po/ja.po: Updated Japanese translation. -2005-09-23 Benoît Dejean +2005-09-23 Benoît Dejean * std_hooks.lua: More i18n strings. @@ -600,24 +610,24 @@ "multiline" .. "strings" because gettext doesn't join them. -2005-09-22 Benoît Dejean +2005-09-22 Benoît Dejean * sanity.{cc,hh}: Uninlined F() and FP(). This happily saves ~100KB of .text on my ppc. -2005-09-22 Benoît Dejean +2005-09-22 Benoît Dejean * netsync.cc: Reverted changes from f0a632bf14468b6e03a488d6f1a64ef18b61d04c to 4f7f638954c79c54460d04c3be111acad8b26dd3 -2005-09-22 Benoît Dejean +2005-09-22 Benoît Dejean * lua.cc (monotone_gettext_for_lua): New function. * po/POTFILES.in: Added std_hooks.lua. * std_hooks.lua: One more string for i18n. -2005-09-22 Benoît Dejean +2005-09-22 Benoît Dejean * ui.{cc,hh} (get_user_locale): Returns a const &. @@ -734,7 +744,7 @@ * netsync.cc, commands.cc: Give hooks new argument. * monotone.texi: Update documentation for those hooks. -2005-09-11 Benoît Dejean +2005-09-11 Benoît Dejean * database.cc * database_check.cc @@ -753,7 +763,7 @@ the current directory, so we test the just-built monotone binary, not some older version. -2005-09-07 Benoît Dejean +2005-09-07 Benoît Dejean * std_hooks.lua: Don't spawn emacs with '-no-init-file'. @@ -775,20 +785,20 @@ * monotone.texi (Certificates): Remove mention of fcerts and mcerts. -2005-09-07 Benoît Dejean +2005-09-07 Benoît Dejean * ui.{cc,hh}: Added user_inferface::user_locale. * sanity.hh: Made F() and FP() locale aware. -2005-09-06 Benoît Dejean +2005-09-06 Benoît Dejean * monotone.cc: One more i18n string. -2005-09-06 Benoît Dejean +2005-09-06 Benoît Dejean * po/fr.po: Updated French translation. -2005-09-06 Benoît Dejean +2005-09-06 Benoît Dejean * commands.cc: No i18n for cert_revision_changelog. @@ -803,13 +813,13 @@ Windows (desktop.ini) per-directory browser configuration files. -2005-09-05 Benoît Dejean +2005-09-05 Benoît Dejean * commands.cc: Fixed some strings (added ' around revisions). Removed some whitespaces. No i18n in diff output. -2005-09-05 Benoît Dejean +2005-09-05 Benoît Dejean * sanity.{cc,hh}: boost::format vs. F(). Merged boost::format and moved non-template code to sanity.cc. @@ -946,22 +956,22 @@ "Existing control files" * .mt-ignore: ignore testsuite.dir -2005-09-03 Benoît Dejean +2005-09-03 Benoît Dejean * commands.cc (ls_certs): * netsync.cc (load_data): Merged strings. -2005-09-01 Benoît Dejean +2005-09-01 Benoît Dejean * commands.cc: Merged one more "no such revision '%s'" string. -2005-09-01 Benoît Dejean +2005-09-01 Benoît Dejean * commands.cc: Merged all "no such revision '%s'" strings. (string_to_datetime): Merged catch blocks in order to merge error messages. -2005-09-01 Benoît Dejean +2005-09-01 Benoît Dejean * ChangeLog: Fixed. @@ -1003,7 +1013,7 @@ to monotone_guess_binary_file_contents_for_lua and guess_binary_file_contents. -2005-08-31 Benoît Dejean +2005-08-31 Benoît Dejean * basic_io.cc (basic_io::input_source::err): Merged strings. @@ -1013,7 +1023,7 @@ to uint8_t before using as array indices. Also replace some ints with size_t's to quiet g++ warnings. -2005-08-30 Benoît Dejean +2005-08-30 Benoît Dejean In function void set_char_is_binary(char, bool) 133: warning: array subscript has type char @@ -1023,7 +1033,7 @@ 160: warning: comparison between signed and unsigned integer expressions 162: warning: array subscript has type char -2005-08-30 Benoît Dejean +2005-08-30 Benoît Dejean * file_io.cc (walk_tree): Fixed format. @@ -1051,20 +1061,20 @@ * std_hooks.lua: Simple support for merging using merge(1) and vim. -2005-08-30 Benoît Dejean +2005-08-30 Benoît Dejean * po/fr.po: Updated French translation. -2005-08-30 Benoît Dejean +2005-08-30 Benoît Dejean * commands.cc: Merged some error messages. -2005-08-30 Benoît Dejean +2005-08-30 Benoît Dejean * commands.cc: Merged complete(..., file_id) and complete(..., manifest_id) into template complete(..., ID). -2005-08-30 Benoît Dejean +2005-08-30 Benoît Dejean * commands.cc (ls_certs): Reworked for i18n. (CMD(commit)): Merged 2 strings. @@ -1814,7 +1824,7 @@ * constants.hh: new constant max_path_depth to limit recursion in check_depth. -2005-08-26 Benoît Dejean +2005-08-26 Benoît Dejean * po/fr.po: Updated French translation. @@ -1835,39 +1845,39 @@ * tests/t_drop_execute.at, tests/t_rename_execute.at: New tests. * testsuite.at: Add them. -2005-08-26 Benoît Dejean +2005-08-26 Benoît Dejean * mt_version.cc (print_full_version): Merged strings. * change_set.cc: No i18n for unittests. Wow, this saves 21 strings (total 781). -2005-08-25 Benoît Dejean +2005-08-25 Benoît Dejean * commands.cc (safe_gettext): New function. (explain_usage): Used there to avoid _(""). -2005-08-25 Benoît Dejean +2005-08-25 Benoît Dejean * sanity.{cc,hh} (sanity::do_format): Merged code from sanity::{log, warning, progress} in order to merge strings. Fixed exception rethrowing. -2005-08-25 Benoît Dejean +2005-08-25 Benoît Dejean * commands.cc (CMD(lca)): One more string for i18n. (CMD(trusted)): Merged all strings. -2005-08-25 Benoît Dejean +2005-08-25 Benoît Dejean * po/fr.po: Updated French translation. -2005-08-25 Benoît Dejean +2005-08-25 Benoît Dejean * database.cc (database::version): Marked string for i18n and simplifed. (database::info): Reworked to merge all strings for i18n. -2005-08-25 Benoît Dejean +2005-08-25 Benoît Dejean * database.{cc,hh} (database::open, database::check_filename): New functions to avoid error handling code and string duplicates. @@ -1879,11 +1889,11 @@ * tests/t_genkey.at: check that address@hidden works and address@hidden doesn't. -2005-08-24 Benoît Dejean +2005-08-24 Benoît Dejean * database.cc (assert_sqlite3_ok): Somehow merged error messages. -2005-08-24 Benoît Dejean +2005-08-24 Benoît Dejean * change_set.cc (move_files_to_tmp_bottom_up): Better strings. * keys.cc (generate_key_pair): Merged 2 strings. @@ -1971,23 +1981,23 @@ avoid overflow -- calculate truncation by length, but perform truncation by bytes...) -2005-08-24 Benoît Dejean +2005-08-24 Benoît Dejean * po/fr.po: Updated French translation. -2005-08-24 Benoît Dejean +2005-08-24 Benoît Dejean * monotone.cc: * commands.cc: Two more i18n strings. -2005-08-23 Benoît Dejean +2005-08-23 Benoît Dejean * lua.cc: boost::format vs. F. 2005-08-23 Nathaniel Smith - * AUTHORS: Add Benoît Dejean . Create new - section for translators. Add Benoît there too. + * AUTHORS: Add Benoît Dejean . Create new + section for translators. Add Benoît there too. 2005-08-23 Nathaniel Smith @@ -2004,7 +2014,7 @@ * keys.cc (get_passphrase): Put back trailing ": " removed in recent i18n changes. -2005-08-23 Benoît Dejean +2005-08-23 Benoît Dejean * change_set.cc (dump_change_set): boost::format instead of F. * commands.cc (get_log_message, notify_if_multiple_heads, @@ -2015,7 +2025,7 @@ * i18n.h: N_() stands for gettext_noop(), not plural. * keys.cc (get_passphrase): Fixed string surgery. * netsync.cc: i18nized tickers' labels. Added xgettext comment - as tickers do not play well with multibytes characters (like é). + as tickers do not play well with multibytes characters (like é). (session::analyze_attachment): Fixed string surgery. (session::process_hello_cmd): Merged many strings. (session::process_data_cmd): Removed some leading/trailing @@ -2024,16 +2034,16 @@ * ui.cc (tick_write_count::write_ticks): Reworked and fixed surgery. Merged some strings. -2005-08-23 Benoît Dejean +2005-08-23 Benoît Dejean * commands.cc (CMD*): _("") -> "" as _("") returns the PO header. -2005-08-23 Benoît Dejean +2005-08-23 Benoît Dejean * transforms.cc (check_idna_encoding): No i18n for unittests. -2005-08-23 Benoît Dejean +2005-08-23 Benoît Dejean * change_set.cc (dump_change_set): boost::format instead of F. * commands.cc (get_log_message, notify_if_multiple_heads, @@ -2044,7 +2054,7 @@ * i18n.h: N_() stands for gettext_noop(), not plural. * keys.cc (get_passphrase): Fixed string surgery. * netsync.cc: i18nized tickers' labels. Added xgettext comment - as tickers do not play well with multibytes characters (like é). + as tickers do not play well with multibytes characters (like é). (session::analyze_attachment): Fixed string surgery. (session::process_hello_cmd): Merged many strings. (session::process_data_cmd): Removed some leading/trailing @@ -2053,7 +2063,7 @@ * ui.cc (tick_write_count::write_ticks): Reworked and fixed surgery. Merged some strings. -2005-08-23 Benoît Dejean +2005-08-23 Benoît Dejean * netcmd.cc (test_netcmd_functions): Don't translate unittest strings. @@ -2062,7 +2072,7 @@ * lua.cc (dump_stack): boost::format vs. F for strings that are not messages. -2005-08-23 Benoît Dejean +2005-08-23 Benoît Dejean * xdelta.cc: Don't translate unittest strings. @@ -2119,14 +2129,14 @@ 2005-08-22 Nathaniel Smith * commands.cc (dump_diffs): Don't use F() to create diff headers. - (commands::process): Put '' in the log message to make Benoît + (commands::process): Put '' in the log message to make Benoît Dejean happy ;-). 2005-08-22 Nathaniel Smith * po/LINGUAS, po/ja.po: Add Japanese translation by Satoru SATOH. -2005-08-20 Benoît Dejean +2005-08-20 Benoît Dejean * po/monotone.pot: Remove from version control. * po/POTFILES.skip: New file. @@ -2135,10 +2145,10 @@ 2005-08-22 Nathaniel Smith - * commands.cc (read): Use FP (thanks to Benoît Dejean for + * commands.cc (read): Use FP (thanks to Benoît Dejean for catch). * mt_version.cc (print_version, print_full_version): Mark more - strings for i18n (also thanks to Benoît Dejean). + strings for i18n (also thanks to Benoît Dejean). 2005-08-22 Nathaniel Smith @@ -2192,7 +2202,7 @@ * revision.hh: Delete doubled line of text in comment. -2005-08-20 Benoît Dejean +2005-08-20 Benoît Dejean * monotone.cc (cpp_main): setlocale(LC_ALL). * commands.cc (dropkey): Unify warning into a single string. @@ -8795,7 +8805,7 @@ * AUTHORS: Mention Wojciech and Neil. * revision.cc (calculate_ancestors_from_graph): Make non-recursive. -2005-01-17 Wojciech Mià Âkowski +2005-01-17 Wojciech MiÅkowski * std_hooks.lua: Teach about meld. ======================================================================== --- database.cc 184060fcbaf07eb487e53a21e600235b49394290 +++ database.cc 5b488d9296a1165037f850298c34720b5e4fb253 @@ -316,6 +316,7 @@ void database::dump(ostream & out) { + transaction_guard guard(*this); dump_request req; req.out = &out; req.sql = sql(); @@ -334,6 +335,7 @@ dump_index_cb, &req, NULL); assert_sqlite3_ok(req.sql); out << "COMMIT;\n"; + guard.commit(); } void ======================================================================== --- schema_migration.cc 9a892271e8cc99f14028876d9702d1f4c80c7a0e +++ schema_migration.cc 75444dd60f8b30e6572d184ced5299d97ff4649a @@ -159,7 +159,7 @@ // those are auto-generated indices (for // UNIQUE constraints, etc.). "AND sql IS NOT NULL " - "AND name != 'sqlite_stat1' " + "AND name not like 'sqlite_stat%' " "ORDER BY name", &append_sql_stmt, &tmp, NULL); if (res != SQLITE_OK) @@ -263,6 +263,9 @@ if (sqlite3_exec(sql, "VACUUM", NULL, NULL, NULL) != SQLITE_OK) throw runtime_error("error vacuuming after migration"); + + if (sqlite3_exec(sql, "ANALYZE", NULL, NULL, NULL) != SQLITE_OK) + throw runtime_error("error running analyze after migration"); } else {