Commit Graph

19467 Commits

Author SHA1 Message Date
drh cf8e0861a2 When doing a DROP VIEW do not try to delete entries from the sqlite_stat1
table as there are none.

FossilOrigin-Name: 7efdba2bbc8547ee9292a1bbd1e61d38b40d7aabc0860ceba188bdec539f5114
2018-07-27 22:55:58 +00:00
drh 550a33091b Minor grammar changes that help the parser run faster by reducing the
number of NUL rule reductions.

FossilOrigin-Name: cfd1b00592bd550e444dfc7b6a6a93c77c07b835729c6cc69a4b6361038964ba
2018-07-27 22:14:50 +00:00
mistachkin 1f237e3f52 Enhance Makefile for MSVC to support building the shell tool without using the amalgamation.
FossilOrigin-Name: 3d815d83a6805938b87e03ffabe6d71ca2ecfd05052e8e02c6cc5d3c9ea4ddf3
2018-07-27 20:45:28 +00:00
drh 2d475e80bd The WHERE-clause constant propagation optimization attempts to use
transitive laws to replace column values with constants in the WHERE
clause in order to help to query planner make more aggressive optimizations.

FossilOrigin-Name: f4229707ac08d66c5b0f53483ce17a63f5ac40a21922f66c3408e1b6fda3a7c2
2018-07-27 20:37:42 +00:00
drh 9cbf4f3550 Reduce the performance cost of the constant propagation optimization to
less than 200,000 cycles.

FossilOrigin-Name: 865249de683e6971984a645a30d96f9fcc6f6d9d7af7e269ff68cc3e42e5fe71
2018-07-27 20:01:00 +00:00
drh e081d73c46 Performance improvement to sqlite3ExprCollSeq(). With this change, the
performance of speed-check.sh is within 400,000 cycles of trunk.

FossilOrigin-Name: a5f86f49b7d9e52546f234f7c3bcbac6b0f78aa55a71c44ca69e21bc31139f3e
2018-07-27 18:19:12 +00:00
drh bcd15938ae Faster implementation of sqlite3IsBinary().
FossilOrigin-Name: be05d0db09f43cc3362c28273463d1d236af737a4f8a494cf1050da07ed0df47
2018-07-27 18:12:40 +00:00
drh 7810ab6464 Only run the constant propagation optimization on joins since that is the
only scenario where it is useful.  This saves prepare time for the common
case of a simple query.

FossilOrigin-Name: 598d608359005b13fa1151c6c69f2fd12ef3ab7f563a035fc4a6f3c569dc6c67
2018-07-27 17:51:20 +00:00
drh efad2e2366 Constant propagation is now restricted to just the WHERE clause. The
mechanism is changed to take affinity and collation into account.  This
seems to give correct answers.  But the search for constant propagation
costs 4 million cycles in the speed test.

FossilOrigin-Name: 82c67efb723dba387964f690cd459b420e59e3367d9589016597a76531596391
2018-07-27 16:57:11 +00:00
drh 7de7602eb7 Add a test case demonstrating the collation problem with constant propagation.
FossilOrigin-Name: 50add839fd95665bd67a6ae5de8346fd09e83904bbcbad26fad280dff86d9e93
2018-07-26 23:54:19 +00:00
drh 24e1116e0f Generalize the constant propagation optimization so that it applies on every
WHERE close, not just those that contain a subquery.  This then demonstrates
that the current implementation is inadequate since it does not take into
account collating sequences.

FossilOrigin-Name: 57eb2abd5b270d65be5e0f138f0d46899fa6091df3ba20b0ea7ef04244a15d48
2018-07-26 23:47:11 +00:00
drh ce705305b5 In the unix VFS, give every unixInodeInfo object its own mutex, rather
than using the global VFS mutex, to improve concurrency in cases where there
are many threads operating on separate database files.

FossilOrigin-Name: 22f47cf430827c50634794a5a33987511bb71492c0dd1f6466a0c5b779d0521b
2018-07-26 21:48:05 +00:00
drh 660ee55663 Initial implementation of the WHERE-clause constant propagation optimization.
FossilOrigin-Name: 2fb82ad8ebb6434438c0d235b1239444fb08c8711cea2c5a9ed955fedd0acdec
2018-07-26 21:16:53 +00:00
dan 42b2653871 Fix a buffer overread in fts5.
FossilOrigin-Name: 0e3de8abbb0c7ae64e637776cb055ce79736f99a103e00e44d17a6b091b98c81
2018-07-25 15:25:55 +00:00
mistachkin 758784d1db Keep generated opcode values grouped together when required, even when they do not correspond to a token.
FossilOrigin-Name: 6ee2950b272ede475e485bfaa7d413eaa81482fe9dd6452aeeaf95ff7938f7da
2018-07-25 15:12:29 +00:00
dan caf0a2540c Fix a typo in the documentation for sqlite3_snapshot_get().
FossilOrigin-Name: cd9713c9a88cd30887c67f477abbbf8ef90299051a0b9bb52a04cf4132987c9c
2018-07-25 07:29:20 +00:00
drh ba968dbfe7 Do not abort running queries due to a CREATE INDEX statement. Allow them
to run to completion before being reprepared.  Fix for ticket
[c694113e50321afdf9].

