Commit Graph

13126 Commits

Author SHA1 Message Date
dan
8ac1a67eff Modify the documentation for sqlite3_backup_init() to indicate that it will fail if there is already a read or read-write transaction open on the destination database.
FossilOrigin-Name: ef03a203351a6002e2b1075139717e4234c816cd
2014-11-13 14:30:56 +00:00
dan
fad01993b7 Have calls to sqlite3_backup_init() fail if there is already a read or read-write transaction open on the destination database.
FossilOrigin-Name: 169b5505498c0a7ee2b5dbb2ba13c41dfaa7c62f
2014-11-13 14:18:25 +00:00
drh
6f9c5669e2 When a transaction or savepoint rollback occurs, save the positions of all open read-cursors so that they can be restored following the rollback operation. Cherry-pick of check-in [dd03a2802f3f27]
FossilOrigin-Name: 402780a9c8df9e7ea898bdca49c1191042fe387a
2014-11-13 13:42:39 +00:00
dan
d7b06909ad Add further tests for rollback operations in the presence of ongoing selects.
FossilOrigin-Name: eaf3aae014f59c8d37aa20aa31d54cf13f9e86fc
2014-11-12 17:45:37 +00:00
dan
8023104252 When a transaction or savepoint rollback occurs, save the positions of all open read-cursors so that they can be restored following the rollback operation.
FossilOrigin-Name: dd03a2802f3f276525f3cef9a93f825dd8606626
2014-11-12 14:56:02 +00:00
drh
5a2c8c885c Fix the %c format character in sqlite3VXPrintf() so that it correctly handles precisions larger than 70.
FossilOrigin-Name: 839a6df9f98b90fb593534a62145d9c913540bae
2014-11-12 14:12:28 +00:00
drh
51a205410c Make sure that NULL results from OP_Column are fully and completely NULL and do not have the MEM_Ephem bit set. Fix for ticket [094d39a4c95ee4].
FossilOrigin-Name: e1017745e183f5d7429ce787ec2feef946a24f0f
2014-11-12 14:07:28 +00:00
drh
85fabf1444 This is a cherry-pick of version [b5df5ac052].
FossilOrigin-Name: d4b2d5d066891e06f2bf4337902b44b000fa9fd2
2014-11-11 22:55:26 +00:00
mistachkin
bfa395d085 Remove some calls to the 'breakpoint' test command.
FossilOrigin-Name: 1412fcc480799ecbd68d44dd18d5bad40e20ccf1
2014-11-11 19:07:56 +00:00
dan
2d8e3caa2e Add tests for sqlite3_blob_bytes().
FossilOrigin-Name: a066a3832a7c6de65c3016e77e49ac00e09db749
2014-11-11 16:11:04 +00:00
drh
949d43a5fd Permit read operations to continue after a ROLLBACK as long as the schema
does not change.

FossilOrigin-Name: b5df5ac0529f7b0d1e880a7f4a307e7d77b7fa6c
2014-11-11 14:59:31 +00:00
dan
43f4066e10 Add new test file e_blobclose.test, containing tests for sqlite3_blob_close().
FossilOrigin-Name: 5a1eac2419b1462e6f21595a3fff26d9cc49d203
2014-11-11 12:20:35 +00:00
drh
47b7fc7843 Experimental changes that permit read operations to continue after a
ROLLBACK, as long as the schema is unchanged.

FossilOrigin-Name: fa6e6a9ae276cad60e9a4abc1bc23cf2809ea786
2014-11-11 01:33:57 +00:00
drh
de58f4fe7f New test cases for deleting content out from under a SELECT statement.
FossilOrigin-Name: 8289c3e9b47f7c2a606a88839f6bf615f8904ac2
2014-11-10 19:16:59 +00:00
dan
923c4b35be Add test file e_blobwrite.test, containing tests for the sqlite3_blob_write() interface.
FossilOrigin-Name: 1df77e5f1bd82de4dc92fe28359c3e56ab3f9ed4
2014-11-10 17:53:03 +00:00
drh
1728bcb07f Add the eval() SQL function extension in ext/misc/eval.c.
FossilOrigin-Name: 27cf665b957f2c0ced403e3032099e80c295598f
2014-11-10 16:49:56 +00:00
drh
4ace5362c2 Shorten over-length source code lines in shell.c.
FossilOrigin-Name: 7f3819f6422badd344c1264b0cd2f2c7afe077df
2014-11-10 14:42:28 +00:00
dan
b391b94431 Add new test file e_blobopen.test, containing tests for sqlite3_blob_open().
FossilOrigin-Name: ecbccd0e594d22b3ae7fabc8037951dc49570bc3
2014-11-07 14:41:11 +00:00
drh
97d3898335 Fix another harmless comment typo.
FossilOrigin-Name: b45bc80bb16f07192d84fd14433bb724a84d4146
2014-11-07 14:37:32 +00:00
drh
9a06d30bb5 In the ".scanstats on" output from the shell, round the estRows value to
the nearest integer, rather than rounding toward zero.

