Commit Graph

11543 Commits

Author SHA1 Message Date
drh
b41392241e Allocate extra stack space for UnpackedRecord objects, reducing the need
to malloc for them as often, and thereby get a performance improvement.

FossilOrigin-Name: a725a75f870d7d9b21946fbcc71a956492986ab0
2013-11-06 14:36:08 +00:00
drh
d9b7ec9348 Minor optimization to the OP_Halt opcode.
FossilOrigin-Name: d70c78814ba565a44628eab61a3a0a5dba56269a
2013-11-06 14:05:21 +00:00
drh
416846a362 Improved ORDER BY optimization for WITHOUT ROWID tables.
FossilOrigin-Name: 8f1709ff2d52d5ceca3da6a2a4e06da204d9e65a
2013-11-06 12:56:04 +00:00
drh
d4ddae985b Disable the OR optimization for WITHOUT ROWID tables, since it relies on
the use of rowids.

FossilOrigin-Name: 6055dad2ba2f9256b1f2d0a9e32ca00f1b81b0cf
2013-11-06 12:05:57 +00:00
drh
79b9831cdd Remove an incorrect test case from conflict2.test.
FossilOrigin-Name: 427612efc169c8ebe94a8b586d7abd0fcd43d0d0
2013-11-06 11:46:48 +00:00
drh
4ad8b90244 Remove an unused variable.
FossilOrigin-Name: e9c1e419b7227d86f2e1882cebf360116cdf1a13
2013-11-06 02:36:04 +00:00
drh
1282609b02 Make sure the query planner knows that the PRIMARY KEY index of a
WITHOUT ROWID table is always a covering index.

FossilOrigin-Name: 03e7019e14255dbeb85bb299569c82ef48ac4a98
2013-11-05 22:39:17 +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
drh
5a9a37b7b4 Fix a bug in secondary index initialization when the secondary index is
a superset of the PRIMARY KEY for a WITHOUT ROWID table.

FossilOrigin-Name: 52a3d885192c5d31f956c5ee17e29e2d1f3d5c9f
2013-11-05 17:30:04 +00:00
dan
6d8578bc8f Remove an "explain" command from test script without_rowid1.test that was accidentally committed.
FossilOrigin-Name: 4b41d989e894b9214a9b973228ef8446356f9fbb
2013-11-05 16:56:11 +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
7b3d1860af Updates to the backcompat.test test script so that it works with really old (3.6.*) versions.
FossilOrigin-Name: ace7e7b64261aeabc9525d5d0cfebe0275c9ddf5
2013-11-05 15:02:39 +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
d269461c91 Add the index7.test script for testing partial indices with WITHOUT ROWID
tables.  Fix bugs in ANALYZE located by that script.

FossilOrigin-Name: 79befe3ac1f676272b78423b9aa5dac41435420e
2013-11-04 22:04:17 +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
c3e356fe10 Add another test case file for WITHOUT ROWID and fix the bugs that the new
test file uncovered.

FossilOrigin-Name: bc2a06eb8e57573d08e77800a7937eee5af3f035
2013-11-04 18:34:46 +00:00
drh
5838340b0e Fix a problem with processing INTEGER PRIMARY KEY on a WITHOUT ROWID table.
FossilOrigin-Name: 89098e6d18dacd1554cf4471b5f035db85d1f327
2013-11-04 17:00:50 +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
90e758ff1f Correctly handle self-referential foreign keys on WITHOUT ROWID tables.
FossilOrigin-Name: af128862ab6008df9dda1ee90f93f9efd629e259
2013-11-04 13:56:00 +00:00
drh
bd50a926ef Improved comments on foreign key logic.
FossilOrigin-Name: 1315d9109c7105f4a62bb2d43ca6948d41245129
2013-11-03 02:27:58 +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
63f0eedf10 Many new test cases added, that mostly work. Currently 18 errors in
without_rowid3.test.  Also there is a hack marked by a /*FIXME*/ comment 
on at fkey.c:547 that needs fixing.

FossilOrigin-Name: 39e32187b66405e00dbd44685f6cdd269c90f5e5
2013-11-02 22:09:48 +00:00
drh
ce95d11921 Change the "idx" name of the primary key index for WITHOUT ROWID tables in
sqlite_statN statistics tables to be the name of the table rather than the
fabricated index name (ex: sqlite_autoindex_xyz_1).  This makes it consistent
with sqlite_master table.

