Commit Graph

16322 Commits

Author SHA1 Message Date
drh
0efd37f28b Fix lempar.c so that the shift-reduce optimization works for error processing.
This is a Lemon issue only and has no impact on SQLite.

FossilOrigin-Name: 3665a2f554e5b8d2717d952dbaf325a39c637c31
2016-06-06 18:17:36 +00:00
drh
4335ad05b8 Initialize the yyerrcnt variable in the lemon parser template. This has no
effect on SQLite itself.

FossilOrigin-Name: 45531654f7f5be3a08e9ee8598f14efe028245d8
2016-06-06 13:24:57 +00:00
drh
05a360913d Small performance boost and size decrease in sqlite3BtreeMovetoUnpacked().
FossilOrigin-Name: e106a77d85c20ae23ebe49a5acceeaffecb40fc2
2016-06-06 01:54:20 +00:00
drh
c80937a5f5 Small performance improvement in the LIKE function.
FossilOrigin-Name: 5fb0c35459cf7a8662bf8cd84ac345f6fafda6cc
2016-06-06 01:48:14 +00:00
drh
5cd22006ef Btree interface refactoring:
(1) The sqlite3BtreeKeySize() interface is renamed to sqlite3BtreeIntegerKey()
and modified to work only for table btrees with a rowid.
(2) The sqlite3BtreeDataSize() interface is renamed to sqlite3BtreePayloadSize()
and modified to work with any btree.
(3) The sqlite3BtreeDataFetch() and sqlite3BtreeKeyFetch() routines are
combined into a single sqlite3BtreePayloadFetch() routine.
The result of these changes is a smaller binary and fewer CPU cycles needed
to run queries.

FossilOrigin-Name: 2d831074cf730dce47de5880d7b4570d04d15fee
2016-06-06 01:14:08 +00:00
drh
5e08d0fcb6 Improved comment on cursorOwnsBtShared(). No changes to code.
FossilOrigin-Name: 5e269c2d2667df65592a32d6bc2fa388fd7eb181
2016-06-04 21:05:54 +00:00
drh
d66c4f809d Fix a C99-ism and a compiler warning for MSVC.
FossilOrigin-Name: aa53a36ea2eb90cc4939e37e6ad320b4211692fd
2016-06-04 20:58:35 +00:00
drh
a7c90c42ea Change the sqlite3BtreeKeySize() interface into sqlite3BtreeIntegerKey() and
make it only work for table btrees.  Change sqlite3BtreeDataSize() into
sqlite3BtreePayloadSize() and make it work for all btrees.  Combine
sqlite3BtreeDataFetch() and sqlite3BtreeKeyFetch() into a single
sqlite3BtreePayloadFetch() routine.  These changes seem to make the
b-tree interface more rational and they reduce both binary size and
CPU usage.

FossilOrigin-Name: bef35e18dd19732f7859287b097feeb593e5900f
2016-06-04 20:37:10 +00:00
drh
f94fdd832c Allocate KeyInfo objects from lookaside if possible.
FossilOrigin-Name: b411107a3609d53af4e147f01e311b858b78420b
2016-06-04 17:12:26 +00:00
drh
30e3fdf0ee Fix up speedtest1.c so that it will compile and run on SQLite versions prior
to 3.6.18 (circa 2009-09-11).

FossilOrigin-Name: 9583c0fb39f357a76e0c99ea03b034aea3e03c75
2016-06-04 16:33:48 +00:00
drh
cc97173810 Remove an unreachable branch in the UNIQUE constraint parsing.
FossilOrigin-Name: 313e990c741d7db082f1d9b9f3f4c65fdd91b812
2016-06-04 13:57:41 +00:00
drh
f0755fc85e The OR optimization is usable on virtual tables with LIKE, REGEXP and/or GLOB
terms in the WHERE clause.

FossilOrigin-Name: fa3a89fc0b88d5ad7f5c232198847b3483eef611
2016-06-03 18:59:37 +00:00
drh
a4680a8b19 Add support for virtual tables using a WITHOUT ROWID schema. This merge also
includes enhancements to the CSV extension, which is used for testing of
the new WITHOUT ROWID virtual table mechanism.

FossilOrigin-Name: aa7e9d0cc15c050205b09d5a50f985e4ade571d0
2016-06-03 18:44:43 +00:00
drh
0b2c140a4d Fix a memory leak when a WITHOUT ROWID eponymous virtual table is used.
FossilOrigin-Name: 31b83a7d7e553163eb186fc966a885f237554ec2
2016-06-03 18:21:04 +00:00
drh
7edcf627af Disallow access to the rowid column on WITHOUT ROWID virtual tables.
FossilOrigin-Name: d31c25972bfb6d04caad05534505698776e7e6d5
2016-06-03 17:27:14 +00:00
drh
c576b27580 Enhance the sqlite3_load_extension() interface to permit extensions to
return SQLITE_OK_LOAD_PERMANENTLY which will prevents unloading when
the database connection closes.

