]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
8 years agoPut the affinity() function implementation inside of #ifdef SQLITE_DEBUG. affinity-sql-func
drh [Tue, 3 Jan 2017 14:39:30 +0000 (14:39 +0000)] 
Put the affinity() function implementation inside of #ifdef SQLITE_DEBUG.

FossilOrigin-Name: f778f58ae4ea3e16f51b94591a2c1e563dcb0cde

8 years agoMerge all the latest changes from trunk.
drh [Tue, 3 Jan 2017 14:30:28 +0000 (14:30 +0000)] 
Merge all the latest changes from trunk.

FossilOrigin-Name: c27cd8a8127b81d3176f6a5b9915c9b3c69574fb

8 years agoDefer size checking on row-value assignments for when the RHS is a SELECT
drh [Tue, 3 Jan 2017 13:45:22 +0000 (13:45 +0000)] 
Defer size checking on row-value assignments for when the RHS is a SELECT
until after the "*" wildcards have been expanded.

FossilOrigin-Name: 36944be6be5c42096f5da84187ff203af26b08ae

8 years agoFix a typo on a comment. No code changes.
drh [Tue, 3 Jan 2017 11:59:54 +0000 (11:59 +0000)] 
Fix a typo on a comment.  No code changes.

FossilOrigin-Name: abc27b6023e28a717bfa15648ddc152bda9c7b96

8 years agoAdd test cases for the fix in [f12ed3ce]. No problems discovered.
dan [Tue, 3 Jan 2017 08:11:24 +0000 (08:11 +0000)] 
Add test cases for the fix in [f12ed3ce]. No problems discovered.

FossilOrigin-Name: 548532fdcf84d565c17aed79a6b595e8b62a3ab4

8 years agoImprovements to the way vector assignment size checking is done. Size checks vector-size-check
drh [Tue, 3 Jan 2017 02:58:01 +0000 (02:58 +0000)] 
Improvements to the way vector assignment size checking is done.  Size checks
when the RHS is a SELECT are deferred until after "*" wildcards are expanded.

FossilOrigin-Name: 696219b11049930cdbc38f574820f4bbaf8621bb

8 years agoFix the row-values in UPDATE statements within TRIGGER problem identified
drh [Tue, 3 Jan 2017 01:24:10 +0000 (01:24 +0000)] 
Fix the row-values in UPDATE statements within TRIGGER problem identified
by ticket [8c9458e7].

FossilOrigin-Name: f12ed3ce0bfb2d94c9baad23fdcbd816c72439a1

8 years agoImproved assert()s on the sqlite3ExprListDup() logic for TK_SELECT_COLUMN. rowvalue-update-trigger
drh [Tue, 3 Jan 2017 00:27:16 +0000 (00:27 +0000)] 
Improved assert()s on the sqlite3ExprListDup() logic for TK_SELECT_COLUMN.

FossilOrigin-Name: 14da99d41f7968bf816203b4ae11c1f0d1ee0b5d

8 years agoTest cases for the row-value UPDATE TRIGGER fix.
drh [Mon, 2 Jan 2017 23:43:03 +0000 (23:43 +0000)] 
Test cases for the row-value UPDATE TRIGGER fix.

FossilOrigin-Name: b9b964373c89a491649f366ad7d70ae4d69b891d

8 years agoPut an ALWAYS() on an unreachable branch in the sqlite3ExprListDup() routine.
drh [Mon, 2 Jan 2017 23:18:35 +0000 (23:18 +0000)] 
Put an ALWAYS() on an unreachable branch in the sqlite3ExprListDup() routine.

FossilOrigin-Name: 2caaaab5e07f6b76d66fbe4e93a4b956937427d8

8 years agoProposed fix for the row-value TRIGGER UPDATE problem described in
drh [Mon, 2 Jan 2017 22:36:32 +0000 (22:36 +0000)] 
Proposed fix for the row-value TRIGGER UPDATE problem described in
ticket [8c9458e7].

FossilOrigin-Name: 61a442ea2ceec2cbd327dae0ff5214e1f3c69ec0

8 years agoIncrease the version number to 3.17.0 for the next release cycle.
drh [Mon, 2 Jan 2017 19:10:14 +0000 (19:10 +0000)] 
Increase the version number to 3.17.0 for the next release cycle.