FossilOrigin-Name: 5700508535c35ac6b158b527e1d47e529e8e28ab
2014-11-07 13:52:44 +00:00
drh
86a11b8a6a Fix harmless typos in comments.
FossilOrigin-Name: 94c564da4c2cf5dffe58fdf7a180e9ba4cc3de69
2014-11-07 13:24:29 +00:00
drh
6137138ded Fix typo in sqlite3.h reported on the mailing list.
FossilOrigin-Name: 402703212a8488f8b571ce170b3b6c7374bd7daa
2014-11-07 11:39:16 +00:00
drh
8790b6e860 Update documentation on sqlite3_config() and add corresponding evidence marks.
FossilOrigin-Name: 360c8ca11c3315c8e08c7c52ff5468e3f723e562
2014-11-07 01:43:56 +00:00
drh
b1a6eada1d Added SQLITE_SCANSTAT_SELECTID. Change the value returned by
SQLITE_SCANSTAT_EST from sqlite3_int64 to double.  Enhanced the formatting
and display of scan statistics using the ".scanstats on" command in the
shell.

FossilOrigin-Name: 20c7614addb8494cd7f40263a50fa6f428cce1c7
2014-11-06 14:43:53 +00:00
drh
15f23c2cf0 Further improvements to the ".scanstats on" display in the shell. Be sure
to show the results of all subqueries even if there are gaps in the 
SELECTID values.  Add ".scanstats" to the ".help" output.

FossilOrigin-Name: ee922682bb7235dbcd23a22fcfdfa188f6d3228a
2014-11-06 12:46:16 +00:00
drh
179bac3a14 On the ".scanstats on" output in the shell, initialize the estimated count for
the first loop of each subquery to the actual loop count.

FossilOrigin-Name: d1c51c8455d5ce972a77720c2d56228646ced27c
2014-11-06 12:17:24 +00:00
drh
42f30bce11 Changes the formatting of ".scanstats on" in the shell so that the stats for
subqueries are grouped together and occur after the main query.

FossilOrigin-Name: eacbbd8849db9b023eff15ef1cb42ec941299433
2014-11-06 12:08:21 +00:00
drh
c6652b1efe Add the SQLITE_SCANSTAT_SELECTID metric. Use it to improve the
".stmtscan on" output in the shell.

FossilOrigin-Name: 64ad5761a841f71530d41565b9fbe9d19c2d6aff
2014-11-06 04:42:20 +00:00
drh
518140ed04 Change the SQLITE_SCANSTAT_EST parameter so that it returns a double for
the estimated number of output rows per loop, rather than a 64-bit integer.
Revise the output format for the ".scanstats on" in the shell to make use
of this new capability.

FossilOrigin-Name: f9684000665ae7ef6f89c3773612b8286b8f545a
2014-11-06 03:55:10 +00:00
drh
e1db0db899 Fixes to the Windows VFS to allow memory mapped files to work without WAL support.
FossilOrigin-Name: 272fddc14cc322655eeba670bc0f9fc30e5a804c
2014-11-05 21:34:56 +00:00
drh
fefa094921 Fix harmless compiler warnings in the new balance_nonroot() routine.
FossilOrigin-Name: 83a1e5db926b3a6d40f4a5cf9a8e6852b9bac9ac
2014-11-05 21:21:08 +00:00
drh
6d3f91d040 Change the query planner to do a better job of estimating the number rows
selected by a BETWEEN operator using STAT4 when both upper and lower bounds
are contained within the same sample.

FossilOrigin-Name: 2d36be5d9a1cdd4fd2d54fc4eeece32a81cbacc1
2014-11-05 19:26:12 +00:00
drh
6b5631e02f Make sure that NULL results from OP_Column are fully and completely NULL
and do not have the MEM_Ephem bit set.  Fix for ticket [094d39a4c95ee4].

FossilOrigin-Name: 42705fd7d892c4fdfb95fbbb468c99569beece25
2014-11-05 15:57:39 +00:00
dan
937994aa65 Add a test case to check that the previous commit is effective.
FossilOrigin-Name: 948d6e5d07bc14b6de32ec2144c716a5532f894c
2014-11-05 14:19:05 +00:00
drh
e0de876e27 Enhance whereLoopCheaperProperSubset(X,Y) so that it does not report true
if X uses skip-scan less than Y, since in that case X might
deserve to be cheaper even if it is a proper subset.

FossilOrigin-Name: c106b755369c1f8546e897ecd2ac56fd09d6e885
2014-11-05 13:13:13 +00:00
dan
8d1edb92c4 Add the ".scanstats on" command to the shell tool. Executing this command causes the shell tool to print values from sqlite3_stmt_scanstatus() after each query is run.
FossilOrigin-Name: 7974c0ed10ffdc960a43fed89845c2bed428958d
2014-11-05 09:07:28 +00:00
drh
547fb61807 Improved output formatting for the showstat4 tool.
FossilOrigin-Name: 7df82c46da437bc743576358c25e758280067df8
2014-11-04 21:38:45 +00:00
mistachkin
fdece7bad1 Skip tests that require WAL mode when it is not enabled.
FossilOrigin-Name: 6fc4ead26d19b9348bbda34c3053ae1e066abc32
2014-11-04 19:52:15 +00:00
mistachkin
73767829b9 For the Win32 VFS, allow memory mapped files to work when compiled without WAL support.
FossilOrigin-Name: 1fc7e2f3d34e25e7b59aa8b51d10c1e27ab4a527
2014-11-04 19:37:22 +00:00
drh
4d9f188f00 Add various requirements evidence marks for sqlite3_config() options.
FossilOrigin-Name: d423349d2cd8bc7e04f3d90ca7bab11e1ad86e25
2014-11-04 17:23:24 +00:00
drh
cbd55b0362 Change the definition of SQLITE_CONFIG_SCRATCH so that at most one scratch
buffer is used per thread.  Use the generic heap memory allocator for the
WalIterator object when running a checkpoint.