FossilOrigin-Name: 5908aa4dc59925c414b236b6fd3d3ecd7f3da435
2016-06-03 13:35:55 +00:00
drh
ac9c3d2c18 Performance optimizations on the CSV virtual table. Disallow WITHOUT ROWID
virtual tables that have an xUpdate method, for now.

FossilOrigin-Name: 3134b3266c36c9d018e8d365ef46ef638c0792f4
2016-06-03 01:01:57 +00:00
drh
35db31b24b Add the CSV extension to the test fixture. Fix a memory leak in the CSV
extension.  Add test cases for the CSV extension, including one that uses
a WITHOUT ROWID virtual table participating in the OR optimization.

FossilOrigin-Name: 95f483e86e30ae68108904400e18ed41d389446b
2016-06-02 23:13:21 +00:00
drh
adcba64df4 Add the data= parameter to the CSV virtual table extension.
FossilOrigin-Name: 769191042aa14e6eccdfe2391fc1011171d5c9ad
2016-06-02 17:44:24 +00:00
drh
273bfe9f20 Fix corner cases in the WITHOUT ROWID virtual table logic.
FossilOrigin-Name: a393bbb972660c1ffcdda923d0f3564ecfcd2f0a
2016-06-02 16:22:53 +00:00
dan
82a1c0e5bb Fix an issue preventing RBU vacuum from working with virtual tables.
FossilOrigin-Name: 3bd85fa5a9a489fd505c973e37c33a76c1b0e957
2016-06-01 10:37:50 +00:00
mistachkin
9f6e686f59 Fix compilation issues with the VFS stat extension.
FossilOrigin-Name: f6e956525b03fa07190e5521edac4758c386cc80
2016-06-01 05:02:05 +00:00
drh
62340f8498 An experimental branch with code that allows virtual tables to be declared
as WITHOUT ROWID tables. This might be useful for virtual tables that model
external data sources that do not have a convenient way of computing a unique
rowid.  The current check-in almost works, but there are still serious issues.

FossilOrigin-Name: 49638f180e26477974cacc69b79e0be0a5e18b29
2016-05-31 21:18:15 +00:00
drh
1fc1a0f280 Add the columns=N parameter to the CSV extension.
FossilOrigin-Name: 28ebeadd6a4c9ff2ce9fc86a0f0fe2f6cf94d3ac
2016-05-31 18:44:33 +00:00
drh
abfd272b59 Add the testflags parameter to the csv extension.
FossilOrigin-Name: b93fb2fe0df1b3bea2bc2a4e1528da74ab290593
2016-05-31 18:08:35 +00:00
drh
724b18966d Add the "csv" virtual table for reading CSV files, as an extension in
the ext/misc/ subfolder.

FossilOrigin-Name: 00d3570c8bb96469c984903e20de589e998d4636
2016-05-31 16:22:48 +00:00
dan
0df5024e83 Fix an FTS5 problem (segfault or incorrect query results) with "... MATCH 'x OR y' ORDER BY rank" queries when either token 'x' or 'y' is completely absent from the dataset.
FossilOrigin-Name: 64ca1a835a89fd211078d2cd8f9b649e89be528d
2016-05-30 08:28:21 +00:00
dan
dbd2dcbd5e Experimental change to allow virtual tables to take advantage of LIKE, REGEXP and GLOB terms that are part of OR expressions within WHERE clauses.
FossilOrigin-Name: 242507b4ff96bc4c7c7844dbe1c2b8508dbf1d01
2016-05-28 18:53:55 +00:00
drh
66bf810467 Remove an unnecessary malloc from the vfsstat extension.
FossilOrigin-Name: 24f258c2392290168cf34622b89a4a406a3dd853
2016-05-28 17:45:15 +00:00
drh
c1502e2f4f Enhance the sqlite3_load_extension() interface to permit extensions to
return SQLITE_OK_LOAD_PERMANENTLY which will prevent the extensions from
unloading when the database connection closes.

FossilOrigin-Name: d3f99a5e8d0486d0917dfe96987c179a6f63b850
2016-05-28 17:23:08 +00:00
drh
444c445ff8 Enhance "PRAGMA compile_options" so that it shows the version of the compiler
used to generate the executable, for common compilers.

FossilOrigin-Name: 6a0f200957ea294a2ae06c0b039a10ac838925f2
2016-05-28 15:22:33 +00:00
dan
00dae0a3ca Update the amalgamation-tarball configure script so that it can use header file "readline/readline.h" with library file "libedit".
FossilOrigin-Name: cbf72b04bb0650b62336d86b22ef59315ccdc183
2016-05-28 15:09:35 +00:00
drh
3c40ae7d3a Add the vfsstat.c loadable extension - a VFS shim that measures the amount
of I/O, and an eponymous virtual table that is used to extract and view
the measurements.

