]>
git.ipfire.org Git - thirdparty/sqlite.git/log
drh [Sat, 25 Sep 2021 20:28:39 +0000 (20:28 +0000)]
Load recent dbsqlfuzz cases into test/fuzzdata8.db.
FossilOrigin-Name:
7a8fcf6d2c8e3c8f10ff515c8c00c761d15a28eef8e0e31e09e22feb06c9443b
dan [Sat, 25 Sep 2021 20:19:16 +0000 (20:19 +0000)]
dan [Sat, 25 Sep 2021 18:21:01 +0000 (18:21 +0000)]
Fix a bad interaction between the pager cache and the dbstat module that could lead to a malfunction following an OOM. dbsqlfuzz
9ed3e4e3816219d3509d711636c38542bf3f40b1 .
FossilOrigin-Name:
e03554a6a8c33d820922edccf605a2ce92055315bf22e464207ea8c0d81e3dd6
drh [Sat, 25 Sep 2021 17:07:57 +0000 (17:07 +0000)]
Add const to parameters on various internal interfaces.
FossilOrigin-Name:
70c221c5cf7b4d9ed34f16d045f262f99d16aa3db84f80cf0b03ee82ba28d075
drh [Fri, 24 Sep 2021 19:57:32 +0000 (19:57 +0000)]
Dbsqlfuzz (
a097eaad43c3c845b236126df92fb49b25449b0c ) found a way to reach the
assert() that was added to sqlite3_declare_vtab() by [
eb94f4a8174436b1 ].
This check-in fixes the problem.
FossilOrigin-Name:
857d26a68cf439e9cba4f8a3b326c69366fc486a876b76835538709ee39b8713
drh [Fri, 24 Sep 2021 16:14:47 +0000 (16:14 +0000)]
Add lots of new "const" on internal function parameters. There is opportunity
for many more - this is a work in progress.
FossilOrigin-Name:
a3c71a673ddd1c299bdae550fb955077b77088329a8ca2895dfb23538b524a8e
drh [Fri, 24 Sep 2021 12:59:33 +0000 (12:59 +0000)]
Ensure that sqlite_stat1 and sqlite_stat4 are ordinary tables (not views or
virtual tables) before trying to load them
(dbsqlfuzz
bc02a0cde82dee801a8d6f653d2831680f87dca1 ). This prevents
sqlite3_declare_vtab() from running with db->init.busy turned on. Even so,
enhance sqlite3_declare_vtab() to be able to deal with db->init.busy being on,
in case there are undiscovered paths to that state.
Each of these two changes are independently sufficient to prevent the problem
fixed by the previous check-in [
c7560c1329965ab5 ] but there
is no harm in keeping that third layer of protection in place.
FossilOrigin-Name:
eb94f4a8174436b1f0deed0a43618a20018387bb815be658314ca6b454c446fb
drh [Fri, 24 Sep 2021 02:14:35 +0000 (02:14 +0000)]
drh [Wed, 22 Sep 2021 14:43:35 +0000 (14:43 +0000)]
drh [Wed, 22 Sep 2021 14:26:22 +0000 (14:26 +0000)]
For shell.c.in, define CHAR_BITS to 8 on platforms that do not have that
value set by default. This fixes the build on older machines.
FossilOrigin-Name:
96610cc8251ad4ff8d7f0536f20f4572a996bfa8d24bec8a7925a333e507da1e
drh [Wed, 22 Sep 2021 13:43:16 +0000 (13:43 +0000)]
Fix harmless compiler warnings in shell.c.in, and a compiler warning in
sqlite3expert.c which is a real error, though also harmless.
FossilOrigin-Name:
56da0e9c0321d1fd3c360722cd6284296f9ba459f6b37ab35c81ecabd18f12e3
drh [Wed, 22 Sep 2021 13:07:10 +0000 (13:07 +0000)]
Fix an incorrect assert() in rtree that was added recently
by [
f7ad73c49507c943 ]. Change it to testcase().
FossilOrigin-Name:
3aa0bf3a098ee9a62c79f266f94e4d290056d0f3e91237944893d6bbb686861f
drh [Wed, 22 Sep 2021 10:57:30 +0000 (10:57 +0000)]
Enhance the TCL-based test harness so that it is possible to list multiple
test modules on the "testfixture" command-line and have them all run.
For example: "<tt>./testfixture test/shell*.test</tt>"
FossilOrigin-Name:
45caf9b85fc75abe80e3d2704fc634e4b103647c912c3fbffb1847d8cb581b62
drh [Wed, 22 Sep 2021 10:28:50 +0000 (10:28 +0000)]
Use sqlite3_snprintf() for the ".changes" output formatting in the shell
because it now uses %lld, and some older C compilers do not understand that
construct.
FossilOrigin-Name:
53dadf80672a4fe05341fe40873b6cfa73f6bc1e07cc41fcf10fe290c9156363
larrybr [Tue, 21 Sep 2021 20:03:05 +0000 (20:03 +0000)]
Fix .expert name collision bug reported at https://sqlite.org/forum/forumpost/
05e6f32984561f57 ?t=h
FossilOrigin-Name:
4a3f98ad0dd2a8c0370042611a041bed2bd8d9ca82d6706e2db349eb97aaf1f0
larrybr [Tue, 21 Sep 2021 19:19:28 +0000 (19:19 +0000)]
Speed and (slightly) simplify shell's input line early processing.
FossilOrigin-Name:
a1c7f7f8e1b46440234be96e813e4c2c28150413dd95dcab5d13b9c80a202edf
drh [Tue, 21 Sep 2021 17:26:23 +0000 (17:26 +0000)]
Add the "PRAGMA table_list" command with its corresponding eponymous
table-valued function: "pragma_table_list".
FossilOrigin-Name:
2c0e7ae541e9ecb86aa58fa7e7057def8aac1b1af1af1aa80b8bf2d260f9a2f9
larrybr [Mon, 20 Sep 2021 21:42:39 +0000 (21:42 +0000)]
Accomplish fileio standalone for Win32 with less intervention.
FossilOrigin-Name:
af5dcc9c2a3a45d10b985f6b7ea18d39c75502ed10fa6496aad787dbe8c8c3fb
larrybr [Mon, 20 Sep 2021 20:15:28 +0000 (20:15 +0000)]
Allow fileio extension to be a stand-alone DLL for Win32
FossilOrigin-Name:
d1cc3105b2baceb9f426fd6bc8d8317de3af09a0f02517715bd292c68e282fa1
larrybr [Sun, 19 Sep 2021 18:31:55 +0000 (18:31 +0000)]
Adjust shell tests for *Nix and Windows test platform anomaly
FossilOrigin-Name:
577544c5a2f193e00e5ca55b7feae96568198019573b9b0b37e2bf4300d6d524
larrybr [Sat, 18 Sep 2021 21:35:22 +0000 (21:35 +0000)]
Sync w/trunk, further streamline shell's resumable prescan.
FossilOrigin-Name:
9e00f9f7c03c192a3fb6b22851db0626515c59daac5ce6520229c42c838bf5b7
dan [Sat, 18 Sep 2021 16:15:54 +0000 (16:15 +0000)]
Further tests for legacy rtree geom callbacks.
FossilOrigin-Name:
99d6bb22e8735681443bfe67287aa15ce2c57d0d63e304abf8aa01fde50dd021
larrybr [Fri, 17 Sep 2021 21:12:47 +0000 (21:12 +0000)]
Shell's .read pipe now works for Windows too.
FossilOrigin-Name:
929bcc4098549692c573779d65c4c28027b0a2f48ebbf5b3f038deee24374b67
dan [Fri, 17 Sep 2021 20:43:27 +0000 (20:43 +0000)]
Add tests for legacy geometry callbacks to rtreedoc2.test.
FossilOrigin-Name:
6ad00e52eda5bc4cb8e6fffbd7538bcd4c6b22f84b837a746eba6bf8c91eb55a
drh [Fri, 17 Sep 2021 13:07:15 +0000 (13:07 +0000)]
Make the affinity() function available even if compiled without
SQLITE_DEBUG. Surround the implementation of all test-only SQL functions
with #ifndef SQLITE_UNTESTABLE.
FossilOrigin-Name:
b7e00ef8059f6fb5658c6ad6f337cfdf065a5f1b1130452122282f3a69e98a93
drh [Thu, 16 Sep 2021 22:23:36 +0000 (22:23 +0000)]
The dbsqlfuzz fuzzer found a refutation for a recent ALWAYS() macro.
FossilOrigin-Name:
ebfc18aaa6506ccac80f297a1792e726972bb39c0b5c8706faadeb8df94a45e9
drh [Thu, 16 Sep 2021 20:16:39 +0000 (20:16 +0000)]
Minor changes to rtree.c so that we can get full branch coverage even when
it is compiled without geopoly.
FossilOrigin-Name:
f05ae9b5864459493154037d2c902d203c4a43007b5d61bd4beb1eed56e06d13
dan [Thu, 16 Sep 2021 19:50:54 +0000 (19:50 +0000)]
drh [Thu, 16 Sep 2021 17:02:59 +0000 (17:02 +0000)]
Add a single new ALWAYS() to rtree.c, with justification.
FossilOrigin-Name:
778e4499cdf2083d5431738099dedf0aade9271f661e09ca3278e0109bb1e720
drh [Thu, 16 Sep 2021 16:41:59 +0000 (16:41 +0000)]
Add a tag comment in rtree.c. No changes to code.
FossilOrigin-Name:
213410fa9cceb4ce34bf590ba65648ebeb94cc8d0c29a8881222208097162a95
dan [Thu, 16 Sep 2021 14:17:14 +0000 (14:17 +0000)]
Add a reference counter to a structure used internally by the Tcl interface so that it does not segfault if the database connection is closed from any of the various callback scripts that may be invoked.
FossilOrigin-Name:
e54a33ce56432b23947583d34cf12fc64a55bbc49eb77c7f33cff5926df51070
drh [Thu, 16 Sep 2021 14:07:09 +0000 (14:07 +0000)]
drh [Thu, 16 Sep 2021 13:52:28 +0000 (13:52 +0000)]
Back out a couple of ALWAYS() macros from [
4fab9089868bbb05 ]. Test case
added to TH3.
FossilOrigin-Name:
d26963a530ccbe36a174823d2f0bd7e06c6fca4f38ecdd04cd700c4000cc3719
drh [Thu, 16 Sep 2021 13:20:29 +0000 (13:20 +0000)]
For ALTER TABLE RENAME COLUMN, do not try to filter virtual tables out of
calls to sqlite_rename_column(). Let the function filter them itself.
The WHERE clause can mistakenly let virtual tables through if the
sqlite_schema table is corrupt. The sqlite_rename_column() function must
deal with them. We might as well let it deal with them always.
FossilOrigin-Name:
7c82b43b7cdb825f431d3a778f8b34e32666ccb3b067f1f2533d3b3dcca7bdc9
drh [Thu, 16 Sep 2021 12:33:53 +0000 (12:33 +0000)]
Under SQLITE_DEBUG with PRAGMA vdbe_trace=ON, show an output line if the
VDBE aborts for any reason.
FossilOrigin-Name:
7e3d6810039ca4563aa68dfa3671f570792a10f75c8eea68aa7dfd02d17702ca
drh [Thu, 16 Sep 2021 07:32:24 +0000 (07:32 +0000)]
Simplify the routine that attempts to estimate the size of an rtree index
by looking at the sqlite_stat1 entry for the %_rowid table.
FossilOrigin-Name:
06c329c17c2c2de8bc1ca7f3b0b929055675761a8be7a7e8b4a9fc5cca0d1679
drh [Thu, 16 Sep 2021 05:39:07 +0000 (05:39 +0000)]
Mark various unreachable branches in rtree.c with ALWAYS() or NEVER().
FossilOrigin-Name:
4fab9089868bbb05a192da09bc201f0a84c5b9bef39dcb063afc1d7658299fdd
drh [Thu, 16 Sep 2021 05:24:40 +0000 (05:24 +0000)]
New ALWAYS() and assert() to mark unreachable branches in rtree.c.
FossilOrigin-Name:
f7ad73c49507c9436adc7fe1b865f801eefcc7ea6b3ba35e83e63029beb03016
drh [Wed, 15 Sep 2021 19:53:22 +0000 (19:53 +0000)]
In rtree.c, remove an incorrect ALWAYS(). Add other ALWAYS() and NEVER().
FossilOrigin-Name:
cbaac8878aac0623beb5af3bc79a5b1c0179213206fd658b8c4fcc3531889480
drh [Wed, 15 Sep 2021 19:13:24 +0000 (19:13 +0000)]
Add more ALWAYS() macros on unreachable branches in rtree.c
FossilOrigin-Name:
fbba89dac9591c56da81bd0808910fbc64640f3ccfd95845ecab4d3aea46ca61
drh [Wed, 15 Sep 2021 16:20:15 +0000 (16:20 +0000)]
Fix the xBestIndex method on rtree so that it correctly recognizes that
rowid=? works the same as id=?.
FossilOrigin-Name:
c74c07cc86443057d34284ae31eb68470741592b0e61072fd5e120e82919169b
drh [Wed, 15 Sep 2021 15:56:00 +0000 (15:56 +0000)]
Add ALWAYS() macros on some unreachable branches in rtree.
FossilOrigin-Name:
9123f680ae3100f4c781ac4f5b8afac49bb5d4231b5931ad112b1b615f22f613
dan [Wed, 15 Sep 2021 15:53:01 +0000 (15:53 +0000)]
larrybr [Wed, 15 Sep 2021 14:48:02 +0000 (14:48 +0000)]
drh [Wed, 15 Sep 2021 13:09:55 +0000 (13:09 +0000)]
Simplify some of the corrupt shadow-table detection logic in rtree.
FossilOrigin-Name:
0c4f37aa475bd4bd17c20c02ab2d9f63d0a6a08b0e2bbfa559f7b972ece6f4fc
larrybr [Wed, 15 Sep 2021 11:15:03 +0000 (11:15 +0000)]
dan [Wed, 15 Sep 2021 10:49:31 +0000 (10:49 +0000)]
Ensure rtreedoc.test is not run for builds without the rtree extension.
FossilOrigin-Name:
42dff223470e9c096b8486ef232ac41b70d0875d8ae07630bfaaea1515ffa8d0
dan [Tue, 14 Sep 2021 20:07:58 +0000 (20:07 +0000)]
drh [Tue, 14 Sep 2021 18:57:30 +0000 (18:57 +0000)]
Update requirements marks to reflect recent documentation changes.
FossilOrigin-Name:
08cab8921e670a0d1758b505fe8c7455f6194cec69d1b7b77de91688be1028a6
dan [Tue, 14 Sep 2021 14:16:36 +0000 (14:16 +0000)]
dan [Tue, 14 Sep 2021 11:27:20 +0000 (11:27 +0000)]
larrybr [Mon, 13 Sep 2021 23:11:46 +0000 (23:11 +0000)]
Shell to .read any named character source file/device (again.)
FossilOrigin-Name:
c6fe4f8d639db25f0a339f4071f0ae34b90dcfec8dcc2c571f969e2614a38e05
dan [Mon, 13 Sep 2021 18:32:02 +0000 (18:32 +0000)]
drh [Mon, 13 Sep 2021 18:16:15 +0000 (18:16 +0000)]
dan [Mon, 13 Sep 2021 16:36:20 +0000 (16:36 +0000)]
drh [Mon, 13 Sep 2021 13:53:13 +0000 (13:53 +0000)]
Fix an incorrect comment and possible integer overflow in pager
resulting from check-in [
23ca23894af352ea ]. Problem reported by
[forum:/forumpost/
e2ea1a3f61 |forum post
e2ea1a3f61 ]. Also change
the datatype of Pager.pageSize to i64 even though page size never
exceeds 65536, in order to help prevent future problems of this kind.
FossilOrigin-Name:
f4a552ed9f4ab35520b634954c39748cc7bda535f426280b79da1b99f70599ac
larrybr [Sat, 11 Sep 2021 02:42:04 +0000 (02:42 +0000)]
CLI prescanner made to match SQLite's rules for delimited identifiers. Tests begun.
FossilOrigin-Name:
15b105c520968855ad960d8929f80af9e9bedc155237af9af1956f7b546947f2
larrybr [Fri, 10 Sep 2021 22:00:43 +0000 (22:00 +0000)]
larrybr [Fri, 10 Sep 2021 19:45:22 +0000 (19:45 +0000)]
Make CLI prescan handle goofy identifier delimiters too. Streamline code.
FossilOrigin-Name:
968aed690ba7240f8a256f5ba679cc971f432ff9af0ff99744824af79b952545
larrybr [Fri, 10 Sep 2021 18:35:59 +0000 (18:35 +0000)]
Fix (luckily harmless) typo in memdb.c per https://sqlite.org/forum/forumpost/
15af8872d5999df1
FossilOrigin-Name:
d577030cdad165474b082afbe64782e2eb3290331b0e3045b1e85ee6fe011504
larrybr [Fri, 10 Sep 2021 01:45:20 +0000 (01:45 +0000)]
When showHeader set at CLI invocation, do not auto-set it later.
FossilOrigin-Name:
733b7d4f95a4e2f0df323974f323c40c2486b188d442e74306a4b580fd8a8bd8
drh [Fri, 10 Sep 2021 01:02:42 +0000 (01:02 +0000)]
Back out changes [
00286ca5d998d802 ] and [
6844ede29e1dac93 ] (replacing the
associated branches with NEVER()) and add a single new test to
btreeOverwriteCell() that detects when an overflow pages is also mapped
into a b-tree page and raises and immediate SQLITE_CORRUPT error before
making any changes.
dbsqlfuzz
81791bd980fe6935ff2c7334ec8bef11c1c12b82 and others.
FossilOrigin-Name:
32210fa4ac4f06e1705ef808731c7be040a23f9a8630986440100c5d4e76dc07
larrybr [Fri, 10 Sep 2021 00:58:46 +0000 (00:58 +0000)]
Speed-up CLI's processing for huge block comments, for any content
FossilOrigin-Name:
c4568f9f458bad16bd4481f1f6f5e7b6f39f5ccf23f2b05890078577ce2ab9a2
drh [Thu, 9 Sep 2021 19:19:02 +0000 (19:19 +0000)]
drh [Thu, 9 Sep 2021 18:06:07 +0000 (18:06 +0000)]
Avoid masking off an OOM fault in rtreecheck().
FossilOrigin-Name:
3ebfe7128a20b270de65ebf4620f62e34ea6cc46b472cc52aed96af504eb9637
drh [Thu, 9 Sep 2021 14:03:55 +0000 (14:03 +0000)]
Improved database corruption detection in the editPage() subroutine
of the btree rebalancer.
dbsqlfuzz
f035b1b5a100a5f0cffb95c958b6c67d7c5eaf1f .
FossilOrigin-Name:
00286ca5d998d80214d5e8d501a3b305f432cda1c0ef67ca530e1219565909b7
larrybr [Wed, 8 Sep 2021 21:49:03 +0000 (21:49 +0000)]
Speedup CLI's gulping of many huge block SQL comments.
FossilOrigin-Name:
729620c5c0c642243be2fdda98f18d04efaf78ce365092e655cf60c9fee0874f
drh [Wed, 8 Sep 2021 19:25:21 +0000 (19:25 +0000)]
Fix PRAGMA integrity_check so that it does not try to enforce types on
ANY columns in a STRICT table.
FossilOrigin-Name:
57384fda8db43964871be5e48ae1c72c67533046b523f161d60a41fdc8e96b9e
larrybr [Tue, 7 Sep 2021 20:58:49 +0000 (20:58 +0000)]
For sqldiff, sqlite_schema comparisons must use compound (synthesized) PK.
FossilOrigin-Name:
5bdd8466129b8e477c8349847f19f2a5adea3f650cca6dbafa3b835e5a538d09
drh [Tue, 7 Sep 2021 19:23:32 +0000 (19:23 +0000)]
New test cases added to fuzzdata8.db. No code changes.
FossilOrigin-Name:
51e5aadafe1a4ba6a0be7fc1732d1ec940cbc5e23723b76267c2abf887d713ac
larrybr [Tue, 7 Sep 2021 19:04:42 +0000 (19:04 +0000)]
Make sqldiff able to compare sqlite_schema tables (for detailed schema differences.)
FossilOrigin-Name:
7ff92da9f183bc24a0d93996df771df7a712df1122ad897cb9143cde7d57ef7d
dan [Tue, 7 Sep 2021 16:05:48 +0000 (16:05 +0000)]
Fix a memory leak in fts5 that could occur when writing to an fts5 table that is being scanned by an fts5vocab cursor.
FossilOrigin-Name:
1183552de10b64a776874a23be8962c0693e5e0cd1a191ea8fa5d6a02b691e4a
drh [Tue, 7 Sep 2021 15:41:25 +0000 (15:41 +0000)]
Fix a potential NULL pointer deference in the LIKE optimization. The
problem was introduced by the addition of generated columns
in check-in [
b855acf1831943b3 ] (SQLite version 3.31.0, 2020-01-22).
Reported by Wang Ke in
[forum/forumpost/
699b44b3ee |forum post
699b44b3ee ].
FossilOrigin-Name:
b9417d400f4585004f434837022709f818044d5844fe208fe01595a6b226ef7d
dan [Mon, 6 Sep 2021 16:15:23 +0000 (16:15 +0000)]
Fix a use-after-free error that could occur if an fts5 table is written while scanning it using an fts5vocab cursor.
FossilOrigin-Name:
e751c2ec786b5c1a1c9640fdc3fde036879a2c32db2bd67fe7c72604780f67b8
drh [Mon, 6 Sep 2021 15:59:32 +0000 (15:59 +0000)]
Fix an issue in the "shrink.test" test script reported by
[forum:/forumpost/
90a74bd61861f58f |forum post
90a74bd618 ].
FossilOrigin-Name:
6c3734edb2ecabd85a715c853ef58da39381af26d3dd32e53c068b4fcf6fb98f
drh [Mon, 6 Sep 2021 11:44:19 +0000 (11:44 +0000)]
Restore the use of system isnan() that was removed by
check-in [
ea748edecb261f2b ]. See
[forum:/forumpost/
d7c530ac587f59e6 |forum thread
d7c530ac587f59e6 ].
FossilOrigin-Name:
b3cfe23bec0b95ca673802526704200e2396df715fdded72aa71addd7f47e0e1
drh [Fri, 3 Sep 2021 18:11:12 +0000 (18:11 +0000)]
Fix an assertion fault in pcache introduced by [
4bc93658aa563f2f ] and
detected by OSSFuzz. Test case in TH3.
FossilOrigin-Name:
2262a49467fa56c386080dac3e99a66e16c1700e138dba74db66e7b93ae76bf5
dan [Tue, 31 Aug 2021 15:53:58 +0000 (15:53 +0000)]
Have the planner ensure that if one scan uses a subset of the WHERE clause of another, that scan is estimated to cost less and return fewer rows.
FossilOrigin-Name:
c7b34930e27597e7f634ad76be55fc436dcb84ea48d5b41b5d7f3596285dd672
dan [Mon, 30 Aug 2021 17:02:48 +0000 (17:02 +0000)]
Do not disable a rowid=? term used to drive an IPK index if it is a transitive constraint.
FossilOrigin-Name:
46e28cbcf6044b36aa4ddcda09adb49a46c6c6a8d41d558467ede3091304aa8c
drh [Fri, 27 Aug 2021 11:26:37 +0000 (11:26 +0000)]
Patch lemon to fix "error" token handling, according ot
[forum:/forumpost/
e680f42f53090061 |forum post
e680f42f53090061 ].
FossilOrigin-Name:
106b5e5355a3836a9756333e6dcbb13f0878a5352dab00973b8f0900879bd724
drh [Thu, 26 Aug 2021 18:31:39 +0000 (18:31 +0000)]
Add the --safe to the CLI. Also the --nonce option and the .nonce command.
FossilOrigin-Name:
c76870cb1a8e2e1389ad864c51b9f596dff21df8bb58f438f0a2cacfa63b22a4
drh [Tue, 24 Aug 2021 17:07:44 +0000 (17:07 +0000)]
Correctly preserve the collating sequence for a column when changing
its datatype. Fix for the problem reported by
[forum:/forumpost/
e5c76b738e |forum post
e5c76b738e ]. Test cases
in TH3.
FossilOrigin-Name:
c7f0813cabf9d8ab367bead5ba8cf20132b8bb9274d8e47b76ad66a10517dd2a
drh [Mon, 23 Aug 2021 15:56:01 +0000 (15:56 +0000)]
Fix a typo in a comment. No changes to code.
FossilOrigin-Name:
d953646a63bf96a8e6e57fefaa60ae1487e5e4eb776fb38cd9c4ce002e74d016
drh [Mon, 23 Aug 2021 10:28:02 +0000 (10:28 +0000)]
Back out the change that allows typeless columns in strict tables. Replace
that capability with an ANY type for strict tables that will accept any
datatype with BLOB affinity.
FossilOrigin-Name:
d8fd1a2bfd51848ea612142d23475b268b3f5269e558f2e09713d1ac18b18274
drh [Sat, 21 Aug 2021 20:54:19 +0000 (20:54 +0000)]
Allow typeless columns in STRICT tables that are able to accept any
data type.
FossilOrigin-Name:
1e2dcc2d4ee88c0aed40d1472b1c7d43fd43822891729ad6a2c55d5b912e7ad7
drh [Sat, 21 Aug 2021 16:42:58 +0000 (16:42 +0000)]
Defer deleting subqueries in the compound-SELECT code generator until the
end of code generation, in order to avoid deleting expressions out from under
the aggregation function sanity checking assert()s that occur near the
end of SELECT code generation. This fixes the assertion fault described by
[forum:/forumpost/
cfcb4b461d |forum post
cfcb4b461d ].
FossilOrigin-Name:
600f1991e5c0a5d89cd8776a157b6fd72c7489791085876925e8dd7ab146fe1f
drh [Fri, 20 Aug 2021 19:51:22 +0000 (19:51 +0000)]
Improvement to error handling in Lemon. No impact on SQLite.
[forum:/forumpost/
2f468f43cbc48d7f |Forum post
2f468f43cbc48d7f ]
FossilOrigin-Name:
18cc2f85744a18b6810d30baebe07a7a1bd332348e13b1a50d779edc616fb0c1
drh [Fri, 20 Aug 2021 15:44:48 +0000 (15:44 +0000)]
Support for STRICT tables. A table with the STRICT option only allows a few
core datatypes on columns and enforces those types rigidly. Also, PRIMARY KEY
columns must be NOT NULL.
FossilOrigin-Name:
f9c1d3441b87ee296542faa724410d16a348143cba24fe74292eefc48e038a55
drh [Fri, 20 Aug 2021 08:05:42 +0000 (08:05 +0000)]
Improved error messages for the SQLITE_CONSTRAINT_DATATYPE error.
FossilOrigin-Name:
39abca01479c0f4f747b7b21fa05181896b00ed7559f0ab74aa575c23097ac21
drh [Fri, 20 Aug 2021 01:12:39 +0000 (01:12 +0000)]
Do not allow the xfer-optimization to move the content of an ordinary
table into a strict table.
FossilOrigin-Name:
1ed1b594d3c03ced68eb2b1285dfd8b9641cda20db1b1b7ae1afee217a3a9fe2
drh [Thu, 19 Aug 2021 16:29:33 +0000 (16:29 +0000)]
Improved comments. Fewer opcodes for integrity_check on strict tables.
FossilOrigin-Name:
4ee57fb588b41ab76649c605f57c7bcf5b7b638435af458d69f69a8ccbb121e8
drh [Thu, 19 Aug 2021 02:58:15 +0000 (02:58 +0000)]
Enhance PRAGMA integrity_check so that it verifies the datatype of
all columns in STRICT tables.
FossilOrigin-Name:
97c9248b3b81facce569bfa3fb405d44a1d1041e87132e8f649458c95620ccb2
drh [Thu, 19 Aug 2021 00:24:43 +0000 (00:24 +0000)]
STRICT tables require all fields of the PRIMARY KEY to be NOT NULL.
FossilOrigin-Name:
5efdf9acad9d54783f5134b7e9338f44336862d87dc324d315b8d55e44df1923
drh [Wed, 18 Aug 2021 23:00:43 +0000 (23:00 +0000)]
Merge the WITHOUT ROWID, NOT NULL ON CONFLICT bug fix into the strict-tables
branch.
FossilOrigin-Name:
7ee01ee47da247a80bcf16f88eb187b8c0928024536435ed20797a1a90495511
drh [Wed, 18 Aug 2021 22:26:51 +0000 (22:26 +0000)]
Fix ON CONFLICT clause processing for NOT NULL constraints of PRIMARY KEY
columns on WITHOUT ROWID tables.
Ticket [
f2be158c57aaa8c6 ]
FossilOrigin-Name:
13abba0941a724eb62455650976b03678e4455b6b3090c84a2ab2f4a7656b4d8
drh [Wed, 18 Aug 2021 19:22:27 +0000 (19:22 +0000)]
Trying to insert an incorrect datatype into a STRICT table raises an
SQLITE_CONSTRAINT_DATATYPE error. Seems to work, though lots more testing
is needed.
FossilOrigin-Name:
a19305e5cfedf5c472200d6e05c1396443e348f052a40a0979f860f2ff06851d
drh [Wed, 18 Aug 2021 13:13:58 +0000 (13:13 +0000)]
What would it be like if you could add the keyword "STRICT" after a CREATE
TABLE statement to cause the table to (1) allow only a few well-defined
datatypes, (2) rigidly enforce those types, (3) require NOT NULL on PK
columns, (4) always enforce foreign key constraint, and so forth? This
branch seeks to explore that question.
FossilOrigin-Name:
78732b9f98936693ae29c85a692c35a84c7d065aec79903af34b08d18f10a5e6
drh [Wed, 18 Aug 2021 12:05:22 +0000 (12:05 +0000)]
Rename the Column.eType field to Column.eCType - with an extra "C".
FossilOrigin-Name:
b9b0dcd5af072c22f2ce71cf9584b5b572fbcfbce6410a7d703b586adb8938ba
drh [Tue, 17 Aug 2021 19:59:09 +0000 (19:59 +0000)]
Fix an off-by-one error in the error-handling logic of the Lemon
parser-generator. This does not affect SQLite.
[forum:/forumpost/
cff80737bf |Forum
cff80737bf ].
FossilOrigin-Name:
7cca80808cef192fe0479477056a028e230a164fd368e72100def065d424ca2c
dan [Thu, 12 Aug 2021 14:22:30 +0000 (14:22 +0000)]
By default, do not use memory mapping to access the temporary files used for external sorts. The old behaviour (to use memory mapping by default) may be restored by building with SQLITE_ENABLE_SORTER_MMAP defined.
FossilOrigin-Name:
306694dfb462f9d1f128461e7a8f15a0bb9b21fbc696caa1832f4b20749490d1