]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
5 years agoOmit the "_except" term from the name of the new interface. sqlite3_drop_modules_except
drh [Mon, 19 Aug 2019 20:35:30 +0000 (20:35 +0000)] 
Omit the "_except" term from the name of the new interface.

FossilOrigin-Name: e5ba47c2d8eb9f48a0e0d325e57d0092d536f85983819634c871ebd51829f1d1

5 years agoThe experimental sqlite3_drop_modules_except() interface.
drh [Sat, 17 Aug 2019 19:45:25 +0000 (19:45 +0000)] 
The experimental sqlite3_drop_modules_except() interface.

FossilOrigin-Name: 0851db4d337a87f8b2d3ce2ae9f9c928b9483591ca41a9e39cc01548059b1888

5 years agoFix the new ability to unregister virtual table modules so that it works
drh [Sat, 17 Aug 2019 19:31:09 +0000 (19:31 +0000)] 
Fix the new ability to unregister virtual table modules so that it works
for the automatic PRAGMA virtual tables.

FossilOrigin-Name: 5d6f4dfeea75c7dcd8c511545accb9eb4b405a02db034332249ba54794e313d2

5 years agoWhen populating an ephemeral b-tree for the RHS of an IN(...) clause, avoid applying...
dan [Sat, 17 Aug 2019 19:13:49 +0000 (19:13 +0000)] 
When populating an ephemeral b-tree for the RHS of an IN(...) clause, avoid applying an affinity to a value that may be used later on for some other purpose. Fix for [c7a117190].

FossilOrigin-Name: 43e8b14314d876178d487c3b519296ac1de065fdcaa70768e40d684015bceb9d

5 years agoEnsure the functions that appear to be constant are not factored out of
drh [Sat, 17 Aug 2019 17:07:15 +0000 (17:07 +0000)] 
Ensure the functions that appear to be constant are not factored out of
expression that originate on the right-hand side of a LEFT JOIN.
Ticket [6710d2f7a13a2997]

FossilOrigin-Name: 500c9152daaf11cf69d778aa8592175f6088337c6667c59af6df3a24cd81eb0e

5 years agoActivate introspection pragmas by default. The new option
drh [Sat, 17 Aug 2019 15:27:58 +0000 (15:27 +0000)] 
Activate introspection pragmas by default.  The new option
SQLITE_OMIT_INTROSPECTION_PRAGMAS must be provided to keep them out.

FossilOrigin-Name: 9c4bca64fb5f635296a8d7d7c1bf2808e02ca734a9983e5cee9132f5352a9a6d

5 years agoThe SQLITE_DIRECTONLY flag, when added to sqlite3_create_function() prevents
drh [Sat, 17 Aug 2019 00:53:29 +0000 (00:53 +0000)] 
The SQLITE_DIRECTONLY flag, when added to sqlite3_create_function() prevents
the function from being used inside a trigger or view.

FossilOrigin-Name: de767376987f7668b0770c4920f1532e341b5a27f797d69c0f5e92b87d036170

5 years agoAdd the ability to unregister a virtual table module by invoking
drh [Fri, 16 Aug 2019 22:58:29 +0000 (22:58 +0000)] 
Add the ability to unregister a virtual table module by invoking
sqlite3_create_module() with a NULL sqlite3_module pointer.

FossilOrigin-Name: 31e34fa3390196cdc3178bf120224b08df5ec58fa2c77079ede6e9461a430dad

5 years agoFix harmless compiler warnings in the TCL interface.
drh [Thu, 15 Aug 2019 23:11:42 +0000 (23:11 +0000)] 
Fix harmless compiler warnings in the TCL interface.

FossilOrigin-Name: f17e72291f197a92b3e15e054271b997d45211a5a31ca4ea6c7fbb33026d5f1f

5 years agoAdd the SQLITE_DBCONFIG_ENABLE_VIEW option, together with a "db config"
drh [Thu, 15 Aug 2019 21:27:20 +0000 (21:27 +0000)] 
Add the SQLITE_DBCONFIG_ENABLE_VIEW option, together with a "db config"
command in the TCL interface that can access that option as well as all the
other sqlite3_db_config() boolean options.

FossilOrigin-Name: 61b4bccd2984f4c2cf50f58ef08677588e57aa7e079af07473b2e188d9ce4f52

5 years agoProvide the SQLITE_DIRECTONLY flag for app-defined functions that prohibits directonly
drh [Thu, 15 Aug 2019 20:04:09 +0000 (20:04 +0000)] 
Provide the SQLITE_DIRECTONLY flag for app-defined functions that prohibits
the use of those functions within triggers or views.

FossilOrigin-Name: fc745845d8d76adc165575e2192f4176e3c28e614c72571d56f4011560499fe1

5 years agoEnsure that the optional "sz=N" parameter that can be manually added to the
drh [Thu, 15 Aug 2019 14:35:45 +0000 (14:35 +0000)] 
Ensure that the optional "sz=N" parameter that can be manually added to the
end of an sqlite_stat1 entry does not have an N value that is too small.
Ticket [e4598ecbdd18bd82]

FossilOrigin-Name: 98357d8c1263920b33a3648ef9214a63c99728bafa7a8d3dd6a1241b2303fd42

