Commit Graph

13126 Commits

Author SHA1 Message Date
drh
063970a15f Fix comment typos reported on the mailing list. No changes to code.
FossilOrigin-Name: 93a71c9f058b58d11187293a1e8d5324d0911880
2014-12-04 14:01:39 +00:00
drh
a25165fa68 Add an implementation mark and fix a comment describing the OP_Checkpoint
opcode.

FossilOrigin-Name: 7475b90c558157802b036162376fceacc1b9ab4a
2014-12-04 04:50:59 +00:00
drh
dd90d7ee81 Add evidence marks and assert()s used as evidence for checkpoint requirements.
FossilOrigin-Name: b2da8afc7657266fbe8e683c6e50fe18216cbcf3
2014-12-03 19:25:41 +00:00
drh
86e166a778 Fix over-length comment lines in sqlite.h.in. No changes to code.
FossilOrigin-Name: cbd357fd8c25c9c6043063710a3e2a89ff8b4575
2014-12-03 19:08:00 +00:00
drh
bb9a378df3 Simplify the sqlite3_wal_checkpoint() documentation. Add some source code
evidence marks.

FossilOrigin-Name: 026c44ff2c092b14faa19985dd46873aeb8727dc
2014-12-03 18:32:47 +00:00
drh
5b875311a3 Futher tweaks to the sqlite3_wal_checkpoint_v2() documentation.
FossilOrigin-Name: 7d284d047b0677fb4532df5aae06f5bad997f5e9
2014-12-03 16:30:27 +00:00
drh
2d2e7bfeff Updates to the documentation for sqlite3_wal_checkpoint_v2() and related
interfaces, including adding many requirements marks.

FossilOrigin-Name: 1e212d9899387344fd62c7b6fbcc59ea885b6d7c
2014-12-03 15:50:09 +00:00
drh
2f89546001 Add support for SQLITE_CHECKPOINT_TRUNCATE.
FossilOrigin-Name: edda2b9e7a15ed486de81b10dd9bacd39c571d3f
2014-12-02 20:51:52 +00:00
dan
0fe8c1b967 When attempting to restart a wal file, make any required calls to sqlite3_randomness() before waiting on or checking for wal file readers. This restores the behaviour exhibited by the trunk.
FossilOrigin-Name: 6ee08769f0ffbb3d620c66b89180ece7782dc820
2014-12-02 19:35:09 +00:00
dan
f26a1549ac Add the SQLITE_CHECKPOINT_TRUNCATE option.
FossilOrigin-Name: 8e20a43419e46b6b9d1f60ec7ea420bbfb3ef358
2014-12-02 19:04:54 +00:00
drh
1fd2d7d471 Convert two unreachable branches into assert() statements.
FossilOrigin-Name: 61b31e771430f490fc2c4cef55046debc4a5f4f5
2014-12-02 16:16:47 +00:00
drh
9b5444af6c Work around overzealous NULL pointer checking in memcpy() and memset() for
some systems.

FossilOrigin-Name: 0d04f380e1bd17104b3cf76b64d0cfc79a726606
2014-12-02 13:46:53 +00:00
drh
ac5649a985 Remove the ill-designed "-end" option from the command-line shell. Instead,
allow multiple SQL or dot-commands as command-line arguments.  Any -cmd
commands are processed first, followed by other command-line arguments, for
backwards compatibility.

FossilOrigin-Name: 24fa2e9832daaa5d68ee28a00c56c55f97a4da9e
2014-11-28 13:35:03 +00:00
drh
cb7fe0ab9c Add the -end option to the command-line shell, which forces it to exit after
reading prior command-line options (presumably including one or more -cmd
options) and without reading standard input.

FossilOrigin-Name: b59397b1f1e32c478b5fa96659cd4300177d39f7
2014-11-28 11:54:44 +00:00
dan
d89b834f54 Fix a buffer overread during compilation of CREATE VIRTUAL TABLE statements that featured an explicit database name but no virtual table arguments. For example, "CREATE VIRTUAL TABLE main.ft USING fts4".
FossilOrigin-Name: f095cde579e7417306e11b5c1d2dd90b6bb547d5
2014-11-27 11:36:36 +00:00
drh
3f2d22e1a3 More test cases for the balancer.
FossilOrigin-Name: 358ea818f7ea5aa55bafaf4057e9fc7a5fd77c11
2014-11-27 04:23:19 +00:00
drh
5ab63775dd Fix a problem in the new b-tree balancer that was causing corruption of
the fragmentation count.

