Commit Graph

6571 Commits

Author SHA1 Message Date
mistachkin 4ff8431fd1 Initial work on porting the changes on this branch to Win32.
FossilOrigin-Name: 3738bfd0c0eadb10eea58954af5052cb6ce164059f3aacfe65d7da6a400c63c7
2017-11-09 16:30:55 +00:00
dan 08ecefc5b1 Handle the race condition that may occur if another process connects and then
checkpoints and truncates the wal file while a readonly-shm client is building
its heap-memory wal-index.

FossilOrigin-Name: 5a6703fc3f2174b3e9a624c7272ae013b73c42d6c97ffa62b58553efdb54e3bc
2017-11-07 21:15:07 +00:00
dan f12ba66cf8 On unix, if the *-shm file cannot be opened for read/write access, open it
read-only and proceed as if the readonly_shm=1 URI option were specified.

FossilOrigin-Name: ba718754fa5ab8596cb84b751051de98afa2706fe6c5df39ad6d925d790719ee
2017-11-07 15:43:52 +00:00
dan d24c5b1c98 Add fault-injection tests for the code on this branch.
FossilOrigin-Name: a7d949fb735f60c19e7257a1a7a12568a9c15be9cd980c018f3a0d6bf112c339
2017-11-07 09:08:43 +00:00
dan ab54838452 Add further test cases for the new code on this branch. And a couple of fixes.
FossilOrigin-Name: 71af9acb227a91d9ad8798c9d0b12d6967e863d050f5cb1fddb45f25ee1f47db
2017-11-06 19:49:34 +00:00
dan cbd3321978 Add further tests for the code added on this branch.
FossilOrigin-Name: a6716fcde38b28b8a03b40f9d16f78a57ec20f60cf391ff553692641cb7f0d3f
2017-11-04 21:06:35 +00:00
dan 11caf4f4b7 In cases where a readonly_shm client cannot take the DMS lock on the *-shm
file, have it parse the wal file and create a wal-index to access it in heap
memory.

FossilOrigin-Name: 18b268433d739486eac1b04947bd418655e4bc56e8dc63ffa558aa4552a32e30
2017-11-04 18:10:03 +00:00
dan 44c8a97e01 Fix test cases in wal2.test broken by the locking change in the previous
commit.

FossilOrigin-Name: f569c3517234881f9425075aab65a32ffd0deb8e793f421a241d8cca881da33f
2017-11-02 18:57:46 +00:00
dan dea5ce36f5 Avoid locking shm-lock WAL_READ_LOCK(0) during recovery. Doing this allows
recovery to proceed while a readonly_shm connection in unlocked mode has an
ongoing read transaction.

FossilOrigin-Name: 5190d84a296b7cf716ef43bf7b6d4d351ef1a4d650de37dc01a5ab333da7c05d
2017-11-02 11:12:03 +00:00
dan 92c02da33e If a readonly_shm connection cannot map the *-shm file because no other
process is holding the DMS lock, have it read from the database file only,
ignoring any content in the wal file.

FossilOrigin-Name: ce5d13c2de69b73378637d4f7e109714f7cd17bf1d1ad995e0be442d517ed1b3
2017-11-01 20:59:28 +00:00
dan 514c4b7e5d Merge latest trunk changes into this branch.
FossilOrigin-Name: 985bfc992950625a45a7521bf4c8438cd0170de974dff976968be158ac5922a9
2017-11-01 07:06:41 +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
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
dan ab04eff809 Fix an error in the previous commit on this branch.
FossilOrigin-Name: f71dfee06ce1e0eee760cfca19482bdec7729d6c7d28f10f4cfd21e1f92a04b0
2017-10-26 17:34:50 +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