FossilOrigin-Name: 391c9b85abcb5ba300fb2e116384639310c69ed2
2014-11-04 14:22:27 +00:00
drh
5279d3433c Improved documentation and addition of source-code evidence marks for the
sqlite3_config() interface.

FossilOrigin-Name: 681031a436fdd4cce426d6cd43cbae6b83167d26
2014-11-04 13:41:32 +00:00
drh
def6889d21 Add the SQLITE_CONFIG_PCACHE_HDRSZ option for sqlite3_config().
FossilOrigin-Name: 6eb03e62a34e8e0964175283587247b0212db604
2014-11-04 12:11:23 +00:00
drh
d84bf205c3 Updates to the sqlite3_stmt_scanstatus() documentation. No changes to code.
FossilOrigin-Name: d97c324eb1d870c994911c53fbf84205f4e3e7a1
2014-11-03 18:03:00 +00:00
dan
0cb6948f6b Add the experimental sqlite3_stmt_scanstatus() API. For comparing the number of rows actually visited by a loop with the estimate used by the query planner.
FossilOrigin-Name: ab3b0fc5760c6d428dbe1f974726a7d3526640bc
2014-11-03 16:56:43 +00:00
dan
d72219da43 Fix a typo preventing this from building with SQLITE_ENABLE_STMT_SCANSTATUS defined.
FossilOrigin-Name: 4c5714ab3dba19513374c7b1478221a0b90b450c
2014-11-03 16:39:37 +00:00
drh
d1a1c23423 Refactor the interface to make it more easily extensible.
FossilOrigin-Name: 7955342da4a35b57e4ae26690b8d40f7bba20e8f
2014-11-03 16:35:55 +00:00
dan
e2f771b047 Add further tests. Fixes so that compilation without ENABLE_STMT_SCANSTATUS works.
FossilOrigin-Name: a2303c719222f1effb51acc6b37930561148c00c
2014-11-03 15:33:17 +00:00
drh
7b4d780b54 Use exponential buffer size growth in StrAccum, as long as the size does not
grow to large, to avoid excess memory allocation resize operations.  Also,
document the fact that setting scratch memory causes SQLite to try to avoid
large memory allocations.

FossilOrigin-Name: a518bc3318232d652349eb29303ff250aee40459
2014-11-03 14:46:29 +00:00
drh
7f5a7ecd21 When enlarging the size of a StrAccum object, use sqlite3DbMallocSize() to
record the entire size of the allocation, not just the requested size.

FossilOrigin-Name: 3dda3c937469ce661d1cd0e8d8963a03e698ee39
2014-11-03 13:24:12 +00:00
dan
037b5324bd Remove unused variable from struct WhereInfo. Add some explanatory comments to new code.
FossilOrigin-Name: f5313e0c680d9baebefb1cf50ddadedd4418a334
2014-11-03 11:25:32 +00:00
dan
43764a8efb Minor performance enhancements to SQLITE_ENABLE_STMT_SCANSTATUS code.
FossilOrigin-Name: f13d6ba8a72d75838c4aaf85326c1129da027f8b
2014-11-01 21:00:04 +00:00
dan
6f9702ed4d If SQLITE_ENABLE_STMT_SCANSTATUS is defined, record the number of times each VDBE opcode is executed. Derive the values returned by sqlite3_stmt_scanstatus() from these records on demand.
FossilOrigin-Name: 9ea37422a8cc2fce51bb10508e5e90f40fd4b511
2014-11-01 20:38:06 +00:00
drh
d1dcb23465 Add requirements marks and make minor tweaks to documentation.
FossilOrigin-Name: 49188b2bb53a92b0b0b6aaf8247edeb0c1bcd1f5
2014-11-01 18:32:18 +00:00
dan
89e71646df Minor fixes and documentation improvements for sqlite3_stmt_scanstatus().
FossilOrigin-Name: 8d8cc9608d30bb65fffcfe488e904411cbbc7f41
2014-11-01 18:08:04 +00:00
dan
04489b6dce Add the experimental sqlite3_stmt_scanstatus() API.
FossilOrigin-Name: 6a9bab34aeb6a01b612211a28c140de60a3e883c
2014-10-31 20:11:32 +00:00
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
7abfe9d0c6 Version 3.8.7.1
FossilOrigin-Name: 3b7b72c4685aa5cf5e675c2c47ebec10d9704221
2014-10-29 13:59:56 +00:00
drh
35404253f6 Increase the version number to 3.8.7.1
FossilOrigin-Name: 83afe23e553e802c0947c80d0ffdd120423e7c52
2014-10-29 01:27:43 +00:00
drh
a26b9a7727 Fix problems with running UPDATE and DELETE against a VIEW and referencing
the rowid in the WHERE clause.  This is a cherrypick of [95f8ebdbf87326f2]
and [8523670d50004f3].

