Commit Graph

21099 Commits

Author SHA1 Message Date
drh
f5f1915d59 Changes to the INSERT logic to make it simpler and faster and so that
it works with generated columns and BEFORE triggers.

FossilOrigin-Name: bc368cb090376d33d3844e3689c4f6bd19eed758e39b878ee67fef93b1c839ea
2019-10-21 01:04:11 +00:00
drh
dd6cc9b52a Work toward getting generated columns to work with triggers. Still more
work to do in this area.

FossilOrigin-Name: 932a37275d7e932f8237d32c8fc6087ed8cd342fe01ef2f7a43c7237ab84c9ac
2019-10-19 18:47:27 +00:00
drh
c5f808d85e Add testcase macros.
FossilOrigin-Name: fb9c9bb284d441bd7aa34c87b6fd8ce57d036c17623d82354154fc6286bdd134
2019-10-19 15:01:52 +00:00
drh
b9bcf7ca60 Refactor names of column index transformation functions, for clarity.
Get generated columns working with ALTER TABLE RENAME COLUMN.

FossilOrigin-Name: 27ab41c9102e7801ff829488fc123a8040da008bef373d6704efbe2f93e1da90
2019-10-19 13:29:10 +00:00
drh
f95909c764 Fixes for WITHOUT ROWID tables with VIRTUAL columns and an INTEGER PRIMARY KEY.
FossilOrigin-Name: 86074da0fd2949e231898ef0bc672d90fd89cefa49fb0eb50ff398fbdd91d1ad
2019-10-18 18:33:25 +00:00
drh
4102deb962 Merge trunk enhancements into the generated-columns branch.
FossilOrigin-Name: 85bc4524d76999080faa4474e8880d2b6a2ac3a7f6a76239af4de1a42f8138c8
2019-10-18 17:47:47 +00:00
drh
8e10d74b21 Get generated columns working for WITHOUT ROWID tables.
FossilOrigin-Name: 9f409649ec4282a47f0a8b079b419f1922e0c24779b297f477ced168d5b7910d
2019-10-18 17:42:47 +00:00
drh
491c5bea7a Enhance the ".imposter" command in the CLI so that the first argument
can be an existing WITHOUT ROWID table instead of an index.  The resulting
imposter is the same table, but with columns in storage order and with
all constraints removed.

FossilOrigin-Name: 9dc0d34586eebf6705d9bd81494c417ac76707b8625d1ff99eda18b4ca2d8a50
2019-10-18 15:58:50 +00:00
drh
6df9c4b990 Claw back some performance from the sqlite3ExprGetColumnOfTable() routine.
FossilOrigin-Name: e8426acb94179ff49549aced6ea3c26c49ba4761c2f414fa1772d6a031edc79d
2019-10-18 12:52:08 +00:00
drh
01ef55e0f5 Fix sqlite3ColumnOfIndex() to account for virtual columns.
FossilOrigin-Name: 447271123e3b467d9271a4c0cf27f47af2f865c9298b8c355d9e766411a1f422
2019-10-18 12:14:48 +00:00
drh
463e76ff8f Get indexes working on virtual columns.
FossilOrigin-Name: 450c48766c8e62653d074c95f69b0576de3880d183a1d1e5992d88b6fce6cc39
2019-10-18 10:05:06 +00:00
drh
9942ef0d95 STORED columns can now reference other STORED columns, in any order, as long
as there are not loops.

FossilOrigin-Name: 0d236698e64b2a4b46f91a25279c406e0bf392fe66116678456f0a034c11d7b4
2019-10-18 02:19:18 +00:00
drh
0b0b3a95d0 In the Table object, change the nVCol field to nNVCol - the number of
non-virtual columns, as that is the quantity that we need most.

FossilOrigin-Name: 4ad66af04a654d92711d2d056ce8f35cd21eac4b99fb8d78be1a314620b6d29e
2019-10-17 18:35:57 +00:00
drh
d4cd292c2a Bug fix with INSERT using an explicit column list on a table with
a non-final STORED column.

FossilOrigin-Name: 61b4459ae6a6cc182c11abbc8b1dd629f77beb088d7ccad5e563d8d4769056df
2019-10-17 18:07:22 +00:00
drh
c143114460 Some (but not all) INSERT and UPDATE statements now work for STORED columns.
FossilOrigin-Name: fe7517bf4d360597576ab9aba29627d7926d23f2bbbfb3e7bf4d32761617574c
2019-10-17 17:54:05 +00:00
drh
ae3977a8f3 Fix the xfer optimization for generated columns, so that VACUUM works again.
FossilOrigin-Name: 8f67b89b04622c1509dc102a83be7a80057dc791625804fc2c294089c98b97e4
2019-10-17 16:16:34 +00:00
drh
8a53ce2ff8 Basic UPDATE functionality working for VIRTUAL tables.
FossilOrigin-Name: c21959d4eb5d742a097a98e1874c0bf132dc962a97a65be1ab22d6ca3cf2b261
2019-10-17 15:59:03 +00:00
dan
b2075011a7 Avoid an infinite loop in fts3/4 incremental-merge in the case where the lowest level in the database contains segments but no data (because there is a delete-marker for each valid entry). Fix for [bf1aab89].
FossilOrigin-Name: 35beaee059a6cccead4311886ca928d936f23584cf435e35e265e98feea723dc
2019-10-17 15:41:36 +00:00
drh
676fa25a0f Bug fixes so that "make test" once against runs with no errors.
FossilOrigin-Name: 7bfe0f679d8951b3e925bdf549efa0f8d6b514eddeaca69cbfddbd9476cfff5f
2019-10-17 14:21:07 +00:00
drh
ab3c5f26ab Fix the table_info and table_xinfo pragmas so that they work with virtual
columns.  Table_info omits virtual columns.  Table_xinfo gives them a
"hidden" flag of 2, and 3 for STORED columns.