FossilOrigin-Name: 4ee4d3106308508a58b80e54e0afb4afb42f510b
2013-11-02 19:34:38 +00:00
drh
ebe25af168 Update the ANALYZE logic so that it works with WITHOUT ROWID tables.
FossilOrigin-Name: 9075770e4030b35677fbbe291f3c3c4946937a9a
2013-11-02 18:46:04 +00:00
drh
c6bd4e4a36 Store the root page of the PRIMARY KEY index for a WITHOUT ROWID table in
the sqlite_master entry for the main table and omit the sqlite_master entry
for the PRIMARY KEY.

FossilOrigin-Name: b7544bb280f1c1c55135a9b35aeb85604fef94a3
2013-11-02 14:37:18 +00:00
drh
71b4ea83e0 Import the sqlite3_analyzer fixes from trunk.
FossilOrigin-Name: ac711459ff243e787ea5e9c01720dff75a5eda9b
2013-11-02 11:43:05 +00:00
drh
a46417151a A pair of sqlite3_analyzer bug fixes: (1) quote strings in the SQL at the end
of the output. (2) Fix test_stat.c so that it no longer misses some overflow
pages on internal index pages.

FossilOrigin-Name: 42a11e7464ab1d97d603c7409f10710ad4f1f542
2013-11-02 11:34:58 +00:00
drh
1153c7b25d Size KeyInfo objects so that IdxInserts always compare the correct number of
fields.

FossilOrigin-Name: 302a81390f039fc23eeb8510e95b9d9fa0b41edd
2013-11-01 22:02:56 +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
bc43ae3d0d Additional UPDATE test cases for WITHOUT ROWID.
FossilOrigin-Name: 65384ae0f027d05cf9208faed56575870d63c486
2013-11-01 18:14:36 +00:00
drh
8a120f8b68 Fix an invalid cast operation in the WITHOUT ROWID parsing logic.
FossilOrigin-Name: 845153be36d5ca0ca9d930c56418fb080d906740
2013-11-01 17:59:53 +00:00
drh
1aae39cd26 Merge all changes from trunk, and disable a pair of corruption tests that are
no longer valid since sqlite_master.rootpage can now be NULL for tables.

FossilOrigin-Name: dd5d57b9a1b25fb6c9e20024e519b58630cf1fd0
2013-11-01 17:21:29 +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
29f9774771 A couple of bug fixes.
FossilOrigin-Name: cdf00248cf8f7e3c2a3f2f5514273fbacc6fc8d9
2013-11-01 01:45:46 +00:00
drh
313619f572 Fix the Synopsis on OP_Concat. Added test_addop_breakpoint() during
SQLITE_DEBUG.  Enhanced sqlite3VdbeChangeToNoop() to omit the instruction
if it is the most recent added.  Continue to fix problems with UPDATE
and WITHOUT ROWID.

FossilOrigin-Name: 9b6d9e106aaa3c2efb33d234d26cf08cd3c967b9
2013-10-31 20:34:06 +00:00
dan
f52a4690b0 Fix a problem in os_unix.c causing compilation failure if SQLITE_DEBUG and SQLITE_MAX_MMAP_SIZE=0 are both defined.
FossilOrigin-Name: 090db8c81d8ca216277d11c8c4751c0a37801524
2013-10-31 18:49:58 +00:00
drh
ee0ec8e1db Fix issues with quering from an auxiliary index that must refer back to the
PRIMARY KEY index of a WITHOUT ROWID table.

FossilOrigin-Name: cff1f55c52ff57557d9b728a5cd830a367091794
2013-10-31 17:38:01 +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
mistachkin
293566eaf2 Update comments in the MSVC batch build tool.
FossilOrigin-Name: 0414bb73ef83332bec3d06471d431690356dbe13
2013-10-31 06:39:15 +00:00
mistachkin
99eef00d43 Enable some more tests on Windows.
FossilOrigin-Name: 72389c295bb240ec76746e289403b82e04189903
2013-10-31 06:13:57 +00:00
mistachkin
2744938e82 Fix harmless compiler warnings.
FossilOrigin-Name: 1a0a88657f54874703fc05f828ce29ad115d9f28
2013-10-31 06:11:10 +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
5b843aa032 In the P4 column of the EXPLAIN listing, abbreviate "keyinfo" as just "k" and
"BINARY" as just "B".

FossilOrigin-Name: 72d45eb79b5d0505050cff57a00d725948b2a0c0
2013-10-30 13:46:01 +00:00