Commit Graph

19920 Commits

Author SHA1 Message Date
drh
ba160891de Add the "PRAGMA table_xinfo" command that works like table_info but also
shows hidden columns in virtual tables and adds the "hidden" boolean column.

FossilOrigin-Name: defa0515b8fd50ed9be699542f8c6695dd4a60c02f310665db6657ec5b6b67d0
2018-10-01 21:41:15 +00:00
drh
bfbf7d9daa Test case for PRAGMA table_xinfo.
FossilOrigin-Name: 7694b9bc3003db6ba0b41c5029c8f7b84c07724e7a518e835e98b3c46e4ea227
2018-10-01 21:36:38 +00:00
drh
bdc9744f60 Change the name of the pragma to PRAGMA table_xinfo. Improve the
mkpragmatab.tcl script to reuse column names where appropriate.

FossilOrigin-Name: 2fdd068987e59b979045d71ae64e700600ef07e54ae340f30c2064e5dcccb8ea
2018-10-01 21:26:30 +00:00
drh
d7dc0a36cc Add the extra "hidden" column to the end of the PRAGMA table_vinfo output.
FossilOrigin-Name: cf1b76135f511530dcc7b82f78c952bf97ebcddb40be06f713f9f2326915fabe
2018-10-01 18:28:42 +00:00
dan
49f84ce1cd Speed up xAccess() calls made on an RBU VFS when there are lots of open
connections.

FossilOrigin-Name: 310b4b65b8c8ee080760c7efb4c7e20244c6063a5dba37a4f40490105aafd29f
2018-10-01 17:33:35 +00:00
drh
5612ef1057 Bring the PRAGMA table_vinfo statement up to date with trunk.
FossilOrigin-Name: 6f606f99231f88ae5ff719d0ce21afc4b844490102c27ac20aa606baaf78d8d6
2018-10-01 17:15:17 +00:00
drh
44d068532e Fix a potential crash that can occur while reading an index from a corrupt
database file.  The corruption is a record-header-size that is larger than
0x7fffffff.  Problem detected by OSSFuzz against GDAL and reported to us 
(with a suggested fix) by Even Rouault.  The test case is in TH3.

FossilOrigin-Name: 8ac2cdda68f92b0352bc7f0b4be5fca4bb58565ca65055fb34153cc284ed6922
2018-10-01 13:54:30 +00:00
dan
5351e884aa Fix a problem with ALTER TABLE commands when the schema features an INSTEAD of
trigger that uses NEW.* or OLD.*.

FossilOrigin-Name: c52f457e56eb9d573eb67093731eb231aaf6fd6dbdc397e6f948b82736fbe3ab
2018-10-01 07:04:12 +00:00
drh
15fc988ce0 Add the PRAGMA table_vinfo command (with an extra "v" before "info") that
works like PRAGMA table_info (without the "v") except that it also shows
hidden columns on virtual tables.

FossilOrigin-Name: 8bcd1a59560aa7ea73e6529e5c14ece8ac09bf7e99efdcfd388fead39846b6bf
2018-09-29 19:38:42 +00:00
drh
ca9a5faf70 Fix test cases so that they work with ICU.
FossilOrigin-Name: d04b2013b5436430ebbf7053d637fd89c1b15affcb42787dcf1cf5ffc3ae54e2
2018-09-28 23:53:24 +00:00
dan
f8248c42f9 Have sqlite3changegroup_output_strm() call its output function more regularly.
FossilOrigin-Name: 8467c31aa0bf24e597f680748460a99f425c49f5ab741c3574c339aa56857146
2018-09-28 20:46:41 +00:00
drh
09b523c99b Fix a bug in the sqlite_memstat virtual table that was causing it to report
the amount of memory used as zero bytes.

FossilOrigin-Name: 8a758a872175b0c74e631c231240c5c733fbec708d0cff23eb9c4025e4a800ec
2018-09-28 18:51:18 +00:00
drh
60afcb80ee Add the geopoly_regular(X,Y,R,N) function to the geopoly extension.
FossilOrigin-Name: 4505bbae58357eacab262b642b2a56d6dd380de72faceb5bbfd042eb94a12c06
2018-09-28 14:01:17 +00:00
drh
601c8f2829 Make most geopoly functions pure.
FossilOrigin-Name: 944e167a98e995c5750c1fcd44df857d6b10c1cbb91731fad2849415c42b2cfc
2018-09-28 13:18:24 +00:00
drh
b2d83494d3 Rig geopoly to use sqlite3AtoF() if it is available, as that routine is much
faster than atof().

FossilOrigin-Name: 470c6c07d0eb70806ac257c1c8ad877e041bbc14ff9a5c490edb51b2956ae726
2018-09-28 00:16:57 +00:00
drh
17e65ae4c0 Small performance optimization in the JSON parser of Geopoly.
FossilOrigin-Name: fb520e71035258d5490be33ee28575df2caefa5d5a301c8bbdf1471551c96282
2018-09-27 23:57:45 +00:00
drh
50db3e8d51 Enhance the GeoPOLY extension so that it always stores its polygons in the
binary format, which is faster and more compact.

FossilOrigin-Name: dc35f7b1754a78fa0d70c92754de07bb3c28d0d31cb929ee8a3a47ac4f3d446e
2018-09-27 20:37:52 +00:00
drh
09d00b2f4f Ensure that the OP_VColumn opcode does set sqlite3_vtab_nochange() unless
the OPFLAG_NOCHNG bit is set in P5.  Fix for ticket
[69d642332d25aa3b7315a6d385]

FossilOrigin-Name: 322ab1fc613f616e9f07dc94ef74a29572a21cc476d88e97b4ce865500a47b62
2018-09-27 20:20:01 +00:00
dan
0efb6f5135 Another minor tweak to memstat.c so that it may be built against older versions
of SQLite.

FossilOrigin-Name: 4c1fed60b9b35ac2f5d2f2533b54db429d72bdbc0aad0dd5af52ff851789d4ae
2018-09-27 17:33:06 +00:00
drh
6dd5f07d3d Modify the memstat virtual table so that it works with SQLite version 3.9.2.
FossilOrigin-Name: 7171d8ae6b1e7c97b0cf06bcca2262674c9ce557c85666b4b77c16cbac508502
2018-09-27 17:15:21 +00:00
drh
982c1fac2b Add the sqlite_memstat extension - an eponymous virtual table that shows
memory usages statistics for SQLite.

FossilOrigin-Name: 954ef61f6a02532e72c815208ec839310f1e00d69e0003cc6f5426f0559229d1
2018-09-27 17:03:03 +00:00
drh
d7134fe0c1 Enhancements to sqlite_memstat:
(1) Add an extra "schema" column to show the schema name for ZIPVFS stats.
(2) Only show ZIPVFS stats to schema that use ZIPVFS
(3) Put a NULL in unused columns of the output.

FossilOrigin-Name: 9351135b4331107be2f2bda7b6adbd5436381f4f9a68340e8a172b6517ec3f12
2018-09-27 16:57:42 +00:00
drh
7c5577acdc Add initial ZIPVFS support for the "main" database to the sqlite_memstat
virtual table.

FossilOrigin-Name: 9cd27350b0f62debfe3238c57c3ab51079699142e82c05a7ec8460a8429f55f2
2018-09-27 15:45:03 +00:00
drh
d7fda6cfc5 Initial prototype of a eponymous virtual table that accesses sqlite3_status64()
and sqlite3_db_status().

FossilOrigin-Name: 0b44e1f68e0c8349367e3f929d4734c3df96338ec8d6fb652565bf894e8b8343
2018-09-27 15:21:13 +00:00
dan
6afa35c985 Disallow the use of window functions in the recursive part of a recursive CTE.
FossilOrigin-Name: 7fc2994434c7d9ed29c96a69c07e8eb4e97be776473c170c63f9a1bbaa09fa68
2018-09-27 12:14:15 +00:00
mistachkin
1c06b47864 Minor simplification: In OP_ParseSchema, read the p1 register once.
FossilOrigin-Name: bd250533a06e4a11c1f548c3de66b8562fc627383848570d7d030cf132fd336f
2018-09-27 00:04:31 +00:00
drh
eb7f2a0fc5 Further improvements to the ".help" command in the CLI.
FossilOrigin-Name: edc3d18ecbda32d6a55de76ee7335342425c57d917e9b48814a7301a012263b2
2018-09-26 18:02:32 +00:00
drh
98aa2abc45 Begin revamping the ".help" command in the command-line shell so that it
can accept an argument and will do a search for commands that match that
argument.

FossilOrigin-Name: 209afb8d06466536863b89a8acb9a1a18477a06331d8cce95fc6380e1666b6f5
2018-09-26 16:53:51 +00:00
dan
2e5e0e10f2 Tweak spellfix.c so that if SQLITE_SPELLFIX_5BYTE_MAPPINGS is defined at
compile time the Transliteration structure has space for 5 byte (instead of 4
byte) mappings.

FossilOrigin-Name: cbaf5b6c1b07b29b2c83fa01618de856d81cc1174769cb9770cb5c894cc87ace
2018-09-26 16:05:07 +00:00
drh
6b26a7b950 Fix typos in the header comment for the sha1 and sha3 hash extensions
in the ext/misc folder.