FossilOrigin-Name: 16415b5aad445c9e4e849018b48538d74eec8944

8 years agoProvide the SQLITE_DEFAULT_LOOKASIDE compile-time option and make it's default
drh [Mon, 2 Jan 2017 19:02:20 +0000 (19:02 +0000)] 
Provide the SQLITE_DEFAULT_LOOKASIDE compile-time option and make it's default
value be 1200,100 (raised from 512,125 in the latest release).

FossilOrigin-Name: 584da48f9e818f25134e0a62fb7e84f07019511f

8 years agoChange SQLITE_DEFAULT_PCACHE_INITSZ from 100 to 20, which is experimentally
drh [Mon, 2 Jan 2017 18:40:03 +0000 (18:40 +0000)] 
Change SQLITE_DEFAULT_PCACHE_INITSZ from 100 to 20, which is experimentally
determined to be slightly faster.

FossilOrigin-Name: 12d9493cb29307aec65ceccc68e802e4d0f18112

8 years agoAvoid unnecessary calls to sqlite3BtreeEnterAll() and sqlite3BtreeLeaveAll()
drh [Mon, 2 Jan 2017 18:19:29 +0000 (18:19 +0000)] 
Avoid unnecessary calls to sqlite3BtreeEnterAll() and sqlite3BtreeLeaveAll()
when no btree is using shared-cache.

FossilOrigin-Name: cfb3158204628eb2fd170090a7f212df0e4ce6c9

8 years agoAdd the --all option to the wordcount test program.
drh [Mon, 2 Jan 2017 12:20:15 +0000 (12:20 +0000)] 
Add the --all option to the wordcount test program.
Fix the speedtest1 test program so that it builds on MSVC and so that
the --lookaside 0 0 option works.

FossilOrigin-Name: cb338f367e5408861bd7c0fbf74cebdbd8e3c515

8 years agoVersion 3.16.0 version-3.16.0
drh [Mon, 2 Jan 2017 11:57:58 +0000 (11:57 +0000)] 
Version 3.16.0

FossilOrigin-Name: 04ac0b75b1716541b2b97704f4809cb7ef19cccf

8 years agoDetect row-value comparison size mismatches even when the size of one
drh [Sun, 1 Jan 2017 12:44:07 +0000 (12:44 +0000)] 
Detect row-value comparison size mismatches even when the size of one
operand is obscured by an unexpanded subquery.

FossilOrigin-Name: 2c4d167ccd4be591487f404de9ee629fd484c8bf

8 years agoAdd the --help and --all options to the wordcount test utility. wordcount-enhancement
drh [Sat, 31 Dec 2016 21:55:23 +0000 (21:55 +0000)] 
Add the --help and --all options to the wordcount test utility.

FossilOrigin-Name: 18baeadfc89f6252e38dbc22904b11c5b56347ee

8 years agoIn speedtest1.c, make the "--lookaside 0 0" option completely disable lookaside. speedtest1
drh [Sat, 31 Dec 2016 18:37:50 +0000 (18:37 +0000)] 
In speedtest1.c, make the "--lookaside 0 0" option completely disable lookaside.

FossilOrigin-Name: 52b99bcbf18f34196ec29f829c6af539e0d05524

8 years agoMinor #include change to speedtest1.c so that it will compile under MSVC.
drh [Sat, 31 Dec 2016 14:33:05 +0000 (14:33 +0000)] 
Minor #include change to speedtest1.c so that it will compile under MSVC.

FossilOrigin-Name: 8c28fde004678c85524770969eb001719b109179

8 years agoFix a crash that could occur following an OOM in the group_concat() function
dan [Fri, 30 Dec 2016 17:40:14 +0000 (17:40 +0000)] 
Fix a crash that could occur following an OOM in the group_concat() function
if the second argument is an SQLITE_BLOB value.

FossilOrigin-Name: 14d855d2b2b5b3485e0673d11405db7266b34c6d

8 years agoStrengthen the defense against OOM in the instr() SQL function.
drh [Fri, 30 Dec 2016 15:16:20 +0000 (15:16 +0000)] 
Strengthen the defense against OOM in the instr() SQL function.

