Commit Graph

20817 Commits

Author SHA1 Message Date
drh
ade54d68ee Add the SQLITE_TESTCTRL_PRNG_SEED test control.
FossilOrigin-Name: 3ac5723164ae801e209ce525a5d94692767136f9d06be2a84883dcea677d02da
2019-08-02 20:45:04 +00:00
dan
0bf6549cd1 If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Fix for ticket [41866dc37].
FossilOrigin-Name: faaaae4940b5f4f70e4988ad5b45582410b381ace0031e6abcde0b9217c06796
2019-08-02 19:40:01 +00:00
dan
ddd7421c91 If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Possible fix for ticket [41866dc37].
FossilOrigin-Name: a7277ed0623dccdbf775ae6127611d6bc6e150f6942a048ab4281e5136c0e98d
2019-08-02 18:43:59 +00:00
drh
d744ee0b50 The sqlite3_set_authorizer() interface should only expire prepared statements
when it is setting a new authorizer, not when clearing the authorizer.  And
statements that are running when sqlite3_set_authorizer() is invoked should be
allowed to continue running to completion.

FossilOrigin-Name: 961e2f08c35238bcb1d32430d16451a96807b2c4bbb194ee621128dd09cd3981
2019-08-01 22:48:45 +00:00
dan
401593e348 Add new release tests for windows to releasetest_data.tcl.
FossilOrigin-Name: 1b330ec24c350c59f6d3779f6c0819fe95b89f4dfca5a1f2c22f22b5fe9cd087
2019-08-01 15:18:51 +00:00
dan
71f059c880 Fix a problem in ALTER TABLE triggered by views or triggers that include the construction "ORDER BY true" or "ORDER BY false".
FossilOrigin-Name: 8168021f9ab5fb8b4888257963c9ec68fd1dfeedaf6bba4b8e07438001d0be0f
2019-08-01 10:58:46 +00:00
dan
45cb2aa98c Update "releasetest_data.tcl" so that it is a standalone script that generates sh or batch scripts to run each tcl test run at release time. Update wapptest.tcl to use it.
FossilOrigin-Name: 559c2dd6724b2fc238760863d4be7132b591457e72ca5758fdd4002fbf7df4bc
2019-07-31 21:08:55 +00:00
drh
9252df4969 New test cases in test/fuzzdata8.db.
FossilOrigin-Name: 6e92d71c24c6039e7116f02fc5f39b2b87efcd3674ea828077c03d760bf49c45
2019-07-31 15:16:14 +00:00
drh
7e35e81dcb Do not allow the json_set() function to overwrite the same element more than
once.

FossilOrigin-Name: f237f60e4fa9171dfe9a77c8637595c2701e971034d41bd6018944e8b2b27a6f
2019-07-31 12:13:58 +00:00
drh
9c3bb59f76 Fix the build for when -DSQLITE_SMALL_STACK is used.
FossilOrigin-Name: b9eda2249ab5cf523093e4849c317d9a4b1743f7e15d96bdd6bb6cc423302914
2019-07-30 21:00:13 +00:00
drh
2ad07d96b6 Improved fix for ticket [ced41c7c7d6b4d36] that keeps skip-scan enabled,
but avoids identifying a skip-scan as order-distinct (because it is not)
and thus forces a separate b-tree to implement the DISTINCT clause of a
query.  This undoes check-in [a871d69c6de65038] and substitutes a new fix.

FossilOrigin-Name: 89bf0399e87be76e7b264e0a35e8a6d3af0f9e71123a929c20754882b636ca70
2019-07-30 14:22:10 +00:00
drh
822bc969f6 Disable the skip-scan optimization for DISTINCT queries.
Fix for ticket [ced41c7c7d6b4d36]

