Commit Graph

6568 Commits

Author SHA1 Message Date
dan 85e1f46eb9 Fix a problem causing an INDEXED BY specifying an unusable partial index to be
mishandled.

FossilOrigin-Name: 292a04086a902634fc514b379a2b245eb2681c1b84d9bb950b6ecb9aab28b468
2017-11-07 18:20:15 +00:00
drh 37ab9523fa Move the test scripts for checkfreelist and checkindex over into the
ext/repair/test directory.  Run them now using the sqlite3_checker utility
with the --test option.  Some tests are currently failing due to an
incomplete port.  This is an incremental check-in.

FossilOrigin-Name: 17f8d5e111a9fe5b074f946e23936ae5a2a7a8d8018bad4212660d8eb81c04b7
2017-11-01 18:05:32 +00:00
drh 1884d00dd0 Merge all recent enhancements from trunk.
FossilOrigin-Name: 24adf90ffb3ce9ff3c26efef0357f3a47312e8d11dc391ef2cc7e6873ef25895
2017-10-31 18:15:36 +00:00
dan 7eded5925b Fix a couple of issues in incremental_index_check to do with CREATE INDEX
statements that contain embedded SQL comments.

FossilOrigin-Name: 2aef41815a9f1786ebdf09d8f6cfa59a8e7d733253eafeae24fa6e2a093bb1d8
2017-10-31 12:01:01 +00:00
dan e7a579d27d Add support for indexes on expressions to incremental_index_check.
FossilOrigin-Name: 8c1c701fdbe0d56ee7f6f7d7b583aafde9fa14acc93ee8ecaddc8bb311e2bf52
2017-10-30 19:38:41 +00:00
dan 75650d4f94 In checkindex.c, use C code instead of SQL/group_concat() to compose various
SQL clauses. This is to make it easier to support indexes on expressions.

FossilOrigin-Name: 940606b3af059eb3f79d71fec871ea88df8bce0349f5b33b79c147a85610e269
2017-10-30 17:05:18 +00:00
dan 6fc6617909 Fix an issue in incremental_index_check with indexes that use non-default
collation sequences.

FossilOrigin-Name: 3ebb2351e2650d263029d2c0042683cba3529c9d3f76b5f994f2e737b84d3f67
2017-10-30 08:04:38 +00:00
dan 19465e7380 Fix "after" parameter handling in the incremental_index_check code.
FossilOrigin-Name: c40c3c62e996044f31ca49ffc2edb2cc0320e69956f7ee6fe3e9012200e0d9a0
2017-10-28 20:31:25 +00:00
drh 6d6e76f75f Add test cases from OSSFuzz to prevent a regression in co-routine
processing.

FossilOrigin-Name: 689743d8e3fa81e65dcb067bbf61bab09210b3b39586c865c00d9f1d6692daf2
2017-10-28 12:20:09 +00:00
dan bde13e2694 Add the start of the "incremental_index_check" virtual table in
ext/repair/checkindex.c. For incremental verification of index contents.

FossilOrigin-Name: d5b9dada471358a2864727759648b763bf6890fc2521fac53c0d8216017d39b7
2017-10-27 20:53:16 +00:00
drh 0503f2acfa Fix a Pager ref-count leak in the sqlite_dbpage virtual table.
FossilOrigin-Name: c063bb04da77d6847e4e254b6bb939c860e781382e34ddff8e0454d9db7552e2
2017-10-27 18:24:11 +00:00
drh 6e61c5f895 Additional test case demonstrating the ability to access structure elements
using quoted names in the JSON1 extension.

FossilOrigin-Name: 8d3cc928a8f0c7b2616c5c75af9d3a50bd4f0fe8e4ccab545ab8648cbfbb4b7f
2017-10-27 12:27:25 +00:00
drh 47d9f83982 Enhance the min/max optimization so that it works with indexes on
expressions.

FossilOrigin-Name: 6caec9082b3ad6d3f89f6291084a8f5c80f296630e2e94bc764389ac1a47a833
2017-10-26 20:04:28 +00:00
drh 3cd8aaa748 Fix the sqlite3_dbpage virtual table so that it can read and write from
any attached database.

FossilOrigin-Name: d4f893e1ae53a0445939ea2920af87d21dd36270494381028b2eaebe5c188f18
2017-10-25 19:18:33 +00:00
dan 685bea66ce Merge trunk fixes to swarmvtabfault.test and the lsm extension into this
branch. No changes to core SQLite code.

FossilOrigin-Name: f632b87002a7ee9be569aacb5ce85bb7e9c86b7d77bb8d1bf8b55eb5be4ecc77
2017-10-23 20:20:42 +00:00
mistachkin 0295774ca0 In the 'swarmvtabfault' test module, make sure to close the database handle prior to raising an error from the 'not found' callback script.
FossilOrigin-Name: f317037b31b19007e30bb41c54506d9d241a6d590c2b31e2ddda10d4f6e7605b
2017-10-23 20:17:19 +00:00
mistachkin 15dd780a9e Cleanup a test database file prior to using it.
FossilOrigin-Name: e1bf5e1d06dbe573671c6b5472b45f5bfa3cf82374f70a76b4c80815bf15a29b
2017-10-23 17:36:52 +00:00
drh efeaec365f Updates to test procedures so that they all work with encryption. No changes
to the core SQLite code.