FossilOrigin-Name: 2bd593332da0aade467e7a4ee89e966aa6302f37540a2c5e23671f98a6cb599c
2018-07-24 22:02:12 +00:00
mistachkin 5a193dd8e6 Add missing SQLITE_OMIT_WINDOWFUNC check to the json1 extension.
FossilOrigin-Name: fe19f8239dc474db0854a0a8ce5189ac4195c736b496f475a59a185e0879b40c
2018-07-24 13:57:44 +00:00
drh 6886d6dbc4 Return an SQLITE_NOMEM error if the locking mutex fails to allocate.
FossilOrigin-Name: 1c94834879be0601ac40ef3c4fb1b140f7737e89af7808f2f1db4ceb3daae19f
2018-07-23 22:55:10 +00:00
drh da6dc2404a First attempt at reducing mutex contention in the unix VFS by providing
a separate mutex for each unixInodeInfo object.

FossilOrigin-Name: f69afaf00a659cd768a863c5f4a1d527f01187e037240da0ada527cb52c5afe8
2018-07-23 21:10:37 +00:00
mistachkin 1489785be5 Fix typo of 'SQLITE_OMIT_WINDOWFUNC'.
FossilOrigin-Name: 8607b84a5c53d8c9218c90802160a3000f1138b1f188e411a3af46253e0a69cc
2018-07-23 18:53:49 +00:00
drh eca5d3a30c Attempt to improve the documentation for snapshots. No changes to code.
FossilOrigin-Name: 46dd076af5880e6e9a7de974758b26bc43d0dc074f8143234038fa9cdcc726ee
2018-07-23 18:32:42 +00:00
dan 78ccff100e Fix the macros used to generate the output of "PRAGMA compile_options" so that
they handle valid values for the SQLITE_DEFAULT_LOOKASIDE macro (which
contain a "," character).

FossilOrigin-Name: 1cc72845f92198f2f6c1d34957921cd8f5bc82eaccab9f844006993f0b8d7a96
2018-07-23 10:57:53 +00:00
mistachkin 709c822f5e Fix more harmless compiler warnings seen with MSVC.
FossilOrigin-Name: edab5666f8470b37e6031dfd80e615b1aab95d1d85ccbe4ece1a813f8b3d4d95
2018-07-22 21:23:19 +00:00
mistachkin 8417863fe1 Another minor revision to the 'fulltestonly' set of tests.
FossilOrigin-Name: 61f8e2a4c6c146ffba498c8bb40f2b5627fdc14020057eab63b7e900bf88a9ed
2018-07-22 21:08:35 +00:00
mistachkin 5db9a2b364 Fix harmless compiler warning.
FossilOrigin-Name: ead4762dfcd284127e60483e14f88aa4f4f034c2e1efb68a150359ba8f307776
2018-07-22 20:24:38 +00:00
mistachkin 1e8487db29 In the Win32 VFS, when truncating a file, unmap it first.
FossilOrigin-Name: 21510a66dce4d0843ccfe20f092a01f5a52563ef244a94f1d5d2563305cab925
2018-07-22 06:25:35 +00:00
drh 9a047bb881 Remove an unused branch in the FK logic.
FossilOrigin-Name: 523ff77925f1da361cf31e3fc82bcb1708ed356a2391430ab14ef620c9bf2327
2018-07-22 00:45:11 +00:00
mistachkin 9676e611b6 In 'resetdb.test', close a database prior to trying to delete it.
FossilOrigin-Name: 45137053a511b976f5447b0668e3f3a636785d242f44b110a1107898e847e95e
2018-07-21 23:15:55 +00:00
mistachkin 0fc2da3f79 When dropping a view, skip trying to delete from 'sqlite_stat*'.
FossilOrigin-Name: 2f5be3a2ddf469bd1b37b9e357545ce872b90c479a07094de2101d0a43ad70a4
2018-07-20 20:56:22 +00:00
drh 72d03a646c Change the SQLITE_Stat34 bit of the optimization test-control so that it
prevents STAT4 data from being used but allows it to be loaded into the
Index objects.  This permits STAT4 to be turned on and off on a per-statement
basis.

FossilOrigin-Name: 489f3caf5dcc8cace20a0da58ceb32fdea5770ba570fa3c9f712cd35e726846a
2018-07-20 19:24:02 +00:00
drh 040d77aa71 New checked in PRAGMA integrity_check to validate the autovacuum settings
in the header.

FossilOrigin-Name: a4663f09c91d1381a831f61a2b8e8a113eb6083932c4aea2ad0c011ece1418c5
2018-07-20 15:44:09 +00:00
drh 91d5866eb6 Enhanced detection of problems on the freelist and on overflow list in
PRAGMA integrity_check.

FossilOrigin-Name: 11e58f5b37d99848978007d834d187c262d904eb9d58924742e028d7cb324e64
2018-07-20 13:39:28 +00:00
drh b0b0230082 Avoid a branch in the commit logic that is unreachable when compiled
without SQLITE_ENABLE_BATCH_ATOMIC_WRITE.