FossilOrigin-Name: cc33e846c8509419f0a1fbfb286807b4c137788d
2014-10-29 01:26:25 +00:00
drh
bba8206be9 Disable the use of strchrnul() unless specifically enabled by compile-time
options.  Cherrypick of check-in [e580470db77d6da9]

FossilOrigin-Name: 837368adfe859c41b347d3124d5b3fdf790eec03
2014-10-29 01:18:03 +00:00
drh
739383d25d 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].  This is a cherrypick of
check-in [24780f8ddc1683fc].

FossilOrigin-Name: 304ea6ba6f4cf40a76d32d37af73a253f493ba47
2014-10-29 01:13:58 +00:00
drh
62ecc28caf 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].
This is a cherrypick of [3e922208b68563489].

FossilOrigin-Name: a8f9bd1e890434fcffa02fcd2baf8b0fb5d4c9dd
2014-10-29 01:07:21 +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
drh
81b567a4c7 Version 3.8.7
FossilOrigin-Name: e4ab094f8afce0817f4074e823fabe59fc29ebb4
2014-10-17 11:24:17 +00:00
mistachkin
7bdc9749d5 Work around MSVC not being able to deduce that a local variable was initialized in a called function.
FossilOrigin-Name: 06c576c152c4013080c255cbbeb45bf2e298be9f
2014-10-16 21:39:17 +00:00
mistachkin
92c2e0da8f Changes to work around Win32 and MSVCRT APIs that are not present on Windows CE 200x.
FossilOrigin-Name: 1418c006e377d7915a50577d4ccb21125b750bae
2014-10-16 18:34:50 +00:00
dan
facd5fd622 Update the vdbe-compress.tcl script to account for expressions of the form (123>var), where "var" should be replaced with a reference to a union member.
FossilOrigin-Name: 640345d880c6178f8434e3ce40329b7527588843
2014-10-16 11:45:14 +00:00
dan
5d510d4c41 Update releasetest.tcl so that x86-64 runs a superset of the x86 tests.
FossilOrigin-Name: 3c1e70f4d55bc009ed9ed4cf6d756d7061985851
2014-10-15 15:28:27 +00:00
dan
f41652419e Fix a problem causing lock5.test to fail in mmap-mode.
FossilOrigin-Name: b3e7b446bdb47cf9d7fe43dc37e3b4f8010ee09e
2014-10-15 14:45:34 +00:00
drh
92787cf042 Add a four-byte prefix to the BtShared.pTmpSpace buffer to avoid reading
before the beginning of an allocation.

FossilOrigin-Name: 9386bfca128023583a24303e5f1d832987a49d43
2014-10-15 11:55:51 +00:00
dan
74439167cb Rearrange an expression in vdbemem.c to avoid a (harmless) reference to a possibly unitialized variable.
FossilOrigin-Name: 4a7b3fa049a9aa0668e318287edd4a78c0588bf8
2014-10-15 11:31:35 +00:00
drh
5604cc0d3b Make sure new sqlite3_vtab objects created by the xCreate() virtual table
method are initialized by the system, in accordance with the documentation.

FossilOrigin-Name: eab82330631187dcc3e5d2dddd23dbda5752904b
2014-10-14 20:25:43 +00:00
dan
8e9ba0c335 Fix some code duplication issues on this branch. Add minor optimizations to the new code.
FossilOrigin-Name: 58d7793bd5d608ba9fc3a2cd44b9d9512e0332ba
2014-10-14 17:27:04 +00:00
drh
8dd8362d64 Optimize a database corruption test inside of the OP_Column opcode.
FossilOrigin-Name: 005e5b388a8a97bca6d1f0e06c40d68d92aa1212
2014-10-13 23:39:02 +00:00
drh
facf47a891 Use the padding word in the Mem object as temporary storage for
serial_type value in OP_Record, and thus avoid a redundant computation of
the serial_type for each column.

FossilOrigin-Name: 4b3b65ee5ea61e9b9671ca027940bf02689cb890
2014-10-13 20:12:47 +00:00
dan
d0b8f93b5f Merge trunk changes into this branch.
FossilOrigin-Name: d5b7c5a88dd58de85b3060a1f28b6d96e6e21207
2014-10-13 18:09:13 +00:00
dan
d7b545bbcb Further work on balance_nonroot().
FossilOrigin-Name: 6594f9b420e2fa642737722ff8521f756ecef227
2014-10-13 18:03:27 +00:00
drh
f526dcad29 Three small optimizations to vdbeaux.c.
FossilOrigin-Name: 04892f8ba6c55cec4fe37bfe59b6349fd2a40698
2014-10-13 17:42:05 +00:00
drh
c22284f4b3 Reduce the CPU load imposed by sqlit3VdbeCursorMoveto() by factoring out
some of its functions and by avoiding unnecessary calls.

