Commit Graph

12914 Commits

Author SHA1 Message Date
drh 0fb5daed34 Change the command-line shell man-page to use the ".tr" troff directive
instead of ".cc" for escaping the initial "." characters in the ".help"
output.

FossilOrigin-Name: 67f0d469da28c023200239a1f3d0c6cef9ef0e45
2014-10-31 14:46:51 +00:00
drh d836d42383 Simplify the logic in the cell redistribution loop of balance_nonroot().
Enhance and clarify comments and add assert() statements for additional
verification of correctness.

FossilOrigin-Name: a07078b60007e88adea67bec5f0caf91f707ad78
2014-10-31 14:26:36 +00:00
drh bec021b9fc Simplify the math slightly, and reduce by one the number of loop iterations,
for the loop in balance_nonroot() that moves cells between pages.

FossilOrigin-Name: 2e838db82e533598b3cb00011c04fc0d5a896895
2014-10-31 12:22:00 +00:00
drh 9c0153457a Add the "varint.c" utility program in the tool directory.
FossilOrigin-Name: ea5d56be5fe14934e4dbe9c17d46b058f487a231
2014-10-31 10:31:59 +00:00
drh 768f29002e Remove an unnecessary branch from balance_nonroot().
FossilOrigin-Name: 9fc7c88e3f5221883aa6eafbf8af3be94db0c299
2014-10-31 02:51:41 +00:00
drh 00fe08af82 In the balance_nonroot() routine, protect the values in aPgno[] array from
change during the page sort, so that aPgno[] can be used to avoid unnecessary
pointer-map updates for auto_vacuum databases.

FossilOrigin-Name: 69c3924fe834a78d4a8d86833626bf5f68e33a3a
2014-10-31 00:05:23 +00:00
drh 2a0df92542 Improvements to the wording of some comments. Reinstate an assert() that
is only true for non-corrupt database files by adding an "|| CORRUPT_DB" term.

FossilOrigin-Name: 67adb44838f98805f86aecca634d9a3b07370b9e
2014-10-30 23:14:56 +00:00
drh ba0f999418 Tweaks to comments in btree.c. Minor code changes to enhance testability.
FossilOrigin-Name: c7d9aa3a1ce63e27ec94295601bc89fecf1e4977
2014-10-30 20:48:44 +00:00
drh af8f513f9d Fix the %c format character in sqlite3VXPrintf() so that it correctly
handles precisions larger than 70.

FossilOrigin-Name: 08a27440f19b7fc884464832e6105af1bf008172
2014-10-29 18:20:18 +00:00
drh 22e8d833f0 In the OP_Column opcode, when extracting a field that is past the end of
a short record (because the row was originally inserted prior to ALTER TABLE
ADD COLUMN) then make sure the output register is fully NULL and does not
contain leftover flags (such as MEM_Ephem) from its previous use.
Fix for ticket [43107840f1c02].

FossilOrigin-Name: 24780f8ddc1683fc62180e6961dc6bfe1168f4df
2014-10-29 00:58:38 +00:00
dan aa55563d7e Add new test file e_totalchanges.test, containing tests of the sqlite3_total_changes() interface.
FossilOrigin-Name: f84af4adcc34d7a4c72027bf5b038a1a45a4c307
2014-10-28 20:49:59 +00:00
drh 4f41b7dec5 Update the documentation on the sqlite3_randomness() interface to conform
to enhancements associated with the SQLITE_ENABLE_API_ARMOR change.