FossilOrigin-Name: 4ed9d83a0b14a22b3ecf25785b03b5a824d260e01a608aea85231df9b816421d
2018-09-26 03:43:42 +00:00
dan
6705584a5b Fix a problem in releasetest.tcl causing configuration "Fast-One" to fail.
FossilOrigin-Name: 42e04fefbc241dd33f12abd66344a87720ae4cda6d82f2882217b3cb71be8733
2018-09-25 13:51:31 +00:00
drh
5398806889 Slightly smaller and faster alternative to [507d892c3a40a0bacbd47] that
fixes a problem with views that use window function as part of complex
expressions.

FossilOrigin-Name: d7c816ae15f05f21b9b213161e1044aaefc56f17e7bc4b7b551a9e04efc05855
2018-09-24 15:39:30 +00:00
dan
2fae150402 Fix a problem with views that use window functions as part of complex expressions.
FossilOrigin-Name: 507d892c3a40a0bacbd47ed3c4fe2d8925a82716ae08da8401750a42782ba454
2018-09-24 14:51:59 +00:00
drh
6314eeaeb3 Allow a writable virtual table to have a schema with an INTEGER PRIMARY KEY
and WITHOUT ROWID.  This fixes ticket
[f25d5ceebe1d710ff61a571e395356869d8272ef].

FossilOrigin-Name: 5a38d9281b4ad63b853efa5cdd5ad4a64b19dfaf8250ef8e0e186684df1211ea
2018-09-24 14:10:55 +00:00
drh
6fb5d358a8 Use compile-time options SQLITE_QUERY_PLANNER_LIMIT and
SQLITE_QUERY_PLANNER_LIMIT_INCR to control the value for
WhereLoopBuilder.iPlanLimit, rather than embedding magic numbers in the
code.

FossilOrigin-Name: 903e501894b2a5dd7055b5154d74d4a47a619f76e66485a4d62b6259f10723d6
2018-09-24 12:37:01 +00:00
drh
7ebb605c0a Increase the initial value of WhereLoopBuilder.iPlanLimit to 20K. Issue
a warning if the iPlanLimit reaches zero.

FossilOrigin-Name: 3dd35f51187574f47f860405309877cdbf9dc5710703dfd98cf98073b771140c
2018-09-24 10:47:33 +00:00
drh
f8937f9034 Fix a faulty assert() in the validation logic for the LEFT JOIN strength
reduction optimization.  Problem found by OSSFuzz.

FossilOrigin-Name: 2fd62fccd13e326dbd7dd730112542c6faa56e466bf4f7b8e22ced543031280c
2018-09-23 02:01:42 +00:00
drh
2c3ba94969 Enhance WhereLoopBuilder.iPlanLimit to handle a case involving the OR
optimization discovered overnight by OSSFuzz.

FossilOrigin-Name: 7b59930a1d7b664b54d5a2bc9fa385925b5f4c8f34bf401c798307e3e2dae2c6
2018-09-22 15:05:32 +00:00
mistachkin
7cc5595a01 Fix harmless compiler warning when compiled with SQLITE_OMIT_AUTHORIZATION.
FossilOrigin-Name: 50f2fa19532e0f849d61d9e2a97427cfbf64cfb787ca481ef8c860d0f24f6cfe
2018-09-21 23:41:18 +00:00
drh
5eaebf3a63 Comment typo fixed. No code changes.
FossilOrigin-Name: 7e68cdab20f50cf776b92b2138bb4aba7cb070f2bd855dd4cbbf46d447f2dc88
2018-09-21 19:06:09 +00:00
drh
fc9098a45e Put a limit counter on the query planner that restricts the number of
index+constraint options that can be considered for each table in a join.
This prevents certain pathological queries from taking up too much time
in the query planner.

FossilOrigin-Name: 8690b5a0cc08eeb175230de45d4ca9b9f7b9b22aeebea70b8b7151f10b130969
2018-09-21 18:43:51 +00:00
drh
0d7f0ccd96 Optimization to the OP_MakeRecord opcode makes speed-check.sh run about
1.1 million cycles faster, and results in a slightly smaller library.

FossilOrigin-Name: d10e63629183f6daf0c263cd4dae052a3786c8c1480b3b6a73124b3315e41951
2018-09-21 13:07:14 +00:00
drh
5db90714aa Minor code simplification.
FossilOrigin-Name: 22ae8a52dd2fb744f467c7dccf1d7fe7c7cef0e1dcc897dd492f897e84c9facb
2018-09-20 20:43:28 +00:00
drh
42eb070729 Add the "PRAGMA legacy_alter_table=ON" command to enable the pre-3.25.0
behavior of ALTER TABLE that does not modify the bodies of triggers or
views or the WHERE clause of a partial index.  Enable the legacy behavior
by default when running the xRename method of virtual tables.

FossilOrigin-Name: 7edd26ed27ed1e7eab603058f7d55f2eac45e7bd1908bfa5f32293611883b157
2018-09-20 20:15:02 +00:00
drh
eda079cd2c Combine the Expr.pTab and Expr.pWin fields into a union named "y". Add a new
EP_WinFunc property that is only true if Expr.y.pWin is a valid pointer.
This reduces the size of the Expr object by 8 bytes, reduces the overall
amount of code, and shaves over 1 million cycles off of the speed test.

FossilOrigin-Name: ad130bb86e74e6ce165fdbdce3a19699510f0e62071c1c7923b5a4538d888c7c
2018-09-20 19:02:15 +00:00
dan
34566c4434 By default, make all "ALTER TABLE RENAME" statements executed within a virtual
table xRename() method exhibit the legacy behaviour.

FossilOrigin-Name: 71947337e98b90debb13b390119bc2a6b39dd41535151b836071ee327a31e45d
2018-09-20 17:21:21 +00:00
dan
674b894269 Add a PRAGMA that restores the legacy ALTER TABLE RENAME TO behaviour.
FossilOrigin-Name: 5acad2e92c11c209bedc6ac8a709595e8070eed028ffc82af61499e5ceaa5e2b
2018-09-20 08:28:01 +00:00
drh
504eba5f46 A minor code simplification, saved in a branch for future reference.
FossilOrigin-Name: 5e458f4a92743effb9a3d3249767424fed8b444a05ca136c4a55d60c4d70c2cc
2018-09-19 18:17:46 +00:00
dan
85c6892aa4 Fix a compilation issue in the "userauth" extension. Also fix a few test
script errors that occur with SQLITE_USER_AUTHENTICATION=1 builds.

FossilOrigin-Name: 221f3f572ed49d7af69a2e7c88741fa5206ea33ca59ee791eac7698bdd11ca4d
2018-09-19 17:09:09 +00:00
drh
c6727c8342 Fix the "sqlite3" command in the TCL interface so that it correctly returns
an error if invoked with no arguments.

FossilOrigin-Name: 2034fa8089676132b5e2f71bdebf1af9ca141da2e173920c6e84fb974ab0f022
2018-09-19 15:08:21 +00:00
dan
16f39b6e5d Fix a problem building on Android with SQLITE_ENABLE_BATCH_ATOMIC_WRITE set.
FossilOrigin-Name: e41e50fe7430cb79f67369fe81ac9938665bfc5db59c4faaf429ceb8ca03f584
2018-09-18 19:40:18 +00:00
dan
c4b1e5e758 Avoid incrementing the SQLITE_LOOKASIDE_MISS_SIZE stat before sqlite3_open()
returns. Fix test script problem in lookaside.test.

FossilOrigin-Name: e461cb281959d8517296e3e4e934eba8206770b1a592cd7655b6567268da1634
2018-09-18 17:50:34 +00:00
dan
253c6ee1bf Enhance tester.tcl so that when "--malloctrace=1" is specified, the test
generates self-contained Tcl scripts that present GUIs instead of *.sql files
that require a separate program to interpret.

FossilOrigin-Name: de2e3cbd08c00d235106c040fa472ec267ef8f1ec13c34ed7d16deac8d50b6cc
2018-09-18 17:00:06 +00:00
dan
b1e1a0fd2d Minor improvements to the permutations.test script. Most notably, a command
like "permutations.test alter%" now runs all test scripts with names that
match the LIKE pattern "alter%". Or, say, "permutations wal alter%" to run all
alter% tests in wal mode.

FossilOrigin-Name: 3e1a2f6614eacb65e1dffe64c6292c809fc5808be2d9d7d103cfc57d7b32fcd9
2018-09-18 16:06:42 +00:00
drh
40b4e7a692 Further optimizations to the UPDATE logic to avoid making changes to partial
indexes if none of the columns mentioned in the WHERE clause are modified by
the UPDATE.

FossilOrigin-Name: d1365a5bf0ee2f145427b81d2a593f539c3ad4705d579478703c1f65ae5f80bf
2018-09-17 20:47:38 +00:00
drh
d4cb09e3d2 Disable the ORDER BY LIMIT optimization in queries using window functions.
This fixes a problem that was introduced by check-in [206720129ed2fa8875a286]
which attempted to fix ticket [9936b2fa443fec03ff25f9].  This changes is
a fix for the follow-in tocket [510cde277783b5fb5de628].

FossilOrigin-Name: c6c9585f294710829ca24b64d70a36fd9f409261dd0661367c6c4198cdbc4c81
2018-09-17 15:19:13 +00:00
drh
051a1022ff Fix a false-positive in the post-ALTER-TABLE schema verification logic that
prevents ALTER TABLE from working if the table being altered has a trigger
that references any column of a virtual table. Ticket [b41031ea2b537237].