FossilOrigin-Name: 069351b85f9a706f60d3e98fbc8aaf40c374356b967c0464aede30ead3d9d18b
2019-10-17 13:15:40 +00:00
drh
ab45fc0413 INSERT with named columns for a table with generated columns.
FossilOrigin-Name: 64db39f92d68d1b9f23e48af35e16b969c38b58041fbe900066eeb3ddb291cef
2019-10-16 22:01:56 +00:00
drh
c27ea2ae8d ALTER TABLE is able to add a VIRTUAL column.
FossilOrigin-Name: 120c6b78cb51532f783014605f1107d40b2e4f54e3852fb1f8f167d0c0b78c69
2019-10-16 20:05:56 +00:00
drh
7e508f1ee2 Simple INSERT and SELECT operations working with VIRTUAL columns.
FossilOrigin-Name: 7f9f90b1b885fa9905b296f2e0fcc9b2341019b42fc839722a93cf60e49a9252
2019-10-16 19:31:46 +00:00
mistachkin
16fd04cdbe Enhancements to SQL query normalization for UPDATE statements.
FossilOrigin-Name: bba975c7af3de9aeb5c62fb8b05d61b96e4ecd0b030008442bbdd345e1e5f134
2019-10-16 17:46:22 +00:00
drh
2da8d6fe74 If an AFTER DELETE trigger fires when a conflict row is deleted by REPLACE
conflict resolution, make sure the conflict really has been resolved and that
the trigger did not recreate the row before continuing.
Ticket [a8a4847a2d96f5de]

FossilOrigin-Name: eea1e7aa57e74c4329003f4550168e2aed9e33d2301a3ba84b10781a9cebbc1b
2019-10-16 14:56:03 +00:00
drh
81f7b37270 Initial experimental code for generated column support. Non-functional.
FossilOrigin-Name: 11d472c1df707b8d03ec57d8fc582a34f5eb89a9d02a154a9871650c65065b45
2019-10-16 12:18:59 +00:00
drh
4ec3e820a0 Formatting change on a multi-line conditional, for improved clarity.
No logic changes.

FossilOrigin-Name: 7248e3476511ecd317f54edcfe1e87443bfdcc1b10c89c7734eefcabafec6c0b
2019-10-15 19:01:55 +00:00
drh
68748ec509 Futher improvements to the IN operator for row-values on virtual tables.
FossilOrigin-Name: bc751fb64d5b08e5ca4c85cd1c6fbf09590fa9dad7e176ba373082ea373655b5
2019-10-14 20:32:31 +00:00
drh
4a9f379c9c New test cases in test/fuzzdata8.db.
FossilOrigin-Name: 344d9cb0c726078af6deb4a26bed3aded5b26914bb286d3446d3a4e9150840b7
2019-10-14 15:24:20 +00:00
dan
2d82269ca8 Fix a problem with row-value IN(...) operators and virtual tables.
FossilOrigin-Name: aa57d7abac0bb92d4d5fd4e093a11cf8efc04e4eed748b2a400d01f137250649
2019-10-14 15:15:50 +00:00
drh
a0fe5fe54f When Select-Trace is enabled (in debugging builds only) do not show the
result of Window function tree rewrites if there are no window functions.