FossilOrigin-Name: a871d69c6de65038360aa6142fbad22689fb347e526cca56bb83e695c1441fbe
2019-07-30 01:17:03 +00:00
drh
8fbcb04811 Convert an assert() in R-Tree into a database corruption detection case.
FossilOrigin-Name: 48b518eb6f76fb0beb161d1ebcf3b793efc36262d6d77a1ad5906b6501138e28
2019-07-29 17:18:45 +00:00
dan
8279fe8a4b Fix a crash in fts3 caused by corrupt database records.
FossilOrigin-Name: 11f7f94f1c5d761e7f381e277658b7e857cc369283996c509061de55fd6aad52
2019-07-29 16:53:30 +00:00
dan
ed9d12dbc2 When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c].
FossilOrigin-Name: 6ac0f822450b26c7d67c33cdb2a90189cd3cf65a052af8497b795c3f71a23813
2019-07-29 15:32:01 +00:00
dan
a79a0e733f When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c].
FossilOrigin-Name: b47169319ad88e8ffdbe8fbb91f4cced81ebd5c0ee1b018be2d0256c9a1c5159
2019-07-29 14:42:56 +00:00
drh
337cc3992a Fix the OP_Affinity operator so that when applying REAL affinity, it
only sets MEM_IntReal if the integer value will fit in 6 bytes or less.
Fix for ticket [ba2f4585cf495231]

FossilOrigin-Name: 2b221bb15fd2b9f6a426e5eb439f7dbabbe3c4cab010c49b87dae3bb1f16c081
2019-07-29 06:06:53 +00:00
drh
122c514271 Fix a minor typo in a comment.
FossilOrigin-Name: cea8a892f76bddc63b921ffc11ea8dce8f8cf649a2c77aa908c7c5c91eed7f4c
2019-07-29 05:23:01 +00:00
mistachkin
f71a243a60 Sync up warning related compiler options in the Makefiles for MSVC.
FossilOrigin-Name: e77d48d1dd140967b18106044dd45e2ba6cd77b6aa5afa8bf3f0a9c16a50eec4
2019-07-29 02:52:11 +00:00
mistachkin
ac713403fd Fix harmless compiler warning seen with MSVC for x64.
FossilOrigin-Name: 857b2ba6d05d6f5a8cfdf269bae9005b25e1903ab9dc6b70546979d8c633f03b
2019-07-29 02:49:14 +00:00
dan
b8293a5bee Update RBU so that it supports indexes on expressions.
FossilOrigin-Name: 6bfa44da226fd758a2ee924d1e8e3a742b0635b6d3f922a4a7919cb14b2418e6
2019-07-26 20:33:23 +00:00
dan
dff1d5b61b Fix RBU handling of partial indexes with comments embedded in their CREATE INDEX statements.
FossilOrigin-Name: e1ccf211aa975a6688a27f7dc4cea80784ed8dcfe1950b2fa6eb0a3cb938838a
2019-07-26 16:16:31 +00:00
dan
bfe33f80dd Fix a potential buffer overread in fts5 triggered by a corrupt database record.
FossilOrigin-Name: 16472112b6886ada18d45cfb409cca2e83dde5a8ba8a36d481e87b61100b0186
2019-07-25 19:29:24 +00:00
drh
00c12a51e3 Fix faulty asserts in the code generator.
Ticket [c52b09c7f38903b1]