FossilOrigin-Name: 84105ea4af98bd8bddbdf9dc6674bdf73c110c0685afe868ce9681da110144d7
2018-09-17 14:13:48 +00:00
drh
e597c47545 Restore an assert() that was present on trunk.
FossilOrigin-Name: a7b572ca7867a95f49888dc95c0dc6d726afa9fea26283be147ba422639d1307
2018-09-17 13:55:18 +00:00
dan
de79e094bc Minor modification to the fix on this branch to avoid adding extra conditional
compilation macros.

FossilOrigin-Name: 4d8be404dab265b51e5a6a95e83be85c22512e19a437191690c7d845c87ff259
2018-09-17 13:38:45 +00:00
mistachkin
746127e734 Fix missing space in 'configure.ac' reported on the mailing list.
FossilOrigin-Name: 96b00a3cd2273dd3baa8e5b7a441458b142d4d2daabc679e4fcb5ab706674e76
2018-09-17 12:49:21 +00:00
dan
0208337c16 Add extra test for the fix on this branch. Also fix a
pointer-compare-after-free problem that occurs in similar cases.

FossilOrigin-Name: 1856ea63b3186c2c8fa716ffe01c731397bdbbc3fbb56dc72ad0686cb7f152ca
2018-09-17 08:27:23 +00:00
drh
e68fe9665a Add assert()s to the new code in the previous check-in.
FossilOrigin-Name: b12f23a5c484cab3654721299ea0f05230eef6b14012b557f3bf2592fac0f00e
2018-09-17 00:15:21 +00:00
drh
95f78d98b9 First proposed fix for the ALTER TABLE problem described by ticket
[b41031ea2b5372378cb3d2d]

FossilOrigin-Name: 05a9d129254e01a5f6b5e4033c105190eae386575a94b020ef3e0cbd30bbf056
2018-09-16 23:27:37 +00:00
drh
86f3492650 Remove an unreachable branch from the index-on-expression optimization.
FossilOrigin-Name: 2df2cf4f179dd88fb2530dfd338f344ac48dd052ef954dc95a136884523f7aee
2018-09-16 18:23:48 +00:00
drh
6557a07ca8 Fix a memory leak in the explain extension.
FossilOrigin-Name: d0c92b047a5355726aea87f38038e5bda3adf6137492919be94bd29bb847eddb
2018-09-16 16:34:31 +00:00
drh
9b84f03556 Add the new "explain" virtual table in ext/misc. Use this virtual table
for additional test cases for the optimization that avoids updating indexes
on expressions when none of the columns changed by the UPDATE are in the
expression.

FossilOrigin-Name: 2404304cc15eaeee2744cf3c8f9cac0a544631c4f1060c5a17a78b43ca86edf0
2018-09-16 16:18:01 +00:00
drh
2b7cdf6f6b Improved presentation on the new code that prevents unnecessary writes to
expressions on indexes during an UPDATE when the expression does not reference
any of the columns that are changing.

FossilOrigin-Name: c9f045295c4577752b0847ff2027b44661e6cb15bb08b942ccb3a0ef396f3dec
2018-09-16 15:01:25 +00:00
drh
6a9afa918b Increase the version number to 3.26.0 as we start the next development cycle.
FossilOrigin-Name: 885f0f8252aae776a86c64bcc7da582f0ed58f2caae8ebff810a83ca339da820
2018-09-15 21:43:14 +00:00
drh
e9816d82a7 Optimization: when doing an UPDATE on a table with indexes on an expression,
do not update the expression indexes if they do not refer to any of the
columns of the table being updated.

FossilOrigin-Name: a71b101635ed28a4c99734dabb20bd65ef1018c1d63ac143b7321cdb0fafa5d7
2018-09-15 21:38:48 +00:00
drh
f7d3b7a56c Version 3.25.0
FossilOrigin-Name: b63af6c3bd33152742648d5d2e8dc5d5fcbcdd27df409272b6aea00a6f761760
2018-09-15 04:01:47 +00:00
drh
9fd8425467 Fix minor typos in comments that get carried over into documentation.
No changes to code.

FossilOrigin-Name: 7921dd91a1745aa79ea157b91b22c380e9331800050861ee6ca1f0efa0a97628
2018-09-14 17:42:47 +00:00
dan
f86ff13206 Update releasetest.tcl to run "make test" as part of the "Fast-One"
configuration.

FossilOrigin-Name: d5ebfe1c75d336dac374d9cfa257e45e77ab51f9c2f24d1af615cbbe9dd83d9b
2018-09-13 17:11:51 +00:00
drh
af524a6343 Make sure the %z optimization for printf() is not invoked if there has been
a prior error (SQLITE_NOMEM or SQLITE_TOOBIG) associated with the same
printf() call.

FossilOrigin-Name: a2304a3474b0ca35eee0af64286ce2f7cb24d181323e128d5f04f7fe6e1c0980
2018-09-13 17:07:12 +00:00
drh
396a103612 Fix a requirement mark on a test script. No changes to code.
FossilOrigin-Name: 628d5c0aa057c05c7cf84c330a51b8a44720c97250eadf0e5e8c750b7a2969c3
2018-09-13 13:17:14 +00:00
dan
a86acc2132 Fix an assert() in os_unix.c that is not true when using RBU.
FossilOrigin-Name: 028ed8618af012b51104a06cc155b45d98bc4ff833d4431b9c38fd6851a74e82
2018-09-12 20:32:19 +00:00
drh
16b870d804 Restrict the scope of internal-use functions in alter.c.
FossilOrigin-Name: 4396914f8e1a847d86c22fb0b91e7431cf19aa260cbec520af3564248d6897ad
2018-09-12 15:51:56 +00:00
drh
83a9d14fcd Improvements to the documentation for SQLITE_FCNTL_DATA_VERSION.
No changes to code.

FossilOrigin-Name: 27837624336d2883f721310bd4dceedb77085d1008af5e12557f634936d48b8c
2018-09-12 14:28:45 +00:00
dan
e8ab40d219 Fix an invalid pointer comparison triggered by renaming a table column when
there are views with explicit column names in the schema.

FossilOrigin-Name: 572de7e4e33562c72cd90790b267ba389370f21ddcaebc4db609fd76ae9b7ada
2018-09-12 08:51:48 +00:00
mistachkin
ed008ecede Fix some harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 78862252da7f59d4737ed16f4ccf100cea27d8b421db31051afbaa8d96f24de3
2018-09-12 01:05:26 +00:00
mistachkin
90d6f4807b For MSVC, migrate some commonly used shell compilation options to the library.
FossilOrigin-Name: 68a71e5f4e9cbd15eb64d271008e29f40913480bac467b90fb64f0269ad75818
2018-09-12 00:48:17 +00:00
drh
8741d0ddb0 Fix a harmless compiler warning that arose from the ENABLE_CURSOR_HINTS
fix of check-in [0af18674ca5b34e67e]

FossilOrigin-Name: f578e62ae6f6cc78d8281adab9fa93f3f58711879c2860bbe19f291d257dc0af
2018-09-12 00:21:11 +00:00
drh
15c42942b3 Do not do the byte-by-byte modifications in the resetdb.test script if the
reserved-byte flag in the DB header is non-zero, because in that case the
bytes will be in the wrong place and the test won't work.

FossilOrigin-Name: 0af18674ca5b34e67e1685be3adcdd99a7b8650589c6a7cde7ad9ef1852a8777
2018-09-11 19:05:32 +00:00
dan
e3e79213b1 Fix a problem causing ENABLE_CURSOR_HINTS builds to segfault.
FossilOrigin-Name: e7033104fa8bd974a9a3d173200aa07a3aa3daade86e7eb65cad5d00b086969e
2018-09-11 13:38:35 +00:00
dan
30a7d7ddc5 Fix a test script issue in fts3ao.test.
FossilOrigin-Name: 74c381b573817d0212153278b5ee5d2238a27a727dcf7ee769365c47bb9fc40d
2018-09-10 19:34:06 +00:00
dan
be312ae9fd Fix a minor problem causing an incorrect cursor-hint to be generated in some
cases.

FossilOrigin-Name: d879c47d7d145cbe99602b2cf70294ddc946709e8d61040942085d29e2c5b6cd
2018-09-10 19:27:12 +00:00
drh
173e7823df Add the ability for loadable extensions to access the new
sqlite3_create_window_function() interface.

FossilOrigin-Name: 3def6d8ef11702eb03ad56aeb01763ec8e4ca8ed3b570ffb680164c5c3679e4f
2018-09-10 17:21:17 +00:00
dan
d2f65014bb Fix a broken assert() in fts3.c.
FossilOrigin-Name: 564fa75195c5179d0bc86431aaff06136fc65ec63aa9839cd1114b1fbfac928b
2018-09-10 16:38:25 +00:00
drh
473dc7347e New testcase() macros on virtual table xBestIndex logic.
FossilOrigin-Name: 3bbd9c5f2f1990f7d187951474a86996650dcede12c2608484d43250ae0b30d6
2018-09-10 14:43:15 +00:00
drh
b7a002f836 Fix the LIKE optimization so that it is disabled when the LHS of the
expression does not have TEXT affinity and the RHS is the pattern '/%'
or the RHS begins with the escape character. Fix for ticket
[c94369cae9b561b1f996d0054b].

FossilOrigin-Name: f191431d63aba187000b5cbaf3e072ff5f1b1eef6a2a407fb4d1629bda4e4e8f
2018-09-10 12:40:57 +00:00
dan
eb3fe0b9d4 Fix a problem with processing a "vtab.col IS NULL" expression within
the WHERE clause of a query when "vtab" is a virtual table on the rhs of a
LEFT JOIN.