FossilOrigin-Name: f242394e079dd185aad90f2aee902a5edf27e150
2014-11-27 03:46:04 +00:00
dan
0a79238b39 Fix an integer overflow bug in vdbesort.c.
FossilOrigin-Name: 623827192532f08b68bc0eb9ed1449e173361f0c
2014-11-25 18:59:55 +00:00
drh
0da10d3289 Always reinitialized the Index.bUnordered and Index.noSkipscan flags before
rereading the sqlite_stat1 table, even if SQLITE_ENABLE_STAT4 is defined.

FossilOrigin-Name: 1e1221fc4823a6bb6fc5d2408732e27aca585de9
2014-11-22 21:37:00 +00:00
drh
ab4624d005 Fix an error in the comments from the previous check-in.
FossilOrigin-Name: 9660ce541837ccd8df415641a922274e093056aa
2014-11-22 19:52:10 +00:00
drh
7a1bca7e74 Deploy heuristics (well-commented) to better estimate how much unindexed terms
in the WHERE clause filter the number of output rows from a single table.

FossilOrigin-Name: 221659945c3f78d3b6789bfe8fdeb8d3ee1fa038
2014-11-22 18:50:44 +00:00
drh
a3898250d4 Remove a redundant test case (probably a copy/paste error). Add an assert()
to where.c to ensure that automatic indexes do not have there output row 
counts adjusted downward by supplementary constraints.

FossilOrigin-Name: eea47933493c85a85247ad383bd148b06f627d04
2014-11-22 12:22:13 +00:00
drh
643091f071 Fix a typo in a requirements mark on the abs() SQL function.
FossilOrigin-Name: b1e6c02f8b9a2afaa12ac15a33e3f698c3be27d6
2014-11-20 23:21:23 +00:00
drh
2d8233157d Fix a benign test error on PRAGMA collation_list
introduced by a recent checkin.

FossilOrigin-Name: 332cc9591d05508ac9cb56fde2b82e20e0342d1f
2014-11-20 23:11:30 +00:00
drh
341eca7f68 Updates to requirements tags on the mutex documentation.
FossilOrigin-Name: fcf8b7e4c6c3893e2004a28dc9f0f677907b4ba9
2014-11-20 23:03:42 +00:00
drh
5e3b49bc42 Add requirements marks on the built-in collating functions.
FossilOrigin-Name: 4b608b62ac8d4eafdb76192b3b5db272332a4bfd
2014-11-20 19:22:26 +00:00
drh
fdab02635c Ensure that when the number of cells on a page drops to zero that the freelist
and fragment counter are both cleared.  Also add evidence marks corresponding
to file-format documentation.

FossilOrigin-Name: ef9fbc08b0a047042deeb2d6007d67028fefb9e2
2014-11-20 15:30:50 +00:00
drh
1b40e63f9b Fix the encoding of some integers to use the minimum amount of space:
-128, -32768, -8388608, -217483648, and -140737488355328.

FossilOrigin-Name: 2d7c8da5f16e64eaa7b0c2d66898682ea3d102a0
2014-11-20 02:58:10 +00:00
drh
654858d7f4 Add some requirements marks to the record formatting logic. Comment changes
only - the code is unaltered.

FossilOrigin-Name: 9a9627e178a67bbfc85366aaea900e674d22fb53
2014-11-20 02:18:14 +00:00
drh
113762a284 Add new requirements marks associated with the file format documentation.
No changes to code.

FossilOrigin-Name: 6d00bcca6ed1903fb17275752cab71c14392355b
2014-11-19 16:36:25 +00:00
drh
42a7b4bac9 Completely remove an assert() that had previously been commented out.
FossilOrigin-Name: 89b3c1c4555c98c633089b21cdd2a1a3a1e751eb
2014-11-19 14:31:12 +00:00
drh
664f85dd59 Add an ALWAYS on an always-true branch in wal.c.
Fix the ANALYZE command so that it resets the "unordered" and "noskipscan"
flags on indices when reloading the sqlite_stat1 table.

FossilOrigin-Name: 9ed97a85feee6593faefa2b54cc4cf9a60f515f9
2014-11-19 14:05:41 +00:00
drh
fead4ed8f3 Adding the "noskipscan" token to an sqlite_stat1.stat field prevents
an index for being used with the skip-scan algorithm.

FossilOrigin-Name: 4461bf045d8eecf98478035efcdba3f41c709bc5
2014-11-18 21:54:31 +00:00
drh
36ff0bf684 Allow an automatic index to be used if the only uses of declared indexes for
the same loop use the skip-scan algorithm.