FossilOrigin-Name: d1acf72ae1ea7484bb9c3a8630094f1a3a9597578c7b9d6e02fc0a4e3f59c57d
2019-10-12 23:38:00 +00:00
dan
d681626a8b Update the zipfile extension to use deflateBound(), instead of compressBound(), to learn the maximum possible size of a deflate()d buffer.
FossilOrigin-Name: f5ee30426e8876e70304f852153b56991a2a66e0f6a82597e9dcccf49163272d
2019-10-11 18:55:10 +00:00
drh
a1698993e6 Futher improvements to LEFT JOIN strength reduction.
FossilOrigin-Name: 8a39167bd2d46496f7484cfec371e4bad22da882209b01da9459c4ed5877da25
2019-10-11 17:14:40 +00:00
drh
4a254f98e3 Improvements to the LEFT JOIN strength reduction optimization.
FossilOrigin-Name: 548082dfab5d9484279ccc11cd2833ac131b54b7481372b576d7c28bbb3294ea
2019-10-11 16:01:21 +00:00
dan
8b4d0e2cba Ensure fts3/4 prefix indexes are flushed to disk before an 'optimize' command. Fix for [745f1abc].
FossilOrigin-Name: 4ed905b18847d4dbf5a2570052abced338065f824137b90300f62d77b3159d80
2019-10-11 15:33:13 +00:00
dan
9613c9f4a6 Fix the fts3/4 integrity-check command so that it works with "ORDER=DESC" tables. Fix for [8a6fa2bb].
FossilOrigin-Name: 5863546df99abd1ad4ebcaba18dec647be4368e2c13ce0b28e48c8608d3e87ef
2019-10-11 14:27:17 +00:00
drh
656d535ae6 Increase the version number to 3.31.0 for the next release cycle.
FossilOrigin-Name: ffd4c30620abe6ba38d82f3db934d18cc8468aaac4cd50a4e01be8910854d3f0
2019-10-11 14:25:00 +00:00
drh
21f6daa2cd Faster response to sqlite3_interrupt() in the OP_IntegrityCk and OP_Count
opcodes.

FossilOrigin-Name: bf875dc59909f9c22f7c1fc843bc4d9e5d97af5cb4ef43c4fa1d566ddfdeaacb
2019-10-11 14:21:48 +00:00
mistachkin
af94adf049 Update the autoconf makefile for MSVC.
FossilOrigin-Name: 9455643eecb74c8ac93ad3b3566f30e380dd912cdce3de993da5af42973ac59c
2019-10-10 23:58:28 +00:00
mistachkin
6dcf9a451e Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: 73a82114733af2a316f20eb8578badef307d14286c6ec03197744a6793425161
2019-10-10 23:58:16 +00:00
dan
0287c95165 Prevent SQLite from assuming that if ((? IS NOT NULL) IS NOT NULL) is true, ? may not be NULL. Fix for [d51a8696].
FossilOrigin-Name: 7833feecfe745e237f239ee4c38a9e4bf7ad66a32919150208da87c00a826473
2019-10-10 17:09:44 +00:00
dan
cd79010964 Fix a problem in the fts3 integrity-check routine causing it to report as corrupt tables that contain values with embedded 0x00 bytes.
FossilOrigin-Name: 629e20c9880acc2cb9e2fa6da39a15a90483e9a8f433df29d285c23bdfb03b0b
2019-10-10 16:41:44 +00:00
dan
3703edf110 Be sure to rewrite column references inside FILTER clauses and window frame definitions when flattening queries. Fix for [1079ad19].
FossilOrigin-Name: ccba7202b69d239724c3b589439c9c3b0e1bba237accfeb11c39d492522b8719
2019-10-10 15:17:09 +00:00
dan
da03c1e65e Avoid assuming that an expression that contains the sub-expression (? IS FALSE) or (? IS TRUE) may only be true if ? is non-null. Fix for [a976c487].
FossilOrigin-Name: eb7ed90b8a65748f0721aaf7bdddd2207f552be5015603fbfb7044d815ae2f36
2019-10-09 21:14:00 +00:00
dan
ae55737fbf Do not allow users to effectively disable fts5 crisismerge operations by setting the crisismerge threshold to higher than the maximum allowable segment b-trees on a single level. Fix for [d392017c].
FossilOrigin-Name: 86e497209217abb7bcb491a023cd353f3c7c9c103ebd9f58dd8661b12cf3694c
2019-10-09 18:36:32 +00:00
drh
92a2824cc6 An improved fix for the dbsqlfuzz-discovered ALWAYS() failure following OOM in
sqlite3ExprCollSeq().  This time with a test case (engineered by Dan).

FossilOrigin-Name: 907f7965b335d8d5441f2e386bb190d1f93ffcd45ca98d2d1c621dede491fc5e
2019-10-09 15:37:58 +00:00
dan
a6bd1871d1 Disallow fts5 page sizes greater than 65536 bytes - as there are 16-bit offsets used in the page header.
FossilOrigin-Name: 75775c5ab44e497cb19be10397229637f1374f05c3244e8f92d6c54fcea94f5f
2019-10-09 15:26:45 +00:00
drh
76f8318e31 Remove the "fastfuzztest" makefile target. Use only "fuzztest".
FossilOrigin-Name: e17571c789db31123642d0ed1f3d8764e070019e0deb8b88cce58d2183551cdf
2019-10-09 15:08:27 +00:00
drh
9fd04bfd29 New test cases added to test/fuzzdata8.db.
FossilOrigin-Name: b68d21e93a0839b42f49845918df7738ee7fa2a05c7f4ae2f89fdbb5e47ad8eb
2019-10-09 15:03:45 +00:00
drh
efb02281a4 Change sqlite3SelectDup() to always return NULL if an OOM has occurred.
FossilOrigin-Name: 01ba4641ab436c6065c8725908fc0913f2abded4ea62e004b7534e0116b9451a
2019-10-09 15:00:37 +00:00