Commit Graph

17009 Commits

Author SHA1 Message Date
drh
c595419910 Minor changes to make some newer test cases work under more compile-time
options.

FossilOrigin-Name: 382eea36c56f866efee1321f643687a4061e8b9e
2016-12-27 02:43:47 +00:00
drh
dfcfff646a During fuzz testing with the fuzzcheck utility program, impose a record
length limit of 100MB and a limit on the length of LIKE strings of 50 bytes.

FossilOrigin-Name: edc9db41f3ee200ba44579a46ed8331bbbbf539e
2016-12-26 12:25:19 +00:00
drh
e6ce2b6704 Enable ossfuzz.c to build even if SQLITE_OMIT_PROGRESS_CALLBACK is defined.
FossilOrigin-Name: a37c00dcd192f9d610ecb91810ef57ef41d1f6a6
2016-12-26 12:14:44 +00:00
drh
9cc5b4eeb5 Remove an incorrect ALWAYS() macro from balance_nonroot(), which could result
in corrupt databases if it were optimized out.  This ALWAYS was added 
only two weeks ago (check-in [f9f2e23bbd68a]) and has never appeared in an
official release.

FossilOrigin-Name: e447b23cfd7bb31817e42adb3a98868d351c6b8a
2016-12-26 01:41:33 +00:00
drh
beaf514e23 Enhance the fuzztest utility with the --prng-seed option. Always reseed the
PRNG prior to each test.

FossilOrigin-Name: 8c5187f69d719b69aa6eaf2dc8f89243e5979222
2016-12-26 00:15:56 +00:00
drh
6a5a4208fc Combine the implementations of the ".tables" and ".indexes" commands in the
command-line shell.  The ".indexes" command now puts the indexes in multiple
columns, just like ".tables" and shows all indexes in all attached databases.

FossilOrigin-Name: def29333655691c7d54451193be13445a2857d29
2016-12-24 21:32:40 +00:00
drh
2951809ed4 The schema name "main" is always an acceptable alias for the primary database
even if the primary database is renamed using SQLITE_DBCONFIG_MAINDBNAME.

FossilOrigin-Name: 2f481b854f04bec546eb172d1b6dbc88067d3fda
2016-12-24 19:37:16 +00:00
drh
b20a61b704 Change the output format of the ".databases" command in the command-line shell
so that it shows the schema name, a colon, and the corresponding filename.

FossilOrigin-Name: 8558512e9ca343300a767ef23810f2d7b50fd925
2016-12-24 18:18:58 +00:00
drh
a4b81d2a44 In the command-line shell, improve the formatting to the ".databases"
command and on the ".tables" command, only show the schema prefix for
databases past the first ("main") database.

FossilOrigin-Name: c0d5626e274cbf8c2d2167183c4d6835d72dae57
2016-12-24 18:04:28 +00:00
drh
6bd4dc6dc4 Fill in missing opcode documentation entries for OP_SorterNext and
OP_SorterSort.

FossilOrigin-Name: 2940661b8c014b94973e05c44f1b1f4f443dbdd3
2016-12-23 16:05:22 +00:00
drh
cfdc235ec3 Use the VList object to capture the mapping between SQL parameter names and
variable numbers in a single memory allocation.

FossilOrigin-Name: 99fddf2ecb7202bfdf5ddc4cc1c4e155c883f7ec
2016-12-23 13:54:22 +00:00
drh
ce1bbe51b5 Add check to prevent a VList from growing after pointers to labels have been
taken.

FossilOrigin-Name: aa23d7eaf69f5ecbf9500b2353846094cae41e6c
2016-12-23 13:52:45 +00:00
drh
f326d66d61 Fix the VList object so that it actually works.
FossilOrigin-Name: 9dcd85698af46fd5ba34004ca690d368c4ae3078
2016-12-23 13:30:53 +00:00
drh
9bf755cc44 Use the VList object to replace Parse.azVar for tracking the mapping between
SQL parameter names and parameter numbers.  There is a performance
improvement, though there are still a few hiccups in the current code.

FossilOrigin-Name: 68ecafa1425a41358c88f41efea3262f1b4490f2
2016-12-23 03:59:31 +00:00
drh
344a1bf133 Fix harmless compiler warnings.
FossilOrigin-Name: fa86db2f915c0a189c3be02b1aaa7f24d339d7d6
2016-12-22 14:53:25 +00:00
drh
cdfffed790 Change the default lookaside configuration from 500 slots of 128 bytes each to 125 slots of 512 bytes each. This uses the same amount of memory (64,000 bytes) but seems to perform much better in test applications.
FossilOrigin-Name: 52a12e47de88744187bd1c71f2820885cde414a8
2016-12-21 21:26:58 +00:00
drh
a582b01698 Simplifications to the way UnpackedRecord objects are allocated. Smaller
and faster code that also fixes a subtle (currently unreachable) bug.