5 years agoEnsure that SQLite does not attempt to process incompatible window functions in a...
dan [Thu, 15 Aug 2019 13:53:22 +0000 (13:53 +0000)] 
Ensure that SQLite does not attempt to process incompatible window functions in a single scan. Fix for [256741a1].

FossilOrigin-Name: 4f5b2d938194fab7627486e2ced633def2c90d9d3328e3700612feb9dbfa3d9a

5 years agoAvoid downgrading SQLITE_CORRUPT errors detected by the schema parser into
drh [Thu, 15 Aug 2019 13:46:39 +0000 (13:46 +0000)] 
Avoid downgrading SQLITE_CORRUPT errors detected by the schema parser into
SQLITE_NOMEM or SQLITE_ERROR errors.

FossilOrigin-Name: b2e79f8ff0836fcc98a2df9377aad9137307c34058030ecd1b5d4ec3277ed36a

5 years agoEnsure that the cell overwrite optimization does not overwrite the header
drh [Thu, 15 Aug 2019 13:17:49 +0000 (13:17 +0000)] 
Ensure that the cell overwrite optimization does not overwrite the header
of the b-tree page.

FossilOrigin-Name: 4cc5694cbd69749c146679c367860952fdf3f5356426ddfd1dce470569702bc1

5 years agoEarly detection out-of-bounds page numbers on the direct-overflow-read
drh [Thu, 15 Aug 2019 00:04:44 +0000 (00:04 +0000)] 
Early detection out-of-bounds page numbers on the direct-overflow-read
optimization gives consistent error messages regardless of whether or not
the optimization is enabled.

FossilOrigin-Name: b517a52fa36df0a0854a75858b5e81861771d2e9032a5a0ad79aa76ae64130a2

5 years agoAlways check for reads past the end of the file on the in-memory journal
drh [Wed, 14 Aug 2019 15:17:21 +0000 (15:17 +0000)] 
Always check for reads past the end of the file on the in-memory journal
driver.  This used to be an assert().

FossilOrigin-Name: 4d41ca7d6efbdac70890a8d4159488fc7f59bf78a550b00597b4df990c4fcaef

5 years agoAdd some static to the 'regexp' extension.
mistachkin [Tue, 13 Aug 2019 20:34:35 +0000 (20:34 +0000)] 
Add some static to the 'regexp' extension.

FossilOrigin-Name: a21d1dde73f811244b5b43f9fed5877263a9c5061470221f417e501f5530edfa

5 years agoUpdate test cases so that they work with ICU enabled.
dan [Tue, 13 Aug 2019 17:56:56 +0000 (17:56 +0000)] 
Update test cases so that they work with ICU enabled.

FossilOrigin-Name: 408144a1832569ced8e04840f0dd36a3867405f36b13631b0f13c0f7b8a0fb01

5 years agoUpdate some corruption test cases to take [724f4df9c] into account.
dan [Tue, 13 Aug 2019 17:27:43 +0000 (17:27 +0000)] 
Update some corruption test cases to take [724f4df9c] into account.

FossilOrigin-Name: 927cd7b4c52fae665e57fb6039c6829e339cff5ad5c405800cac3ee149ef5be1

5 years agoFix a problem with RBU function sqlite3rbu_bp_progress() when used during an RBU...
dan [Tue, 13 Aug 2019 15:11:25 +0000 (15:11 +0000)] 
Fix a problem with RBU function sqlite3rbu_bp_progress() when used during an RBU vacuum.

FossilOrigin-Name: 8c44b02f1479cec61554800702a3c1d806e4ee64b41ba2af17320f62794a02fe

5 years agoMake sure the btree cursor overflow cache is cleared when overwriting
drh [Mon, 12 Aug 2019 18:26:46 +0000 (18:26 +0000)] 
Make sure the btree cursor overflow cache is cleared when overwriting
a cell in sqlite3BtreeInsert().  Ticket [3cf9bb227e9a5d32]

FossilOrigin-Name: 7dae7b969ed314605a3a2da2cfdce4d81152740f5d3bfbc2a6e311b13ee325a7

5 years agoFor the ".testctrl prng_seed" command in the CLI, if the argument is "random"
drh [Mon, 12 Aug 2019 16:25:11 +0000 (16:25 +0000)] 
For the ".testctrl prng_seed" command in the CLI, if the argument is "random"
then select a random integer seed and print the seed value on stdout.

FossilOrigin-Name: 636ca4472c9f41eb3989f28854d4968867837399a2092f389d1b814d98cccbae

5 years agoAdd a TESTCTRL that disables the verification of type, name, and tbl_name
drh [Mon, 12 Aug 2019 14:17:43 +0000 (14:17 +0000)] 
Add a TESTCTRL that disables the verification of type, name, and tbl_name
in the sqlite_master table.

FossilOrigin-Name: 48d9b48ab4ace234eb1a055cf33cb533a1c3aa82d0a6e086d96226bd9474ceca

5 years agoValidate the type, name, and tbl_name fields of the sqlite_master table when
drh [Mon, 12 Aug 2019 00:08:07 +0000 (00:08 +0000)] 
Validate the type, name, and tbl_name fields of the sqlite_master table when
loading the schema, unless writable_schema is engaged.