FossilOrigin-Name: c2799aece17d347c64217a0e407bb10e50c184a3
2014-10-13 16:02:20 +00:00
drh
6cf4a7dfa6 Remove the OPFLAG_CLEARCACHE flag from OP_Column. In its place, change the
P3 parameter of OP_SorterData to be the index of the pseudo-table cursor whose
record header cache is to be cleared.  This gives a small size reduction
and performance increase.

FossilOrigin-Name: 20062f49428a2349a2dd705af570c60b499a3eef
2014-10-13 13:00:58 +00:00
drh
b53a5a9e50 Remove the VdbeCursor.lastRowid cache of the current rowid, since maintaining
the correct cache value uses more CPU cycles than just recomputing the rowid
on the occasions when it is actually needed.  Replace it with the
VdbeCursor.aOffset field which used to be computed from VdbeCursor.aType
when needed. Saves 100 bytes of code space and runs 0.2% faster.

FossilOrigin-Name: 91384a7d727ef0f285cd430e829ba9f3852db50e
2014-10-12 22:37:22 +00:00
drh
c81aa2e120 Performance optimization and very slight size reduction for OP_Column.
FossilOrigin-Name: 869c30e45cc87063be423c650f16b99e8adb3df0
2014-10-11 23:31:52 +00:00
dan
09c6840153 Attempt to further reduce memcpy() in balance_nonroot().
FossilOrigin-Name: fec849dcca3aead2bc2d4ecffeda750684d32fb0
2014-10-11 20:00:24 +00:00
drh
d6176c4131 Simplification to the insertCell() routine in btree.c, resulting in a
performance boost and a very small size decrease.  It turns out that the
extra work involved in sometimes avoiding an memcpy() of the first four bytes
of a record takes more time than just unconditionally copying those
four bytes.

FossilOrigin-Name: 66de15580d3c289601e67debfe1edee286f4db5f
2014-10-11 17:22:55 +00:00
drh
8683e08676 Require the SQLITE_ENABLE_RTREE compile-time option in speedtest1.c in order
to enable the R-Tree tests.

FossilOrigin-Name: 5d29a033b0f17b0fd74656b28a8367a9a9067f81
2014-10-11 10:52:54 +00:00
drh
4929047d1a Make sure that a GROUP BY that also implements an ORDER BY scans the table
in the correct order.  Fix for ticket [ba7cbfaedc7e6].

FossilOrigin-Name: 7a32fdfd4be2138c0ab00f3dc6f54a70e4e07be4
2014-10-11 02:12:58 +00:00
drh
c631faa922 Remove an unnecessary conditional from the EXPLAIN QUERY PLAN logic.
FossilOrigin-Name: c5dc83ebded914f07286b7f98d0a50c28c16f609
2014-10-11 01:22:16 +00:00
dan
b6453201d2 Account for the ASC/DESC properties of ORDER BY expressions when using the same index for GROUP BY and ORDER BY. Candidate fix for [ba7cbfaedc].
FossilOrigin-Name: 2a9573962b837973c4959465d8a5f2641d109a5a
2014-10-10 20:52:53 +00:00
drh
1f8817cb32 Restrict the scope of the explainIndexRange() function in where.c.
FossilOrigin-Name: c30124520027f0f860223bf842e2f09db3dafb5f
2014-10-10 19:15:35 +00:00
dan
5bd8af7c6b Fix a failing test case in index5.test. Also tweak the way cache memory is divided between read-only and dirty pages when using SQLITE_CONFIG_PAGECACHE to reduce IO in some cases.
FossilOrigin-Name: 8541dfb3bbdf63dc9ab304d8a0ab8b290cdc9d96
2014-10-10 19:10:59 +00:00
drh
ab993380a2 Changes to enable compiling using VC6.
FossilOrigin-Name: 9ee5686ab3b0bca8cabdf455c75bd9410cdc5378
2014-10-10 18:09:52 +00:00
drh
e35626fabd When using the -config option to releasetest.tcl, default the testing type
to "fulltest" if it is not specified on the command line.

FossilOrigin-Name: cf291cbe9f49396f03cfca39c2e892f27f750107
2014-10-10 17:47:00 +00:00
drh
2eeb7ae437 Provide the new "-config CONFIG" option to the test/releasetest.tcl script,
which allows one to run a single test configuration selected by name.

FossilOrigin-Name: d479e32be205f6cd0474f002282eae6eec613f36
2014-10-10 17:44:03 +00:00
drh
98545bb2ed Add the estimated number of output rows to the EXPLAIN QUERY PLAN output
if compiled with SQLITE_EXPLAIN_ESTIMATED_ROWS.  This feature is off by
default for the time being.

FossilOrigin-Name: daa8314fba9dc3c4f5e7fbda42c97604fbfc4392
2014-10-10 17:20:39 +00:00
drh
6c97789d2e Simplify the code used to generate the text for EXPLAIN QUERY PLAN.
FossilOrigin-Name: beea1efc3a49cad08087fcbb18dbce71c873fe57
2014-10-10 15:47:46 +00:00
drh
681fca0018 Fix a potential problem in the whereRangeScanEst() routine when STAT4 is
active.  The problem was introduced by recent enhancements.