FossilOrigin-Name: a0971e713682a73d8c7c20511db256c20d2f6388

8 years agoAdd a test to ensure that the app-defined pcache xFetch() method is never
drh [Fri, 30 Dec 2016 14:25:42 +0000 (14:25 +0000)] 
Add a test to ensure that the app-defined pcache xFetch() method is never
passed a key of zero.

FossilOrigin-Name: 0bdbe49c6d392c4c86a6c01219c9d91d150dea7d

8 years agoAvoid passing NULL pointers to memcmp() or memcpy(), even when the
dan [Fri, 30 Dec 2016 14:15:56 +0000 (14:15 +0000)] 
Avoid passing NULL pointers to memcmp() or memcpy(), even when the
"number-of-bytes" argument is passed 0.

FossilOrigin-Name: 56ff72ab44288296efc99a608f7edc4346366a50

8 years agoFix a harmless compiler warning in fuzzcheck.c
drh [Fri, 30 Dec 2016 12:10:48 +0000 (12:10 +0000)] 
Fix a harmless compiler warning in fuzzcheck.c

FossilOrigin-Name: 2842bc60538369f888c7df8365858c910322277d

8 years agoDisable the pagerAcquireMapPage() routine if memory-mapped I/O is disabled.
drh [Fri, 30 Dec 2016 12:06:22 +0000 (12:06 +0000)] 
Disable the pagerAcquireMapPage() routine if memory-mapped I/O is disabled.
This fixes a harmless compiler warning on OpenBSD.

FossilOrigin-Name: 3e25ba6e42fba239795a465b8510386a361ee5be

8 years agoEncode a 64-bit integer literal in date.c as a constant expression so that
drh [Fri, 30 Dec 2016 00:09:14 +0000 (00:09 +0000)] 
Encode a 64-bit integer literal in date.c as a constant expression so that
it works on older compilers.  Also fix a harmless compiler warning in vdbe.c.

FossilOrigin-Name: f57952bac652901e1bd48b68301941efbcf29dc4

8 years agoFix harmless compiler warnings in the command-line shell and in Lemon.
drh [Thu, 29 Dec 2016 19:48:46 +0000 (19:48 +0000)] 
Fix harmless compiler warnings in the command-line shell and in Lemon.

FossilOrigin-Name: afcdc4a60e357d171156e0de705bf7ad1b37daab

8 years agoIn kvtest.c, use stat() instead of fseek()/ftell() to determine the size of
drh [Thu, 29 Dec 2016 17:25:06 +0000 (17:25 +0000)] 
In kvtest.c, use stat() instead of fseek()/ftell() to determine the size of
a BLOB to be read directly from disk.  This makes the pile-of-files database
more competative against SQLite.

FossilOrigin-Name: a7dca29f03e037fe71cc600db97f8058e3bd28a4

8 years agoAdd the kvtest.c test program used to show that it is many times faster to
drh [Thu, 29 Dec 2016 16:58:01 +0000 (16:58 +0000)] 
Add the kvtest.c test program used to show that it is many times faster to
read thumbnail and similar BLOBs out of an SQLite database than it is to read
them as separate files from the filesystem.

FossilOrigin-Name: 8074d59cf177cb91ee371e2660f2c59ce540b7e2

8 years agoAdd more detail to the header command to further explain how to compile and kvtest
drh [Thu, 29 Dec 2016 16:49:22 +0000 (16:49 +0000)] 
Add more detail to the header command to further explain how to compile and
use the kvtest.c utility.

FossilOrigin-Name: 55d29839c9fafe9e6a694f5790151d1f22396b01

8 years agoFix kvtest.c so that it compiles using MSVC.
drh [Thu, 29 Dec 2016 16:18:35 +0000 (16:18 +0000)] 
Fix kvtest.c so that it compiles using MSVC.

FossilOrigin-Name: e2bbeae7e77cde531885ca492494a02e5322154d

8 years agoIn kvtest.c: do not show the --cache-size setting on fopen() runs.
drh [Thu, 29 Dec 2016 15:26:50 +0000 (15:26 +0000)] 
In kvtest.c: do not show the --cache-size setting on fopen() runs.
Show progress for the (potentially slow) "export" command.