FossilOrigin-Name: 0481330756e861de8e1eb7136e7dca2f333b2a82377949d2e0eba401af7d73dd
2017-10-23 16:34:07 +00:00
dan f970372698 Fix minor test script problems revealed by releasetest.tcl.
FossilOrigin-Name: 15e87d9bc81812fb9de86f9870389217dddb9f9c4d48e42acefce2d35ba293f1
2017-10-23 07:52:07 +00:00
dan 063cf17a11 Fix test cases in dbpage.test so that they work with
SQLITE_DEFAULT_AUTOVACUUM=1 builds.

FossilOrigin-Name: 0fcf1e61ef2b6c1fb8f4846f973d2d427598ffbc80dbc49e56e71513b194bae7
2017-10-22 08:02:56 +00:00
dan 9499b4a614 Avoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
builds.

FossilOrigin-Name: 7bd20a20a0f422765a6e469d1a1b67b95c4a441931688e04a2b1b491a5238528
2017-10-22 07:57:29 +00:00
dan f2f72a0f9f Take extra care to avoid an OOB read caused by a corrupt b-tree page.
FossilOrigin-Name: 04925dee41a21ffca9a9f9df27d8165431668c42c2b33d08b077fdb28011170b
2017-10-19 15:17:38 +00:00
drh 47b1d68f25 In the query planner, do not consider index X to be a proper subset of
index Y if X is a covering index but Y is not.

FossilOrigin-Name: ee31c04353cd75ea4bbadee2994c30d3808b696a4f680187502d104902988a5d
2017-10-15 22:16:25 +00:00
drh 8544d43e4a The db_use_legacy_prepare command no longer exists. Use the undocumented
-use-legacy-prepare option to DB version instead.

FossilOrigin-Name: ea2fa9ab9b3c97e001c1a2f3e24f3554b544070d5f915b9827eb07eb5ea8f00b
2017-10-13 16:01:36 +00:00
drh 1df6470d35 When compiling with SQLITE_TEST, extra options are available on the
"DB version" command for controlling the internal state of the SqliteDb
object, for testing purposes.

FossilOrigin-Name: bf86478d9c6b899d6441e80cf9d17b58731e5d354e31b11f0d58a798f6fab896
2017-10-13 15:56:26 +00:00
drh 88dd668942 Add the sqlite_dbpage virtual table (enabled using SQLITE_ENABLE_DBPAGE_VTAB).
Make that virtual table and dbstat available to the command-line shell.

FossilOrigin-Name: eaeeb09d4aa1dbccdd2488af8461e2a8c8a53d92c63fd56330be041ad72a9e4a
2017-10-12 20:37:20 +00:00
dan e1b972bd38 Update some test cases to work with SQLITE_OMIT_VIRTUALTABLE and
DEFAULT_AUTOVACUUM builds.

FossilOrigin-Name: 4b68f424ca9b5d4b0e77065a4e60ec0f70dcce0d01053fd7a6b2ecae9d3a5967
2017-10-12 11:13:34 +00:00
dan 3c48e6551b Add test file mmapwarm.test. With tests for the sqlite3_mmap_warm() extension.
FossilOrigin-Name: 5c4980ef17291dcea5e93ead353b9a95e2fbff56ff7257e9878d095f6827b4e9
2017-10-11 20:27:03 +00:00
dan 7d157f91f4 Check that the leaf count on each freelist trunk page is in range as part of
checkfreelist processing.

FossilOrigin-Name: 4e89406248f51d3b83d61e5472fb493f3d3b4ff2a69bf256c7e15445eeb2f3ec
2017-10-11 18:21:44 +00:00
dan 36187fe8c2 Add new extension "checkfreelist", which uses sqlite_dbpage to check that
there are no invalid entries on the database free-list.

FossilOrigin-Name: 21930ef5376261d95fa325be7761d327a350d4ae6b4573c83ddb4d294dea51c4
2017-10-11 18:00:34 +00:00
drh 34d0b1ac56 Get writes working on the sqlite_dbpage virtual table. Add a few test cases.
FossilOrigin-Name: a8b264d811e5bcb7e3ae8a12bf5b6830a9d1adff1f59436dda9e886f97da242f
2017-10-11 15:02:53 +00:00
dan a0ac086f15 Add tests for the example fts3 "rank" function that appears in the
documentation.

FossilOrigin-Name: 702b137aa4f76543647e177beeb1ca2b3cd18c61021c78880e9aa8656f341d65
2017-10-06 18:00:36 +00:00
drh c6aa38159b Updates to requirements marks.
FossilOrigin-Name: 40964a4ef7565ea0ddf452f48cb22373d068528e07d40eefc008f2231c969422
2017-10-04 18:26:44 +00:00
dan 7b7c956f09 Update the speedtest1 program so that it prints the output of "PRAGMA
compile_options" if the -stats option is specified.