FossilOrigin-Name: 83da4d4104ee1870a2a95bb5fa15ee6584c655d8b314b6b8ab97592dad4ee811
2018-09-10 12:17:16 +00:00
drh
f7ded14792 Fix an unreachable branch in the new sqlite3WhereOrderByLimitOptLabel()
function of the query planner.

FossilOrigin-Name: 5a954533edbde58aa7158572ece7ceeb1c6e610b71f3ae45d0b8371d74f9fea5
2018-09-08 20:29:04 +00:00
drh
6ee5a7b481 Fix multiple issues with the ORDER BY LIMIT optimization. This is the
proposed resolution to ticket [9936b2fa443fec03ff25].

FossilOrigin-Name: 206720129ed2fa8875a286266d05b99fb2caf8671e4b74b26a6286a2073fcd8b
2018-09-08 20:09:46 +00:00
mistachkin
c93c614543 Add a missing call to free() in Lemon.
FossilOrigin-Name: 8b4cf33aafe09d9009119dcbd464b54be9605af5701002ee458819efa6e2e1f9
2018-09-08 16:55:18 +00:00
mistachkin
42cb6ec4e6 Fix typo in the Win32-specific code for the fileio extension.
FossilOrigin-Name: e812e5d59a699e8b82c51d465d9c0f09df6a1e6996b5499814dca99c5f8020d5
2018-09-08 16:53:47 +00:00
drh
3b70045096 Remove a faulty ALWAYS() macro added by check-in [8fa254aa6329bdd0].
FossilOrigin-Name: fc47316e9b6b9f4c37cb7d3fe2af3f4dfb900fb5f07945dbf1239152a2d8f836
2018-09-07 19:12:08 +00:00
dan
b2802128d6 Add extra test case to altertab.test.
FossilOrigin-Name: 64c3ee3c255e4630ccd5002116d66fd2af6b12dbdd4a3bee5ed413c3ef87d33a
2018-09-07 18:56:31 +00:00
drh
a488ec9f0a Add assert() and ALWAYS() to identify two unreachable branches.
FossilOrigin-Name: 8fa254aa6329bdd085b8e2c78d8e8a698b418eda8b2d48e0082dd9cd428cef29
2018-09-07 18:52:25 +00:00
dan
d5e6fef2a1 Fix a problem with renaming a non-temp table that has at least one temp
trigger and shares its name with a temp table.

FossilOrigin-Name: ceb60bd7e5f2a0a4247bff476fc6468227305467339ae0c24591be9d2b14bdde
2018-09-07 15:50:31 +00:00
dan
202a0274db Minor fixes for problems revealed by releasetest.tcl.
FossilOrigin-Name: 1a8aedc3376b7ae32fa7b2c367eedd483e2629908836efd10ee5bd1fe0784675
2018-09-07 11:51:21 +00:00
drh
9fd88e8db7 Fix an uninitialized variable in the OP_ParseSchema opcode that comes up
only if the schema is corrupt.

FossilOrigin-Name: 725808d4c59176f71787452c7e500b563fd99cfc8ece47b1efe01d5e207efe0d
2018-09-07 11:08:31 +00:00
dan
803507f863 In all.test, do not attempt to run the RBU tests in non-RBU builds.
FossilOrigin-Name: 10c3e5a0314470ee1ffc37b68445a2cb2054530346d5f5ed3ffbd6df8003cad0
2018-09-06 20:33:11 +00:00
drh
cb4e4b00b3 Fix a harmless compiler warning in os_unix.c.
FossilOrigin-Name: b9d1fb5d44e0a6ffc00ee987f178e448d7516e579beecdeeb387e69aef588921
2018-09-06 19:36:29 +00:00
dan
c50f75df96 Fix a problem with ALTER TABLE when there are views or triggers in the schema
that contain "<expr> IS NULL" expressions.

FossilOrigin-Name: 91aab32e71fcb924e24c02d5f0901f7a474760fc993a7e7436e667512cf5d3c3
2018-09-06 18:56:36 +00:00
dan
1041a6a817 Fix a problem in ALTER TABLE with SQLITE_OMIT_VIRTUALTABLE builds.
FossilOrigin-Name: fa835145e63749e06e04bd50ff992afaeae05dcdd1df597d13911f944e62076b
2018-09-06 17:47:09 +00:00
dan
7ea1edb703 Fix test script problems causing SQLITE_OMIT_VIRTUALTABLE builds to fail.
FossilOrigin-Name: 37ad064e5f5704cf345d23b38b3f6d627fbcf20dbb78c8a91e96c9704760a1b8
2018-09-06 17:23:08 +00:00
mistachkin
1884487e4b Merge accidental fork.
FossilOrigin-Name: ebadb7dc25b9ab544a941ceb9a18926268c21bb60de98737f6ef19915ee8e61a
2018-09-06 16:50:54 +00:00
mistachkin
3c4b61333f Fix harmless compiler warning.
FossilOrigin-Name: 88b39c46c15ab6bdd0ac9536ddb6fb09862d578d0f691c57d039b0a906f1c25c
2018-09-06 16:47:10 +00:00
dan
905f981667 Fix a problem causing SQLITE_OMIT_VIRTUALTABLE builds to fail.
FossilOrigin-Name: 18beabc848d0ed7f5c918cbec5372a49915d889d7ffc9f475e6b208407e9ebd2
2018-09-06 16:47:08 +00:00
dan
71998f03b5 Add new test file "alterauth.test".
FossilOrigin-Name: 00940265b18a3cf848602e1e0b3edbd935cb4309ef91a34b0d5746a258a47ae6
2018-09-06 16:24:23 +00:00
dan
fb05c7ff7d Add an "ALTER TABLE RENAME COLUMN" command. Upgrade "ALTER TABLE RENAME TABLE"
so that it modifies references to the renamed table embedded in SQL view and
trigger definitions.

FossilOrigin-Name: 4da5998314ed2c694b0e242755930f5320af89ac5c148845392f0a2043d44d22
2018-09-06 16:20:09 +00:00
dan
194584e26f Merge latest trunk changes into this branch.
FossilOrigin-Name: 8a28a326d7f72ab94c7d089dbc047e719038b6cd410068dec0d173a7655c87ca
2018-09-06 16:17:22 +00:00
dan
1d85c6bf48 Ensure that the tbl_name column in the sqlite_temp_master table is updated
correctly as part of a RENAME TABLE operation.

FossilOrigin-Name: ffecfca511718e39e0003b380d5113755b8a11405a5bd80cc04503d9557f0842
2018-09-06 16:01:37 +00:00
drh
7894b8547d Add the randomshape.tcl test-case generator script to the util subdirectory
of the rtree extension.

FossilOrigin-Name: 8f48991dcbb01e21d065fbba7782a6d1aebaa8065841a70a76af1e5a21f18ea4
2018-09-06 14:01:56 +00:00
drh
a83a74c428 Fix excess memory usage in the JSON parser of GEOPOLY.
FossilOrigin-Name: 9057e27e12ded07a9ea0b2868036d3019f7bc5be3a67e3d341f56b762d3de9d9
2018-09-06 11:14:17 +00:00
drh
9a09b7b31d Fix a problem with geopoly trying to update both the _shape and an auxiliary
column in the same UPDATE statement.

FossilOrigin-Name: 14c955152d0580abc3df1b363789f2925e013b9c957e550b1e6ebe83a82bae6c
2018-09-06 02:40:15 +00:00
dan
19950d5bfb Merge latest trunk changes into this branch.
FossilOrigin-Name: 6f4f707f9c3c29f2437962fd5d7761876cf8e7ed7fdcb9d0ca4fd001fa226597
2018-09-05 17:52:52 +00:00
dan
5921f2b9e7 Fix some test script errors. And an incorrect assert() in fts5.
FossilOrigin-Name: f804336f083d8d26314bb1ba34cec427675065a67cbe2bf00bb42e40752aeb33
2018-09-05 17:45:17 +00:00
drh
b78d1905c3 Remove an old testcase() macro that is no longer valid.
FossilOrigin-Name: e628713338f6e584a32d5fc3436ddbd9ee8cf88401c321c1ebe7daa1e695c623
2018-09-05 16:16:56 +00:00
dan
8900a48b92 Avoid comparing pointer values after the object that they point to has been
deleted.

FossilOrigin-Name: 2ec7e50cbc0e7a4308d51be3c9416229b187a6a8abdd982c154edc256cd6da1f
2018-09-05 14:36:05 +00:00
dan
dd1a9c8c25 Fix minor code issues in alter.c.
FossilOrigin-Name: 18ba35b86f3b9813179b5f8d74e59e4860bfb800f45aabab8d6c0a6d7c97fe74
2018-09-05 08:28:30 +00:00
dan
4af4212fef Merge latest trunk changes into this branch.
FossilOrigin-Name: ef9e088290efa9d0fc36bcdef710cadfef37c8a33f4685dad4ce113807e1cc75
2018-09-04 18:23:59 +00:00
dan
65372fa963 Improve the error messages emitted by RENAME TABLE.
FossilOrigin-Name: 6805b5900df5e6d3329cbad2660875ebe4069efe37b19575f527d153dc0882a1
2018-09-03 20:05:15 +00:00
dan
366607865b Ensure that FTS5 queries of the form "WHERE rowid BETWEEN ? AND ? AND tbl
MATCH ? ORDER BY rank" do rowid filtering before sorting.

