392 Commits

Author SHA1 Message Date
drh
19913f4419 Bring in the latest updates from trunk.
FossilOrigin-Name: 7b5f3773867ed0e4ed17bd473ba972d500035318
2014-01-28 18:06:17 +00:00
drh
693e671936 Fixes for various clang warnings.
FossilOrigin-Name: 87bf60637e5863c54c5e2d05aaaca0835b7aace8
2014-01-24 22:58:00 +00:00
drh
c187698614 Bring in all the latest trunk changes, including the Common Table
Expressions implementation.

FossilOrigin-Name: 9b43e559195680e558264c4c00d34dc9cf9d9146
2014-01-24 14:05:18 +00:00
drh
1c2c0b776f Avoid redundant register loads during index key generation when doing a
DELETE or INTEGRITY_CHECK on a table with multiple indices.

FossilOrigin-Name: 8f6e6149a165f516be6395fd753e163d52ffd52e
2014-01-04 19:27:05 +00:00
drh
61019c7883 Omit OP_Close operations that occur immediately prior to OP_Halt and which
cannot be jumped over.

FossilOrigin-Name: 874b7e9999811c288ad41d07709f88e458d2d497
2014-01-04 16:49:02 +00:00
drh
762c1c4071 Avoid unnecessary affinity transformations when building indices using
data from a table.

FossilOrigin-Name: 10d851353c2abeadbd2852c210a7ff9f7f513e5d
2014-01-02 19:35:30 +00:00
drh
d9e3c267b4 Merge the latest trunk changes into the sessions branch.
FossilOrigin-Name: cfd110bf5db2c1993a5e2ca718648bd9c17ee22c
2013-12-24 12:09:42 +00:00
drh
d42ef839bc Code simplification in sqlite3GenerateIndexKey() by making use of a subroutine
found over in expr.c.

FossilOrigin-Name: 0026d3355340d66687a3fd4cbece28811ef1b505
2013-12-20 18:44:35 +00:00
drh
1b2ee4fe1a Merge in performance enhancements from trunk.
FossilOrigin-Name: fc9ae839569eb28eb734c52d95676c59b2e27494
2013-11-26 18:00:29 +00:00
mistachkin
20b859530b Fix harmless compiler warning.
FossilOrigin-Name: f336c18fb72ab90e93640b12ac540d41accc7658
2013-11-22 21:32:44 +00:00
drh
e73e067187 Enable the ONEPASS optimization for DELETE, for both rowid and WITHOUT
ROWID tables.

FossilOrigin-Name: 44a07afdd9b3ae2460bc963383295deb0915f899
2013-11-18 03:11:54 +00:00
drh
83d47afe24 Make sure one-pass DELETE for WITHOUT ROWID tables correctly positions the
PRIMARY KEY cursor.  Make the same fix for UPDATE.

FossilOrigin-Name: 6bd5750b7d5da221b0689f6df6be5ed0dce61bec
2013-11-17 02:42:02 +00:00
drh
c51331d16d Fix a couple of minor problems with the new delete logic.
FossilOrigin-Name: a11243f840d35aaed8ee3b9901c3950bc584a417
2013-11-16 23:16:31 +00:00
drh
52a82e6966 Fix an OOM-recovery problem in the DELETE code generator.
FossilOrigin-Name: dc7be158b82ab9156d0fcdf3394f881eac4d23c3
2013-11-16 23:03:06 +00:00
drh
9612947260 Combine the rowid and WITHOUT ROWID paths for DELETE into a single path.
FossilOrigin-Name: c4734b881a64a9d21d03a14e901785797577fbd8
2013-11-16 22:48:52 +00:00
drh
156c7919d9 The one-pass optimization is now working for DELETE on WITHOUT ROWID tables.
FossilOrigin-Name: e4d220a381388f900a95d1b656a82f14c837f92e
2013-11-16 20:45:01 +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
cbf1b8ef7d Merge in the WITHOUT ROWID changes. A few tests are failing now. They will
be fixed in a follow-on check-in.

FossilOrigin-Name: 5addd1234ded59ce60fb633b76ac87d483377edd
2013-11-11 22:55:26 +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
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
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
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
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
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
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
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
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
9eade087da Delete PRIMARY KEY index entries last. Only construct the unique prefix of
an index key when deleting entries from an index.