FossilOrigin-Name: 7c69f8f1089c3e3843fbf7ec37a897c849a3df822a4ce3b4fcde586adf991a3f
2017-10-04 17:05:04 +00:00
drh f3b2c7aa81 New test cases for ticket [b899b6042f97f5] derived from a bug report on
the mailing list from Wout Mertens.

FossilOrigin-Name: ef94ea061d2ec8ee0243e97dfcfc7a7c75dd22006e61a7195b780722bbc925db
2017-10-04 14:13:29 +00:00
dan 4c16760c37 Amend recent changes to busy.test to avoid failing with SQLITE_ENABLE_STAT4
builds.

FossilOrigin-Name: 9ff4944194c56b38843bc626dc51604db8e1ca8a0fd221e2d6f78c840d57c341
2017-10-04 12:08:35 +00:00
dan 61b513e9e3 Add tests to verify that the busy-handler is invoked correctly when processing "PRAGMA optimize" and ANALYZE commands.
FossilOrigin-Name: fb83c3d8df250cb701fbe775b48ab93f5674496f68c57e04f50668c43c2de328
2017-10-04 10:39:28 +00:00
drh 2f65b2f512 Add the OK_IF_ALWAYS_TRUE() and OK_IF_ALWAYS_FALSE() macros for marking
conditionals that improve performance but do not change the outcome.

FossilOrigin-Name: 6035c9b2728f47d338696978eb6fe5a7d6cb84bbea0792ef985c0986ac8f39dd
2017-10-02 21:29:51 +00:00
drh 508e2d00f3 Fix unreachable conditionals and revise a testcase that was made obsolete by
the changes on this branch.

FossilOrigin-Name: 71f0adf7ca6824c3aba69104b9976dbb71b377474529e1a36220b4804293501e
2017-09-30 01:25:04 +00:00
drh 23768298d2 Better names for subqueries in EXPLAIN comments.
FossilOrigin-Name: 04ef40a8fea88776e0d8b73d942922d45d0c038fbfac1a9a82b9322181b4ad92
2017-09-29 12:12:52 +00:00
drh db8e68b4cd Indexes on expressions with a COLLATE clause are able to satisfy an ORDER BY
with the same COLLATE clause.

FossilOrigin-Name: 0413001843dce7c63659d39b329ca14cdcd54f4407922f51b2fb7659572a733e
2017-09-28 01:09:42 +00:00
drh 9325c87c26 Disable tests for the LIKE optimization when ICU is enabled, since the
LIKE optimization only works for the built-in LIKE operator and ICU overrides
the built-in.

FossilOrigin-Name: f5ef2e1bcd2790f960c15947f87cda19bd6a6a384ad09b25f6d07d5244cfecbd
2017-09-27 16:51:00 +00:00
dan b92d585c60 Add an extra snapshot related test case.
FossilOrigin-Name: 24a95e143785bb8e12198092d13c979ec2e116fa8b55d0bf482cb473a92294d8
2017-09-25 09:37:37 +00:00
drh b5c1063ab7 Fix the rendering of the P4_INTARRAY argument to the OP_IntegrityCk opcode
in the output of EXPLAIN.

FossilOrigin-Name: adc12c83dda8ba93ca220bbff649f763058b9440968ae463621f0cb7de8889cf
2017-09-21 00:49:15 +00:00
drh 84d4f1a328 Improved resolution of large integer values in "CAST(x AS NUMERIC)".
FossilOrigin-Name: 7f2bd4ff45fba29528c18cac6da983bd9b164303525d3965056f5b40f85dc83f
2017-09-20 10:47:10 +00:00
drh 2acd24d90c Fix the CSV virtual table extension so that it works when the default character
is unsigned.

FossilOrigin-Name: 42f07775556758754e92e29a759d200d0d81d16eee83ab982b840db11292f834
2017-09-18 00:18:31 +00:00
drh 97258194a2 Do not make the assumption (as check-in [4da49a95c0f07] incorrectly did) that
the ExprList returned by sqlite3ExprListDup() would never be passed into
sqlite3ExprListAppend().  Include a new test case that shows this sometimes
does happen.

FossilOrigin-Name: 29227d00a9999f0f28a0b55ef70183799a667c3b9d81d2e5ac0ab1840bef98b1
2017-09-17 19:45:28 +00:00
dan 3ed0f1c936 Add another test case for the problem fixed by the previous commit.
FossilOrigin-Name: 1a7e0b61c8a6bdd3ed105b9bc8a3732668fd7a897d2ed16c99445498e3c87089
2017-09-14 21:12:07 +00:00
dan 629ec14abc Avoid an out-of-bounds read that can be caused by a specially constructed
journal file.

FossilOrigin-Name: cf5bf42cad6e019a38dc0a36ff1f53ada619eef5259e175c3554a16669e03202
2017-09-14 20:41:17 +00:00
drh bb6896226f Test case update due to PRAGMA integrity_check enhancements in [8525c30c].
No changes to code.

FossilOrigin-Name: 43c6023bbf6b808ab4cfdbd1a63a516cbe2f1794c7787f8230632bae12e2ff59
2017-09-13 20:20:36 +00:00