FossilOrigin-Name: 96e9917c350dfe2069b87860bbb961424ff1105a
2014-10-28 20:35:18 +00:00
dan c3da667b25 Modify the documentation for sqlite3_changes() to make it more testable. Add tests and minor fixes for the same.
FossilOrigin-Name: 41cdd0c422d61533a94870cb5ad094682956d472
2014-10-28 18:24:16 +00:00
dan dd8c460081 Fix a crash that could occur if the WHERE clause of an UPDATE statement on a view that does not feature a column named "rowid" contains a term such as "rowid=?".
FossilOrigin-Name: 8523670d50004f3112b7871f11c8b8b02aab96ab
2014-10-28 16:50:10 +00:00
drh 635e57fc48 Fix a faulty assert() in the DELETE code generator.
FossilOrigin-Name: 95f8ebdbf87326f23cd38e561ac5632b5367a449
2014-10-28 16:19:18 +00:00
drh c3ef4fa88a Trivial simplification to the automatic index logic.
FossilOrigin-Name: 23073a053931de324323f631a6613086786af411
2014-10-28 15:58:50 +00:00
drh 916cd23b2c Bump the version number to 3.8.8
FossilOrigin-Name: 1a7e711ed10860c7985e84b97cdfff748d940b9f
2014-10-28 12:35:28 +00:00
drh eefaf448db Correct the documentation on the maximum size of a scratch allocation.
FossilOrigin-Name: 30f86eb3f9ac88f83ed9e23ea6cd1fccf68e0812
2014-10-28 00:56:18 +00:00
mistachkin 2d8ad51c5b Add special handling for static mutexes in sqlite3_mutex_alloc() when automatic calls to sqlite3_initialize() are enabled.
FossilOrigin-Name: 7857d27caa845e5629d94c2e66587dc89016daca
2014-10-27 22:06:21 +00:00
drh d61a18a9f1 Remove a small amount of unnecessary #ifdeffery from random.c.
FossilOrigin-Name: 2b9340c8684bc382391e02813e960b3166f24daa
2014-10-27 20:14:02 +00:00
mistachkin df9c093e2c Fix compilation issue with MSVC due to a misplaced variable declaration.
FossilOrigin-Name: 9588b345d09daaa49d24d7fb6cab732e64e5474e
2014-10-27 19:58:29 +00:00
mistachkin a95d8ca1fa Fix harmless compiler warning in an assert statement.
FossilOrigin-Name: d33a1ff3aad0bfabf70a98ac338a68f82074e4fe
2014-10-27 19:42:02 +00:00
drh 98d94211ce Fix a typo in the macro name of an #ifdef
FossilOrigin-Name: 9646a136e69cf2583965dfc9fac5f056af4cdb62
2014-10-27 19:39:51 +00:00
drh a4b8fa2360 Add the SQLITE_ENABLE_API_ARMOR compile-time option for extra API parameter
validation.  Enhance sqlite3_stricmp(), sqlite3_strnicmp(), and
sqlite3_uri_parameter() for improved NULL parameter handling.

FossilOrigin-Name: ffb9d8144bbc35bf3d929e0e13a663668fff0558
2014-10-27 18:34:07 +00:00
drh 8a42d1bba1 Fix an unused variable in btree.c:allocateSpace().
FossilOrigin-Name: 637246165a14c4808b90d0437e4d43fa5fac659e
2014-10-27 18:21:01 +00:00
dan 53838629ce Optimizations aimed at reducing the number of memcpy() operations required by balance_nonroot().
FossilOrigin-Name: face33bea1ba3a6d57780655fa827226b4d2baa9
2014-10-27 14:26:54 +00:00
dan f77b610e44 Add test file e_wal.test.
FossilOrigin-Name: fc6920b5483eeeb06a474ff399a21afa51dc4859
2014-10-27 11:25:28 +00:00
dan 61e94c9deb If a free-slot is found within a page, but using that free-slot would fragment the page further and there are already at least 60 fragmented bytes, degragment the page. This matches the behaviour of the trunk.
FossilOrigin-Name: 1f80f8c136ac970dcc7fb2337263dc5922e348c3
2014-10-27 08:02:16 +00:00
dan c65f84630b Merge trunk with this branch.
FossilOrigin-Name: a13df3013bbac4a0d4fce5cef1376c857508c1c5
2014-10-27 07:01:04 +00:00
dan 89ca0b3878 Further modifications to new code to better handle corrupt databases.
FossilOrigin-Name: 1a8cf0a043347772ac54d150d634c32845beee8b
2014-10-25 20:36:28 +00:00
drh d05ab6aacf Increase the resolution of the second parameter to the likelihood() SQL
function (the probability value) so that it can handle probabilities
as small as 0.00000001.  Formerly, it ran out of precision at 0.001.

FossilOrigin-Name: 0f08924fe0c52a85a103f67bee9809e0f8f884b0
2014-10-25 13:42:16 +00:00
drh 051575cbf4 Do not use virtual (and hence redundant) WHERE-clause terms to restrict the
content of a automatic partial index.  Show when an automatic partial index
is used in the EXPLAIN QUERY PLAN output.

FossilOrigin-Name: b9ad601eab1d7298d369267eb697c7fa1bc16985
2014-10-25 12:28:25 +00:00
dan 31f4e99d44 Ensure that the "Any prior cache entry associated with newKey is guaranteed not to be pinned" guarantee made to xRekey implementations is not violated.
FossilOrigin-Name: ecc3544e712041736af7c7b4f34864a1f2e30ff7
2014-10-24 20:57:03 +00:00
drh 059b2d50e1 Enhance the automatic index logic so that it creates a partial index when
doing so gives the same answer for less work.