FossilOrigin-Name: 01cdc590f7894ea23ee0d674747d7ebf8196efbef3c87d47e72dbc1ab6ae2883
2019-07-24 23:15:19 +00:00
dan
9443dbc493 Improve the ".recover" command so that it handles intkey pages linked into non-intkey b-trees, and vice-versa, better.
FossilOrigin-Name: 9c458acba5a100a76148a3efb78ea9f57b85751e80788e4532694bd8976608a0
2019-07-24 20:10:27 +00:00
dan
01c08bcacd Improve the ".recover" command's handling of corrupt database schemas.
FossilOrigin-Name: becaaa4d29d17ad613f2a120f0b173e53403b3de26f22beaf83f66ebf369bf60
2019-07-24 19:20:30 +00:00
dan
95063c2867 Improve the ".recover" command in the shell tool so that it is not confused by auto-vacuum databases. And so that it can recover tables for which one or more of the column names are SQL keywords.
FossilOrigin-Name: 87d76047d6a3df31bc9b7c0cffa7b758236c124f87263a520850b019cbbc4c6e
2019-07-24 08:15:09 +00:00
dan
1c70f71e12 Avoid redefining types u32 and u16 when fossildelta.c is compiled as part of the amalgamation.
FossilOrigin-Name: d8e88248e3204b5f2b95b9b8921ee7ee2f7574ae81e6abd5b4f2ddf187f7d71b
2019-07-23 13:26:43 +00:00
drh
9378818d89 Do not use the insert-overwrite optimization if the cell might overwrite the
page header.

FossilOrigin-Name: f60a83069168899dcfd706b4d0901084c7ce92d85277950317e962a8a98ec668
2019-07-22 23:24:01 +00:00
drh
e209457295 Consolidate the removal of Window objects from the Select.pWin list into
a single subroutine.

FossilOrigin-Name: e46b2afc99329c43de08d4a2e6ade4d2239d7409c5d5626bf272a3e0dd24d1b4
2019-07-22 19:01:38 +00:00
dan
e0ae3f69eb Fix a bug in the linked-list handling code added by commit [fd7316cd].
FossilOrigin-Name: 05080344dceafcfb670fbf01f7d69a1d713a54b6845f968a9cfe941fb53b13af
2019-07-22 17:28:43 +00:00
drh
cda50737f4 New test cases added to test/fuzzdata8.db
FossilOrigin-Name: 25fec62ac5a23382a54eee78d3705885eb4065826d7e8da098816d03ae9dc639
2019-07-22 16:57:13 +00:00
dan
7f6f12bdd3 Remove Window objects from the corresponding Select.pWin list when they are deleted, as they are, for example, when the ORDER BY clause is optimized out.
FossilOrigin-Name: fd7316cda0fdfe86985f41a97dff3beba188606ec9bc6fef38a686a6976a6e01
2019-07-22 16:33:02 +00:00
dan
75b0821e99 Remove Window objects from the corresponding Select.pWin list when they are deleted.
FossilOrigin-Name: d23f33168222dfa40a67dc7de58057418151989e81429e4af47617e86db04667
2019-07-22 16:20:03 +00:00
dan
1e60261cfb Fix a problem with renaming tables when the schema contains an invocation of a currently unregistered aggregate with a FILTER clause.
FossilOrigin-Name: bd37ce3fb8dee8d538f6afc0bfc13cdc3ebdd504e6461f0130c6ecc8af585f68
2019-07-22 11:38:43 +00:00
drh
fd15e18d7f Make sure any window definitions in an ORDER BY clause are removed from
the SELECT statement if the ORDER BY clause gets optimized out.