FossilOrigin-Name: 68e1b4de700b5291f79249a03e1a750c6b2c9ae4
2014-10-10 15:01:46 +00:00
drh
bf59bf94b2 Cause the command-line shell to return non-zero if the final SQL statement
is incomplete.

FossilOrigin-Name: 177fff3b98b101b98f1e7d334b6a80530b645565
2014-10-10 13:08:33 +00:00
dan
33ea486603 Change the balance_nonroot() routine to reduce the amount of memcpy work that takes place. This is a work in progress.
FossilOrigin-Name: 29304499ea4b72dbb6701e10cc19b5d41f7e5ac9
2014-10-09 19:35:37 +00:00
dan
6e1a037357 Allow FTS tokenizers to choose whether or not to consider the "*" character part of tokens or not. This restores the pre-[e21bf7a2ad] behaviour. Also fix a problem causing FTS to interpret tokens beginning with "*" characters as EOF.
FossilOrigin-Name: 49dfee7cd1c9ab2901b8a871a6cd00b2ead76801
2014-10-09 15:08:17 +00:00
drh
622d4f8bb1 Add a test case for the memory leak fixed by the previous check-in.
FossilOrigin-Name: bae36d544676c90e337381a83f4513b4d925ab05
2014-10-09 14:10:38 +00:00
drh
a8950d5038 Fix a memory leak associated with the FTS4 matchinfo() function.
FossilOrigin-Name: fb8da82411b80a234c6a5481622027815450996a
2014-10-09 14:00:49 +00:00
drh
8e0a8f681a Remove an always-true branch in whereRangeScanEst(). Replace it with an
assert().

FossilOrigin-Name: 42e48fd3a6a6219d9bd6135d821b38c5157922ba
2014-10-08 19:33:54 +00:00
drh
3705ef6a73 Fix up test cases to account for the new SQLITE_LIMIT_WORKER_THREADS limit.
FossilOrigin-Name: 6483d426c4c5c772cd49412ea37e0fa7a0378904
2014-10-08 15:53:21 +00:00
drh
f6aff80525 Set the connection-specific lastRowid value before calling any SQL function.
FossilOrigin-Name: dff0f6422e60a7e2e4efb658aab202a119cfa702
2014-10-08 14:28:31 +00:00
drh
6a15440378 Ensure that the Pager.pTmpSpace allocation is correct even if an OOM error
occurs while reducing the page size.

FossilOrigin-Name: e4b43967fd9a0b4944be9ab5575bff3678be8ed5
2014-10-08 13:34:21 +00:00
dan
923c0b53be Remove some temporary code in mallocA.test that was accidentally checked in.
FossilOrigin-Name: dedd15f7cd13868f3be37646dd30ab7ceac5dea7
2014-10-08 11:11:24 +00:00
drh
69afd9980e Fix the STAT4 range scan estimates for DESC indexes.
FossilOrigin-Name: e3fe84005259ef9a6027d25793514cebb2d4e7e0
2014-10-08 02:53:25 +00:00
drh
9a7b41d74a More intuitive labels on ".wheretrace" output.
FossilOrigin-Name: adcb3fed489b580221c7bf2692a60e24248b23a0
2014-10-08 00:08:08 +00:00
drh
722246e801 Make sure the sqlite3VdbeMemClearAndResize() routine is never called with a
zero size parameter, since a size of zero could lead to either a memory leak
or an assertion fault.

FossilOrigin-Name: f672a380e2e52bede95ff11a533fd9f7d412d494
2014-10-07 23:02:24 +00:00
drh
89a5833cb9 Fix the corruptI.test script so that it works with
SQLITE_ENABLE_OVERSIZE_CELL_CHECK and with SQLITE_DEFAULT_AUTOVACUUM=1.

FossilOrigin-Name: e405b9e4a9ef322d84b20e902234b4f6aa196b1b
2014-10-07 20:09:27 +00:00
drh
3b335fce5c Restrict the scope of the valueToText() routine.
FossilOrigin-Name: 13c962b33df411a0d9ead0bb1969596faa286f79
2014-10-07 16:59:22 +00:00
drh
d231aa3a42 Enhance (and fix) the MEMTYPE tags associated with heap memory allocations
when SQLITE_MEMDEBUG is used.

FossilOrigin-Name: ca5b789e33c4e5ce366d8f5372d086442f84e230
2014-10-07 15:46:54 +00:00
drh
85d117bc56 Remove unreachable branches in decodeIntArray() when compiling without
STAT3 or STAT4.