FossilOrigin-Name: 0e56ba69f0fcd12a5166c32f6e4eacdcc29fba04
2013-10-24 14:16:10 +00:00
drh
4415628a4a Construct secondary indices on WITHOUT ROWID tables.
FossilOrigin-Name: 2c028ddc85cb45746cad6ab0cefd99134fbd50d7
2013-10-23 22:23:03 +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
drh
a63b852992 Synchronize with the trunk.
FossilOrigin-Name: 136445ba020c9475d3f5a7843d7d0add98477138
2013-10-10 20:13:18 +00:00
dan
5d1dcff095 Obtain the required shared-cache write-lock when executing "DELETE FROM tbl" statements. Fix for [1e1321ee98].
FossilOrigin-Name: 1f8f4fdf3ff2b8de27e167a44a19b0f479f5ee1a
2013-09-26 15:21:16 +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
7fb30bd0dd Merge in the latest trunk changes, including partial indexes, the MAX_PATH
fix in os_win.c, and the sqlite3_cancel_auto_extension() API.

FossilOrigin-Name: 7e1acb390770d1bd189fac7a3a7f96106f96e3a4
2013-08-02 20:44:48 +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
dan
1bc8b87e46 Merge recent changes to trunk into sessions branch.
FossilOrigin-Name: 62adb0e0d70e619becb68ffd2625d979bcc777cd
2013-03-12 11:38:59 +00:00
dan
6d235cb8d8 Fix a problem with resolving "db.view.column" references that appear in UPDATE or DELETE statements executed against views.
FossilOrigin-Name: ddee56c9b2b591b9386b1072c3b3a699f7c1f853
2013-03-09 14:40:24 +00:00
drh
3dc2b9032f Pull all the latest trunk enhancements into the sessions branch.
FossilOrigin-Name: fce667f2d93a4ba65ccf1e748469576a3cd7ffcc
2012-10-30 21:03:48 +00:00
drh
21172c4cc0 Add an optimization that attempts to run a subquery as a coroutine rather
than manifesting it into a temporary table.

FossilOrigin-Name: 7af3acbbd49a2114fcdada9ec907c68ba9b053bd
2012-10-30 00:29:07 +00:00
drh
d1102b1ec7 Merge the latest trunk changes, especially the ORDER BY optimizer enhancements
but also other fixes, onto the sessions branch.

FossilOrigin-Name: f1fbb8c5bfa84e84e0b8e2872d83b06a0c0d5acc
2012-10-09 14:58:15 +00:00
dan
41fb5cd103 Shared-cache mode fixes for views and virtual tables.
FossilOrigin-Name: 2b370dea704b59262c604af0efcef5660b194454
2012-10-04 19:33:00 +00:00
drh
c4645dacfb Merge the latest trunk changes (especially "PRAGMA busy_timeout" and the
ORDER BY query planner optimizations) into the sessions branch.

FossilOrigin-Name: 6ca8eae1f89d19ee23cbc3a869d85b57d29b4a7d
2012-09-28 13:05:48 +00:00
drh
7e5418e4a4 Add more bits to the bit vector that is used to disable optimizations for
built-in test.  Add specific bit patterns to disable ORDER BY using an
index in general and for joins.  Use macros to test for bits in the 
disabled-optimization bit vector, in order to make the code clearer.

FossilOrigin-Name: d2fcba1e143beca8c45724d2108870657c269e17
2012-09-27 15:05:54 +00:00
drh
310874ca00 Merge the latest trunk changes into the sessions branch.
FossilOrigin-Name: aa62d6881b5aae64e15dbae70ce8e77bcc2a9f0b
2012-08-25 01:21:36 +00:00
dan
0efb72c969 Fix a problem to do with multi-or queries and automatic indexes.
FossilOrigin-Name: a3e26038a1d9f3331239f777c67d1920d904aab0
2012-08-24 18:44:56 +00:00
drh
108606837e Merge all recent trunk changes into the sessions branch.
FossilOrigin-Name: fb9b9987de965e194fef56bca563ee65c49f0950
2012-03-30 17:30:33 +00:00
drh
a748fdcc43 Evaluate typeof(X) and length(Y) where X is any column and Y is a blob column
without actually loading X and Y from disk.

FossilOrigin-Name: b899dbeb60752843287e2c6ad3577e1d00f0d587
2012-03-28 01:34:47 +00:00