FossilOrigin-Name: b0f58d2470e08b9c217afd19fcfde3e6d1007d1d

8 years agoImprovements to the kvtest.c utility. Added the --cache-size option.
drh [Thu, 29 Dec 2016 14:44:43 +0000 (14:44 +0000)] 
Improvements to the kvtest.c utility.  Added the --cache-size option.
Additional reporting of version and settings at the end of "./kvtest run".

FossilOrigin-Name: f6fcac6ae8b3bffee6bf994eef2064affd301a95

8 years agoAdd the kvtest.c test program for measuring key/value read performance under
drh [Thu, 29 Dec 2016 03:57:43 +0000 (03:57 +0000)] 
Add the kvtest.c test program for measuring key/value read performance under
various scenarios.

FossilOrigin-Name: 489e0787c1ea47963174387e8ade6295ceff568e

8 years agoDo not allow the nockpt.test module to run under the inmemory_journal
drh [Tue, 27 Dec 2016 15:59:15 +0000 (15:59 +0000)] 
Do not allow the nockpt.test module to run under the inmemory_journal
permutation.

FossilOrigin-Name: a6af06f164b1f65779e2171ec4946119c66f9be8

8 years agoAllow sqlite3_interrupt() to be invoked on a database connection that is in
drh [Tue, 27 Dec 2016 13:33:52 +0000 (13:33 +0000)] 
Allow sqlite3_interrupt() to be invoked on a database connection that is in
the process of being closed even if SQLITE_ENABLE_API_ARMOR is defined.

FossilOrigin-Name: 7854bee260996087bdb7f8729ba8cfb4f467f93f

8 years agoAdjust a corruption test case to accommodate the sqlite3BtreeInsert()
drh [Tue, 27 Dec 2016 12:45:41 +0000 (12:45 +0000)] 
Adjust a corruption test case to accommodate the sqlite3BtreeInsert()
optimization of check-in [0b86fbca66].

FossilOrigin-Name: 4cb0945f13f2040c8b67936b950da48fc951d55d

8 years agoDisable new test modules nockpt.test and interrupt2.test for incompatible
drh [Tue, 27 Dec 2016 12:35:36 +0000 (12:35 +0000)] 
Disable new test modules nockpt.test and interrupt2.test for incompatible
permutations.  Add a CORRUPT_DB term to an assert() in vdbe.c.

FossilOrigin-Name: a54e619e6f0266932c8873f9ac826fd042a0602f

8 years agoAvoid a potential (harmless) signed integer overflow in memory usage
drh [Tue, 27 Dec 2016 12:08:36 +0000 (12:08 +0000)] 
Avoid a potential (harmless) signed integer overflow in memory usage
accounting when calling sqlite3_realloc() to reduce the size of an
allocation.

FossilOrigin-Name: 2d71cbdf6bc24f0269027c70b39ea7f342436bdb

8 years agoMinor changes to make some newer test cases work under more compile-time
drh [Tue, 27 Dec 2016 02:43:47 +0000 (02:43 +0000)] 
Minor changes to make some newer test cases work under more compile-time
options.

FossilOrigin-Name: 382eea36c56f866efee1321f643687a4061e8b9e

8 years agoDuring fuzz testing with the fuzzcheck utility program, impose a record
drh [Mon, 26 Dec 2016 12:25:19 +0000 (12:25 +0000)] 
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

8 years agoEnable ossfuzz.c to build even if SQLITE_OMIT_PROGRESS_CALLBACK is defined.
drh [Mon, 26 Dec 2016 12:14:44 +0000 (12:14 +0000)] 
Enable ossfuzz.c to build even if SQLITE_OMIT_PROGRESS_CALLBACK is defined.

FossilOrigin-Name: a37c00dcd192f9d610ecb91810ef57ef41d1f6a6

8 years agoRemove an incorrect ALWAYS() macro from balance_nonroot(), which could result
drh [Mon, 26 Dec 2016 01:41:33 +0000 (01:41 +0000)] 
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

8 years agoAdd the built-in affinity() SQL function.
drh [Mon, 26 Dec 2016 00:18:36 +0000 (00:18 +0000)] 
Add the built-in affinity() SQL function.

FossilOrigin-Name: 57e40e1cb1bcd3dd8473d2fdeecc9c7ff3d6192b