FossilOrigin-Name: 80e1baa5c225c78902e08dbea9d577ff5757847f
2014-10-06 18:33:49 +00:00
dan
61a157254f Improve the accuracy of the estimates used when searching an index for values not present in any stat4 samples.
FossilOrigin-Name: 3aff9a9cac7aa994dfdaa0ab5c23ae73a1e820f0
2014-10-06 14:37:48 +00:00
drh
b8e8d5055a Fix a harmless compiler warning inside an assert() in FTS4.
FossilOrigin-Name: 418f3c9ad28672e5fe38d772d34e7cf8d26bc0e1
2014-10-06 12:41:57 +00:00
drh
df868a4fbf Tweaks to documentation on sqlite3_open() and sqlite3_bind(). No code changes.
FossilOrigin-Name: b8f7f19dc06c59de2e194d83e6c052fb7d28c71d
2014-10-04 19:31:53 +00:00
drh
00729cba46 Updates to documentation and requirements marks. No code changes.
FossilOrigin-Name: 0f8102d71a0ee828629f037775ad86fe2a544120
2014-10-04 11:59:33 +00:00
dan
4ee3eb0ad4 Add a test to show that the change on this branch is effective.
FossilOrigin-Name: fc619be057975b8be6d0958024c5d436edbdf084
2014-10-04 10:22:01 +00:00
drh
75b170b164 Avoid leaking Index.aiRowEst memory if an OOM causes a rollback which deletes
the index before the aiRowEst deletion code in sqlite3AnalysisLoad() routine
has a chance to run.  Since the aiRowEst now might be deleted from freeIndex()
which does not always have a db pointer, make sure the aiRowEst memory is
not held in lookaside.

FossilOrigin-Name: efd87ba142723ba131fcc985db6eb45c5a3c637b
2014-10-04 00:07:44 +00:00
dan
0c1a18b294 Fix a division-by-zero error that might occur if the sqlite_stat1 table is corrupt.
FossilOrigin-Name: f9c053b23ece877a7fdbe82204a10592f2d24a2d
2014-10-03 19:29:39 +00:00
dan
43085d7425 Improve the accuracy of the estimates used when searching an index for values not present in any stat4 samples under some circumstances.
FossilOrigin-Name: e6f7f97dbc677c9f01b23142928c3fa7307c2fba
2014-10-03 19:16:53 +00:00
drh
79f7af9a9e Add requirements marks on the sqlite3_db_status() interface implementation.
Fix a typo in the documentation.  Fix the new sqlite3_result_text64() routine
so that it works correctly with an encoding parameter of SQLITE_UTF16.

FossilOrigin-Name: d2fc322728331ae2d147c8496129df5e3c655eb5
2014-10-03 16:00:51 +00:00
drh
8da47419dd Update to requirements marks related to changes in the memory allocation
interface and enhancement of the documentation regarding DEFAULT clauses
in CREATE TABLE.

FossilOrigin-Name: 440705b98a3429b830ea85e71cc1e414bc6d8058
2014-10-03 14:54:47 +00:00
drh
2a3d1d17fd Avoid a NULL pointer deference when processing the IS operator if the
right-hand side is an illegal "#ID" style variable.
Fix for ticket [8c32a33a53092c85a15b]

FossilOrigin-Name: ffe7573636c8057614b02f0a85559e1857fd04e4
2014-10-02 21:52:35 +00:00
drh
ccaba81e26 Show the TK_DOT operator in the TreeView debugging output.
No changes to production code.

FossilOrigin-Name: 07c89940c49a5dca3205a4b6fa8290f23bcb6e10
2014-10-01 13:17:34 +00:00
dan
9501a64516 Avoid ever writing before the start of an allocated buffer in the DIRECT_OVERFLOW_READ code. Fix for [e3a290961a6].
FossilOrigin-Name: c3c15d20c6913811956a5041c959a56ca4eeb5eb
2014-10-01 12:01:10 +00:00
drh
b08cd3f345 Improvements to the new syntax-tree output routines: Omit the "END SELECT"
mark and instead terminate the graph at the last item.  Increase the maximum
tree depth to 100.

FossilOrigin-Name: 5ce05757aac80b99c3b2141cd301809f8e28e661
2014-09-30 19:04:41 +00:00
drh
36be4c49e4 Enable the query planner to deal with WHERE clauses that have OR terms
nested within AND terms that are nested within OR terms.  Also remove an
unused function declaration.

FossilOrigin-Name: b6b289182f6590288ebc7b9efbcb29b6b4480538
2014-09-30 17:31:23 +00:00
drh
0a99ba3bc8 Further enhancements to the "wheretrace" debugging output.
FossilOrigin-Name: 670993eb8113f386cb2cb8b1507917f6da3b4d98
2014-09-30 17:03:35 +00:00
drh
5265149c0d Enhanced debug output for OR-logic in the query loop optimizer.
FossilOrigin-Name: 2e375eae473e4a9f2e7870d59e22ba39051ecbce
2014-09-30 14:14:19 +00:00
drh
c90713d3d2 Show tree diagrams of data structures in the debugging output when the 0x100
bit is set on sqlite3WhereTrace or sqlite3SelectTrace.

FossilOrigin-Name: 92e0b4bd4d75e8b000586e51a07b3e181d9af20b
2014-09-30 13:46:49 +00:00
drh
4fa4a54f7e Remove the SQLITE_ENABLE_TREE_EXPLAIN compile-time option. Add alternative
debugging display routines: sqlite3TreeViewExpr(), sqlite3TreeViewExprList(),
and sqlite3TreeViewSelect().