FossilOrigin-Name: f1138a38bd23f201a35621a71e82c5718abddb42ab82938e9516ab9d43e4df16
2018-09-03 17:11:11 +00:00
dan
143df55d24 Add another test case to altertab.test.
FossilOrigin-Name: 828e8849faed85812c03215b00a2ba34cbb00dfa4d4afdcbd11300ba7fcf9743
2018-09-01 20:38:42 +00:00
dan
b87a9a8a5e Fix a problem with renaming a column in a table that has a temp trigger that
references another attached database.

FossilOrigin-Name: 336b8a0923bf65b7a2c35811cb6dec0e262a0b31e534d2a6ab093d2afdb05c1f
2018-09-01 20:23:28 +00:00
drh
5b1da309f7 Fixes for harmless compiler warnings.
FossilOrigin-Name: 41b8f38b97bf0d1abcd6de8e940269fc4c51e2bbcf7b2e53e0c8440c58187c33
2018-09-01 20:02:07 +00:00
drh
c753c216c6 Fix some harmless compiler warnings and improve defenses against OOM errors.
FossilOrigin-Name: 2e2cf992f5d6cae2030c3c03b0eb98af3b130e86a719b991e41380138751f615
2018-09-01 16:55:36 +00:00
dan
ffc7e91f4f Merge alter-table-rename-table back into this branch.
FossilOrigin-Name: ad704a7c86c9ee51c1eb696007660cb9044bba6a8c588a33a8bd66613c231421
2018-09-01 16:13:41 +00:00
dan
0923650365 Have "ALTER TABLE ADD COLUMN" reload the entire db schema, as "RENAME COLUMN"
and "RENAME TABLE" do.

FossilOrigin-Name: 8d89ddc1a628e983b0fbd929c9c9daac86ee23d18f8dd2709c971012389395c6
2018-09-01 16:05:50 +00:00
drh
010f8ee2fb Merge fixes from the alter-table-rename-column branch that occurred after
this branch separated from that one.

FossilOrigin-Name: 22e785aa2bbce4ae0852bc3d127d4b12222a192eb6e3ee874bf8e5c8582d05f3
2018-09-01 15:55:44 +00:00
drh
c840b428fc Merge fixes and enhancements from trunk.
FossilOrigin-Name: 589186c083ff3af8d5a6d5ad34e1cefea57806ebf3831ea3bf5a48ef1e173140
2018-09-01 15:49:13 +00:00
dan
6ae2454a67 Update test script snapshot_fault.test to account for the new
sqlite3_snapshot_open() error code.

FossilOrigin-Name: c1aca7673ab04740bc8ad76af0a72a229c79a0cd51cf84d1c689a77424ff17c6
2018-09-01 06:13:07 +00:00
drh
28d46eed3f New hyperlink on the README.md file.
FossilOrigin-Name: c663961e34ec03ef76aabc9741f37d19544826e3e0b5931711313fc088e9e62c
2018-08-31 23:22:40 +00:00
dan
8d4b7a3fa8 If a call to sqlite3_snapshot_open() fails because the requested snapshot no
longer exists, return SQLITE_ERROR_SNAPSHOT instead of SQLITE_BUSY_SNAPSHOT.

FossilOrigin-Name: e07923128bb164efbafde29d49175b61f2ef44b2dfac5ae4ed61937945dfcf4c
2018-08-31 19:00:16 +00:00
dan
141e119a17 Ensure b-tree mutexes are always held when sqlite3FindTable() is called. Do
not invoke the authorizer callback when parsing schema items as part of ALTER
TABLE commands. Fix test script issues.

FossilOrigin-Name: eac2aa7dce577f1998cc2078dd8ac384070f8acf1ceb565999a5cf719092024e
2018-08-31 18:23:53 +00:00
drh
876c7ea3fa Try to identify the places in WAL code where thread-safety depends on the
underlying architecture supporting atomic load and store of aligned 32-bit
values.

FossilOrigin-Name: 47d44be4a68d377d0049a12b2587dbbcc0870b469473e1098f7c0358fe8c7532
2018-08-30 20:28:18 +00:00
dan
9d324823a8 Test the schema after renaming a table. Ensure that temp database triggers and
views are updated when renaming a column.

FossilOrigin-Name: f3c27d916d4837f8fc3dd812bd004535f04c7a53bd2a0a2419613275f48bec76
2018-08-30 20:03:44 +00:00
drh
ed9272159e Give the debugging routine print_pager_stats() external linkage in order to
suppress harmless compiler and TSAN warnings.

FossilOrigin-Name: ff4dc08298ab3988e69fe60802657791f65d2af15f4b1cbd1d02649bc597d0d6
2018-08-30 18:53:09 +00:00
dan
0ccda96867 Fix an ALTER TABLE problem with processing temp schema views and triggers.
FossilOrigin-Name: 72cfb1be29971d91a164f1d4f20cb054de68960a0bd547630bcd1160565971c5
2018-08-30 16:26:48 +00:00
drh
e35fc302c3 Improved JSON parser caching.
FossilOrigin-Name: 58078c0d2647a194279fa80e032670441b296ffc3acee692901faa5beca460b7
2018-08-30 01:52:10 +00:00
drh
9c1d7c6d4c Additional test cases for geopoly.
FossilOrigin-Name: 19b5eb45e090c4b7169a52d881495ee2eafc59f80e3db2288fc1814ba76134ac
2018-08-29 21:01:22 +00:00
dan
c9461ecc28 Extend RENAME TABLE to edit triggers and views. Still buggy.
FossilOrigin-Name: 01308bae3acf33f78b5bb90892085eab340df093aafc17e6ccf6a7d6cf324897
2018-08-29 21:00:16 +00:00
drh
17f19eadb8 Fixes to the UPDATE logic in Geopoly.
FossilOrigin-Name: 7c3cee0a2a5ccacff27400c38bd708f7b9b968eb013a8fa685d876dfe85e12a6
2018-08-29 20:52:40 +00:00
drh
9d67afc421 Also free up the MEM_RowSet bit in the Mem.flags field and have RowSet objects
be destroyed using Mem.xDel.  This change results in faster code.

FossilOrigin-Name: f48e9feb3fca514e4e586932e6d19a5e34a384204effeba553006dcddf5f13d2
2018-08-29 20:24:03 +00:00
drh
72f56ef95d Free up the MEM_Frame bit in Mem.flags object. Store VdbeFrame objects
as MEM_Blob with a special Mem.xDel pointer instead.

FossilOrigin-Name: 62db5fd47660bbc4fcf2c6d4a6c5a3077f12c6442a128d22b66b789a0409ef32
2018-08-29 18:47:22 +00:00
drh
c0d2117f1c Add the geopoly_group_bbox() aggregate function to the Geopoly module.
FossilOrigin-Name: 2d4debccbc027405a33aeb10f9d65f6fe4bfb5eb1be5a4d8b82158caba04643f
2018-08-29 15:50:47 +00:00
drh
8ab114c6a9 Disable the server1.test script on old PPC Macs due to problems in the
pthreads implementation on those archaic machines.

FossilOrigin-Name: 43efdd8c7e468405c9d4956a8caa66548059499289cbcc091628de7b055268cd
2018-08-28 21:12:02 +00:00
drh
58726ca4b9 Stricter enforcement of the JSON and GeoJSON standards in the Geopoly extension.
FossilOrigin-Name: c0bf3ff3af4d34ef7801c16e39128e894b00699313f4915f57aa73b57642f7fd
2018-08-28 19:23:41 +00:00
drh
79931a1517 Fix new issues in the geopoly module discovered by TH3.
FossilOrigin-Name: 22fff9afc2fb20906173f258aa8feae9b52acc69a0ca7baf4e914d29c4279a23
2018-08-28 15:51:10 +00:00
dan
f5778751f7 Fix a problem causing spurious SQLITE_CORRUPT errors when using the snapshot
API to read from old database snapshots.

FossilOrigin-Name: 535155be584ad8c1836e6b1c62de836d9872056d39608c995221c928cb5b365d
2018-08-28 11:23:52 +00:00
drh
5965fed24e Add support for the Geopoly extension to the R-Tree extension. This also
involves adding the SQLITE_INDEX_CONSTRAINT_FUNCTION capability to the 
xFindFunction method of the sqlite3_module object, and to the
sqlite3_index_info.aConstraint.op field in the xBestIndex implementation of
virtual tables.

FossilOrigin-Name: 666133e32ca8e95807f8437dc8401bc93e2e6508ab8e6ae1e6031b7cee1584ae
2018-08-27 17:13:12 +00:00
drh
74e0aaece1 Minor changes to the visual01.txt test script.
FossilOrigin-Name: 4bc28eed32154be0e62fe69acd30f828c2e6f59c6579618ecad8ecf632a90517
2018-08-27 17:05:59 +00:00
drh
b2a18c95f0 Split the three-argument version of geopoly_within() off into a separate
function named geopoly_contains_point().

FossilOrigin-Name: 5a0e1541037b5bbc1b4bf26a7da304c9b32ea72960aca8b9309cf2180757c8a4
2018-08-27 15:55:37 +00:00
drh
e6474b77b8 Enhance the geopoly virtual table so that it does a better job of optimizing
geopoly_within() queries.

FossilOrigin-Name: 1f717385340f295064a7649cfc36ad048573cbacb6faa20f5c6067328c40c745
2018-08-25 23:03:27 +00:00
drh
27d62540e5 Provide the two-argument geopoly_within(P1,P2) routine that determines if
polygon P2 is contained within polygon P1.  Make this function available to
the query planner for optimized rtree lookups.  Update the visual01.txt
script to verify that the new functionality actually works.

