]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
7 years agoModify the zonefile format in order to avoid depending on the filesize to
dan [Mon, 19 Feb 2018 14:27:24 +0000 (14:27 +0000)] 
Modify the zonefile format in order to avoid depending on the filesize to
determine the extent of the final frame. See README.md for details.

FossilOrigin-Name: 4dbe0cba3fad9a752834d795127cf35eed21fab63b18a48f75d5c1e96ca77447

7 years agoAdd support for "brotli" compression to the zonefile module.
dan [Sat, 17 Feb 2018 20:22:23 +0000 (20:22 +0000)] 
Add support for "brotli" compression to the zonefile module.

FossilOrigin-Name: 3eb25b3fa5733b4418e7e2633be34b763e2c70342bb9c418a07c9f7d4b196fac

7 years agoAdd support for compression types "lz4" and "lz4hc" to the zonefile module.
dan [Sat, 17 Feb 2018 19:38:02 +0000 (19:38 +0000)] 
Add support for compression types "lz4" and "lz4hc" to the zonefile module.

FossilOrigin-Name: bbe5b21ffab3cd312680ca9f179c5847790c17fb91d4174985153c6c398d48e3

7 years agoAdd support for compression methods "zstd" and "zstd_global_dict".
dan [Sat, 17 Feb 2018 18:33:43 +0000 (18:33 +0000)] 
Add support for compression methods "zstd" and "zstd_global_dict".

FossilOrigin-Name: a993a50bb8d5a3bf7cf79e09204814e172ba0bf9b3949e81912ef83f0d4bb44e

7 years agoAdd support for zlib compression to the zonefile module.
dan [Thu, 15 Feb 2018 20:37:58 +0000 (20:37 +0000)] 
Add support for zlib compression to the zonefile module.

FossilOrigin-Name: 72b8a7ef98d84460718378b9d17477599df39b4216015f8967674dd02b54b406

7 years agoFix another point in zonefile.c so that all files are opened in either "rb" or
dan [Thu, 15 Feb 2018 15:24:12 +0000 (15:24 +0000)] 
Fix another point in zonefile.c so that all files are opened in either "rb" or
"wb" mode.

FossilOrigin-Name: fb1c2277912c55cfae30c18b5434bc193748746395fa7df983cd8a29e5741ff9

7 years agoWhen calling fopen() in the zonefile extension, use modes "rb" and "wb"
dan [Thu, 15 Feb 2018 15:17:42 +0000 (15:17 +0000)] 
When calling fopen() in the zonefile extension, use modes "rb" and "wb"
instead of "r" and "w". This makes no difference on unix, but is required when
accessing binary files on other systems.

FossilOrigin-Name: 4bb854ddd9c1dc2972fd4f7c2c2b2d121caa662d5085694c2dbb35d331a61444

7 years agoFix formatting errors in ext/zonefile/README.md.
dan [Tue, 13 Feb 2018 21:16:16 +0000 (21:16 +0000)] 
Fix formatting errors in ext/zonefile/README.md.

FossilOrigin-Name: a2221e35d6c34d0c07bee9329073ad12cad4ba88437dd40cea71ae3ffc77eeef

7 years agoNote the fact that zonefile depends on json1 in ext/zonefile/README.md.
dan [Tue, 13 Feb 2018 20:53:18 +0000 (20:53 +0000)] 
Note the fact that zonefile depends on json1 in ext/zonefile/README.md.

FossilOrigin-Name: fb27d8f6a87e0dc1253622839c2164a7eb09f21fc0a16817c2ba9264561b77c2

7 years agoFix handling of maxAutoFrameSize parameter.
dan [Tue, 13 Feb 2018 20:08:47 +0000 (20:08 +0000)] 
Fix handling of maxAutoFrameSize parameter.

FossilOrigin-Name: d65e5855743534cb8db0d77d107579eae6daafc25c2f6035efa12c3ff0abbe7a

7 years agoEnhance ext/zonefile/README.md to describe the currently available
dan [Tue, 13 Feb 2018 19:01:08 +0000 (19:01 +0000)] 
Enhance ext/zonefile/README.md to describe the currently available
functionality.

FossilOrigin-Name: 100137c7f68b2d9a329d6d43e6c0a81b6ac843678b670ab6cce5f510bc58b7a8

7 years agoRemove, for now, the "priority" column from the zonefile_files virtual table.
dan [Tue, 13 Feb 2018 18:02:00 +0000 (18:02 +0000)] 
Remove, for now, the "priority" column from the zonefile_files virtual table.

FossilOrigin-Name: 8bf5154bc6e31e206931d97c743eadaba4ef938c11e006082d795439dadaeb8f

7 years agoPad the 26 byte Zonefile header to 32 bytes so that the ZonefileIndex object
dan [Tue, 13 Feb 2018 17:33:28 +0000 (17:33 +0000)] 
Pad the 26 byte Zonefile header to 32 bytes so that the ZonefileIndex object
is 8-byte aligned.

FossilOrigin-Name: fdb6c0c5dc5a67ca16dfafc6e677f73936f36e357a2ff288b4958ddee0544603