FossilOrigin-Name: c52f7971e90cac1058d6b66c9e334cbc8607def3
2014-11-18 21:45:35 +00:00
drh
64b600ff13 Merge in all the other ROLLBACK fixes from the branch-3.8.7 branch.
I don't know why I was doing them one-by-one.

FossilOrigin-Name: 296b0c7397790ceadbdb330959e962f6491abc3e
2014-11-18 20:49:30 +00:00
drh
bea3b976a9 Fix a bug in the sqlite3TripAllCursors() routine that prevents it from
reporting errors.  It is unknown at this time whether or not this omission can
result in any incorrect result in an actual query.

FossilOrigin-Name: 2896f2640ab3e102ee248d20fb68c497817524eb
2014-11-18 20:22:05 +00:00
drh
58f95c43ad Update a couple of test cases to account for the fact that ROLLBACK does not always abort all running SELECT statements.
FossilOrigin-Name: abccda769a3f6b755c3bf70b5fb31a5e16718ef3
2014-11-18 20:16:27 +00:00
drh
bb8f925294 Increment the version number to 3.8.7.2
FossilOrigin-Name: 945a9e687fdfee5f7103d85d131024e85d594ac3
2014-11-18 12:28:52 +00:00
drh
4429c20b86 Add an ALWAYS() to an always-true conditional in the WAL rollback logic.
FossilOrigin-Name: c5eae8a60d474131fbfa4d0c2b459005267e8be4
2014-11-18 02:44:32 +00:00
drh
c5352b996a Remove code from sqlite3BtreeKeySize() made unreachable by the previous
check-in.

FossilOrigin-Name: 57c4aa988c8eda3cc513c1e5df5804d88bee99a0
2014-11-17 20:33:07 +00:00
dan
756d3b3e9d Avoid calling sqlite3BtreeKeysize() on a b-tree cursor in SKIPNEXT or SKIPPREV state.
FossilOrigin-Name: 2f2ecb994889acb783616acb7307f8fed962d213
2014-11-17 19:44:44 +00:00
dan
2b8669a9da Avoid calling sqlite3BtreeKeysize() on a b-tree cursor in SKIPNEXT or SKIPPREV state.
FossilOrigin-Name: 54e7d3fcb1ab21c03ffef1af93ae029a2901098a
2014-11-17 19:42:48 +00:00
drh
d816e00d13 Improved comments on the BtCursor.skipNext field. No changes to code.
FossilOrigin-Name: e956e7db057d1112badf5e0671cea95201385b44
2014-11-17 19:25:15 +00:00
drh
77b1deec40 When a SELECT statement is terminated by a ROLLBACK TO operation, make the
error message be "abort due to ROLLBACK" rather than 
"callback requested query abort".

FossilOrigin-Name: 34fc4a082c192830e48f643549c04a4f91912b8b
2014-11-17 17:13:06 +00:00
drh
13835c41e8 Fix a bug in the sqlite3TripAllCursors() routine that prevents it from
reporting errors.  It is unknown at this time whether or not this omission can
result in any incorrect result in an actual query.

FossilOrigin-Name: 42588207ff5451cb785c394633e1ab631fb82f01
2014-11-17 15:32:47 +00:00
dan
302f583aa4 Update a couple of test cases to account for the fact that ROLLBACK does not always abort all running SELECT statements.
FossilOrigin-Name: eba171e980fa4491dfee9d7e4df50c87a0ebbf87
2014-11-17 15:22:08 +00:00
drh
f9df2fbdcd Adding the "noskipscan" token to an sqlite_stat1.stat field prevents an
index for being used with the skip-scan algorithm.

FossilOrigin-Name: 00fe09505792cd0d104b2da9d040f023e30fa871
2014-11-15 19:08:13 +00:00
dan
70273d0bab Consider using an automatic-index for a scan even if there exists a possible skip-scan that uses one or more "=" operators.
FossilOrigin-Name: 93642a65ef3d53ece322ffd85233b68fc9a86c9d
2014-11-14 19:34:20 +00:00
drh
0a9d9d566e Do not automatically remove the DISTINCT keyword from "a IN (SELECT DISTINCT ...)" expressions. Fix for [db87229497].
FossilOrigin-Name: 98457a57d642b35917eb9ad8f70065e273aad206
2014-11-14 15:42:23 +00:00
dan
dd715f7c57 Do not automatically remove the DISTINCT keyword from "a IN (SELECT DISTINCT ...)" expressions. Fix for [db87229497].
FossilOrigin-Name: 55e453aadbb676dda07f0fa537d39ce184ef636c
2014-11-14 15:28:33 +00:00
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