FossilOrigin-Name: 4ff51325d6b41d0c59e303b573700ec80c51d216
2014-09-30 12:33:33 +00:00
drh
39c4b82b5a Fix the header comment in sqlite3VdbeDeletePriorOpcode(). No changes to
code.

FossilOrigin-Name: 7fb1626866c2f8dad84c7e6184824be3efd71ca2
2014-09-29 15:42:01 +00:00
drh
7682a476f6 Ensure that the OP_Prev opcode verifies that content has not been deleted
out from under the cursor.  Fix for ticket [209d31e3161b9e9ff].

FossilOrigin-Name: 414f0d6a647a4d040b5463c73c5e15e699d85b4c
2014-09-29 15:00:28 +00:00
drh
588400b861 Reduce the amount of memcpy() required by defragmentPage().
FossilOrigin-Name: 3edab9957cc7bb90b52fd40b02613c2cb03fc166
2014-09-27 05:00:25 +00:00
mistachkin
843e4cdea9 Add an assert() to verify the last-row-id for the database just prior to calling a SQL function.
FossilOrigin-Name: d026f0c944ce812732d3595eaa3c5d432a86c7dd
2014-09-26 18:30:11 +00:00
drh
867db83159 Fix the "PRAGMA integrity_check" command so that it avoids formatting error
message context messages until it actually needs to generate an error message.
This avoids much formatting, and hence greatly improves the performance of
"PRAGMA integrity_check" in the common case when there are no errors.  It also
makes the code a little smaller.

FossilOrigin-Name: 83913515830aa850f9e38406f9422d7e88dcab66
2014-09-26 02:41:05 +00:00
drh
3b130beb15 If an SQL function makes a recursive call to do an INSERT into the same
database, make sure that the last_insert_rowid() for that INSERT is recorded.

FossilOrigin-Name: e93aecc090c2a1d3c231bb2bde044886eff0bdf7
2014-09-26 01:10:02 +00:00
drh
d863346194 Minor code reformatting and comment change, to improve clarity.
No logic changes.

FossilOrigin-Name: baeb72a356d73e6f624edacd2986ab766105e177
2014-09-25 17:42:41 +00:00
drh
a15cc47f81 Simplifications to the SQL function and aggregate calling procedures.
FossilOrigin-Name: 3467049a1705b49905ea88a5c6becb6fe318f2fa
2014-09-25 13:17:30 +00:00
drh
2c4dc635a1 Simplification to the random rowid picking logic that begins running when
the maximum possible rowid has already been used.

FossilOrigin-Name: 1330c72e172324c68ab49e5bb2ceba985935ae01
2014-09-25 12:31:28 +00:00
drh
9fdfdc893b Still more performance enhancements to the LIKE and GLOB operators.
FossilOrigin-Name: 6c8924cacc2b875270770fed2cc3b1884f57a655
2014-09-25 11:08:57 +00:00
drh
88b3322f27 More performance optimization for the LIKE and GLOB operators.
FossilOrigin-Name: 5ab1023d6cfe31fa8a194804b8216058977ac973
2014-09-25 03:51:37 +00:00
drh
97348b37c2 Change that might allow SQLite to build and work using the EBCDIC character
set.

FossilOrigin-Name: ef30e0352b3d4a29749cd0872c10e45a6649ec52
2014-09-25 02:44:29 +00:00
drh
328d913cbd Size reduction and performance improvement in the LIKE and GLOB operators.
FossilOrigin-Name: b2c89ef49cd19b8031a8149a2dc47cea07dd04e0
2014-09-25 00:56:00 +00:00
drh
3fbb022b98 Have each open database allocate its pTmpSpace when the first write cursor
is opened, rather than on each insert or delete, for a small space savings
and performance boost.

FossilOrigin-Name: 99323552c001bc9173eb2a44542234c8ef7a9845
2014-09-24 19:47:27 +00:00
drh
b2325b72df Small performance and size optimization for btreeUnlockIfUnused().
FossilOrigin-Name: 13c746f85d254475b10c3dd58555acd3bbead0ce
2014-09-24 18:31:07 +00:00
drh
feada2df39 Do not allow parameters in a DEFAULT clause of a CREATE TABLE statement.
Ticket [78c0c8c3c9f7c1].

FossilOrigin-Name: 1ad2bc1ed4c4ac81ac67a9660761f0eeb47c7fef
2014-09-24 13:20:22 +00:00
drh
9bfdc25062 Have the clearCell() routine return the cell size to the caller, rather
than have the caller make a separate call to cellSizePtr().

FossilOrigin-Name: f21d217583c205dc17f98bb4877fd4ed98cefcb1
2014-09-24 02:05:41 +00:00
drh
3f3874030c Shorten all lines of source code in btree.c to at most 80 characters.
No logical changes.

FossilOrigin-Name: 5dd41cdbfebdd088ebd9a90a394ee296c207ad90
2014-09-24 01:23:00 +00:00
drh
3e28ff5cb5 Add the MemPage.noPayload boolean and use it to help
cellSizePtr() and btreeParseCellPtr() run faster.

FossilOrigin-Name: 8e3375313ebbf26b68561f3ed31d2a488222e5d0
2014-09-24 00:59:08 +00:00