FossilOrigin-Name: 6eb5d09b7f9d9bf8edbf993dccc2e2f702b95ba96cf68445609feb0ccc3ac0f7
2018-08-25 19:51:49 +00:00
drh
95327f539b Fix a harmless compiler warning.
FossilOrigin-Name: d49be9838d237b57ba1f12ed00e2d3411314ee1b9c30ef7bbaf65aca20d0870e
2018-08-25 18:57:12 +00:00
drh
050398bdf1 Fix a minor issue in the altercol.test script so that it runs on Windows.
FossilOrigin-Name: 62089c6daf9ea51be769c077c23d6fa881ba797255fa22d71baaac191a9c1ba7
2018-08-25 16:22:33 +00:00
drh
0d019b9243 Invoke the authorizer for ALTER TABLE RENAME COLUMN.
FossilOrigin-Name: fc293bcb3402f049fb9e22aacfb4fdcd13f8609edf29c97d6cb95ce351363873
2018-08-25 16:14:46 +00:00
drh
3a843f525c Remove an unnecessary IN_RENAME_COLUMN macro from resolve.c.
FossilOrigin-Name: 5858c0bde7c210f07cfa72cee95325847b26733abab4f56301b57cd816931e97
2018-08-25 03:29:34 +00:00
drh
da76adc085 The implementation of sqlite_rename_column() must be holding the
schema mutexes.

FossilOrigin-Name: f0eed21d4e2e1f2c8e680a510a283ac21156c9766efec5b80a362a040424bce7
2018-08-25 02:04:05 +00:00
dan
aa42e9816b Fix a problem by renaming a column when the schema contains an trigger program
featuring an UPSERT that uses an "excluded.*" reference to a different table.

FossilOrigin-Name: 83d5f5abce6be2f6d342a6fc68839289400d7bcb80eaa38194789142c93a80c3
2018-08-24 20:20:33 +00:00
dan
85a9d508df Fix a problem with renaming a column that occurs as an "excluded.colname"
construction in an UPSERT that is part of a trigger program.

FossilOrigin-Name: bb2f7234968157b605522dea8e115d8772ab4234147894089d6e48fedf5d6a5d
2018-08-24 20:10:22 +00:00
mistachkin
88edc6c72a Set SQLITE_PTRSIZE to 4 when compiling with xlc on 32-bit AIX.
FossilOrigin-Name: d158e5b12eec5b81d54c8f5902a972795423947a21d0212b6cceb2810aa6cc5c
2018-08-24 19:04:08 +00:00
dan
0d5fa6b979 After modifying and reparsing the schema as part of an ALTER TABLE RENAME
COLUMN, check that no new schema errors have been introduced (e.g. ambiguous
column names in views) before committing the operation.

FossilOrigin-Name: a0e06d2c5e3abb3f300491e7651bb177a436899efd4506de9239359096b6a9e7
2018-08-24 17:55:49 +00:00
dan
1b0c5de434 Avoid incorrectly replacing tokens that refer to a column being renamed via an
alias. For example, do not overwrite "xyz" when "a" is renamed in "CREATE VIEW
v1 AS SELECT a AS xyz FROM tbl WHERE xyz=1"

FossilOrigin-Name: ad072a835f97ff418f5919d94f547ce8afb4fc7c7b590deba41f1e62136a79ac
2018-08-24 16:04:26 +00:00
drh
355f2e02e9 Add the "atrc" test program to the Makefiles. Fix a typo in the instructions
in the header comment of the atrc program.

FossilOrigin-Name: 2130a407ddd8cdf3d29b109d773686c84906d9dc1663376e94e191086d524c9e
2018-08-23 20:09:19 +00:00
drh
79a5ee93c7 Fix harmless compiler warnings in the ALTER TABLE logic. Rephrase an
error message to use active voice.

FossilOrigin-Name: a7dae59a7e7b187fa2e9457bbb4b01cfe3d48bbdf59c3f8f7b4156bcde3bda98
2018-08-23 19:32:04 +00:00
drh
ba3a4072b4 Automatically detect when compiling for AArch64 on windows and set
SQLITE_BYTEORDER to little-endian to avoid compile-time testing.

FossilOrigin-Name: ef6729be85ed106212ed23a024d83b85b709207cf287436c0603a21c659f36ad
2018-08-23 18:56:33 +00:00
drh
d3130dab92 The Expr.iColumn field must also be initialized in tokenExpr().
FossilOrigin-Name: 772985f18b2ab8fa04a0c29593fc6d9b74c1361260cb59e566606dd56f326535
2018-08-23 18:50:19 +00:00
drh
4fe759b2cc Make sure the Expr.iTable field is initialized by tokenExpr().
FossilOrigin-Name: 02a05a3b3c6440432fc15daa14678a6eba40759e17e43ae8d63d19a0842de56a
2018-08-23 18:22:00 +00:00
drh
a961d3a198 Merge enhancements from trunk.
FossilOrigin-Name: c446c8841192054c97ba5003fb6185b135a687b36c10fe0986e627282955520a
2018-08-23 14:54:45 +00:00
dan
79e9d34764 Fix a test case that was failing for SQLITE_ENABLE_STAT4 builds.
FossilOrigin-Name: 1e29fd430dead641c5d92943ce81cf51b3df2f45c5a011bb2eed592efd62e056
2018-08-21 17:03:25 +00:00
dan
07e9523364 Rename internal function sqlite3RenameToken() to sqlite3RenameTokenMap() and
sqlite3MoveRenameToken() to sqlite3RenameTokenRemap().

FossilOrigin-Name: b9ae9a0a188b82d7066f6ef7d21592889df0a61559e9a0e01819e9d5a92c3f36
2018-08-21 16:32:53 +00:00
dan
0624939818 Rationalize some duplicated code in alter.c. Also improve error messages for
ALTER TABLE RENAME COLUMN in some cases.

FossilOrigin-Name: 5d2163c734aea8c0e1611af1161734bf141e7bd02c08f0b5f2e7bac3c7dfd2a5
2018-08-21 15:06:59 +00:00
drh
f396ecadcd Further attempts to reduce the number of false-positives genenerated by
static analysis tools.

FossilOrigin-Name: 38f9ce6503c4dd05ccdd73463b1784a6df7ed6e5018c29c5874a3681ca34ba54
2018-08-21 12:46:34 +00:00
drh
c4ceea72b7 Fix various harmless warnings generated by static analysis tools.
FossilOrigin-Name: a04a0ea9e30e0ef12bafa0b90b7d1b7764865768bb4a738b0c73a7a3ef9416db
2018-08-21 12:16:33 +00:00
dan
d145e5f46f Minor changes to function tokenExpr() in order to claw back cycles lost to the
rename-column change.

FossilOrigin-Name: 479976955ecb27c3e77a280187eaf23722178549e072b34f3183354a27a4e5c3
2018-08-21 08:29:48 +00:00
dan
b013738b4c Add further tests for RENAME COLUMN.
FossilOrigin-Name: 82c4c10a96db76f39edf5f6d027294d449d75b5a18da70da3667786da90e184d
2018-08-20 20:01:01 +00:00
dan
9d70557e80 Ensure that it is not possible to rename columns of system tables, views or
virtual tables.

FossilOrigin-Name: 786b5991dc0bb6ba13327a3ac9d04efbf8b591dedc736b719b206ffd865b1918
2018-08-20 16:16:05 +00:00
drh
38d9964a73 Additional fixes for harmless compiler warnings that are specific to this
branch.

FossilOrigin-Name: 9d8e73bf71e996b810959ffc0e60de69b5e8ca3301df52f9c35d5e9075921798
2018-08-18 18:27:18 +00:00
drh
2ee001ab39 Merge trunk fixes.
FossilOrigin-Name: ccad277927baa2c36d0b5a03832dc51d9a7f3071587f0da0f2c1b44885c82e8d
2018-08-18 18:14:02 +00:00
dan
c23f3cb15b Have ALTER TABLE RENAME COLUMN also edit trigger and view definitions.
FossilOrigin-Name: 7908e8a4a3b9577211a5d3da9c4142c46e9d5872be4a6499ec053f2b547019b8
2018-08-18 18:01:58 +00:00
dan
24fedb94c2 Improvements to error handling in ALTER TABLE RENAME COLUMN.
FossilOrigin-Name: 7fa1faeaff30b74b68ee6f4b363d837f21cf313d8262361c901bda884df139a2
2018-08-18 17:35:38 +00:00
mistachkin
ed5e7722b2 Fix harmless compiler warnings only seen with STAT4 enabled.
FossilOrigin-Name: 6f5e84bafcaf425cb664c7db8179c9c09a13c96aaf057551c04a919ca554d057
2018-08-17 21:14:28 +00:00
dan
499b825487 Allow an ALTER TABLE RENAME COLUMN to proceed even if the schema contains a
virtual table for which the module is unavailable.

FossilOrigin-Name: 7b72b2360a70eb1f788b3c4d745967dfedb2c80af6b2e146ba940a3741fd51a1
2018-08-17 18:08:28 +00:00
dan
dabc268f96 Ensure that CREATE VIEW, TRIGGER or INDEX statements can be edited by ALTER
TABLE RENAME COLUMN even if they use collation-sequences or
user-defined-functions that are not available.