7 years agoAdd support for reading simple (no compression, no encryption) zonefile files.
dan [Mon, 12 Feb 2018 20:04:22 +0000 (20:04 +0000)] 
Add support for reading simple (no compression, no encryption) zonefile files.

FossilOrigin-Name: dba42f0e1efae7bad4579d23ad98e2c06e38053abe55f5cb277d7eecea42c56c

7 years agoAdd start of "zonefile" virtual table.
dan [Sat, 10 Feb 2018 21:04:12 +0000 (21:04 +0000)] 
Add start of "zonefile" virtual table.

FossilOrigin-Name: 0b7bd1694bf50a5afed22ed3026cefe53c5e7ec334167244e2caa9c56185ff43

7 years agoAdd the start of the "zonefile" extension.
dan [Sat, 10 Feb 2018 17:41:01 +0000 (17:41 +0000)] 
Add the start of the "zonefile" extension.

FossilOrigin-Name: c125b4c380d1a20c7d71b413e96183eca9987aed3d0ba28395aa79c7c31bb6fd

7 years agoFix misplaced testcase() macros from the previous check-in.
drh [Sat, 10 Feb 2018 02:31:30 +0000 (02:31 +0000)] 
Fix misplaced testcase() macros from the previous check-in.

FossilOrigin-Name: 3aed949a18a251c5795f21f0385c205a127502b7e9cf06bc7f4c763951cd7984

7 years agoImprove the performance of the built-in REPLACE() function in cases where
drh [Fri, 9 Feb 2018 23:25:14 +0000 (23:25 +0000)] 
Improve the performance of the built-in REPLACE() function in cases where
it does many substitutions that make the string larger.  OSSFuzz is reporting
intermittant timeouts when running a test where it does a REPLACE() on a
930KB random blob. Perhaps this enhancement will fix that.

FossilOrigin-Name: fab2c2b07b5d3cd851db3e6f5c8a44155e32b0df22905ea33412b153b825a928

7 years agoAdd the zorder.c extension implementing zorder() and unzorder() SQL functions.
drh [Fri, 9 Feb 2018 20:49:15 +0000 (20:49 +0000)] 
Add the zorder.c extension implementing zorder() and unzorder() SQL functions.

FossilOrigin-Name: a57a77dc0cc9fbaa9d5b134422f7a8cc8d4c2851ed3c2bdd449800c6a5d2aae0

7 years agoMake the tests in func6.test more robust against implementation changes.
dan [Fri, 9 Feb 2018 15:42:40 +0000 (15:42 +0000)] 
Make the tests in func6.test more robust against implementation changes.

FossilOrigin-Name: b685d3231097fb90e7d61d9ac01cc560e8bf2671d49390ae7af5bfdbd6d04f11