FossilOrigin-Name: f7ab01f254cd9d7006b8dec29adb234a671b8e6f
2016-12-21 19:45:54 +00:00
drh
f99dd359d0 Change the OP_IfNotZero opcode so that it decrements register P1 by 1 rather
than the value in P3, and so that it only decrements if originally positive.
This avoids decrementing the smallest 64-bit signed integer.

FossilOrigin-Name: 165c044686212fbf7182dd560ad1e57eb4cc9838
2016-12-18 17:42:00 +00:00
drh
22d709dd91 Refinements to the new dbfuzz test program.
FossilOrigin-Name: 50325abe79b6a79b09ec6a1cee7d80ca02337428
2016-12-17 21:07:30 +00:00
drh
6918e2f9b2 Enhance fuzzershell.c to read and execute SQL commands in the autoexec table
of the database under test.  Add the dbfuzz.c test program combining selected
features of fuzzershell.c and fuzzcheck.c.

FossilOrigin-Name: ef6e071a62cd79a0edbbef9f41ca9482540e5cb8
2016-12-17 20:27:22 +00:00
dan
11da002c02 Fix a problem in the shell tools readfile() command causing blobs to be
truncated at the first embedded 0x00 byte in release builds, or an assert() to
fail in a debug build.

FossilOrigin-Name: 8dedd6ad44bd1d103dced9d1350188cb2327128d
2016-12-17 08:18:05 +00:00
drh
d47c6c495d Add the ".lint fkey-indexes" command to the command-line shell.
FossilOrigin-Name: 94689e3bdac2eabbcf1a51d741c2604ed4bd8a40
2016-12-16 18:43:49 +00:00
drh
3fd9f33bd1 Fix minor issues with the ".lint" command implemention in the shell and
the shell help text related to ".lint".

FossilOrigin-Name: 1268dc77712d85de0b62332c88b22f7489f4e87f
2016-12-16 18:41:11 +00:00
drh
186c930702 Built-in PRAGMA statements without side-effects can be invoked as
table-valued functions by prefixing their name with "pragma_".

FossilOrigin-Name: d66ec5cfb67c6c8134fb642e0c2f72113fe1b7fd
2016-12-16 18:14:19 +00:00
dan
3c7ebeb548 Change ".fkey_missing_indexes" to ".lint fkey-indexes".
FossilOrigin-Name: ee621ade38c11806e1df57c459da5f018a6d0670
2016-12-16 17:28:56 +00:00
dan
dd9e0be46a Update .fkey_missing_indexes to use the built-in pragma vtabs.
FossilOrigin-Name: 3ab05987b0cc12af64bf32d885d04aff45d7a77c
2016-12-16 16:44:27 +00:00
dan
c17f6255a4 Merge the pragma-as-vtab change into this branch.
FossilOrigin-Name: 4ba45e722371ca4343e3563e7e1c2896b48c9a87
2016-12-16 16:13:45 +00:00
dan
69b9383edf Fix a problem causing the planner to generate sub-optimal plans for some queries
that use recursive WITH sub-queries with LIMIT clauses.

FossilOrigin-Name: 053a149cc8244a7f85137129cfcb8622efe90306
2016-12-16 15:05:40 +00:00
drh
d8b7200b84 Fix an error in the way the "schema" argument to some pragma virtual tables
is handled.

FossilOrigin-Name: 546821e29edb0282a4b1d8f49512e36027a6bf6d
2016-12-16 04:20:27 +00:00
drh
30776acd74 Simplifications to facilitate full test coverage.
FossilOrigin-Name: 01afc515970a868c6a36d9a598453d0fde9e39ca
2016-12-16 02:31:50 +00:00
drh
9a63f09204 Minor bug fixes and enhancements to the pragma eponymous virtual tables.
FossilOrigin-Name: 3f8f461504139a4efea0e033e3a274cc4b2d3072
2016-12-16 02:14:15 +00:00
drh
c06bbceb9c Merge enhancements from trunk, and especially the ability to use
temp.sqlite_master as an alias for sqlite_temp_master.