FossilOrigin-Name: 540014efd6a048373313c6cd9413de10d5d7114daf537cf5999ccf3c5c3f9358
2018-08-17 17:18:16 +00:00
dan
0cbb0b11f1 Further progress on updating trigger programs as part of ALTER TABLE RENAME
COLUMN.

FossilOrigin-Name: 3f47222b6e20e1c1ef41c0f7391c8b5c7648e2a2d6013303d155ad59ce27143a
2018-08-16 19:49:16 +00:00
drh
3fcef1a3f9 Fix a harmless unused-variable compiler warning that only came up in certain
compile-time configurations.

FossilOrigin-Name: 456842924bb33c0af8af29402f06e5f25b6791f698a0d12a080258b20b0cfb61
2018-08-16 16:24:24 +00:00
drh
d8852095e0 Fix EXPLAIN QUERY PLAN so that it describes IN operators implemented using
a ROWID lookup.

FossilOrigin-Name: 60045fbf52162f15f2e18a4e392e80fab19bdbce242728b5e62b0894eac49dfd
2018-08-16 15:29:40 +00:00
dan
5be60c55e8 (no comment)
FossilOrigin-Name: e272dc2b1c0edab59a40f32c77c81a3e636937280524161eff5669cb0046ad84
2018-08-15 20:28:39 +00:00
dan
588032fe33 Allow sqlite3_snapshot_open() to be called to change the snapshot after a read
transaction is already open on database.

FossilOrigin-Name: 41399169954f9bef53c3fa89879f39823b80bd127f76cf60abbe24217878a571
2018-08-15 14:03:26 +00:00
dan
356afab163 Fix a problem when renaming an IPK column that is also part of a child key.
FossilOrigin-Name: 6e6a2bfdbbfd4ffc14be88962ff97bf3c626fef9d1a337715d2a4be1a657fb0d
2018-08-14 21:05:35 +00:00
dan
f62e8937ac Fix a problem when renaming an IPK column that is also part of a child key.
FossilOrigin-Name: ad15486022209205c65fb5ffdbe30a7b99379170451e6aff4bab6e90b549d6c7
2018-08-14 21:03:38 +00:00
dan
72238130d0 Merge latest trunk and ALTER TABLE error message improvements into this
branch.

FossilOrigin-Name: 7a45802dafaed3c058f59d1487fe8091e1f309cc5f0a5bcf2579f0bdd8e92d89
2018-08-14 20:40:25 +00:00
drh
af4023de22 Do not allow ALTER TABLE RENAME COLUMN on a virtual table.
FossilOrigin-Name: f6d6b472713c21deace3fd52c0b0b6901d758af043c238f004fabe52b01f730c
2018-08-14 20:38:18 +00:00
dan
987db767d2 Have ALTER TABLE RENAME edit column references in CREATE VIEW statements.
FossilOrigin-Name: db829dc1a2d7afa49798a2fd32d1f070185b23e513416e65d8144fda24f23b50
2018-08-14 20:18:50 +00:00
drh
1595abcda6 Improved error messages when an ALTER TABLE RENAME COLUMN fails due to a
duplicate column name.

FossilOrigin-Name: 37d11b8e8224a8b241ff57b9c4b9499db39dde4ddcb56ff8b03a3d08091a4c11
2018-08-14 19:27:51 +00:00
drh
5550b5eee7 Merge fixes and enhancements from trunk.
FossilOrigin-Name: dff0314b7e7ef2d04375ff21fbf89039bf5f64a9cdca53d7bc7120faacd92c06
2018-08-14 18:12:33 +00:00
dan
689b9d269c Fix ALTER TABLE RENAME COLUMN in cases where the column being renamed is an
IPK declared with a separate PRIMARY KEY clause - "CREATE TABLE x(y INTEGER,
PRIMARY KEY(y))".

FossilOrigin-Name: 32ca8418df8735a6c53e53153f733579e514711f091e4e09ecce83db85fe4d85
2018-08-14 16:18:19 +00:00
drh
8430450674 Fix UPSERT so that it checks the target-constraint first and fires the
DO UPDATE if that constraint is violated regardless of whether or not
other constraints are in violation.  This aligns SQLite behavior with
what PostgreSQL does. Fix for ticket [908f001483982c43cdb476dfb590a1a].

FossilOrigin-Name: 529fb55e3d00472f13446117527b0896827b11e870b581af7fe7cbb7392ef3cd
2018-08-14 15:12:52 +00:00
drh
ef52b36a6b Stop requiring the global VFS mutex to access the unixInodeInfo.pUnused field.
The unixInodeInfo mutex is sufficient.

FossilOrigin-Name: e3ea43dabf099dc2954c23d348638e7b2a8b9122d2994154bc649a2c09260c46
2018-08-13 22:50:34 +00:00
drh
095908e1c7 Take extra precautions to ensure access to unixInodeInfo.pUnused is protected
by all necessary mutexes.

FossilOrigin-Name: 8b1e0010b9e0b548a90087f4d25843d2b40f7e9551722ac587fa925d37b510c2
2018-08-13 20:46:18 +00:00
dan
5496d6a25a Edit the WHEN and UPDATE OF clauses of trigger programs as part of ALTER TABLE
RENAME COLUMN.

FossilOrigin-Name: 5fdb6b0aafba727139e1937ef5950e4434a77f95a10fc46f8010ca2de3922326
2018-08-13 17:14:26 +00:00
drh
0a1cc223bd Make the sqlite_rename_column() SQL function resistant to problems caused
by OOMs and/or malformed parameters submitted by hostile application code.
Also add additional comments to the RENAME COLUMN logic.

FossilOrigin-Name: 87743ddef11749b4017d60abc297abfd673e02a26a2ae45ffec861327578aa30
2018-08-13 17:02:26 +00:00
drh
4a2c747c4c Fix legacy comments on Token. Begin commenting the new ALTER TABLE RENAME
COLUMN code.  Fix a memory leak in the sqlite_rename_column() SQL function.

FossilOrigin-Name: 32edc8920376aabb84ebe1900eaa9512d23f1b44d6459e4916dc6b07db66e27c
2018-08-13 15:09:48 +00:00
drh
5fc22cdfde Fix issues with ALTER TABLE RENAME COLUMN associated with OOM errors.
FossilOrigin-Name: 0b28dd5c2e4908d5e49eaedd359492e46de8af3bf84120f4683b3ea906882fbf
2018-08-13 13:43:11 +00:00
drh
3e2c842e46 Fix an incorrect comment on the unix-nolock VFS object. No functional
code changes.

FossilOrigin-Name: 90f7c193b42f0d8120a8e429bdea5e1cec5d3f45b901db8fc5a5c2ca3e69cba8
2018-08-13 11:32:07 +00:00
drh
3a9a76b70a Add the "atrc" test program. "Atrc" is short for "ALTER TABLE RENAME COLUMN".
See the header comment on the program itself for further information.

FossilOrigin-Name: ed64a55a2242408ac0b889b330cf91d38a954399b75c6ebe71232613b864c70b
2018-08-11 20:46:54 +00:00
dan
404c3ba0d6 If the new column name in an ALTER TABLE RENAME COLUMN statement is quoted,
then also use quotes for the column name in the edited SQL statements.

FossilOrigin-Name: ca5184a25f9150540a3e401ef67df0606efa7a294d70e3fa5edad9854003eb36
2018-08-11 20:38:33 +00:00
dan
b0c7920d86 Avoid an assert() sometimes triggered by ALTER TABLE RENAME COLUMN in non-debug builds.
FossilOrigin-Name: 520c1c75dae5e3f4695fcdf0aad5fb9f492f0e528b5fbb49d5d3b5fc02762f47
2018-08-11 18:34:25 +00:00
dan
a8762ae27c Fix a bug causing ALTER TABLE RENAME COLUMN to fail when renaming an IPK
column that is used in a CHECK constraint.

FossilOrigin-Name: 6595c8811f13719d0aed8041abc7e1cade41c57427bcbf3503e2e42408eaa03b
2018-08-11 17:49:23 +00:00
dan
872165f260 Fix a bug causing all ALTER TABLE RENAME COLUMN commands to fail if ANALYZE
had been run on the database. Also prevent the user from renaming the columns
of system tables.

FossilOrigin-Name: ca644a2877c26561f8fb3b3feb74a070cd46621acb105577f04bc936c9b72a95
2018-08-11 17:34:38 +00:00
dan
e325ffed04 Reload the entire schema after renaming a column in order to ensure that the
schema for any tables for which parent key definitions were changed are
reloaded.

FossilOrigin-Name: f4497b0136e9fcb1121a834c86f84eeaf8f1e7d3157d409484e086bcef3487f1
2018-08-11 13:40:20 +00:00
dan
5da06d3d7e Ensure the schema cookie is changed when a column is renamed.
FossilOrigin-Name: 2dec9ea4ab1779d00bb22add0aa9a8536661d8abc9f4c2fb8628e04d4cd84326
2018-08-10 20:19:34 +00:00
drh
ad866a1e00 Fix harmless compiler warnings.
FossilOrigin-Name: 9564d7008c3fd804401a5da6ea342c6f4261db14e9f994d1a38883358a7c6f8c
2018-08-10 19:33:09 +00:00
dan
6fe7f23fa9 When a column is renamed, update any references to it in REFERENCES clauses
that belong to other tables.