FossilOrigin-Name: d95d0313c447f5baeabdb17284d8606331ab7d49
2014-10-24 19:28:09 +00:00
dan 23eba45d23 Fix some issues in the new code on this branch related to the handling of corrupt databases.
FossilOrigin-Name: 19736dd9fbbb7e252c4f8715e2277d48ac41f5bc
2014-10-24 18:43:57 +00:00
dan e6593d8e8c Fix some minor formatting and code organization issues.
FossilOrigin-Name: eab8706dc47aa0a44caf73619de858397c3e0b4e
2014-10-24 16:40:49 +00:00
drh 4dd96a8315 Honor a high likelihood() on range constraints.
FossilOrigin-Name: 401235edf40fcd665eaf426cf5155ac6855e8537
2014-10-24 15:26:29 +00:00
drh 9769efcc4c Get the likelihood() functions working on operators like BETWEEN that
create virtual terms in the WHERE-clause analysis.

FossilOrigin-Name: 03d0498d0f24bec2383d5d79edf25069effecd59
2014-10-24 14:32:21 +00:00
drh 5a5d120bcc Fix two problems. Tests now passing.
FossilOrigin-Name: 1c220b806d56e163842e17038c3331f71861bd9c
2014-10-24 12:37:00 +00:00
drh 9ca95730e3 Add the SQLITE_ENABLE_API_ARMOR compile-time option. This is a work in
progress and is not yet completely functional.

FossilOrigin-Name: c297a84bc678f81ffc0aa9139ab73f0ca87c1971
2014-10-24 00:35:58 +00:00
drh 4f81bbb528 Implement sqlite3_create_collation() by invoking
sqlite3_create_collation_v2() with a NULL destructor argument.  This saves
a little space.

FossilOrigin-Name: 9762ad0639cca2fc1ef0573113fb613ce9e7e83e
2014-10-23 01:01:26 +00:00
drh b7288e28e4 Disable the use of strchrnul() unless specifically enabled by compile-time
options.

FossilOrigin-Name: e580470db77d6da970c755102790e603fb26b3c6
2014-10-22 20:07:19 +00:00
drh d7d7147022 Change the 0x800 bit of SQLITE_TESTCTRL_OPTIMIZATIONS so that it disables
the loading of STAT3 and STAT4 content, not just the using of that content.
Change the internal name of that bit to SQLITE_Stat34.

FossilOrigin-Name: ca3b00c44ec52d209642a5ba9ef82e085fac39db
2014-10-22 19:57:16 +00:00
dan cc8490d2cd Merge latest trunk with this branch.
FossilOrigin-Name: 854a54c6c21e800b0cd999023014813f7c50b23f
2014-10-22 18:42:31 +00:00
drh 9f07cf7b2e Take steps to avoid misestimating range query costs based on STAT4 data
due to the roundoff error of converting from integers to LogEst and back
to integers.

FossilOrigin-Name: 3c933bf95f291f7957580d823dce92c981375a5c
2014-10-22 15:27:05 +00:00
drh 442c5cd3cf Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and
when synchronous=FULL in order to ensure that transactions are durable
across a power loss that happens moments after the commit.  Proposed
fix for [https://bugzilla.mozilla.org/show_bug.cgi?id=1072773].

FossilOrigin-Name: 3e922208b68563489c7766abb9afb4885113e7b8
2014-10-21 21:56:06 +00:00
drh f7f2e84a9c Further tuning of the cost estimates for skip-scan loops, especially for cases
when skip-scan loops are in competition with regular loops.

FossilOrigin-Name: a27861c28c4791e51d797aa37e9cca806cb58775
2014-10-21 18:16:21 +00:00
drh 1b131b7a7a Improvements to the WHERETRACE debugging logic.
FossilOrigin-Name: ec1e942f08548695ff02645b3f3cd6bb2516bc9a
2014-10-21 16:01:40 +00:00
drh c8bbce1e6a If a skip-scan is a proper subset of some other scan, then adjust the
cost of the skip-scan upward so that it is more costly than the other scan.
Such a cost imbalance can arise under STAT4 because of difficulties in getting
an accurate estimate for skip-scans.

FossilOrigin-Name: f4b22a2620a5dc48949048c2ecbd226755d4b2c3
2014-10-21 01:05:09 +00:00
drh 40253262e0 Fix a (probably harmless) but in the CSV output mode of the command-line
shell.

FossilOrigin-Name: 19fe4a0a475bd94f491031aea7a183f7c0515cf3
2014-10-17 21:35:05 +00:00