7 years agoFix a harmless compiler warning.
drh [Fri, 9 Feb 2018 15:04:51 +0000 (15:04 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: a6c3115483d597fc77ab19fdcfd1d3437cad7e467081ad8c5315fb98c115eed9

7 years agoEnhance sqlite3ErrStr() to include several more error codes.
mistachkin [Thu, 8 Feb 2018 01:00:11 +0000 (01:00 +0000)] 
Enhance sqlite3ErrStr() to include several more error codes.

FossilOrigin-Name: ad5d3bdc739a0997786f94fb5789b726b9f53ff883226093924338fe5000922b

7 years agoFix typo in comment. Skip tests added by check-in [4761db83b6] when running on Windows.
mistachkin [Wed, 7 Feb 2018 18:45:00 +0000 (18:45 +0000)] 
Fix typo in comment.  Skip tests added by check-in [4761db83b6] when running on Windows.

FossilOrigin-Name: 468a389cdc8b6f92c77b11f682e210ad8cce7e3dbc0df308a898f4115e85fce2

7 years agoIn extensions rtree, fts3 and fts5, ensure that when dynamic buffers are bound
dan [Wed, 7 Feb 2018 18:02:50 +0000 (18:02 +0000)] 
In extensions rtree, fts3 and fts5, ensure that when dynamic buffers are bound
to persistent SQL statements using SQLITE_STATIC, the binding is replaced with
an SQL NULL before the buffer is freed. Otherwise, a user may obtain a pointer
to the persistent statement using sqlite3_next_stmt() and attempt to access
the freed buffer using sqlite3_expanded_sql() or similar.

FossilOrigin-Name: 2a5f813bc61f9e780f2ccbda425611f65ad523b6d486a1e5e2b9d5e9f1d260a2

7 years agoWhen the final connection disconnects from a wal mode database, check that the
dan [Wed, 7 Feb 2018 16:14:41 +0000 (16:14 +0000)] 
When the final connection disconnects from a wal mode database, check that the
database file has not been moved or unlinked before deleting the wal and shm
files.

FossilOrigin-Name: 4761db83b6d3d57f281370899403c102e39ad0021d315dd6a6912d250436782a

7 years agoAdjust the previous check-in, which modified the Win32 VFS, so that it works with...
mistachkin [Mon, 5 Feb 2018 21:02:47 +0000 (21:02 +0000)] 
Adjust the previous check-in, which modified the Win32 VFS, so that it works with SQLITE_OMIT_WAL.

FossilOrigin-Name: 36c2e67e82626f8d0a187c6c286c133ed659889e3b577469261b9dcd3b3ab75b

7 years agoAllocation the mutex used by the Win32 VFS only once at initialization, instead of...
mistachkin [Mon, 5 Feb 2018 20:42:50 +0000 (20:42 +0000)] 
Allocation the mutex used by the Win32 VFS only once at initialization, instead of every time it is needed.

FossilOrigin-Name: 535ed0ac5e8728ec91fc0a4cb54b820923d161cfd4e0e6aed6df6cdae365bc7d

7 years agoAllocation the mutex used by the unix VFS only once at initialization, instead
drh [Mon, 5 Feb 2018 16:39:12 +0000 (16:39 +0000)] 
Allocation the mutex used by the unix VFS only once at initialization, instead
of every time it is needed.

FossilOrigin-Name: 5764dc160783f5c4017204b3e26a89d31240c868484ced8214c9ad872bd77bd4

7 years agoFix another minor problem in walro2.test.
dan [Mon, 5 Feb 2018 13:42:45 +0000 (13:42 +0000)] 
Fix another minor problem in walro2.test.

FossilOrigin-Name: ba0631de60ca38bf7efa6dbd86ec8774bf6f438c804155968e97f17eabe3b20a

7 years agoUpdate test file walro2.test to account for systems with a page-size
dan [Mon, 5 Feb 2018 13:28:51 +0000 (13:28 +0000)] 
Update test file walro2.test to account for systems with a page-size
(getpagesize()) larger than 32KB.

FossilOrigin-Name: d9e59cfb8476e1ec1ca458b8382172526c0557ab785f41e31971d03045c9344c

7 years agoIn the CLI,
drh [Sun, 4 Feb 2018 20:33:13 +0000 (20:33 +0000)] 
In the CLI,
make sure sqlite3_initialize() is called correctly even for non-UTF8 hosts.

FossilOrigin-Name: a3591fb54178b8f124207ff16e3ef9e58a62585feb3a56ced2b862222aea19d8

7 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Sun, 4 Feb 2018 01:30:54 +0000 (01:30 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 63a914410b5750bd08836864ae456ff09549487c5ce49706fedffa3d4f973059

7 years agoMove variable declaration in zipfile extension to fix MSVC compiler error.
mistachkin [Sun, 4 Feb 2018 01:29:01 +0000 (01:29 +0000)] 
Move variable declaration in zipfile extension to fix MSVC compiler error.

FossilOrigin-Name: ac6a32482e675871c3ce5ecc727e50e4bba649e80e3c55bf99025fed5667da94

7 years agoRemove the "include <io.h>" win32 dependency from the zipfile extension.
dan [Fri, 2 Feb 2018 16:28:19 +0000 (16:28 +0000)] 
Remove the "include <io.h>" win32 dependency from the zipfile extension.

FossilOrigin-Name: cb3feb3bc33718625159eddbf8ef608cd641af84e97d433d6b11ba6da94dad2e

7 years agoRemove the time() dependency from the zipfile extension. Use SQLite VFS
dan [Fri, 2 Feb 2018 16:20:41 +0000 (16:20 +0000)] 
Remove the time() dependency from the zipfile extension. Use SQLite VFS
methods instead.

FossilOrigin-Name: 0702fb5611c7cf0154c5490eeada66afc733731dff0fe030375bae6a72123a17

7 years agoAdd a few more zipfile tests. No changes to code.
dan [Thu, 1 Feb 2018 20:42:23 +0000 (20:42 +0000)] 
Add a few more zipfile tests. No changes to code.

FossilOrigin-Name: 3f621545879ea39502cfaf2b61883f92c077070274b4fdf45524ded81cac3e63

7 years agoFix a problem triggered when a zipfile virtual table is created and written to
dan [Thu, 1 Feb 2018 19:41:23 +0000 (19:41 +0000)] 
Fix a problem triggered when a zipfile virtual table is created and written to
within the same transaction. And add other zipfile test.

FossilOrigin-Name: 48f1c556994d7f8f359c649a1da81eec02306106b68946a9a20b276742c4610d

7 years agoNew assert() statements to help ensure that no other errors similar
drh [Thu, 1 Feb 2018 15:57:00 +0000 (15:57 +0000)] 
New assert() statements to help ensure that no other errors similar
to [343634942dd54ab57b7] ever appear in the code.

FossilOrigin-Name: 5a70af1e9c567f12c997d25d0a305a8d42bf2cc92f2811e9d5fdde720665e213

7 years agoFix a memory leak that could follow an IO error in the zipfile extension. And
dan [Thu, 1 Feb 2018 15:19:54 +0000 (15:19 +0000)] 
Fix a memory leak that could follow an IO error in the zipfile extension. And
add other tests.

FossilOrigin-Name: e6bb750697c3c7ceb5ce41d216e8ef6a1d556822a3b55e0a007b4a03e194a7d9

7 years agoWhen an index is based on a text representation of a numeric column in the
drh [Thu, 1 Feb 2018 01:13:33 +0000 (01:13 +0000)] 
When an index is based on a text representation of a numeric column in the
original table, make sure the indexed value uses the canonical text
representation of the numeric value in the table.
Proposed fix for ticket [343634942dd54ab57b70].

FossilOrigin-Name: 88e2ce916791d488076584f3795a89eb4277fcb812af9e4c2f383815d55ff6f1

7 years agoWhen creating a new archive entry, have zipfile store UTC instead of local
dan [Wed, 31 Jan 2018 20:18:26 +0000 (20:18 +0000)] 
When creating a new archive entry, have zipfile store UTC instead of local
time in the legacy MS-DOS format timestamp field.

FossilOrigin-Name: b730d187f2202e5b5d31ed6c94c9bb04d7c289f7086a9b44b3d9050ea3586d3a

7 years agoFix a test case in zipfile.test. zipfile-timestamp-fix
dan [Wed, 31 Jan 2018 19:45:58 +0000 (19:45 +0000)] 
Fix a test case in zipfile.test.

FossilOrigin-Name: 4eb5b24c64ee5907c18371f563b79fa0caf58285a62b8f09e639a690e6727eaa

7 years agoWhen creating a new archive entry, have zipfile store UTC instead of local
dan [Wed, 31 Jan 2018 19:13:31 +0000 (19:13 +0000)] 
When creating a new archive entry, have zipfile store UTC instead of local
time in the legacy MS-DOS format timestamp field.

FossilOrigin-Name: e2114df18383d111dd5fbac902e08b42a7f4b2b2d6f7bf29574a3722e4a4dad5

7 years agoImprove the omit-left-join optimization so that it works in some cases
drh [Wed, 31 Jan 2018 16:50:27 +0000 (16:50 +0000)] 
Improve the omit-left-join optimization so that it works in some cases
when the RHS is subject to a UNIQUE but not NOT NULL constraint.

FossilOrigin-Name: 02ba8a7ba7ba71cd7abd5dd3093ea486f53a025f6972bb444f2da37e0e2fc3b2

7 years agoFix a failing assert() in the new code on this branch. omit-left-join-fix
dan [Wed, 31 Jan 2018 14:07:01 +0000 (14:07 +0000)] 
Fix a failing assert() in the new code on this branch.

FossilOrigin-Name: 74d857d178dfadea7e07ba47439fe11aa9d282b54caf78cd6961e593b37406d0

7 years agoChanges to the autoconf tarball so that it does not try to use system() when
drh [Wed, 31 Jan 2018 01:38:44 +0000 (01:38 +0000)] 
Changes to the autoconf tarball so that it does not try to use system() when
building on iOS.

FossilOrigin-Name: 32ed9c106710c74a12d60ec33027fd6a9335627c95642ba608593b2735714da6

7 years agoIf a virtual table xColumn method sets an error message using
dan [Tue, 30 Jan 2018 18:33:23 +0000 (18:33 +0000)] 
If a virtual table xColumn method sets an error message using
sqlite3_result_error(), use that message in preference to any error message
left in the sqlite3_vtab object.

FossilOrigin-Name: 71e3b715ad36c2132a587b84221be6359c31d7a17c3fba201b7ed3baf17922f1

7 years agoAdd tests cases for the zipfile extension.
dan [Tue, 30 Jan 2018 17:43:22 +0000 (17:43 +0000)] 
Add tests cases for the zipfile extension.

FossilOrigin-Name: 13b786dafd308b7aef42328f26fe64981c83d524e4bf82ceb7d58afc7146c7d3

7 years agoPrevent users from creating zipfile() virtual tables without an argument.
dan [Tue, 30 Jan 2018 14:07:55 +0000 (14:07 +0000)] 
Prevent users from creating zipfile() virtual tables without an argument.

FossilOrigin-Name: 81fdbe0cc5a360f818078d47a5888d0a29d555927da279a9a0213702d74ef09a

7 years agoAdd unix-only tests to check that the "unzip" program can unpack archives
dan [Mon, 29 Jan 2018 19:47:32 +0000 (19:47 +0000)] 
Add unix-only tests to check that the "unzip" program can unpack archives
generated by the zipfile extension.

FossilOrigin-Name: 438c5c5237a801ae78809bf324bb9251fb50250addfc1f8e36659442b0e26ab6

7 years agoAdd aggregate function zipfile() to the zipfile extension. For composing new
dan [Mon, 29 Jan 2018 18:41:07 +0000 (18:41 +0000)] 
Add aggregate function zipfile() to the zipfile extension. For composing new
zip archives in memory.

FossilOrigin-Name: e364eeac76a8225146b37d801bc6cabe03e9abede5a1412ebe9d94a32d8838cc

7 years agoUpdate the omit-left-join optimization so that it works in some cases when the
dan [Mon, 29 Jan 2018 17:08:52 +0000 (17:08 +0000)] 
Update the omit-left-join optimization so that it works in some cases when the
RHS is subject to a UNIQUE but not NOT NULL constraint.

FossilOrigin-Name: 88411a402b29f19d69e0d06d9099eabb98c238ddb7c07ce110236316f008753e

7 years agoEnsure the "unique-not-null" flag is set for automatic indexes on columns
dan [Mon, 29 Jan 2018 16:22:39 +0000 (16:22 +0000)] 
Ensure the "unique-not-null" flag is set for automatic indexes on columns
declared with "col UNIQUE NOT NULL" (where the NOT NULL comes after the
UNIQUE).

FossilOrigin-Name: 8767f7b880f2e4112f75f0b6ef7be3f50ab1ae20e103e7d03d8bfe77e6c79438

7 years agoFix missing header comments and other code issues in zipfile.c.
dan [Sat, 27 Jan 2018 18:55:18 +0000 (18:55 +0000)] 
Fix missing header comments and other code issues in zipfile.c.

FossilOrigin-Name: 6ea8ba312c38365d3e28cfb2a367d729dd2751d1d853843eea0e18126777a320

7 years agoIf a zipfile virtual table is created with no argument - "CREATE VIRTUAL TABLE
dan [Sat, 27 Jan 2018 16:29:59 +0000 (16:29 +0000)] 
If a zipfile virtual table is created with no argument - "CREATE VIRTUAL TABLE
zzz USING zipfile()" - accumulate data in memory. Support "SELECT
zipfile_blob(z) FROM zzz LIMIT 1" to retrieve a zip archive image.

FossilOrigin-Name: e63185edfe0c316aa60c1fa085d032425ecc7db54536dfa5a977772eaf3c240e

7 years agoChanges to avoid a harmless UB warning from clang.
drh [Sat, 27 Jan 2018 14:25:27 +0000 (14:25 +0000)] 
Changes to avoid a harmless UB warning from clang.

FossilOrigin-Name: 19f5c1400054df10688ab448e7e23afef97cab4a7c7a3e411f7527509b515dd8

7 years agoNew test case for ticket [ec32177c99ccac2b1] that works without the STAT4.
drh [Sat, 27 Jan 2018 13:55:56 +0000 (13:55 +0000)] 
New test case for ticket [ec32177c99ccac2b1] that works without the STAT4.

FossilOrigin-Name: 5259d4847f2b73f26b2385f9d8cff8fe0cabc54b4deab8477c87c8d1bb5535b1

7 years agoProposed fix for the query planner problem of ticket
drh [Sat, 27 Jan 2018 05:40:10 +0000 (05:40 +0000)] 
Proposed fix for the query planner problem of ticket
[ec32177c99ccac2b1].

FossilOrigin-Name: eef8cbef3c49e6331301a8f3f8a5fd12090b1e99e68487c2d405e53ef771f688

7 years agoFix compiler warnings in zipfile.c.
drh [Sat, 27 Jan 2018 03:26:10 +0000 (03:26 +0000)] 
Fix compiler warnings in zipfile.c.

FossilOrigin-Name: bed610d99b5322ee209b06966c0086e8c55f8a82be8d7693cfdeb4d728679721

7 years agoFix the query planner so that it takes into account dependencies in the
drh [Fri, 26 Jan 2018 22:41:59 +0000 (22:41 +0000)] 
Fix the query planner so that it takes into account dependencies in the
arguments to table-valued functions in subexpressions in the WHERE clause.
Fix for ticket [80177f0c226ff54f6dd].

FossilOrigin-Name: 7daa687340e475972d6849f84fe1419a1f5700934f53fd80656849adc73d6d04

7 years agoIf the argument to table function zipfile() is a blob (not text), assume that
dan [Fri, 26 Jan 2018 18:59:25 +0000 (18:59 +0000)] 
If the argument to table function zipfile() is a blob (not text), assume that
it contains a zip file image to interpret, not the name of a file on disk.

FossilOrigin-Name: 029ebcd30cb261d949f7587ac54c23d7479796b6716fd4ca7512361b8f32de3e

7 years agoImprove text-to-integer conversion in boundary cases. The
drh [Fri, 26 Jan 2018 18:37:34 +0000 (18:37 +0000)] 
Improve text-to-integer conversion in boundary cases.  The
sqlite3Atoi64() function always returns the minimum or maximum integer
if the magnitude of the text value is too large.  Trailing whitespace is
now ignored.

FossilOrigin-Name: ace0644a1a2a42a3ea42d44f00a31915b8a7e56c9ba90f90a6c02001f89f9c86

7 years agoReorganize zipfile.c code to make it easier to add support for in-memory zip
dan [Thu, 25 Jan 2018 20:50:46 +0000 (20:50 +0000)] 
Reorganize zipfile.c code to make it easier to add support for in-memory zip
archive processing.

FossilOrigin-Name: 30b9258294e3028ef4ea467e332e013995509544e9a23c8bbf5168772a7e895d

7 years agoSlightly smaller and faster implementation of OP_If and OP_IfNot.
drh [Thu, 25 Jan 2018 01:20:29 +0000 (01:20 +0000)] 
Slightly smaller and faster implementation of OP_If and OP_IfNot.

FossilOrigin-Name: 6ab42934e2c4957b5d8927bf4434a9db07ab6078987a6a2d25f35cc468d21203

7 years agoWhen unpacking a sorter record, do so from right to left instead of left to
drh [Wed, 24 Jan 2018 20:42:42 +0000 (20:42 +0000)] 
When unpacking a sorter record, do so from right to left instead of left to
right, since by starting with the right-most column, the work done by
OP_Column opcodes is reduced.

FossilOrigin-Name: 8055e4f42446ceb5bcf752bbf41a73289c3ca759c56c9f779edc3d7f202b7881

7 years agoReorganize spellfix.c to make it easier to edit automatically (e.g. using a
dan [Wed, 24 Jan 2018 18:28:39 +0000 (18:28 +0000)] 
Reorganize spellfix.c to make it easier to edit automatically (e.g. using a
script). No changes to functionality.

FossilOrigin-Name: 090a64faaac579c6ed1cddb02d14e7089468a4aeaeec11e78d461790bcb6eb0a

7 years agoRearrange fields of the BtCursor object so that it is smaller and requires less
drh [Wed, 24 Jan 2018 16:04:21 +0000 (16:04 +0000)] 
Rearrange fields of the BtCursor object so that it is smaller and requires less
initialization, for a small performance improvement.

FossilOrigin-Name: 0ddf5292cc0411ec6fcb7399ecf2904c899e0488404d3f65490fbe1db15efdf4

7 years agoAdd the normalize.c extension.
drh [Wed, 24 Jan 2018 15:07:37 +0000 (15:07 +0000)] 
Add the normalize.c extension.

FossilOrigin-Name: 16ebe558d2f0982f630c39b6c1b00d14d27011d454cced213f17c26491a2c06e

7 years agoInterchange the numeric codes for CURSOR_VALID and CURSOR_INVALID to obtain
drh [Wed, 24 Jan 2018 14:40:01 +0000 (14:40 +0000)] 
Interchange the numeric codes for CURSOR_VALID and CURSOR_INVALID to obtain
a small size decrease and performance increase.

FossilOrigin-Name: e0f192ea6dda4fa0b243d58c8ce41932519141bcae0689a90318b4f866f54edd

7 years agoAdjust the fts3rank.test module so that it works on big-endian systems
drh [Wed, 24 Jan 2018 14:39:18 +0000 (14:39 +0000)] 
Adjust the fts3rank.test module so that it works on big-endian systems
(hopefully - I don't have a big-endian machine to test the change on.)

FossilOrigin-Name: e4766cabdf64d8e998048ae43154466fc9c3fad0b86102a42b65122abfcbbe55

7 years agoImproved error message output when the btreeinfo.c extension is run in
drh [Wed, 24 Jan 2018 13:15:56 +0000 (13:15 +0000)] 
Improved error message output when the btreeinfo.c extension is run in
a connection that lacks sqlite_dbpage support.

FossilOrigin-Name: 461b0b81b2acedb1b9ca520657518d6778417c375aeb58c41ead840b75a6d985

7 years agoPrevent a harmless unused variable warning when compiling with
drh [Wed, 24 Jan 2018 12:14:43 +0000 (12:14 +0000)] 
Prevent a harmless unused variable warning when compiling with
SQLITE_OMIT_TRACE.

FossilOrigin-Name: 61a44961b5811c993ae8d4f820a21a0ee739fe5e88cbfe5e4190e0091912ca19

7 years agoFix a formatting issue in sqlite3_prepare_v3() documentation. No changes
drh [Wed, 24 Jan 2018 11:29:42 +0000 (11:29 +0000)] 
Fix a formatting issue in sqlite3_prepare_v3() documentation.  No changes
to code.

FossilOrigin-Name: 9e6066de84285252fb8999a8d8e02a46c5bb6c822e4f7421ad3911687357ee5d

7 years agoFix the sqlite3ext.h header file so that it correctly accesses the
drh [Wed, 24 Jan 2018 11:25:59 +0000 (11:25 +0000)] 
Fix the sqlite3ext.h header file so that it correctly accesses the
new sqlite3_value_nochange() and sqlite3_vtab_collation() interfaces.

FossilOrigin-Name: 6185d190e250faae0d979a24cb1039c7fce178478ae75df8e4af1d94cd38c18e

7 years agoUpdate a couple of test scripts so that they work on F2FS file-systems that
dan [Wed, 24 Jan 2018 06:30:10 +0000 (06:30 +0000)] 
Update a couple of test scripts so that they work on F2FS file-systems that
support atomic transactions.

FossilOrigin-Name: 49e58e645e0c114c71935a3b7fa4771e8a23e28127efd2efe0f2f18813c8f391

7 years agoMake the shell functional even if compiled with SQLITE_OMIT_COMPLETE.
drh [Wed, 24 Jan 2018 01:58:49 +0000 (01:58 +0000)] 
Make the shell functional even if compiled with SQLITE_OMIT_COMPLETE.
Omit the sqlite3_complete() call from the fuzzing interface if it is
compiled with SQLITE_OMIT_COMPLETE.

FossilOrigin-Name: c3e816cca4ddf0967c4c790cdde2345101dde3f2d854e62589f1ac1d7f3c60b8

7 years agoInvoke the sqlite3_complete() interface from the fuzzer.
drh [Wed, 24 Jan 2018 01:02:23 +0000 (01:02 +0000)] 
Invoke the sqlite3_complete() interface from the fuzzer.

FossilOrigin-Name: 332bf84625d2034c9e1c029aa8243aa34088217e52e34e1f5472217743a31af3

7 years agoIncrease the version number to 3.23.0 for the next development cycle.
drh [Tue, 23 Jan 2018 20:22:15 +0000 (20:22 +0000)] 
Increase the version number to 3.23.0 for the next development cycle.

FossilOrigin-Name: b58b60b2c0729b73c0ef35bd1a5aa90965d1c01043413ca45b412d8b68f59bce

7 years agoRemove an unreachable branch from sqlite3SkipAccumulatorLoad().
drh [Tue, 23 Jan 2018 19:24:54 +0000 (19:24 +0000)] 
Remove an unreachable branch from sqlite3SkipAccumulatorLoad().

FossilOrigin-Name: 8b9c8eab60b692e45c55a718d76b70e63040416040696907463692cbf83fb0c5

7 years agoWork around a problem with GCC on 32-bit machines that cause the CAST
drh [Tue, 23 Jan 2018 17:33:42 +0000 (17:33 +0000)] 
Work around a problem with GCC on 32-bit machines that cause the CAST
operator to generate a floating-point result for strings that could be
represented as very large integers.

FossilOrigin-Name: 1b02731962c21bb097a88801ece76ff441bf882519a821a246da84f4e2a33455

7 years agoFix a bug causing spurious "sub-select returns N columns expected 1" errors
dan [Tue, 23 Jan 2018 16:38:57 +0000 (16:38 +0000)] 
Fix a bug causing spurious "sub-select returns N columns expected 1" errors
in join queries with a term like "(a, b) IN (SELECT ...)" in the WHERE clause.

FossilOrigin-Name: 14dfd96f9bca2df5033b2d894bf63cc8bf450a45ca11df5e3bbb814fdf96b656

7 years agoFix the modification-time setting logic in the fileio.c extension on Windows
drh [Tue, 23 Jan 2018 15:26:30 +0000 (15:26 +0000)] 
Fix the modification-time setting logic in the fileio.c extension on Windows
so that it works with utf8 filenames.

FossilOrigin-Name: f785b9041556912edbacdbfb3dfc38705058d7c10d874544295c25db54628bc2

7 years agoIn SQLITE_ENABLE_BATCH_ATOMIC_WRITE builds on F2FS file-systems, invoke
dan [Tue, 23 Jan 2018 14:01:51 +0000 (14:01 +0000)] 
In SQLITE_ENABLE_BATCH_ATOMIC_WRITE builds on  F2FS file-systems, invoke
SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE if an SQLITE_FCNTL_COMMIT_ATOMIC_WRITE call
fails. Also, do not use an atomic transaction to create the initial database.
This is because if an error occurs while writing to the db file, any changes
to the file-size do not seem to be rolled back automatically. The only time
this matters is when the file was 0 bytes in size to start with.

FossilOrigin-Name: b3122db1545aeb48b7c28d480534b4b0fe04e83d5336225714c3cad926e5960e

7 years agoFix comment typos. No changes to code.
drh [Tue, 23 Jan 2018 13:30:38 +0000 (13:30 +0000)] 
Fix comment typos.  No changes to code.

FossilOrigin-Name: 8e5e74c66b9cdb348392e3db2d9f32cfa20fcec35bf09d9e1f623e7ad875ec97

7 years agoSkip defining WIN32_LEAN_AND_MEAN when it is already defined.
mistachkin [Tue, 23 Jan 2018 07:11:05 +0000 (07:11 +0000)] 
Skip defining WIN32_LEAN_AND_MEAN when it is already defined.

FossilOrigin-Name: 195f5323df800f7963df2ea251c497c72e4d7ff0b88a70f1fa60f13bb1a9fd3b

7 years agoSlightly faster implementation of the length() SQL function.
drh [Tue, 23 Jan 2018 04:22:33 +0000 (04:22 +0000)] 
Slightly faster implementation of the length() SQL function.

FossilOrigin-Name: 9a4199aedb039141a50a68943ef863d7df9637ada318793cce6c12b9d39bcdc5

7 years agoSlightly faster function dispatch in the virtual machine by avoiding
drh [Tue, 23 Jan 2018 03:44:06 +0000 (03:44 +0000)] 
Slightly faster function dispatch in the virtual machine by avoiding
unnecessary reinitialization of variables that are already correctly
initialized.

FossilOrigin-Name: edd4e6876cc08ab907bb21f075380de946562d4c56a04923760848b4b11536ac

7 years agoSimplify one of the compiler warning fixes from the previous check-in.
mistachkin [Tue, 23 Jan 2018 00:17:27 +0000 (00:17 +0000)] 
Simplify one of the compiler warning fixes from the previous check-in.

FossilOrigin-Name: 012d7d49c571207087bbe24af05d639627b96df526bfcb2098a3e975b74d865d

7 years agoFix harmless compiler warnings seen with MSVC.
mistachkin [Tue, 23 Jan 2018 00:05:18 +0000 (00:05 +0000)] 
Fix harmless compiler warnings seen with MSVC.

FossilOrigin-Name: 76a11a80e94d1e9c9645e6e348948f3fd508266d4569c85d80a3879862d0a819

7 years agoVersion 3.22.0 version-3.22.0
drh [Mon, 22 Jan 2018 18:45:57 +0000 (18:45 +0000)] 
Version 3.22.0

FossilOrigin-Name: 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2171d

7 years agoAvoid unnecessary OOM detection warnings in a debugging routine.
drh [Mon, 22 Jan 2018 15:45:12 +0000 (15:45 +0000)] 
Avoid unnecessary OOM detection warnings in a debugging routine.

FossilOrigin-Name: 395f8ea790e6e295800fa8927f0585b2419b9521ef4fd591d51d2a48db2a90c4

7 years agoFix a test case in walro2.test so that it works with encryption extensions
dan [Mon, 22 Jan 2018 15:20:59 +0000 (15:20 +0000)] 
Fix a test case in walro2.test so that it works with encryption extensions
(when each page has a little less usable space available than usual).

FossilOrigin-Name: b79521d255a4aa2a7b4424f3498443f27d329ab5428171ba6b87c987f3ccdfc2

7 years agoOn the walro2-X.4.2.2 test case, show the size as part of the test output.
drh [Mon, 22 Jan 2018 14:49:15 +0000 (14:49 +0000)] 
On the walro2-X.4.2.2 test case, show the size as part of the test output.

FossilOrigin-Name: ac5091d7f870f1d0659a576723de454d544e5bfa2bdbba307d7c81eb5ab34e3b

7 years agoAllow the shell to be built from the configure script with
dan [Sat, 20 Jan 2018 15:48:45 +0000 (15:48 +0000)] 
Allow the shell to be built from the configure script with
SQLITE_OMIT_VIRTUALTABLE defined.

FossilOrigin-Name: 136bf323e42dc90e1780199a381bcbb084b069eca5c7343ee6fc6e2550831536

7 years agoUse a loop to avoid recursion in the heightOfSelect() function.
dan [Thu, 18 Jan 2018 19:00:54 +0000 (19:00 +0000)] 
Use a loop to avoid recursion in the heightOfSelect() function.

FossilOrigin-Name: 86de43595cb2ecebd680fe654affcfb9fbcfff6575c893293ae298124a357bfe

7 years agoCheck for both zlib.h and -lz before enabling zlib support in the amalgamation
dan [Thu, 18 Jan 2018 17:46:08 +0000 (17:46 +0000)] 
Check for both zlib.h and -lz before enabling zlib support in the amalgamation
configure script.

FossilOrigin-Name: 8ecd13a1b38e58d4464585c388c1aa27d1f056dba0db239316623e81d3eb5284

7 years agoUpdate the autoconf configure.ac script and Makefile.am templates so that
drh [Thu, 18 Jan 2018 17:09:26 +0000 (17:09 +0000)] 
Update the autoconf configure.ac script and Makefile.am templates so that
ZLIB is automatically detected and used.

FossilOrigin-Name: 41bfb6b8d61699d09a7e67d2289149abfbb9ce8e75e6ff8560546cad0d2e3f2b

7 years agoFix sessions module handling of sqlite_stat1 rows with (idx IS NULL).
dan [Thu, 18 Jan 2018 16:59:52 +0000 (16:59 +0000)] 
Fix sessions module handling of sqlite_stat1 rows with (idx IS NULL).

FossilOrigin-Name: 0e916416331d7948b312a5dd58ac0c145030bb3b47a37dab2636564397249a86

7 years agoClarify the handling of the sqlite_stat1 table by legacy versions of the sessions-stat1
dan [Thu, 18 Jan 2018 16:56:19 +0000 (16:56 +0000)] 
Clarify the handling of the sqlite_stat1 table by legacy versions of the
sessions module.

FossilOrigin-Name: dc7c48cb4126db9e25c73512cc743155293fe1c4c2516f8c84102228695b6e70

7 years agoAdd comments describing the special sqlite_stat1 handling to sqlite3session.h.
dan [Thu, 18 Jan 2018 16:53:41 +0000 (16:53 +0000)] 
Add comments describing the special sqlite_stat1 handling to sqlite3session.h.

FossilOrigin-Name: 4431a3256f7436e34b3c33edc1f3e53df7eb3c87daec9bac8d038895d93ca7f2