FossilOrigin-Name: 23b119671f0be3c6b72cf2dc5f7707a0626766db7aa56529ab00d33d1a0a1bee
2019-07-20 21:12:31 +00:00
drh
7fc296aa66 Early detection of a corrupt R-Tree in the R-Tree search algorithm.
FossilOrigin-Name: 2bf5a4c16457562dc942bcc6ec06d9b4e795ef3ea8e31550e18857bbebd08a76
2019-07-20 18:00:46 +00:00
drh
bcb0e64c82 Performance optimizations in the rtreeStepToLeaf() routine of RTree.
FossilOrigin-Name: 4e34e3615ff31f4a6432033797b2e1a6604007ea0e501d714ecb362632776150
2019-07-20 17:43:28 +00:00
drh
e04c1ec52a New test cases added to test/fuzzdata8.db.
FossilOrigin-Name: 39be3c61bd809cc89bdfdba90afc391ac9c2f81dfd8bb68a9b085b0ca8cd1fba
2019-07-19 15:03:54 +00:00
drh
c5cc870ef8 Refinement to check-in [348e7f193a963390] that avoids unreachable branches.
FossilOrigin-Name: bbfb2908ecd113c88e69a0984cbe2550463cdd3a67648b0e4e3578e80630136e
2019-07-19 15:00:32 +00:00
dan
9bf022d57c Fix a problem with renaming a table when the schema contains an invocation of a window function that is not currently registered.
FossilOrigin-Name: ff290feb97f689cf6ce4162d6aa36f9f9dcf1bff3096847d53a85f39f728d2de
2019-07-19 14:32:42 +00:00
dan
750c6ba5e5 Fix a problem with renaming tables when the schema contains WINDOW definitions with (illegal) non-numeric expressions as part of a PRECEDING or FOLLOWING clause.
FossilOrigin-Name: 348e7f193a963390a0595183d603541f85c5d1a911c98ed2e06599691ffe98f5
2019-07-19 11:20:42 +00:00
dan
a1ac03590b Fix a faulty assert() in walker.c that could fail when processing an ALTER TABLE statement on a schema containing invalid table references that are part of a WINDOW definition.
FossilOrigin-Name: ee076c28d8ee0f5b099cdef83ae6cea6ef5aa209ab528d7c49949dd653ce019c
2019-07-19 10:31:29 +00:00
drh
b555b0806e Fix a new problem in the BETWEEN operator when applied to a window function.
The problem was introduced yesterday by check-in [7ef7b23cbb1b9ace].

FossilOrigin-Name: 47e23064ba0205148f89e12803a62d5a4d6d2054f593f60c031e815112170b9b
2019-07-19 01:11:27 +00:00
drh
4509ffa362 Always use the stdlib.h intptr_t type for pointer-integer conversions, when
it is available.

FossilOrigin-Name: c0d932449db3deed42a99bd948aab61e56b2d8441d7de5243688695ff04e8177
2019-07-17 19:57:55 +00:00
drh
996f5ccb33 Fix an incorrect assert() in balance_nonroot().
FossilOrigin-Name: 59c9e73f86b89ee17b0bce47bcb93f5b5ace5b7985678287195002afb9d40cd8
2019-07-17 16:18:01 +00:00
drh
09ea1256ec Improvement to the hexdb interpreter built into the CLI and into the
TCL test harness: Round the "size" up to the next multiple of the "pagesize".

FossilOrigin-Name: 9ec92939cb2d2c96ae15bc496feed233ce31424c25a6bf86ace7e0ef3eedec5b
2019-07-17 15:05:16 +00:00
dan
8b65e5919d When processing a BETWEEN or CASE expression, avoid transforming a node of the original expression into a TK_REGISTER node. Instead, take a copy and use it instead. Fix for [1be72aab9].
FossilOrigin-Name: 7ef7b23cbb1b9ace9f853238d9133320c153e6c3417e6823ab6394ee1fe56358
2019-07-17 14:34:17 +00:00
drh
3db3d12cd1 Fix the WITHOUT ROWID table logic so that it generates a correct KeyInfo
object for tables that have a PRIMARY KEY containing the same column used
more than once with different collating sequences.  Enhance the index_xinfo
pragma to assist in testing the above. Fix for ticket [fd3aec0c7e3e2998].

FossilOrigin-Name: 84a51a755c18ac8253080db6eec505df894ee3b1e97cfa8e61039ac38001e270
2019-07-17 12:49:16 +00:00
drh
19d9a3ca6c New test cases for PRAGMA index_xinfo on a WITHOUT ROWID table. And new
testcases using index_xinfo to verify that WITHOUT ROWID tables are
constructed correctly.

FossilOrigin-Name: 340378c1e60da80263523776f4b6366a9d332a7ee25986637e8b157f4e8e4bd3
2019-07-17 12:42:15 +00:00