8 years agoEnhance the fuzztest utility with the --prng-seed option. Always reseed the
drh [Mon, 26 Dec 2016 00:15:56 +0000 (00:15 +0000)] 
Enhance the fuzztest utility with the --prng-seed option.  Always reseed the
PRNG prior to each test.

FossilOrigin-Name: 8c5187f69d719b69aa6eaf2dc8f89243e5979222

8 years agoCombine the implementations of the ".tables" and ".indexes" commands in the
drh [Sat, 24 Dec 2016 21:32:40 +0000 (21:32 +0000)] 
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

8 years agoThe schema name "main" is always an acceptable alias for the primary database
drh [Sat, 24 Dec 2016 19:37:16 +0000 (19:37 +0000)] 
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

8 years agoChange the output format of the ".databases" command in the command-line shell
drh [Sat, 24 Dec 2016 18:18:58 +0000 (18:18 +0000)] 
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

8 years agoIn the command-line shell, improve the formatting to the ".databases"
drh [Sat, 24 Dec 2016 18:04:28 +0000 (18:04 +0000)] 
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

8 years agoFill in missing opcode documentation entries for OP_SorterNext and
drh [Fri, 23 Dec 2016 16:05:22 +0000 (16:05 +0000)] 
Fill in missing opcode documentation entries for OP_SorterNext and
OP_SorterSort.

FossilOrigin-Name: 2940661b8c014b94973e05c44f1b1f4f443dbdd3

8 years agoUse the VList object to capture the mapping between SQL parameter names and
drh [Fri, 23 Dec 2016 13:54:22 +0000 (13:54 +0000)] 
Use the VList object to capture the mapping between SQL parameter names and
variable numbers in a single memory allocation.

FossilOrigin-Name: 99fddf2ecb7202bfdf5ddc4cc1c4e155c883f7ec

8 years agoAdd check to prevent a VList from growing after pointers to labels have been VList
drh [Fri, 23 Dec 2016 13:52:45 +0000 (13:52 +0000)] 
Add check to prevent a VList from growing after pointers to labels have been
taken.

FossilOrigin-Name: aa23d7eaf69f5ecbf9500b2353846094cae41e6c

8 years agoFix the VList object so that it actually works.
drh [Fri, 23 Dec 2016 13:30:53 +0000 (13:30 +0000)] 
Fix the VList object so that it actually works.

FossilOrigin-Name: 9dcd85698af46fd5ba34004ca690d368c4ae3078

8 years agoUse the VList object to replace Parse.azVar for tracking the mapping between
drh [Fri, 23 Dec 2016 03:59:31 +0000 (03:59 +0000)] 
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