FossilOrigin-Name: 191079bd4f774528a1e39b71b4a4ce7859dee0edf0ce72e4b6968ae889dc35c8
2018-08-10 19:19:33 +00:00
dan
7364fb1d04 Merge latest trunk changes with this branch.
FossilOrigin-Name: c355a8370782aa70f155ee956fa0faec7f45d7c483c442b169b63c5f0a988fd3
2018-08-10 15:27:55 +00:00
dan
e9a2fa3182 Fix a problem with renaming columns on tables with REFERENCES clauses that
specify a large number of columns.

FossilOrigin-Name: d48f7bbdf4a1686c25e634a8dec6ead88bf2866fee94ed8e5058f830363424a8
2018-08-10 14:23:41 +00:00
drh
ad9f515f52 Fix the isLikeOrGlob() routine in the WHERE clause processing logic so that
it avoids signed/unsigned character comparisons, as that can lead to an
incorrect answer if the ESCAPE clause is an invalid UTF8 string.  Problem
found by OSSFuzz.

FossilOrigin-Name: 4195a3f8b5d2c2ec63771890c5aa7b5e2de60b9fa2273652730239b8577ae418
2018-08-09 21:45:45 +00:00
dan
cf8f289542 Experimental implementation of ALTER TABLE ... RENAME COLUMN. Still buggy.
FossilOrigin-Name: fa0fc01eb48a864f0a3d43f9b805d5ed2e530846ee0c34fcbc2eabd9e5696277
2018-08-09 20:47:01 +00:00
drh
d98f53249c When a column must be a constant due to WHERE clause and the value of that
column is being coded as a constant, make sure the affinity is correct.

FossilOrigin-Name: 7404ea83168e6c739ebe8fc5d65bbf0265432ccb35b3418bb0381d74362f7527
2018-08-09 18:36:54 +00:00
mistachkin
6389a7b0ac Minor style improvements.
FossilOrigin-Name: 60bbca2b9a591800cd8e7b374e62d75b1df0e8fd2d2f71f9b4d5fd044da78be0
2018-08-08 20:46:35 +00:00
dan
fa3d4c19a9 Allow sqlite3_snapshot_open() to be called to change the snapshot after a
read transaction is already open on database.

FossilOrigin-Name: 051ac0152048ef52723196c26ca5f2629dafb782aec1c66fc30531bf54335043
2018-08-06 17:12:36 +00:00
drh
f018fd5284 Enhance the edit() function so that it converts text from \r\n back into \n
only if the original unedited copy contained no \r\n values.

FossilOrigin-Name: 20c995d3f0f4de5410962172cb59da0f25edf0c62e199420186cc59ea874e981
2018-08-06 02:08:53 +00:00
drh
5180d683a0 Add the --info option to the fuzzcheck test utility.
FossilOrigin-Name: 1caaaaa70f21fe71fbe0af227eea8d1367870e2575eedf248cc2a0b515783390
2018-08-06 01:39:31 +00:00
drh
24846bc0bf Fix an overzealous assert() statement discovered by OSSFuzz.
FossilOrigin-Name: d9c9fe9f5ad3fc9123ad29ebafcb7f40dcecd448fb7a928bb31bea8181d81ec1
2018-08-06 01:21:53 +00:00
drh
dda7e66d7d Remove the column-cache from the code generator. The column-cache has been
a persistent source of bugs for years and with recent improvements
in the performance of OP_Column, it no longer provides a benefit.  After
the column cache is removed, the binary is almost 2KB smaller and the
speed-check.sh performance test is over 3 million cycles faster.

FossilOrigin-Name: cdff3af7bedc5ebea04bd9b5e2112d3db451a475c18c9a9ebd45f6f3a89a43cb
2018-08-04 20:30:55 +00:00
drh
cfdeeeb966 Remove a testcase() that is no longer reachable without the column cache.
Provide an assert() to help prove that the testcase is no longer reachable.

FossilOrigin-Name: a500893b6f64aced197cd32b79d51a481629a39d45dbcf0f02d65e5451ac4706
2018-08-04 20:12:10 +00:00
drh
36a5d88dde Fix comments that were made obsolete by the removal of the column cache.
FossilOrigin-Name: 2041231d56c7b02b785015ef4d1af260d61326eab1b2a304c17faa3e33f76441
2018-08-04 17:15:56 +00:00
drh
c6ed275fcb Remove more column-cache residue: The OP_SetColTab and OP_VerifyColTab
opcodes and the associated SQLITE_DEBUG_COLUMNCACHE logic.

FossilOrigin-Name: 80236e81cefdf3d3cda3dbdb6de1575c38e4e248cc4b72ca9ee96d3aa0464bfd
2018-08-04 16:54:53 +00:00
drh
8c60719132 Further logic simplifications that flow out of the omission of the column cache.
FossilOrigin-Name: 7d9072b027cc28dd8ecf5e2686d821017997445c15124eebe2839984622af4db
2018-08-04 15:53:55 +00:00
drh
bb9c45b49a Add test cases for the constant expression fix of the previous check-in.
FossilOrigin-Name: 95db5bd9fea86a10c9528dd24841e1370dfdc0bbb5c98b7cbd808a8bc59dd48f
2018-08-04 15:28:12 +00:00
drh
b8b0669065 Ensure that all expressions that are to be evaluated once at the start of
a prepared statement (the Parse.pConstExpr expressions) pass the
sqlite3ExprIsConstantNotJoin() test. It is not sufficient to pass just the
sqlite3ExprIsConstant() test as that would allow through column references
that are bound to constants by the WHERE clause in the constant propagation
optimization.  This fixes a problem discovered by OSSFuzz.

FossilOrigin-Name: 8bc7f84c39f913b0b0f5e9f5fd9d7dd8bda8422248c069712b6992c32c759a83
2018-08-04 15:16:20 +00:00
drh
38ee2d9197 Remove additional traces of the column cache.
FossilOrigin-Name: db6052e9725368736abd19f14f97376582d35d07f543046d39991d767ed29851
2018-08-04 14:30:21 +00:00
drh
02ceed058a Completely remove the column cache logic, which has been a persistent source
of bugs for many years.  We recent enhancements to the performance of the
OP_Column opcode, the removing the column cache actually makes speed-check.sh
run faster.  It also saves about 1,800 bytes of code space.

FossilOrigin-Name: 3f5f60cd7529330209027fdae8129cca420cec1050eae50a7750d0b715b56972
2018-08-03 23:04:16 +00:00
dan
a4b5fb55f3 Fix the handling of sub-queries with LIMIT clauses by the optimization
activated by compile-time symbol SQLITE_COUNTOFVIEW_OPTIMIZATION.

FossilOrigin-Name: 21235d9a41567897418aa12f7bd6dd8d6ee363147527e1d8fbca14fc83e0f2c9
2018-08-03 20:19:52 +00:00
drh
e4fe6d4e62 Fix the OP_SeekRowid opcode so that it has no type-change side-effects on the
key register in P3.  This fixes an obcure problem that arises when doing
equi-joins between a table with a TEXT column against another table with
an INTEGER PRIMARY KEY.  The original problem was discovered when OSSFuzz
created such a query and hit an assert() in OP_VerifyTabCol that was
specifically designed to catch these kinds of errors at run-time.

FossilOrigin-Name: fa94b49e02eb6b8fc4acc220ecc2fabef546c65845696758b25965c26b251ea9
2018-08-03 15:58:07 +00:00
drh
5eae974c48 Improve "PRAGMA vdbe_trace=ON" to always show the key values for the
OP_IdxGT and related opcodes.

FossilOrigin-Name: 0f881955ed173c7c35dfca2d4aeca855858e40bb951e6fb6fedd9a2fff6a5a86
2018-08-03 13:56:26 +00:00
drh
884406b42c In the command-line shell, always exit if realloc() fails.
FossilOrigin-Name: e390023c8e70961661fd9e29674dedacd1b941b6b8d9cd88f8cfa8f787f030f9
2018-07-29 18:56:35 +00:00
drh
f559ed3400 Add a small cost penalty to sorting to bias the query planner in favor of
plans that do not require a final sorting pass.

FossilOrigin-Name: 85b9beb4605eb0cfe2ed063c2a1925186c9e37031f78c875e60a347cce891638
2018-07-28 21:01:55 +00:00
drh
07aded63f4 Do not allow a column reference that is converted into a constant by the
WHERE-clause constant propagation optimization to be moved to the init-time
constant expression list, as the table reference will not work there.
This fixes a problem found by OSSFuzz.

FossilOrigin-Name: d30b2a947313b146f29e2b53f0fd471409fda7938151241d3fb5863614f88999
2018-07-28 16:24:08 +00:00
drh
1fd4e7bb0c Fix an assert() statement that was made obsolete by the constant
propagation enhancement.  Problem discovered by OSSFuzz.

FossilOrigin-Name: e4b4737e348235e196a45e1b71876b82e0cc836e1c5c16ea5f9333b7509b59b8
2018-07-28 14:56:56 +00:00
drh
d2a4401c8a Improved debugging output when the ".selecttrace" option is used in the shell.
FossilOrigin-Name: fcb88dd6b0f248f600c1158907889f6d5fa2c96eb4585221941da4673c6db6eb
2018-07-28 14:34:22 +00:00
drh
954733b386 Improvements to the parser to increase coverage. Fix the parser so that
at least one expresssion is required after PARTITION BY and within the
list of expressions on VALUES().

FossilOrigin-Name: 02204f8b246c868846f39bd44f2e3bc0fab0275aa09ef3a0e5a8e3d58f484ca8
2018-07-27 23:33:16 +00:00
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