FossilOrigin-Name: 994a4401f5c34fed17af420761291b03072a5ea1
2016-12-16 01:09:22 +00:00
drh
e0a04a36a6 All temp.sqlite_master to be used as an alias for sqlite_temp_master.
FossilOrigin-Name: 8d646905b830d5bb29092e103ac5cb499b3c7e5a
2016-12-16 01:00:21 +00:00
drh
ae7045cd53 Fix the cost estimation in the BestIndex method of the eponymous pragma
virtual table implementation.

FossilOrigin-Name: 7126807a186746a8663fbaa267d63214d06476e4
2016-12-15 21:33:55 +00:00
drh
d7175ebeaf The pragma as eponymous virtual table mechanism now appears to work.
FossilOrigin-Name: 2c274a1a7b57ef1208901fbc1d96d39c0d492652
2016-12-15 21:11:15 +00:00
drh
2fcc1590c4 Code to automatically create eponymous virtual tables for read-only pragmas.
Compiles, but does not yet work.

FossilOrigin-Name: 988a61e8b03f302c69d11898d1ea95f002cba1a5
2016-12-15 20:59:03 +00:00
drh
35a1895990 Do exponential rather than linear expansion of the SrcList.a array when
appending new elements, to reduce the number of malloc() calls.

FossilOrigin-Name: 4e3749127e7249f46e17bfabc614b0876f60565a
2016-12-15 18:59:14 +00:00
drh
c232aca184 Do more pragma processing from tables rather than in-line code.
FossilOrigin-Name: a88ca3524b97f296dffc68335466b3767a681747
2016-12-15 16:01:17 +00:00
dan
f9647b6625 Add the -groupbyparent option to the ".fkey_missing_indexes" command.
FossilOrigin-Name: 976c51b4836dfba2ce9b246334a85bda08ac526f
2016-12-15 06:01:40 +00:00
dan
35ac58eabc Add the experimental ".fkey_missing_indexes" command to the shell tool. To
identify indexes that should be created on child keys if FK processing is to
be enabled.

FossilOrigin-Name: 7df23aca1f7c7b769d614d740b3fda3073f46ba9
2016-12-14 19:28:27 +00:00
drh
79df77821a Refactor the Table.nRef field as Table.nTabRef for easier grepping.
FossilOrigin-Name: 9cae4c2e300e20304ced0dc8c1415c4922185928
2016-12-14 14:07:35 +00:00
drh
d07df8e76a Increase the size of the reference count on Table objects to 32 bits.
FossilOrigin-Name: d08b72c38ff6fae6ddf7dc84a54f6d7189876289
2016-12-14 13:54:25 +00:00
drh
5ed7de09b0 Fix the configure makefile to align it with the manual makefile. Unsaved
changes from the previous check-in.

FossilOrigin-Name: 00a184b65f73f361e1728fea06529f746fab66b5
2016-12-14 11:39:52 +00:00
drh
c06e54345c Adjust the unix makefiles so that "make test" runs fuzzcheck prior to even
attempting to build the other test programs.

FossilOrigin-Name: bb48f7a55945da4cee369bae0809037900fcaac7
2016-12-14 11:23:51 +00:00
drh
ac178b3d7f Three times faster sqlite3SrcListAppend() in the common case by avoiding the
call to sqlite3SrcListEnlarge() for the first allocation.

FossilOrigin-Name: 0ea2762f1d8f6a93ae2ee3b7b835927a474c6f66
2016-12-14 11:14:13 +00:00
drh
8a123d60a8 Fix the optimization that prevents writing freelist pages to the journal.
FossilOrigin-Name: 6aa9b26544cbd0b41115c5f127dcf9a286d17e2b
2016-12-14 10:30:12 +00:00
drh
79f20e96dc In the command-line shell, in the output of the ".dump", ".schema", and
".fullschema" commands, convert CREATE TABLE statements that appear to come
from shadow tables into CREATE TABLE IF NOT EXISTS statements.

FossilOrigin-Name: c7021960f5c070fb5c9db9e41b4000d3dc065f42
2016-12-13 23:22:39 +00:00
drh
380c08eaad Fix harmless compiler warnings.
FossilOrigin-Name: ed2c9f3738c96d8e3dbece7ccb721cb1a8ae8fac
2016-12-13 20:30:29 +00:00
drh
fc4111f7d6 Convert sqlite3PagerGet() into a pointer-dispatched virtual method. This
makes it about 25% faster.

FossilOrigin-Name: 7f88bb44129a0cd36e27e00dc7c37e87cf3c90f7
2016-12-13 18:47:54 +00:00
drh
cbed604f52 In the pager, avoid checking for the illegal page number 0 except when creating
a new page.

FossilOrigin-Name: dee20ba982125ea98c280ad1571789af0f393903
2016-12-13 18:34:01 +00:00