larrybr
8d463ce135
CLI prescanner made to match SQLite's rules for delimited identifiers. Tests begun.
...
FossilOrigin-Name: 15b105c520968855ad960d8929f80af9e9bedc155237af9af1956f7b546947f2
2021-09-11 02:42:04 +00:00
dan
9023444fea
If an EXCEPTION_IN_PAGE_ERROR exception is caught, make the underlying OS error code available via sqlite3_system_errno().
...
FossilOrigin-Name: fdb20e9ee48465b94aa6ac3c5e263ecaa7c3b10f4a193e79f965b7c35944b08b
2021-09-10 21:28:56 +00:00
larrybr
a96bbe9af6
Make CLI prescan handle goofy identifier delimiters too. Streamline code.
...
FossilOrigin-Name: 968aed690ba7240f8a256f5ba679cc971f432ff9af0ff99744824af79b952545
2021-09-10 19:45:22 +00:00
larrybr
3a9793e40f
Fix (luckily harmless) typo in memdb.c per https://sqlite.org/forum/forumpost/15af8872d5999df1
...
FossilOrigin-Name: d577030cdad165474b082afbe64782e2eb3290331b0e3045b1e85ee6fe011504
2021-09-10 18:35:59 +00:00
larrybr
ae509121d0
When showHeader set at CLI invocation, do not auto-set it later.
...
FossilOrigin-Name: 733b7d4f95a4e2f0df323974f323c40c2486b188d442e74306a4b580fd8a8bd8
2021-09-10 01:45:20 +00:00
drh
7f58117921
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
2021-09-10 01:02:42 +00:00
larrybr
8bc4cbce6b
Speed-up CLI's processing for huge block comments, for any content
...
FossilOrigin-Name: c4568f9f458bad16bd4481f1f6f5e7b6f39f5ccf23f2b05890078577ce2ab9a2
2021-09-10 00:58:46 +00:00
drh
3acb3b7845
Remove a NEVER() in btree that is sometimes reachable.
...
dbsqlfuzz b9140023005430654c8fe544cf0a082ef8d561c1.
FossilOrigin-Name: 6844ede29e1dac93a392dfb1e7e676bb9d0a2e7bbec0a4a5804ffc2025a99b66
2021-09-09 19:19:02 +00:00
drh
30ad4a6932
Improved database corruption detection in the editPage() subroutine
...
of the btree rebalancer.
dbsqlfuzz f035b1b5a100a5f0cffb95c958b6c67d7c5eaf1f.
FossilOrigin-Name: 00286ca5d998d80214d5e8d501a3b305f432cda1c0ef67ca530e1219565909b7
2021-09-09 14:03:55 +00:00
larrybr
31bffb44fa
Speedup CLI's gulping of many huge block SQL comments.
...
FossilOrigin-Name: 729620c5c0c642243be2fdda98f18d04efaf78ce365092e655cf60c9fee0874f
2021-09-08 21:49:03 +00:00
drh
94b70d8343
Fix PRAGMA integrity_check so that it does not try to enforce types on
...
ANY columns in a STRICT table.
FossilOrigin-Name: 57384fda8db43964871be5e48ae1c72c67533046b523f161d60a41fdc8e96b9e
2021-09-08 19:25:21 +00:00
drh
eb61630b40
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
2021-09-07 15:41:25 +00:00
drh
e534c7b97f
Restore the use of system isnan() that was removed by
...
check-in [ea748edecb261f2b]. See
[forum:/forumpost/d7c530ac587f59e6|forum thread d7c530ac587f59e6].
FossilOrigin-Name: b3cfe23bec0b95ca673802526704200e2396df715fdded72aa71addd7f47e0e1
2021-09-06 11:44:19 +00:00
drh
e7e9539d99
Fix an assertion fault in pcache introduced by [4bc93658aa563f2f] and
...
detected by OSSFuzz. Test case in TH3.
FossilOrigin-Name: 2262a49467fa56c386080dac3e99a66e16c1700e138dba74db66e7b93ae76bf5
2021-09-03 18:11:12 +00:00
dan
748d8b9cdd
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
2021-08-31 15:53:58 +00:00
dan
beed24d57e
Do not disable a rowid=? term used to drive an IPK index if it is a transitive constraint.
...
FossilOrigin-Name: 46e28cbcf6044b36aa4ddcda09adb49a46c6c6a8d41d558467ede3091304aa8c
2021-08-30 17:02:48 +00:00
dan
ee7c667a36
Change the structuree exception handler in wal.c to catch EXCEPTION_IN_PAGE_ERROR instead of EXCEPTION_ACCESS_VIOLATION.
...
FossilOrigin-Name: 0c6ab539cfbc908550fa993a587e85d644b6335853ff9781caae860c461c045d
2021-08-26 21:12:07 +00:00
drh
b97e2ad10a
Add the --safe to the CLI. Also the --nonce option and the .nonce command.
...
FossilOrigin-Name: c76870cb1a8e2e1389ad864c51b9f596dff21df8bb58f438f0a2cacfa63b22a4
2021-08-26 18:31:39 +00:00
drh
5ced0a914e
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
2021-08-24 17:07:44 +00:00
drh
0ccda5294f
Fix a typo in a comment. No changes to code.
...
FossilOrigin-Name: d953646a63bf96a8e6e57fefaa60ae1487e5e4eb776fb38cd9c4ce002e74d016
2021-08-23 15:56:01 +00:00
drh
b9fd0101bd
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
2021-08-23 10:28:02 +00:00
drh
2a0eefd665
Allow typeless columns in STRICT tables that are able to accept any
...
data type.
FossilOrigin-Name: 1e2dcc2d4ee88c0aed40d1472b1c7d43fd43822891729ad6a2c55d5b912e7ad7
2021-08-21 20:54:19 +00:00
drh
ce68b6bfeb
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
2021-08-21 16:42:58 +00:00
drh
67ae593ffe
Use VVA_ONLY() instead of TESTONLY() in SEH macros so that the build
...
works for coverage testing.
FossilOrigin-Name: 9e9d5b566da72adf780685ea27da7d76a7274e904a533438255af92875c94503
2021-08-20 18:18:12 +00:00
dan
5b6c3c8f7d
Add missing SEH_INJECT_FAULT macros.
...
FossilOrigin-Name: 27e9bdb3a90a5826f45d32e0378e9afa90a16ac762a75236f38218f41bc45ded
2021-08-20 17:23:19 +00:00
dan
c6effdbfba
Add some assert() statements and fix small issues with code on this branch.
...
FossilOrigin-Name: bd9b373b177a71f5eaeb7ce8dd1dc755b34951ee1376c24652418bb329bfcb45
2021-08-20 16:19:19 +00:00
dan
b15c63cbb9
Fix a problem on this branch causing checkpoints that do not proceed because they can't get the CHECKPOINT lock to return incorrect output values.
...
FossilOrigin-Name: 5a98820c3d20766813bb4b0da23247ac90f380c07827ff13b61d5b606d8311aa
2021-08-20 11:50:12 +00:00
drh
faf9c77b4b
Improved error messages for the SQLITE_CONSTRAINT_DATATYPE error.
...
FossilOrigin-Name: 39abca01479c0f4f747b7b21fa05181896b00ed7559f0ab74aa575c23097ac21
2021-08-20 08:05:42 +00:00
drh
7b4b74acc7
Do not allow the xfer-optimization to move the content of an ordinary
...
table into a strict table.
FossilOrigin-Name: 1ed1b594d3c03ced68eb2b1285dfd8b9641cda20db1b1b7ae1afee217a3a9fe2
2021-08-20 01:12:39 +00:00
drh
aecd7f9d75
Enable this branch to run both with and without the -DSQLITE_USE_SEH option.
...
FossilOrigin-Name: 840e0a14ebc4a85d4ede0223287d4c1e4465e9f20c3c43bfc74775dddec1fa8f
2021-08-19 23:10:57 +00:00
dan
8aa22ffe98
If SQLITE_USE_SEH is defined, handle structured-exceptions thrown by MSVC builds if the *-shm file mapping is accessed after it becomes invalid for some reason.
...
FossilOrigin-Name: 5c5fa47076c5da25ca92248df3a4c11b90a0225a07f05d7220fa95d9bbb36f43
2021-08-19 21:01:15 +00:00
drh
71c770fbda
Improved comments. Fewer opcodes for integrity_check on strict tables.
...
FossilOrigin-Name: 4ee57fb588b41ab76649c605f57c7bcf5b7b638435af458d69f69a8ccbb121e8
2021-08-19 16:29:33 +00:00
drh
9e1209d111
Enhance PRAGMA integrity_check so that it verifies the datatype of
...
all columns in STRICT tables.
FossilOrigin-Name: 97c9248b3b81facce569bfa3fb405d44a1d1041e87132e8f649458c95620ccb2
2021-08-19 02:58:15 +00:00
drh
ab16578b72
STRICT tables require all fields of the PRIMARY KEY to be NOT NULL.
...
FossilOrigin-Name: 5efdf9acad9d54783f5134b7e9338f44336862d87dc324d315b8d55e44df1923
2021-08-19 00:24:43 +00:00
drh
3b7a0ccd5c
Merge the WITHOUT ROWID, NOT NULL ON CONFLICT bug fix into the strict-tables
...
branch.
FossilOrigin-Name: 7ee01ee47da247a80bcf16f88eb187b8c0928024536435ed20797a1a90495511
2021-08-18 23:00:43 +00:00
drh
fd46ec6476
Fix ON CONFLICT clause processing for NOT NULL constraints of PRIMARY KEY
...
columns on WITHOUT ROWID tables.
Ticket [f2be158c57aaa8c6]
FossilOrigin-Name: 13abba0941a724eb62455650976b03678e4455b6b3090c84a2ab2f4a7656b4d8
2021-08-18 22:26:51 +00:00
drh
72532f52bc
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
2021-08-18 19:22:27 +00:00
drh
44183f83d0
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
2021-08-18 13:13:58 +00:00
drh
b70f2eabb4
Rename the Column.eType field to Column.eCType - with an extra "C".
...
FossilOrigin-Name: b9b0dcd5af072c22f2ce71cf9584b5b572fbcfbce6410a7d703b586adb8938ba
2021-08-18 12:05:22 +00:00
dan
0546027cd7
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
2021-08-12 14:22:30 +00:00
drh
a76b151dab
During DELETE, if an index entry is missing, do not raise the
...
SQLITE_CORRUPT_INDEX error (added by [f339f31f9e9a856b]) if in
"PRAGMA writable_schema=ON" mode.
FossilOrigin-Name: 19e56291a7344c7aa69e2845f11cb865ee10a6b89a00bbe74b3babbeebe0357b
2021-08-11 18:43:54 +00:00
drh
df67ec08ff
Do not apply the push-down optimization to CTE subqueries that will be
...
reused in other contexts in where the same optimization is unlikely to
be valid. Fix for the bug reported by
[forum:/forumpost/d496c3d29bc93736|forum post d496c3d29bc93736].
FossilOrigin-Name: a7ce29a6ef2e0362bbc9b23719d936dce07209b2651153c774682f599bbd888e
2021-08-11 13:48:56 +00:00
drh
834c688171
Improved comment on the OP_OpenDup used to get a new cursor for a
...
reused materialized CTE.
FossilOrigin-Name: b1926cc0ab2b81c7df30c4baa6014efcfddb9631f6e46a55c1cec0113ee1afdc
2021-08-11 13:19:13 +00:00
drh
f9d349a80d
Fix a compiler warning in pcache1. Reduce the maximum size of a pcache1
...
cache to 2147418112 pages.
FossilOrigin-Name: 4bc93658aa563f2fa84f7f85f7f9f336dc80425640140c0fc2aec4a3606fad48
2021-08-09 19:54:27 +00:00
mistachkin
bdf15bbd62
Further improvements to the eOpenState bit values.
...
FossilOrigin-Name: d44f74f14a387960ce105913526b572f4a3d1935351c6aab10cee85946488a9e
2021-08-09 18:13:38 +00:00
drh
8a72882425
Ensure that the pcache1 cache size does not get so big that it overflows
...
the integer that is keeping track of the cache size.
FossilOrigin-Name: bf9d70fc2fde06a3f132270a26d4abe321687169066aff26ad9e92757c7f9ee4
2021-08-09 18:07:06 +00:00
drh
9d16fb1c09
Fix harmless compiler warnings and improve the presentation for the new
...
--threadsafe option to the CLI.
FossilOrigin-Name: 7929dc2f6f304b077c174d41711b49a24120adeb0b29cb6acb4d6a40852d7e00
2021-08-09 17:45:00 +00:00
drh
af6d1afd24
Undocumented "--threadsafe N" option added to the CLI for testing purposes.
...
One of SQLITE_CONFIG_SINGLETHREAD, _MULTITHREAD, or _SERIALIZED is called
depending on the value of the N integer.
FossilOrigin-Name: 2d8f297c115f378854c1f2198e47ac5af5f222a5de8cc7575c42154094e71b53
2021-08-09 17:37:58 +00:00
drh
c806917441
Improved Hamming bit-distance between the SQLITE_STATE constants.
...
FossilOrigin-Name: 5100b0456bc91f11e4a0bcf0d426ae4d8328cd9341ee2f9c83d0fa9f73047a83
2021-08-09 17:36:22 +00:00
drh
687d74dfcc
Fix comments associated with sqlite3.eOpenState. No logic changes.
...
FossilOrigin-Name: fd8f498f5d5f7fcb78dd8f6f9323d20b9e2904b249ec735477a0f03cb47b8561
2021-08-09 13:06:59 +00:00