FossilOrigin-Name: 0987487dd4ebfcf66ddeec8ceca47775216a0887
2016-05-28 14:53:48 +00:00
mistachkin
f35b8f8369 Clang can define _MSC_VER in some circumstances; therefore, check for Clang first.
FossilOrigin-Name: 3f710bc3617691fa7432a24f1410d4651ca181b6
2016-05-28 00:13:21 +00:00
mistachkin
7ce6cdd515 Check for Clang before GCC.
FossilOrigin-Name: 7c2cd4b05f88a759bdf72d3a249db5984fd7105d
2016-05-27 21:13:43 +00:00
mistachkin
756e09c338 Remove surplus quotation marks from the COMPILER= compile_options setting for Clang.
FossilOrigin-Name: 5c966f200018043f5258eb03e043bb25c7766131
2016-05-27 20:30:02 +00:00
drh
2b9672e998 Remove surplus quotation marks from the COMPILER= compile_options setting
for GCC.

FossilOrigin-Name: 664c132dabe4a871d5c39c11b339f871ca3a5d31
2016-05-27 19:34:29 +00:00
mistachkin
15e2ddeab3 Add basic compiler information to the results of 'PRAGMA compile_options'.
FossilOrigin-Name: d734e2df40d95da74ce0c8dd2da1c14033cad8bb
2016-05-27 18:09:45 +00:00
drh
c84a4020ef Improvements to WHERE-clause debug tracing. Show TK_MATCH expressions and
show more details on WhereTerm traces.

FossilOrigin-Name: 71087c12bc75a82f5d1051600a442ef6efc5e899
2016-05-27 12:30:20 +00:00
drh
8dc8247eab Fix Lemon so that it actually works with -DYYSTACKDEPTH=0.
FossilOrigin-Name: a9be4c2d56d08fea2cd1aab20b19092a45ef7620
2016-05-27 04:10:47 +00:00
drh
baf254aef9 Fix the Lemon-generated parser so that it compiles with -DYYSTACKDEPTH=0.
It does compile now, but there are subtle issues still.

FossilOrigin-Name: 28d439f816d2fa5263e1c4ddecf3bf1ac2dd6549
2016-05-27 01:07:18 +00:00
drh
eeb9565a3e Add a new OP_SeekRowid opcode, that combines the functions of OP_MustBeInt
and OP_NotExists.  This makes the code slightly smaller and faster.

FossilOrigin-Name: ffe80a1bfa014943a614fc6993c1749b9bfec4c1
2016-05-26 20:56:38 +00:00
drh
ce3c5011d9 Add the libvers.c tool in the tool/ subdirectory.
FossilOrigin-Name: 2a41f098b2f0523b3d7e6eba6ae91cc0d30752df
2016-05-25 18:53:39 +00:00
drh
756b41ebd4 Enhance Lemon and the parser template so that it can once again build parsers
that have no unreachable branches.

FossilOrigin-Name: 41fd46e2962ba9a1e1f6867567499d1f6f5b8372
2016-05-24 18:55:08 +00:00
drh
f34a25a23b Minor change to the walcrash4.test module so that it works when
SQLITE_DEFAULT_WAL_SYNCHRONOUS is set to something other than 2.

FossilOrigin-Name: 61e239bc4310eff172e1e50d51522ecc75dd997e
2016-05-24 18:50:41 +00:00
dan
fe912510ea Fix an obscure problem with transactions written in "PRAGMA synchronous=full" mode on systems that do not support POWERSAFE_OVERWRITE causing an xSync() call to be omitted if the last frame written by a transaction is aligned to a sector boundary. This means that if a power failure or OS crash occurs very soon after such a transaction is committed, it may be lost following system recovery.
FossilOrigin-Name: 37de3eab67f12ae1ce5bc8d5e541c64fc6b1fd80
2016-05-24 16:20:51 +00:00
drh
abecc0b883 Improvements to the initialization of the push-down automoton for the
Lemon-generated parser.  Smaller and faster.

FossilOrigin-Name: 3b28b68e232060f8b2fe2fe6fa478280da2006ff
2016-05-24 00:40:54 +00:00
drh
118ab65859 Use a pointer to the top of the stack rather than an index into the stack
in the Lemon-generated parser template, for about 6.6% parser performance gain.

FossilOrigin-Name: 3c2a770549d5bb65fcd6cc684e0a0ae6d641ac68
2016-05-23 21:56:24 +00:00
drh
605123a277 Avoid a minor error message when running RTREE without an sqlite_stat1 table.
FossilOrigin-Name: 276e92f5b4c1ee49eabb738b24d73d7af90fb13c
2016-05-23 19:02:58 +00:00
drh
f1e2c8e1ff Fix the rtreeG.test test case.
FossilOrigin-Name: 9589e9377118efc356c73ea1aab2d7e6c2f7fc36
2016-05-23 18:27:07 +00:00