dan
ebbf08a012
Avoid spurious "no such table" errors in statements of the form "INSERT INTO tbl WITH xxx AS (...) SELECT * FROM xxx".
...
FossilOrigin-Name: cccff8a0b427feb05cc8952a765b829e731394fd
2014-01-18 08:27:02 +00:00
dan
4e9119d9e8
Add code to handle non-recursive CTEs in the same way as SQL views.
...
FossilOrigin-Name: a26f399ba485e8127c276c5f103ec6c555e11734
2014-01-13 15:12:23 +00:00
drh
75593d96be
Allow a VALUES clause to be used any place that a SELECT statement can be
...
used.
FossilOrigin-Name: c9ea7d199f06a7801ab639e7ac98ebeb98706f24
2014-01-10 20:46:55 +00:00
drh
5426d80948
Avoid some unnecessary OP_SCopy operations when inserting into a table
...
with multiple indices.
FossilOrigin-Name: 429018b19cb525a4bb0843d20955457b53900d4b
2014-01-03 16:03:43 +00:00
drh
a021f121c9
Remove an unneeded column-cache flush in aggregate SELECT
...
and an unreachable branch in the INSERT logic.
FossilOrigin-Name: ffa092e13b3781677b18418cca40e3dd1e388aed
2013-12-19 14:34:34 +00:00
drh
46d03fcbfc
Omit one or more pointless instructions that occur in between OP_NoConflict
...
and OP_Halt.
FossilOrigin-Name: 61e2f3575c4a94f9571c28fb2bd19da84b0edceb
2013-12-19 02:23:45 +00:00
drh
6a53499a20
Enhance the DELETE logic so that it can make use of WHERE_ONEPASS_DESIRED
...
for rowid tables.
FossilOrigin-Name: 8f479a72758ab6fedb171ada612b1963143c32fa
2013-11-16 20:13:39 +00:00
drh
4308e348d7
Remove unreachable code, replacing it in most cases with assert() or NEVER()
...
macros.
FossilOrigin-Name: 924d63b283a3d059838114c95d42c6feaf913529
2013-11-11 16:55:52 +00:00
drh
392ee21d1a
Performance improvement: Avoid unnecessary seeks on REPLACE INTO for a
...
WITHOUT ROWID table.
FossilOrigin-Name: fd11afa5f5c853dcac2290444b581a3fe1d4332d
2013-11-08 16:54:56 +00:00
drh
ce60aa469a
Optimize out a NotExists/NotFound opcode that occurs in UPDATE processing
...
after constraint checks if there is no possiblity that the constraint checking
code might have moved the cursor.
FossilOrigin-Name: 74e3ee2ee6ea89af2c12dd0bce248467fd0f1310
2013-11-08 01:09:15 +00:00
drh
2ec2fb2269
Reference count the KeyInfo object. Cache a copy of an appropriate KeyInfo
...
for each index in the Index object, and reuse that one copy as much as possible.
FossilOrigin-Name: defd5205a7cc3543cdd18f906f568e943b8b3a2c
2013-11-06 19:59:23 +00:00
drh
4ad8b90244
Remove an unused variable.
...
FossilOrigin-Name: e9c1e419b7227d86f2e1882cebf360116cdf1a13
2013-11-06 02:36:04 +00:00
drh
8d1b82e40b
Fix conflict handling for the case when the rowid uses REPLACE but other
...
unique constraints use FAIL or IGNORE.
FossilOrigin-Name: 573cc27427af297185f11aac8dce88ca31f471ca
2013-11-05 19:41:32 +00:00
dan
427ebba10c
Unless the destination table is completely empty, disable the xfer optimization for WITHOUT ROWID tables.
...
FossilOrigin-Name: 3877c9f50582b51817dcf3cd75d836891a34e590
2013-11-05 16:39:31 +00:00
dan
e83267da54
Add tests for updates of without-rowid tables that use non-BINARY collation sequences for the primary key columns. And a minor bugfix to the same.
...
FossilOrigin-Name: 99b1fa4b1664a79eae1dddce2b9a848384cdb1d7
2013-11-05 14:19:22 +00:00
drh
f9c8ce3ced
Standardize the error messages generated by constraint failures to a format
...
of "$TYPE constraint failed: $DETAIL". This involves many changes to the
expected output of test cases.
FossilOrigin-Name: 54b221929744b1bcdbcc2030fef2e510618afd41
2013-11-05 13:33:55 +00:00
drh
00012df46d
Add the conflict2.test script. Fix issues discovered by this script.
...
FossilOrigin-Name: 294ed33756b06375e56c41f1088d42ee48adbdc8
2013-11-05 01:59:07 +00:00
drh
da475b8dbc
Bug fixes in the INSERT constraint checker. Refactor the Rowid handling logic
...
for ANALYZE with STAT3/4.
FossilOrigin-Name: 1ea43c0f236792a3bc13e1cb330f5ff3402c2851
2013-11-04 21:44:54 +00:00
drh
6546af1480
Correctly handle changing counting when inserting and deleting on
...
WITHOUT ROWID tables. Add more FOREIGN KEY test cases.
FossilOrigin-Name: d072bcd0a8692d590c13c2bf458454c10c12a3e2
2013-11-04 15:23:25 +00:00
drh
2552d43f4c
Improved Synopsis on register comparison operators. Fix a bug on the
...
constraint check generator.
FossilOrigin-Name: a7a18b65fa34dfdf6117fa21db3e576f96876617
2013-11-02 22:29:34 +00:00
drh
7913e41f6d
Fix sqlite3_analyzer so that it works with WITHOUT ROWID tables.
...
Fix index generation for secondary indices that include fields from
the PRIMARY KEY.
FossilOrigin-Name: f9769d701c65770f4b8488f541c59e508393e6c2
2013-11-01 20:30:36 +00:00
drh
f8ffb27850
Change the interface to sqlite3GenerateConstraintChecks() for improved lucidity
...
and to fix issues in dealing with UPDATEs for WITHOUT ROWID tables. Make sure
iDataCur and iIdxCur are initialized when processing DELETEs of a VIEW.
UPDATE processing distinguishes between changes to ROWID and PRIMARY KEY.
FossilOrigin-Name: c525ac5630d6bcd51842cfc84f2c2c50be9cec1c
2013-11-01 17:08:56 +00:00
drh
f82b9afcba
Improved VDBE comments on the constraint checker. Fix a missing write
...
lock in the UPDATE logic.
FossilOrigin-Name: 3bed599e74d354bf1513e4fb0e8665376ba44d0b
2013-11-01 14:03:20 +00:00
drh
ccc79f021f
Some UPDATE statements now working in WITHOUT ROWID tables.
...
FossilOrigin-Name: 5c0eaea6a26b5c3310d96b3c896ac3068a3ebad1
2013-11-01 12:42:21 +00:00
drh
6934fc7b6f
Improved comments and variable names in infrastructure routines of UPDATE,
...
DELETE, and INSERT.
FossilOrigin-Name: ad90e762e51384ac7c311f08a641419f03f6d3f0
2013-10-31 15:37:49 +00:00
drh
77f64bb7b9
Moving UPDATE towards the iDataCur/iIdxCur representation. Still not working
...
for WITHOUT ROWID, though.
FossilOrigin-Name: deacbd21b50cc8c63a1572d14a4bbc7af4052d37
2013-10-31 12:13:37 +00:00
drh
26198bb481
Refactor the INSERT, DELETE, and UPDATE code generators to distinguish between
...
the "data cursor" and the "first index cursor", which are no longer consecutive
in the case of a WITHOUT ROWID table.
FossilOrigin-Name: 1adfca6019847d37dee4a297669f29d5ca184066
2013-10-31 11:15:09 +00:00
drh
6fbe41acf2
Continue working to get UPDATE operational for WITHOUT ROWID tables.
...
Fix PRAGMA integrity_check so that it works on WITHOUT ROWID tables.
FossilOrigin-Name: 0d4fea7462c0f61cd1c736cbcd7bea5ec2034d54
2013-10-30 20:22:55 +00:00
drh
72ffd09188
Make sure KeyInfo objects on multi-column indices of WITHOUT ROWID tables
...
have the correct nField and nXField values. Also, add the
SQLITE_ENABLE_MODULE_COMMENT compile-time option and the VdbeModuleComment()
macro and use it to label entry and exit points of some key routines.
FossilOrigin-Name: 6d9af6065fc0da8337aee2297a8da7511eecccf1
2013-10-30 15:52:32 +00:00
drh
0978d4ffb2
Improved comments on the constraint checking logic.
...
FossilOrigin-Name: 141a38a7a636e3e4255b59c27df4a1b3d6f26e97
2013-10-29 16:14:35 +00:00
drh
11e85273df
Work on the UPDATE and INSERT logic. This is an incremental check-in so that
...
can switch over to trunk to work on an unrelated issue there.
FossilOrigin-Name: 086ec2a177b24ad90d5d705a99d93aa0c1545217
2013-10-26 15:40:48 +00:00
drh
6f225d0d7f
Replace the OP_IsUnique opcode with OP_NoConflict. This code simplification
...
might be useful to move onto trunk even if this branch is never merged.
FossilOrigin-Name: e6650e16dd11327afd25961b2feb29ec8778c2ca
2013-10-26 13:36:51 +00:00
drh
d82b50212e
Minor refactoring of variable names and fixes to comments in insert.c.
...
FossilOrigin-Name: ae61a34378d3ed2f454ba8768029d6f5fef849e4
2013-10-26 00:58:34 +00:00
drh
ea22abe3d6
Progress toward getting UPDATE to work in WITHOUT ROWID tables.
...
FossilOrigin-Name: e557b7d80f1ede63427a31b16757bf5d8dbfb66d
2013-10-25 19:17:17 +00:00
drh
261c02d963
Basic DELETE operations now working on WITHOUT ROWID tables.
...
FossilOrigin-Name: 9eafafa31c4a2bbcf48418743e0fcb17c374e9a6
2013-10-25 14:46:15 +00:00
drh
ecb31b6304
Update the interface to the sqlite3GenerateRowDelete() utility so that it is
...
able to handle WITHOUT ROWID tables. The implementation still needs to be
completed.
FossilOrigin-Name: 85daf5174679630474b3bccf3d662d5d56bf00d5
2013-10-24 19:48:39 +00:00
drh
dd9930ef20
Change the sqlite3OpenTable() utility to open the PRIMARY KEY index when
...
reading a WITHOUT ROWID table.
FossilOrigin-Name: 247f389930aededaa54ecb792748aa8d0ad6d57b
2013-10-23 23:37:02 +00:00
drh
55548273a3
Get VACUUM and the xfer optimization working with WITHOUT ROWID.
...
FossilOrigin-Name: 579815fff1737552d2077255862b8f4fd220927c
2013-10-23 16:03:07 +00:00
drh
ad124329ab
Some inserts and queries working for multi-column primary keys
...
and WITHOUT ROWID.
FossilOrigin-Name: b21d831b2aa55507dd9def2acb02cdbffddf10d1
2013-10-23 13:30:58 +00:00
drh
ec95c44175
Some simple inserts and queries working on WITHOUT ROWID tables.
...
FossilOrigin-Name: 3f8016dee24213ec83a02d71ad2698789cc3a818
2013-10-23 01:57:32 +00:00
drh
bbbdc83b52
The Index object now has nKeyCol and nColumn. nColumn is the total number
...
of columns and nKeyCol is the number of key columns. Currently these always
differ by one. Refactor aiColumn[] to be of type i16 instead of int.
FossilOrigin-Name: a106ce86cd4afd1f81603826de77df1fb25e9ab5
2013-10-22 18:01:40 +00:00
dan
5988572876
If an "INSERT INTO ... SELECT" can use the xfer optimization, pass the OPFLAG_BULKCSR hint to btree cursors used to update indices. This results in a tighter key packing.
...
FossilOrigin-Name: 087af29ee2e1572f8668dd0152a14d7f9796a530
2013-10-04 18:17:18 +00:00
dan
8ff2d9561a
When preparing an UPDATE statement, avoid generating VDBE code for those foreign key related actions and constraint checks that may be seen to be unnecessary by considering the subset of table columns potentially modified by the UPDATE.
...
FossilOrigin-Name: e940b5de49baa1d6a4cf859fbbc0e0df86ac5dbf
2013-09-05 18:40:29 +00:00
drh
619a1305e7
Fill out an initial implementation of the sqlite3ExprImpliesExpr() function.
...
FossilOrigin-Name: 8e07aa2ad5579aeb82174ce5bd432ddb9c058bc1
2013-08-01 13:04:46 +00:00
drh
8a9789b6c1
Test cases and bug fixes for the partial index logic.
...
FossilOrigin-Name: 6b73ae7c123801787c8994113cbeb87ee96ba653
2013-08-01 03:36:59 +00:00
drh
b2b9d3d758
Add the logic to keep partial indices up to date through DML statements and
...
when new partial indices are created. This new logic is untested except to
verify that it does not interfere with full indices.
FossilOrigin-Name: fb9044d15ad4fd6ae4a38858c0c0e6fe9d4faa25
2013-08-01 01:14:43 +00:00
drh
d91c1a1768
Add extended error codes for constraint errors.
...
FossilOrigin-Name: 5461104668a49529577f21df97f6a0e7d8f0c679
2013-02-09 13:58:25 +00:00
drh
2d8e920339
Duplicating check constraint expressions prior to code generation is no
...
longer required, and so it is removed.
FossilOrigin-Name: 1a9db8dc2f3c5cb089801d56122cdf5c3a618163
2012-12-08 04:10:44 +00:00
drh
5f53aac2e7
Remove an unreachable condition. Replace it with an assert().
...
FossilOrigin-Name: 7d5fc1a339cf4f3597ab6a5f3e7101884d2d7673
2012-12-03 19:42:39 +00:00
drh
c31c7c1c6e
Changes to facilitate full test coverage.
...
FossilOrigin-Name: 28d1eb40bfc4c993010ce670ee10780ca2ae5c9c
2012-10-08 23:25:07 +00:00