8 years agoFix harmless compiler warnings.
drh [Thu, 22 Dec 2016 14:53:25 +0000 (14:53 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: fa86db2f915c0a189c3be02b1aaa7f24d339d7d6

8 years agoChange the default lookaside configuration from 500 slots of 128 bytes each to 125...
drh [Wed, 21 Dec 2016 21:26:58 +0000 (21:26 +0000)] 
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

8 years agoSimplifications to the way UnpackedRecord objects are allocated. Smaller
drh [Wed, 21 Dec 2016 19:45:54 +0000 (19:45 +0000)] 
Simplifications to the way UnpackedRecord objects are allocated.  Smaller
and faster code that also fixes a subtle (currently unreachable) bug.

FossilOrigin-Name: f7ab01f254cd9d7006b8dec29adb234a671b8e6f

8 years agoChange the OP_IfNotZero opcode so that it decrements register P1 by 1 rather
drh [Sun, 18 Dec 2016 17:42:00 +0000 (17:42 +0000)] 
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

8 years agoRefinements to the new dbfuzz test program.
drh [Sat, 17 Dec 2016 21:07:30 +0000 (21:07 +0000)] 
Refinements to the new dbfuzz test program.

FossilOrigin-Name: 50325abe79b6a79b09ec6a1cee7d80ca02337428

8 years agoEnhance fuzzershell.c to read and execute SQL commands in the autoexec table
drh [Sat, 17 Dec 2016 20:27:22 +0000 (20:27 +0000)] 
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

8 years agoFix a problem in the shell tools readfile() command causing blobs to be
dan [Sat, 17 Dec 2016 08:18:05 +0000 (08:18 +0000)] 
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

8 years agoAdd the ".lint fkey-indexes" command to the command-line shell.
drh [Fri, 16 Dec 2016 18:43:49 +0000 (18:43 +0000)] 
Add the ".lint fkey-indexes" command to the command-line shell.

FossilOrigin-Name: 94689e3bdac2eabbcf1a51d741c2604ed4bd8a40

8 years agoFix minor issues with the ".lint" command implemention in the shell and fkey-missing-indexes
drh [Fri, 16 Dec 2016 18:41:11 +0000 (18:41 +0000)] 
Fix minor issues with the ".lint" command implemention in the shell and
the shell help text related to ".lint".

FossilOrigin-Name: 1268dc77712d85de0b62332c88b22f7489f4e87f

8 years agoBuilt-in PRAGMA statements without side-effects can be invoked as
drh [Fri, 16 Dec 2016 18:14:19 +0000 (18:14 +0000)] 
Built-in PRAGMA statements without side-effects can be invoked as
table-valued functions by prefixing their name with "pragma_".

FossilOrigin-Name: d66ec5cfb67c6c8134fb642e0c2f72113fe1b7fd

8 years agoChange ".fkey_missing_indexes" to ".lint fkey-indexes".
dan [Fri, 16 Dec 2016 17:28:56 +0000 (17:28 +0000)] 
Change ".fkey_missing_indexes" to ".lint fkey-indexes".

FossilOrigin-Name: ee621ade38c11806e1df57c459da5f018a6d0670

8 years agoUpdate .fkey_missing_indexes to use the built-in pragma vtabs.
dan [Fri, 16 Dec 2016 16:44:27 +0000 (16:44 +0000)] 
Update .fkey_missing_indexes to use the built-in pragma vtabs.

FossilOrigin-Name: 3ab05987b0cc12af64bf32d885d04aff45d7a77c

8 years agoMerge the pragma-as-vtab change into this branch.
dan [Fri, 16 Dec 2016 16:13:45 +0000 (16:13 +0000)] 
Merge the pragma-as-vtab change into this branch.

FossilOrigin-Name: 4ba45e722371ca4343e3563e7e1c2896b48c9a87

8 years agoFix a problem causing the planner to generate sub-optimal plans for some queries
dan [Fri, 16 Dec 2016 15:05:40 +0000 (15:05 +0000)] 
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

8 years agoFix an error in the way the "schema" argument to some pragma virtual tables pragma-as-vtab
drh [Fri, 16 Dec 2016 04:20:27 +0000 (04:20 +0000)] 
Fix an error in the way the "schema" argument to some pragma virtual tables
is handled.

FossilOrigin-Name: 546821e29edb0282a4b1d8f49512e36027a6bf6d

8 years agoSimplifications to facilitate full test coverage.
drh [Fri, 16 Dec 2016 02:31:50 +0000 (02:31 +0000)] 
Simplifications to facilitate full test coverage.

FossilOrigin-Name: 01afc515970a868c6a36d9a598453d0fde9e39ca

8 years agoMinor bug fixes and enhancements to the pragma eponymous virtual tables.
drh [Fri, 16 Dec 2016 02:14:15 +0000 (02:14 +0000)] 
Minor bug fixes and enhancements to the pragma eponymous virtual tables.

FossilOrigin-Name: 3f8f461504139a4efea0e033e3a274cc4b2d3072

8 years agoMerge enhancements from trunk, and especially the ability to use
drh [Fri, 16 Dec 2016 01:09:22 +0000 (01:09 +0000)] 
Merge enhancements from trunk, and especially the ability to use
temp.sqlite_master as an alias for sqlite_temp_master.

FossilOrigin-Name: 994a4401f5c34fed17af420761291b03072a5ea1

8 years agoAll temp.sqlite_master to be used as an alias for sqlite_temp_master.
drh [Fri, 16 Dec 2016 01:00:21 +0000 (01:00 +0000)] 
All temp.sqlite_master to be used as an alias for sqlite_temp_master.

FossilOrigin-Name: 8d646905b830d5bb29092e103ac5cb499b3c7e5a

8 years agoFix the cost estimation in the BestIndex method of the eponymous pragma
drh [Thu, 15 Dec 2016 21:33:55 +0000 (21:33 +0000)] 
Fix the cost estimation in the BestIndex method of the eponymous pragma
virtual table implementation.

FossilOrigin-Name: 7126807a186746a8663fbaa267d63214d06476e4

8 years agoThe pragma as eponymous virtual table mechanism now appears to work.
drh [Thu, 15 Dec 2016 21:11:15 +0000 (21:11 +0000)] 
The pragma as eponymous virtual table mechanism now appears to work.

FossilOrigin-Name: 2c274a1a7b57ef1208901fbc1d96d39c0d492652

8 years agoCode to automatically create eponymous virtual tables for read-only pragmas.
drh [Thu, 15 Dec 2016 20:59:03 +0000 (20:59 +0000)] 
Code to automatically create eponymous virtual tables for read-only pragmas.
Compiles, but does not yet work.

FossilOrigin-Name: 988a61e8b03f302c69d11898d1ea95f002cba1a5

8 years agoDo exponential rather than linear expansion of the SrcList.a array when
drh [Thu, 15 Dec 2016 18:59:14 +0000 (18:59 +0000)] 
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

8 years agoDo more pragma processing from tables rather than in-line code. table-driven-pragma
drh [Thu, 15 Dec 2016 16:01:17 +0000 (16:01 +0000)] 
Do more pragma processing from tables rather than in-line code.

FossilOrigin-Name: a88ca3524b97f296dffc68335466b3767a681747

8 years agoAdd the -groupbyparent option to the ".fkey_missing_indexes" command.
dan [Thu, 15 Dec 2016 06:01:40 +0000 (06:01 +0000)] 
Add the -groupbyparent option to the ".fkey_missing_indexes" command.

FossilOrigin-Name: 976c51b4836dfba2ce9b246334a85bda08ac526f

8 years agoAdd the experimental ".fkey_missing_indexes" command to the shell tool. To
dan [Wed, 14 Dec 2016 19:28:27 +0000 (19:28 +0000)] 
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

8 years agoRefactor the Table.nRef field as Table.nTabRef for easier grepping.
drh [Wed, 14 Dec 2016 14:07:35 +0000 (14:07 +0000)] 
Refactor the Table.nRef field as Table.nTabRef for easier grepping.

FossilOrigin-Name: 9cae4c2e300e20304ced0dc8c1415c4922185928

8 years agoIncrease the size of the reference count on Table objects to 32 bits.
drh [Wed, 14 Dec 2016 13:54:25 +0000 (13:54 +0000)] 
Increase the size of the reference count on Table objects to 32 bits.

FossilOrigin-Name: d08b72c38ff6fae6ddf7dc84a54f6d7189876289

8 years agoFix the configure makefile to align it with the manual makefile. Unsaved
drh [Wed, 14 Dec 2016 11:39:52 +0000 (11:39 +0000)] 
Fix the configure makefile to align it with the manual makefile.  Unsaved
changes from the previous check-in.

FossilOrigin-Name: 00a184b65f73f361e1728fea06529f746fab66b5

8 years agoAdjust the unix makefiles so that "make test" runs fuzzcheck prior to even
drh [Wed, 14 Dec 2016 11:23:51 +0000 (11:23 +0000)] 
Adjust the unix makefiles so that "make test" runs fuzzcheck prior to even
attempting to build the other test programs.

FossilOrigin-Name: bb48f7a55945da4cee369bae0809037900fcaac7

8 years agoThree times faster sqlite3SrcListAppend() in the common case by avoiding the
drh [Wed, 14 Dec 2016 11:14:13 +0000 (11:14 +0000)] 
Three times faster sqlite3SrcListAppend() in the common case by avoiding the
call to sqlite3SrcListEnlarge() for the first allocation.

FossilOrigin-Name: 0ea2762f1d8f6a93ae2ee3b7b835927a474c6f66

8 years agoFix the optimization that prevents writing freelist pages to the journal.
drh [Wed, 14 Dec 2016 10:30:12 +0000 (10:30 +0000)] 
Fix the optimization that prevents writing freelist pages to the journal.

FossilOrigin-Name: 6aa9b26544cbd0b41115c5f127dcf9a286d17e2b

8 years agoIn the command-line shell, in the output of the ".dump", ".schema", and
drh [Tue, 13 Dec 2016 23:22:39 +0000 (23:22 +0000)] 
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

8 years agoFix harmless compiler warnings.
drh [Tue, 13 Dec 2016 20:30:29 +0000 (20:30 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: ed2c9f3738c96d8e3dbece7ccb721cb1a8ae8fac

8 years agoConvert sqlite3PagerGet() into a pointer-dispatched virtual method. This
drh [Tue, 13 Dec 2016 18:47:54 +0000 (18:47 +0000)] 
Convert sqlite3PagerGet() into a pointer-dispatched virtual method.  This
makes it about 25% faster.

FossilOrigin-Name: 7f88bb44129a0cd36e27e00dc7c37e87cf3c90f7

8 years agoIn the pager, avoid checking for the illegal page number 0 except when creating pager-get-method
drh [Tue, 13 Dec 2016 18:34:01 +0000 (18:34 +0000)] 
In the pager, avoid checking for the illegal page number 0 except when creating
a new page.

FossilOrigin-Name: dee20ba982125ea98c280ad1571789af0f393903

8 years agoFix a problem causing SQLite to return false "foreign key violation" errors
dan [Tue, 13 Dec 2016 16:57:49 +0000 (16:57 +0000)] 
Fix a problem causing SQLite to return false "foreign key violation" errors
when there is a partial (i.e. WHERE constrained) UNIQUE index on the parent
key columns. This bug did not cause SQLite to allow illegal data to be
inserted into the database, only to reject legal operations.

FossilOrigin-Name: 850877d1ea43104cc215353414b870c340acced2

8 years agoFurther refinements to the virtual method implementation of
drh [Tue, 13 Dec 2016 15:53:22 +0000 (15:53 +0000)] 
Further refinements to the virtual method implementation of
sqlite3PagerGet().

FossilOrigin-Name: 67df44464847b43f8c0b186157e31cc66c1e5796

8 years agoMake the sqlite3PagerGet() interface into a virtual method, with different
drh [Tue, 13 Dec 2016 14:32:47 +0000 (14:32 +0000)] 
Make the sqlite3PagerGet() interface into a virtual method, with different
implementations based on the current state of the pager.  This gives a small
performance increase by avoiding unnecessary branches inside the various
methods.

FossilOrigin-Name: df5bb90d208e0633056389e97696d260e3830e8d

8 years agoAdd the --mmap option to the speedtest1 program and to the speed-check.sh
drh [Mon, 12 Dec 2016 23:24:08 +0000 (23:24 +0000)] 
Add the --mmap option to the speedtest1 program and to the speed-check.sh
script that is frequently used to run speedtest1.

FossilOrigin-Name: 1a636d5e0eec0a4d968519d1dfd35a983e512c78

8 years agoRemove unnecessary MemPage initialization resets in the autovacuum ptrmap
drh [Mon, 12 Dec 2016 18:12:03 +0000 (18:12 +0000)] 
Remove unnecessary MemPage initialization resets in the autovacuum ptrmap
processing.

FossilOrigin-Name: 1b36fbb9f05f3a5844e198b489bff36ef6cd908c

8 years agoFaster operation for large in-memory databases.
drh [Mon, 12 Dec 2016 16:08:44 +0000 (16:08 +0000)] 
Faster operation for large in-memory databases.

FossilOrigin-Name: 9675518b33e8d40769daefb860dc748113f750b6

8 years agoPerformance optimization in sqlite3PagerWrite().
drh [Mon, 12 Dec 2016 11:05:15 +0000 (11:05 +0000)] 
Performance optimization in sqlite3PagerWrite().

FossilOrigin-Name: d4dff10a3d4edf8e1cc77c0a4f185d33f2c2e953

8 years agoUpdates to the tokenizer for EBCDIC. No changes for standard builds.
drh [Mon, 12 Dec 2016 01:53:36 +0000 (01:53 +0000)] 
Updates to the tokenizer for EBCDIC.  No changes for standard builds.

FossilOrigin-Name: 4fc6580ffa7232aaf751f38f90c45edc8863abe5