FossilOrigin-Name: 724f4df9ccc2b683f7091a3f7a8c20ee210f44d7a610cd1b4c49da1c274add08

5 years agoFix the sqliteExprImpliesExpr() routine so that it recognizes that
drh [Sat, 10 Aug 2019 15:06:03 +0000 (15:06 +0000)] 
Fix the sqliteExprImpliesExpr() routine so that it recognizes that
"(NULL IS FALSE) IS FALSE" doe not implie "NULL NOT NULL".
Ticket [9080b6227fabb466]

FossilOrigin-Name: da01ba4fa47c6508b31533ccd769e637af04bd37f51463372fbc6c848d892a4d

5 years agoAdd extra test cases related to the previous commit.
dan [Sat, 10 Aug 2019 14:35:06 +0000 (14:35 +0000)] 
Add extra test cases related to the previous commit.

FossilOrigin-Name: 3c690b2b05b7338f3325c50a0750c6023e1173afa4388e836ecb2cc49f19a0ac

5 years agoRemove two incorrect assert() statements from the logic used to derive
drh [Sat, 10 Aug 2019 14:16:17 +0000 (14:16 +0000)] 
Remove two incorrect assert() statements from the logic used to derive
column names and types from subqueries.

FossilOrigin-Name: 712e47714863a8ed7ff73324d9fec569633e8b901c436c633b0220d16a7a9302

5 years agoAllow the RHS of a row-value IN operator to use a compound query with
drh [Fri, 9 Aug 2019 20:26:01 +0000 (20:26 +0000)] 
Allow the RHS of a row-value IN operator to use a compound query with
an ORDER BY clause.

FossilOrigin-Name: eaf15d9bae6773058341d6219241f44ce728ad1cb9cf649f2efd4dddd81ec461

5 years agoModify signature of sqlite3VdbeChangeOpcode() to accept int instead of u32.
mistachkin [Fri, 9 Aug 2019 01:59:14 +0000 (01:59 +0000)] 
Modify signature of sqlite3VdbeChangeOpcode() to accept int instead of u32.

FossilOrigin-Name: 68b7f2acf4d228f32250e37cbc0eb5d275b512d49071bbb38e1f5634b705f7d3

5 years agoFix more compiler warnings.
drh [Fri, 9 Aug 2019 01:11:32 +0000 (01:11 +0000)] 
Fix more compiler warnings.

FossilOrigin-Name: 1b85442b614df0808c10c34ec281282e5dfd93d6d5f9737b51263ffaa4da5c72