FossilOrigin-Name: 271b8980c3bcd0403a40aec26681ec111be1d88d2d5d35199a85a10f09ad6920
2018-07-19 15:27:35 +00:00
drh b657f28bf6 Allow the VACUUM following SQLITE_DBCONFIG_RESET_DATABASE to proceed even
if the write-version in the header indicates that the database file is not
writable.

FossilOrigin-Name: 3dca8b9d5ab1f35f17fc527d8f2a20b6bac989d1406c883d5b4d6719953ef6b4
2018-07-19 14:40:41 +00:00
dan ea933f07b0 Experimental fix for resetting databases that have been deemed read-only due
to a corrupt "read-version" header field.

FossilOrigin-Name: e2394002d02754bb45d56e805df9bc5a2ef0d14e5d94262c1f8ab7643bc27c8f
2018-07-19 11:44:02 +00:00
drh ea99a31c59 Add the SQLITE_FCNTL_DATA_VERSION file control
FossilOrigin-Name: a5087c5c87ad65f92e3bc96bbc84afb43faf10ab6b9ed3ba16304b5c60ad069f
2018-07-18 19:09:07 +00:00
drh 378a2da91e Fix a harmless compiler warning in the pager. Enhance the docs for
sqlite3_changes() and sqlite3_total_changes() to refer to the data_version
pragma.

FossilOrigin-Name: 4c70ea5b0e2a512c6a46ac1f14397720e8c8556875701e78c30b19f850c24f55
2018-07-18 17:37:51 +00:00
dan ac306682df If an SQLITE_IOERR error is encountered as part of an atomic commit on an F2FS file-system, retry the commit in legacy journal mode.
FossilOrigin-Name: 2e0357c2ed30927921cd17129e348a18a6f3fd086d1fc0a42756036b321a084d
2018-07-17 14:01:55 +00:00
dan 4522c3e8d1 Fix for builds without SQLITE_ENABLE_BATCH_ATOMIC_WRITE.
FossilOrigin-Name: b10ec14ef7edcc5d7b0ad298c8230d1eca5508e8cf673fbbc97a0928b76c92fb
2018-07-17 13:55:08 +00:00
dan e79522633a Add new file doc/F2FS.txt, containing notes on the way SQLite uses the F2FS atomic commit feature.
FossilOrigin-Name: 59efb1bfaba12742379aae45c8c796ca539f089af9e553a3a55d6899a9c583c8
2018-07-16 20:44:00 +00:00
drh 7f32dc94a3 Minor simplification to sqlite3RollbackAll().
FossilOrigin-Name: 432fdc221550b3cca4140b1ae411da22201f689c30c72c5472dfdbc79bec9d90
2018-07-16 11:32:59 +00:00
dan 140a59874b If an SQLITE_IOERR error is encountered as part of an atomic commit on an F2FS
file-system, retry the commit in legacy journal mode.

FossilOrigin-Name: 1c41250f67ac5de423b0426ef2ab8fe3303278a270225920033933ca9609592a
2018-07-14 20:25:13 +00:00
dan 2f69b5c5d0 Remove an unused function declaration from fts5.
FossilOrigin-Name: 148d9b61471a874a16a9ec9c9603da03cadb3a40662fb550af51cb36212426b1
2018-07-13 20:28:54 +00:00
dan b80bb6ce88 Add the "categories" option to the unicode61 tokenizer in fts5.
FossilOrigin-Name: 80d2b9e635e3100f90cffdcffa5b5038da6fbbfccc9f5777c59a4ae760d4cb62
2018-07-13 19:52:43 +00:00
dan e882551935 Add a test-control to disable the skip-scan optimization.
FossilOrigin-Name: 650a3fe03d61068e06f3097878a777ca8ed713a769444cdb3f8be7d1e19a0b83
2018-07-12 19:14:39 +00:00
dan 7490128240 Add a test case to check that SQLITE_DBCONFIG_RESET_DATABASE can be used with
wal mode databases even if there are active readers.

FossilOrigin-Name: 6145f5b3bacdee8f377892ac8b885941336c4cc543052f6373e21c1f99e1eca8
2018-07-12 11:28:42 +00:00
drh 222a384a06 On an UPSERT when the order of constraint checks is rearranged, make sure
that the affinity transformations on the inserted content occur before
any of the constraint checks.  Fix for ticket [79cad5e4b2e219dd197242e9e5f4e].

FossilOrigin-Name: d120c45f3dc79f67afed0e44e5133569f784bc6792b15f5d79529deac2d13072
2018-07-11 13:34:24 +00:00
drh 9341916ed5 Adjustments to VdbeCoverage macros to deal with byte-code branches that
can never be taken in some directions.

FossilOrigin-Name: b170c0092b1d0c47dd700843f0c870e51181939607a897fbcae55a58042160f9
2018-07-11 03:27:52 +00:00
drh 5d6374fa39 Remove incorrect ALWAYS() macros from the window function logic.
FossilOrigin-Name: 94ac51cc4e7fdf484214e1936fc96104b96134632a8eb99558b3af743ac8bb8b
2018-07-10 23:31:17 +00:00