5 years agoFix harmless compiler warnings.
drh [Thu, 8 Aug 2019 19:40:29 +0000 (19:40 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 1eef4ddea9a2a8c97b97183402c774caa40ef906ea9cccade307381b29a9785d

5 years agoRemove support for SQLITE_ENABLE_STAT3. The sqlite_stat3 table is now ignored,
drh [Thu, 8 Aug 2019 19:19:42 +0000 (19:19 +0000)] 
Remove support for SQLITE_ENABLE_STAT3.  The sqlite_stat3 table is now ignored,
if it exists.  Run ANALYZE using STAT4 to get the equivalent functionality,
which presumably everybody has been doing for a long time now.

FossilOrigin-Name: f1cd234c9888142e0ac542d866d7fb55a81fb7edd0a5cd810191b4e0395ffc7d

5 years agoFix a case of the Expr.affinity to Expr.affExpr refactor that was missed
drh [Thu, 8 Aug 2019 18:49:16 +0000 (18:49 +0000)] 
Fix a case of the Expr.affinity to Expr.affExpr refactor that was missed
in the [a29f2a7d07beff64] check-in.

FossilOrigin-Name: 83450d10707e2c7c075f3930a8c231c49c593b9cdf0e6097b0187eb877755d2d

5 years agoMore legacy STAT3 code removed. omit-stat3
drh [Thu, 8 Aug 2019 16:23:12 +0000 (16:23 +0000)] 
More legacy STAT3 code removed.

FossilOrigin-Name: 845d2f17de5b4740f95884307d9efec3223737bb0f2c4a74693666caf5f61c21

5 years agoRemove support for STAT3. The sqlite_stat3 tables are ignored, if they
drh [Thu, 8 Aug 2019 15:24:17 +0000 (15:24 +0000)] 
Remove support for STAT3.  The sqlite_stat3 tables are ignored, if they
exist.  STAT4 continues to work as it always has, and as it is a superset of
STAT3 is the recommended replacement.

FossilOrigin-Name: 1e17ea2fd1df4ad49138c787c8fe3207dd0c25c93f9001d52a9b69f8c12e841c

5 years agoRemove a NEVER() that is reachable from a corrupt database.
drh [Thu, 8 Aug 2019 01:39:07 +0000 (01:39 +0000)] 
Remove a NEVER() that is reachable from a corrupt database.

FossilOrigin-Name: 30e6ee27a9fb78291c324ac9b80db4579280140430804ecd4692e312f9938525

5 years agoRemove use of the affinity() function from view.test, as it is only available in...
dan [Wed, 7 Aug 2019 19:57:21 +0000 (19:57 +0000)] 
Remove use of the affinity() function from view.test, as it is only available in SQLITE_DEBUG builds.

FossilOrigin-Name: 7f2246a17be9915b3492624a3d8deff56694bdc372f7627e3f16c1869415b1a3

5 years agoAdd "set TMP=%CD%" to the start of each msvc script output by releasetest_data.tcl...
dan [Wed, 7 Aug 2019 18:34:21 +0000 (18:34 +0000)] 
Add "set TMP=%CD%" to the start of each msvc script output by releasetest_data.tcl. Otherwise, since binaries compiled with SQLITE_TEST all choose the same sequence of pseudo-random numbers, collisions between temp file names cause errors when running multiple tests in parallel.

FossilOrigin-Name: f5d0436d8dc650cadb61a5fe76fd1a0d68dabba54ff0c2a8c138f9dfbdab1c3f

5 years agoEliminate some more cases of redundant sorting in window-function queries.
dan [Wed, 7 Aug 2019 17:45:37 +0000 (17:45 +0000)] 
Eliminate some more cases of redundant sorting in window-function queries.

FossilOrigin-Name: 8158d2aca68c5a253054376fdf1b8eaab2db874f4b93524742be7340e9c50dd5

5 years agoDo not make SQLITE_READ authorizer calls for tables without names, as all
drh [Wed, 7 Aug 2019 13:25:21 +0000 (13:25 +0000)] 
Do not make SQLITE_READ authorizer calls for tables without names, as all
such tables will be internal-use-only tables for subqueries and whatnot.

FossilOrigin-Name: 193c87fc96f964984a144c1a4506ef9db033ab2b80e64dd4d09d820fef466407

5 years agoEnsure that when the col in an operator like "val IN(col)" is a column of a view...
dan [Tue, 6 Aug 2019 21:16:28 +0000 (21:16 +0000)] 
Ensure that when the col in an operator like "val IN(col)" is a column of a view, its affinity is not used to coerce val. Fix for [0a5e2c1d].

FossilOrigin-Name: 17b3d2218c02a4005d4c96471c452105b54abb25901ae62990b01f0c955135fe

5 years agoImproved reuse of file descriptors for which close() is delayed to prevent
drh [Tue, 6 Aug 2019 20:55:06 +0000 (20:55 +0000)] 
Improved reuse of file descriptors for which close() is delayed to prevent
clearly of posix advisory locks.

FossilOrigin-Name: 509c1ba26a4c12c63ecf04ddfa2f175eaf4dd9b96ab7be15faebd36deb0a0a31

5 years agoEnhance the ".recover" output in the shell to use double-quotes around table
drh [Tue, 6 Aug 2019 20:26:17 +0000 (20:26 +0000)] 
Enhance the ".recover" output in the shell to use double-quotes around table
and column identifiers.

FossilOrigin-Name: 846d2d2d2f7fd2e4178c70bc2b92f18941a7972fe88c0129035b7a253ed21785

5 years agoAdd "PRAGMA foreign_keys=OFF;" to the start of the script output by ".recover", just...
dan [Tue, 6 Aug 2019 18:40:36 +0000 (18:40 +0000)] 
Add "PRAGMA foreign_keys=OFF;" to the start of the script output by ".recover", just as is done for ".dump".

FossilOrigin-Name: bfc29e62eff0ed00c153e18a27815f7e3ba316f46871e9645b84ab1e6709a392

5 years agoEnsure that columns of views and sub-queries that are expressions with
drh [Tue, 6 Aug 2019 15:32:42 +0000 (15:32 +0000)] 
Ensure that columns of views and sub-queries that are expressions with
no affinity are comparied without any type conversions, as required in the
documentation.  Tickets [61c853857f40da49] and [d52a29a9e6bc55c5].

FossilOrigin-Name: 9c8c1092a8ce80e114fcfe8ce780332a6f269b8c87df226242b582d2d825c393

5 years agoPerformance optimization to the new affinity handling logic. pending
drh [Tue, 6 Aug 2019 15:18:15 +0000 (15:18 +0000)] 
Performance optimization to the new affinity handling logic.

FossilOrigin-Name: c9724e761bce7a4ae63ce3c1408795915865e8d3024dcb90690456f724f0df53

5 years agoUse 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columns
drh [Tue, 6 Aug 2019 14:37:24 +0000 (14:37 +0000)] 
Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columns
with no affinity can appear in a zero-terminated string.  Use the new
SQLITE_AFF_NONE macro for this new magic number.

FossilOrigin-Name: e8234f6939ccff4c10f741cf66d1c537cfebcbd0d1d79a618a64c755a7f087b5

5 years agoEnsure that columns of views and sub-queries that are expressions with no affinity...
dan [Mon, 5 Aug 2019 20:53:19 +0000 (20:53 +0000)] 
Ensure that columns of views and sub-queries that are expressions with no affinity are not assigned BLOB affinity. This matches the documentation. Fix for [61c853857f40da49].

FossilOrigin-Name: e15a0977ddfad3d0f4c7654c5665ff10830c25b20ecf6ef500b1ba23fb89e31f

5 years agoAdd test cases to this branch. tkt-61c853-A
dan [Mon, 5 Aug 2019 20:45:53 +0000 (20:45 +0000)] 
Add test cases to this branch.

FossilOrigin-Name: f37317d81cc2864ed57c76a7347351310d61c8056a2a0179218530ba60a44986

5 years agoFix the patch on this branch so that it works with sub-queries, as well as views.
dan [Mon, 5 Aug 2019 19:44:47 +0000 (19:44 +0000)] 
Fix the patch on this branch so that it works with sub-queries, as well as views.

FossilOrigin-Name: 7480db307c39b86bce269583e5917f5e1a3990500552fd98400ef3e7088c0b2a

5 years agoOne of two options on how to address ticket [61c853857f40da49]. In this
drh [Mon, 5 Aug 2019 19:32:06 +0000 (19:32 +0000)] 
One of two options on how to address ticket [61c853857f40da49].  In this
mode, we back out the documentation change of
[https://www.sqlite.org/docsrc/info/07b7749da88d54e5|[07b7749da88d54e5]]
and change the core to work as it has been documented to work since 2017,
rather than how it has actually worked since 2009.

FossilOrigin-Name: 09cd0c0c6e6c963e0039a733876e5149adb3cd10e9b92699fa1dcb0633e997a4

5 years agoRefactor field Expr.affinity into Expr.affExpr to avoid confusion with other
drh [Mon, 5 Aug 2019 18:01:42 +0000 (18:01 +0000)] 
Refactor field Expr.affinity into Expr.affExpr to avoid confusion with other
fields and variables named "affinity" and display affExpr it in
sqlite3TreeViewExpr() output.

FossilOrigin-Name: a29f2a7d07beff64e489e8f824babc6228c4a499fadc0ee701caa60a63baadcd

5 years agoImproved detection of corruption on the freeblock list of a btree page.
drh [Mon, 5 Aug 2019 16:22:20 +0000 (16:22 +0000)] 
Improved detection of corruption on the freeblock list of a btree page.

FossilOrigin-Name: 4b00799bdf107fce8a9dd84fd5bf6597e4f3373659b89aae4a1242be5964726f

5 years agoFix a problem with renaming a table when a view or trigger within the schema uses...
dan [Mon, 5 Aug 2019 13:19:25 +0000 (13:19 +0000)] 
Fix a problem with renaming a table when a view or trigger within the schema uses a FILTER with an aggregate function that is not currently registered with the database.

FossilOrigin-Name: 2ac0e42f8ab7a9184c2a2efd13bd50ab51bc01f9f34e9e63591fd18db02dff54

5 years agoPrevent an fts5 table from being its own content table, or part of a view that is...
dan [Mon, 5 Aug 2019 12:55:56 +0000 (12:55 +0000)] 
Prevent an fts5 table from being its own content table, or part of a view that is the content table.

FossilOrigin-Name: b6d52c9364767ff4ab7279ae981afb97799299dcfaf38a0110c40ca82c72a825

5 years agoStregthen an assert() in the WHERE clause code generator for the min/max
drh [Sat, 3 Aug 2019 19:06:18 +0000 (19:06 +0000)] 
Stregthen an assert() in the WHERE clause code generator for the min/max
optimization.

FossilOrigin-Name: 1bd4b97d6405c9b093f3bfed914c56088ee13e4a2242be62b74a86660f74f533

5 years agoFix a problem with queries of the form "SELECT min(<expr>) ... WHERE <expr>=?" where...
dan [Sat, 3 Aug 2019 16:37:40 +0000 (16:37 +0000)] 
Fix a problem with queries of the form "SELECT min(<expr>) ... WHERE <expr>=?" where there is an index on <expr>. Fix for [71e183ca].

FossilOrigin-Name: d465c3eef458c851d97eea6e4117247d9c69386b276168080dbff7bb64070c93

5 years agoIn the ".wheretrace 0x100" debugging mode, show the structure of the
drh [Sat, 3 Aug 2019 16:17:46 +0000 (16:17 +0000)] 
In the ".wheretrace 0x100" debugging mode, show the structure of the
main parameters to sqlite3WhereBegin() calls.

FossilOrigin-Name: fd598e475d353363e19adc27a671170f11ae9f6d8cad58cb2303fb2ad8ac6bec

5 years agoAdd the SQLITE_TESTCTRL_PRNG_SEED which can control the PRNG seed either
drh [Sat, 3 Aug 2019 01:40:17 +0000 (01:40 +0000)] 
Add the SQLITE_TESTCTRL_PRNG_SEED which can control the PRNG seed either
directly or through the schema cookie of a supplied database connection.

FossilOrigin-Name: 2660e9292ae2c229eb7c57a6a79bb19f0c970072f86750fbe9cca3113d44ffe4

5 years agoGive the SQLITE_TESTCTRL_PRNG_SEED two arguments. The second argument if not prng-seed-test-control
drh [Sat, 3 Aug 2019 01:39:20 +0000 (01:39 +0000)] 
Give the SQLITE_TESTCTRL_PRNG_SEED two arguments.  The second argument if not
NULL is a pointer to a database connection which seeds the connection from
its schema cookie.  In this way, fuzzers can control the PRNG seed.

FossilOrigin-Name: 49aa34480622cce4d7a72c59d9cfa8336886387acec8ee15b72f295ea1a52d8c

5 years agoFixes to the PRNG_SEED pragma idea.
drh [Fri, 2 Aug 2019 21:03:24 +0000 (21:03 +0000)] 
Fixes to the PRNG_SEED pragma idea.

FossilOrigin-Name: c71098409c98af8360f8f28b9238a12ec764018a5782e8ff03fdf5db54031d6e

5 years agoAdd the SQLITE_TESTCTRL_PRNG_SEED test control.
drh [Fri, 2 Aug 2019 20:45:04 +0000 (20:45 +0000)] 
Add the SQLITE_TESTCTRL_PRNG_SEED test control.

FossilOrigin-Name: 3ac5723164ae801e209ce525a5d94692767136f9d06be2a84883dcea677d02da

5 years agoIf a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null,...
dan [Fri, 2 Aug 2019 19:40:01 +0000 (19:40 +0000)] 
If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Fix for ticket [41866dc37].

FossilOrigin-Name: faaaae4940b5f4f70e4988ad5b45582410b381ace0031e6abcde0b9217c06796

5 years agoIf a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null,... tkt-41866dc37
dan [Fri, 2 Aug 2019 18:43:59 +0000 (18:43 +0000)] 
If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Possible fix for ticket [41866dc37].

FossilOrigin-Name: a7277ed0623dccdbf775ae6127611d6bc6e150f6942a048ab4281e5136c0e98d

5 years agoThe sqlite3_set_authorizer() interface should only expire prepared statements
drh [Thu, 1 Aug 2019 22:48:45 +0000 (22:48 +0000)] 
The sqlite3_set_authorizer() interface should only expire prepared statements
when it is setting a new authorizer, not when clearing the authorizer.  And
statements that are running when sqlite3_set_authorizer() is invoked should be
allowed to continue running to completion.

FossilOrigin-Name: 961e2f08c35238bcb1d32430d16451a96807b2c4bbb194ee621128dd09cd3981

5 years agoAdd new release tests for windows to releasetest_data.tcl.
dan [Thu, 1 Aug 2019 15:18:51 +0000 (15:18 +0000)] 
Add new release tests for windows to releasetest_data.tcl.

FossilOrigin-Name: 1b330ec24c350c59f6d3779f6c0819fe95b89f4dfca5a1f2c22f22b5fe9cd087

5 years agoFix a problem in ALTER TABLE triggered by views or triggers that include the construc...
dan [Thu, 1 Aug 2019 10:58:46 +0000 (10:58 +0000)] 
Fix a problem in ALTER TABLE triggered by views or triggers that include the construction "ORDER BY true" or "ORDER BY false".

FossilOrigin-Name: 8168021f9ab5fb8b4888257963c9ec68fd1dfeedaf6bba4b8e07438001d0be0f

5 years agoUpdate "releasetest_data.tcl" so that it is a standalone script that generates sh...
dan [Wed, 31 Jul 2019 21:08:55 +0000 (21:08 +0000)] 
Update "releasetest_data.tcl" so that it is a standalone script that generates sh or batch scripts to run each tcl test run at release time. Update wapptest.tcl to use it.

FossilOrigin-Name: 559c2dd6724b2fc238760863d4be7132b591457e72ca5758fdd4002fbf7df4bc

5 years agoNew test cases in test/fuzzdata8.db.
drh [Wed, 31 Jul 2019 15:16:14 +0000 (15:16 +0000)] 
New test cases in test/fuzzdata8.db.

FossilOrigin-Name: 6e92d71c24c6039e7116f02fc5f39b2b87efcd3674ea828077c03d760bf49c45

5 years agoDo not allow the json_set() function to overwrite the same element more than
drh [Wed, 31 Jul 2019 12:13:58 +0000 (12:13 +0000)] 
Do not allow the json_set() function to overwrite the same element more than
once.

FossilOrigin-Name: f237f60e4fa9171dfe9a77c8637595c2701e971034d41bd6018944e8b2b27a6f

5 years agoFix the build for when -DSQLITE_SMALL_STACK is used.
drh [Tue, 30 Jul 2019 21:00:13 +0000 (21:00 +0000)] 
Fix the build for when -DSQLITE_SMALL_STACK is used.

FossilOrigin-Name: b9eda2249ab5cf523093e4849c317d9a4b1743f7e15d96bdd6bb6cc423302914

5 years agoImproved fix for ticket [ced41c7c7d6b4d36] that keeps skip-scan enabled,
drh [Tue, 30 Jul 2019 14:22:10 +0000 (14:22 +0000)] 
Improved fix for ticket [ced41c7c7d6b4d36] that keeps skip-scan enabled,
but avoids identifying a skip-scan as order-distinct (because it is not)
and thus forces a separate b-tree to implement the DISTINCT clause of a
query.  This undoes check-in [a871d69c6de65038] and substitutes a new fix.

FossilOrigin-Name: 89bf0399e87be76e7b264e0a35e8a6d3af0f9e71123a929c20754882b636ca70

5 years agoDisable the skip-scan optimization for DISTINCT queries.
drh [Tue, 30 Jul 2019 01:17:03 +0000 (01:17 +0000)] 
Disable the skip-scan optimization for DISTINCT queries.
Fix for ticket [ced41c7c7d6b4d36]

FossilOrigin-Name: a871d69c6de65038360aa6142fbad22689fb347e526cca56bb83e695c1441fbe

5 years agoConvert an assert() in R-Tree into a database corruption detection case.
drh [Mon, 29 Jul 2019 17:18:45 +0000 (17:18 +0000)] 
Convert an assert() in R-Tree into a database corruption detection case.

FossilOrigin-Name: 48b518eb6f76fb0beb161d1ebcf3b793efc36262d6d77a1ad5906b6501138e28

5 years agoFix a crash in fts3 caused by corrupt database records.
dan [Mon, 29 Jul 2019 16:53:30 +0000 (16:53 +0000)] 
Fix a crash in fts3 caused by corrupt database records.

FossilOrigin-Name: 11f7f94f1c5d761e7f381e277658b7e857cc369283996c509061de55fd6aad52

5 years agoWhen using an index for both DISTINCT and ORDER BY, do not confuse the number of...
dan [Mon, 29 Jul 2019 15:32:01 +0000 (15:32 +0000)] 
When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c].

FossilOrigin-Name: 6ac0f822450b26c7d67c33cdb2a90189cd3cf65a052af8497b795c3f71a23813

5 years agoWhen using an index for both DISTINCT and ORDER BY, do not confuse the number of... tkt-6749cb3c
dan [Mon, 29 Jul 2019 14:42:56 +0000 (14:42 +0000)] 
When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c].

FossilOrigin-Name: b47169319ad88e8ffdbe8fbb91f4cced81ebd5c0ee1b018be2d0256c9a1c5159

5 years agoFix the OP_Affinity operator so that when applying REAL affinity, it
drh [Mon, 29 Jul 2019 06:06:53 +0000 (06:06 +0000)] 
Fix the OP_Affinity operator so that when applying REAL affinity, it
only sets MEM_IntReal if the integer value will fit in 6 bytes or less.
Fix for ticket [ba2f4585cf495231]

FossilOrigin-Name: 2b221bb15fd2b9f6a426e5eb439f7dbabbe3c4cab010c49b87dae3bb1f16c081

5 years agoFix a minor typo in a comment.
drh [Mon, 29 Jul 2019 05:23:01 +0000 (05:23 +0000)] 
Fix a minor typo in a comment.

FossilOrigin-Name: cea8a892f76bddc63b921ffc11ea8dce8f8cf649a2c77aa908c7c5c91eed7f4c

5 years agoSync up warning related compiler options in the Makefiles for MSVC.
mistachkin [Mon, 29 Jul 2019 02:52:11 +0000 (02:52 +0000)] 
Sync up warning related compiler options in the Makefiles for MSVC.

FossilOrigin-Name: e77d48d1dd140967b18106044dd45e2ba6cd77b6aa5afa8bf3f0a9c16a50eec4

5 years agoFix harmless compiler warning seen with MSVC for x64.
mistachkin [Mon, 29 Jul 2019 02:49:14 +0000 (02:49 +0000)] 
Fix harmless compiler warning seen with MSVC for x64.

FossilOrigin-Name: 857b2ba6d05d6f5a8cfdf269bae9005b25e1903ab9dc6b70546979d8c633f03b

5 years agoUpdate RBU so that it supports indexes on expressions.
dan [Fri, 26 Jul 2019 20:33:23 +0000 (20:33 +0000)] 
Update RBU so that it supports indexes on expressions.

FossilOrigin-Name: 6bfa44da226fd758a2ee924d1e8e3a742b0635b6d3f922a4a7919cb14b2418e6

5 years agoFix RBU handling of partial indexes with comments embedded in their CREATE INDEX...
dan [Fri, 26 Jul 2019 16:16:31 +0000 (16:16 +0000)] 
Fix RBU handling of partial indexes with comments embedded in their CREATE INDEX statements.

FossilOrigin-Name: e1ccf211aa975a6688a27f7dc4cea80784ed8dcfe1950b2fa6eb0a3cb938838a

5 years agoFix a potential buffer overread in fts5 triggered by a corrupt database record.
dan [Thu, 25 Jul 2019 19:29:24 +0000 (19:29 +0000)] 
Fix a potential buffer overread in fts5 triggered by a corrupt database record.

FossilOrigin-Name: 16472112b6886ada18d45cfb409cca2e83dde5a8ba8a36d481e87b61100b0186

5 years agoFix faulty asserts in the code generator.
drh [Wed, 24 Jul 2019 23:15:19 +0000 (23:15 +0000)] 
Fix faulty asserts in the code generator.
Ticket [c52b09c7f38903b1]

FossilOrigin-Name: 01cdc590f7894ea23ee0d674747d7ebf8196efbef3c87d47e72dbc1ab6ae2883

5 years agoImprove the ".recover" command so that it handles intkey pages linked into non-intkey...
dan [Wed, 24 Jul 2019 20:10:27 +0000 (20:10 +0000)] 
Improve the ".recover" command so that it handles intkey pages linked into non-intkey b-trees, and vice-versa, better.

FossilOrigin-Name: 9c458acba5a100a76148a3efb78ea9f57b85751e80788e4532694bd8976608a0

5 years agoImprove the ".recover" command's handling of corrupt database schemas.
dan [Wed, 24 Jul 2019 19:20:30 +0000 (19:20 +0000)] 
Improve the ".recover" command's handling of corrupt database schemas.

FossilOrigin-Name: becaaa4d29d17ad613f2a120f0b173e53403b3de26f22beaf83f66ebf369bf60

5 years agoImprove the ".recover" command in the shell tool so that it is not confused by auto...
dan [Wed, 24 Jul 2019 08:15:09 +0000 (08:15 +0000)] 
Improve the ".recover" command in the shell tool so that it is not confused by auto-vacuum databases. And so that it can recover tables for which one or more of the column names are SQL keywords.

FossilOrigin-Name: 87d76047d6a3df31bc9b7c0cffa7b758236c124f87263a520850b019cbbc4c6e

5 years agoAvoid redefining types u32 and u16 when fossildelta.c is compiled as part of the...
dan [Tue, 23 Jul 2019 13:26:43 +0000 (13:26 +0000)] 
Avoid redefining types u32 and u16 when fossildelta.c is compiled as part of the amalgamation.

FossilOrigin-Name: d8e88248e3204b5f2b95b9b8921ee7ee2f7574ae81e6abd5b4f2ddf187f7d71b

5 years agoDo not use the insert-overwrite optimization if the cell might overwrite the
drh [Mon, 22 Jul 2019 23:24:01 +0000 (23:24 +0000)] 
Do not use the insert-overwrite optimization if the cell might overwrite the
page header.

FossilOrigin-Name: f60a83069168899dcfd706b4d0901084c7ce92d85277950317e962a8a98ec668

5 years agoConsolidate the removal of Window objects from the Select.pWin list into
drh [Mon, 22 Jul 2019 19:01:38 +0000 (19:01 +0000)] 
Consolidate the removal of Window objects from the Select.pWin list into
a single subroutine.

FossilOrigin-Name: e46b2afc99329c43de08d4a2e6ade4d2239d7409c5d5626bf272a3e0dd24d1b4

5 years agoFix a bug in the linked-list handling code added by commit [fd7316cd].
dan [Mon, 22 Jul 2019 17:28:43 +0000 (17:28 +0000)] 
Fix a bug in the linked-list handling code added by commit [fd7316cd].

FossilOrigin-Name: 05080344dceafcfb670fbf01f7d69a1d713a54b6845f968a9cfe941fb53b13af

5 years agoNew test cases added to test/fuzzdata8.db
drh [Mon, 22 Jul 2019 16:57:13 +0000 (16:57 +0000)] 
New test cases added to test/fuzzdata8.db

FossilOrigin-Name: 25fec62ac5a23382a54eee78d3705885eb4065826d7e8da098816d03ae9dc639

5 years agoRemove Window objects from the corresponding Select.pWin list when they are deleted...
dan [Mon, 22 Jul 2019 16:33:02 +0000 (16:33 +0000)] 
Remove Window objects from the corresponding Select.pWin list when they are deleted, as they are, for example, when the ORDER BY clause is optimized out.

FossilOrigin-Name: fd7316cda0fdfe86985f41a97dff3beba188606ec9bc6fef38a686a6976a6e01

5 years agoRemove Window objects from the corresponding Select.pWin list when they are deleted. winfunc-in-orderby
dan [Mon, 22 Jul 2019 16:20:03 +0000 (16:20 +0000)] 
Remove Window objects from the corresponding Select.pWin list when they are deleted.

FossilOrigin-Name: d23f33168222dfa40a67dc7de58057418151989e81429e4af47617e86db04667

5 years agoFix a problem with renaming tables when the schema contains an invocation of a curren...
dan [Mon, 22 Jul 2019 11:38:43 +0000 (11:38 +0000)] 
Fix a problem with renaming tables when the schema contains an invocation of a currently unregistered aggregate with a FILTER clause.

FossilOrigin-Name: bd37ce3fb8dee8d538f6afc0bfc13cdc3ebdd504e6461f0130c6ecc8af585f68

5 years agoMake sure any window definitions in an ORDER BY clause are removed from
drh [Sat, 20 Jul 2019 21:12:31 +0000 (21:12 +0000)] 
Make sure any window definitions in an ORDER BY clause are removed from
the SELECT statement if the ORDER BY clause gets optimized out.

FossilOrigin-Name: 23b119671f0be3c6b72cf2dc5f7707a0626766db7aa56529ab00d33d1a0a1bee

5 years agoEarly detection of a corrupt R-Tree in the R-Tree search algorithm.
drh [Sat, 20 Jul 2019 18:00:46 +0000 (18:00 +0000)] 
Early detection of a corrupt R-Tree in the R-Tree search algorithm.

FossilOrigin-Name: 2bf5a4c16457562dc942bcc6ec06d9b4e795ef3ea8e31550e18857bbebd08a76

5 years agoPerformance optimizations in the rtreeStepToLeaf() routine of RTree.
drh [Sat, 20 Jul 2019 17:43:28 +0000 (17:43 +0000)] 
Performance optimizations in the rtreeStepToLeaf() routine of RTree.

FossilOrigin-Name: 4e34e3615ff31f4a6432033797b2e1a6604007ea0e501d714ecb362632776150