1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-13 20:39:27 +03:00
Commit Graph

16333 Commits

Author SHA1 Message Date
drh
11fc3c0fa7 Reference the wayback machine for the dead hyperlink to the MS support
page in the comments about why the extra typedef for va_arg().  No code
changes.

FossilOrigin-Name: ab1a9b5b78de7c00b38357b1df08e82ce5608a14f8c675ac20c5f2dad5212f50
2022-02-11 17:47:25 +00:00
drh
4ba1c5cc49 Fix an assert() in the pager by adding "|| CORRUPT_DB", in as much as the
assert() is not necessarily true if the database size in the header is
wrong.  dbsqlfuzz f2f996065b90988aa9b0ae425b66dbb296546a08.

FossilOrigin-Name: a51402e8c29fad2b24e32de55b10691fb0ebd6c2cebac941e43e54be211d5d39
2022-02-11 17:33:02 +00:00
dan
63a47336af Fix a problem in [c006515ae6faff65] causing an assert() to fail with some build configurations.
FossilOrigin-Name: d7ff262d6d1fd8b855bcb8f6f54ab1833663a4d8187701ddf045f6b5a62a5d1d
2022-02-11 16:10:18 +00:00
drh
85548fac8d Use the enhanced SQLITE_TESTCTRL_LOCALTIME_FAULT (2) capability to do better
testing of the 'localtime' and 'utc' modifiers to date/time functions.

FossilOrigin-Name: f38071946ac2e5bb61e6c0620507e4c94464999ac700d86c1a704b94eb1c009a
2022-02-11 14:08:05 +00:00
drh
0d58ae010c Work around the MSVC bug that prevents the use of function pointer types in
the second argument of va_arg() by adding a typedef.

FossilOrigin-Name: eae3ab0a050079d050f339b2510eebd55afe4464e9b410ddacb7523f89981144
2022-02-11 11:37:12 +00:00
drh
b30af022da Fix SQLITE_TESTCTRL_LOCALTIME_FAULT so that it works even if mutexes are
enabled.

FossilOrigin-Name: 64537a0669553e8a6b610b9e9703ec084472516c86cfc22a7a6c73b6c66131ee
2022-02-10 23:12:58 +00:00
drh
d7e185ce5d Enhance SQLITE_TESTCTRL_LOCALTIME_FAULT so that is able to install an
alternative localtime() interface so that the localtime logic an be better
tested.

FossilOrigin-Name: 6e25cb0890e8cdc63c9a21e841844d066267fc32ad143527843f7c8d05612b53
2022-02-10 21:26:53 +00:00
drh
eadccaa926 Performance improve to the 'localtime' and 'utc' modifiers for date/time
functions.

FossilOrigin-Name: 85cb6014751a0572d28ebd839331d5d7a78de45c9e522adcd834a8a85746f32e
2022-02-10 15:40:40 +00:00
drh
522608d3a2 Faster implementation of the date(), time(), and datetime() functions.
FossilOrigin-Name: fa1b393bdb66b985f6552190a8242ed878f91d653a03352f65aa8d750de3cec4
2022-02-10 12:57:53 +00:00
drh
ddd3fe6fc4 Fix the test harness so that it builds without SQLITE_ENABLE_PREUPDATE_HOOK.
Has been broken since [c006515ae6faff65].

FossilOrigin-Name: 4565f711291bae5daaff6dd2b7b2991b17e139a576b1b73bb1f81f08a4c1a13f
2022-02-10 12:31:37 +00:00
drh
0d36368601 Fix a typo in documentation. No code changes.
FossilOrigin-Name: e97c6ad4c915c82c2f0b347a0cdc8f80942c345194675a88174047ce0d0a43ad
2022-02-10 01:01:31 +00:00
drh
e2adc0eea1 When process first moves a database into WAL mode and then tries to run
sqlite3_wal_checkpoint() without first performing a transaction, first
try to run a synthesized transaction to get the Pager caught up before
attemptingn the checkpoint.
[forum:/forumpost/fd0f19d229156939|forum post fd0f19d229156939].

FossilOrigin-Name: eee6de1967609f0b590ee4dbec088c3e7b03b08753267ed2909c5b03d60a0e18
2022-02-09 18:47:09 +00:00
dan
252fe67bdd Fix a problem with using sqlite3_bind_value() with sqlite3_value objects obtained from sqlite3_preupdate_new() when an integer value is written to a column with real affinity.
FossilOrigin-Name: c006515ae6faff6525d589827d99092b06004472e32b7f586845c00c4732d695
2022-02-09 18:42:15 +00:00
drh
9f4ce3b19f Writes to the subjournal should be all-or-nothing. Fix for
dbsqlfuzz fe3c397fb90029313446c4e0f4a6cd0c81dd9621.

FossilOrigin-Name: 22cc55e84f67f6f39b7dba07a4ef7ae958b2d926633faec91a278922053e50c6
2022-02-08 15:14:18 +00:00
drh
4e532958c1 Provide sqlite3_error_offset() data for some new errors.
FossilOrigin-Name: 1269206db810460e55a52e178ba3332add42a11f66c5f292f8f0d29ccd61a4b8
2022-02-08 13:41:23 +00:00
larrybr
07fc85a2bf comment-only change to sqlite3.h
FossilOrigin-Name: f815cf4a5f97778f177d373814700e8f2f6429dc467b68b799b5b349cc00b7a2
2022-02-08 12:24:43 +00:00
drh
633c798283 Do not show the error code number of CLI error messages unless the error
is something other than 1 (SQLITE_ERROR).

FossilOrigin-Name: b471601892df98c5103bb55132bbdecf3e4dfc428aaecc47bfec1e1d51e583c7
2022-02-08 12:13:16 +00:00
drh
3e46db21d4 Improved error message formatting in the shell. Distinguish between
"Parse errors" and "Runtime errors".

FossilOrigin-Name: ae3e322a029952f575e49c73fb50b46bbea55be6792cc225cb94f5e0cbd046d9
2022-02-08 11:52:45 +00:00
drh
e1c4743121 Disable the sqlite3_error_offset() when the error occurs in a trigger or
view or some other bit of text that is not part of the original statement.

FossilOrigin-Name: 0e909e34fa74e7b9b7954e4ed4c39dd293c1d413b58fda03607faab74aa382ad
2022-02-07 18:52:56 +00:00
larrybr
6e85b27cbb When create table/view fails due to name taken, say which took it.
FossilOrigin-Name: 9a206e37fb49a203a7b5fdc93c41acc39e9ceb37144c78432a235e2f0d54a210
2022-02-07 01:09:49 +00:00
drh
5d20a21814 Fix unreachable branches in the sqlite3_error_offset() logic.
FossilOrigin-Name: 031381aea371892a35737e550121846af41241711a36c1a2086af3b0c11bf7b6
2022-02-06 23:54:41 +00:00
drh
51896e6fd7 The sqlite3_vtab_in() interface should return false for a vector IN constraint.
FossilOrigin-Name: 245d0241c78870c6a41af3e02b82b13151472e2102fbd62989672f8122feca73
2022-02-06 22:13:35 +00:00
drh
89e9baa2ca With the new ALTER TABLE under PRAGMA writable_schema=ON processing, do not
ignore non-parser errors such as OOMs.

FossilOrigin-Name: 36653ccef68cf61b6001000a713b06e951cb6fddced6b6a906c3b17d70a8af87
2022-02-06 21:13:59 +00:00
drh
2ef111168f Faster computation of Expr.nHeight.
FossilOrigin-Name: a7a5af327ba8bafcd58b828e3e7a10d0008bb780d55a6c573aa15896dcc8ab89
2022-02-06 11:51:23 +00:00
drh
17a93ae1b8 Record the error offset on INTEGER tokens.
FossilOrigin-Name: 38e057a580613be176552e230e40b4434a9ed57a82d407e92a23c7b8e62c0b0e
2022-02-06 11:26:51 +00:00
drh
62fc069eb4 Further improvements to localization of errors in input SQL.
FossilOrigin-Name: fa34676042720161ca03f3926814152eb1d144ec12fd2b44e5429408ea4ad5b0
2022-02-06 00:30:04 +00:00
drh
4f77c9208a Enhance sqlite3_error_offset() to report the position of unresolved
identifiers.

FossilOrigin-Name: 5b8d2577907abda10de29884716bacc10bff0df1451228a0ac40342dbea6d589
2022-02-05 23:11:19 +00:00
drh
796588ae07 Record the position of many identifiers in the parse using the new
Expr.w.iOfst field.  This is done with the idea of providing offset
results for sqlite3_error_offset() for a more kinds of errors, though that
part is not yet implemented.

FossilOrigin-Name: 32a3a53b62ab09ac2212905e7f42fe6f1b09d891e015203e5caf4cb16262f18e
2022-02-05 21:49:47 +00:00
drh
dfce5b6dd5 When PRAGMA writable_schema=ON, allow ALTER TABLE to proceed even if there
are entries in the sqlite_schema table that do not parse.

FossilOrigin-Name: fc4c82e5694cbdae13f2cb90e5368ba9f6b826a220a81de32ead2ffe1bc5f31f
2022-02-05 12:39:17 +00:00
drh
569c10566e Fix a NULL pointer dereference that can occur after OOM. Problem
introduced by check-in [197cbabf1767d060].

FossilOrigin-Name: d4e6b9f0f7567b76760a667a701bca4d6158ade39f9a69d205b583c5a1c0c7f4
2022-02-05 12:05:43 +00:00
drh
6c758900c2 Fix documentation typo.
FossilOrigin-Name: 1a7d8bb5ea0d0e0c250312f89a701c0274cfbcaef9cd71995fb83bf939668504
2022-02-05 11:13:26 +00:00
drh
d515ea5b56 Typo fixes in documentation.
FossilOrigin-Name: 1ec747d1c34ced9877709dd306e674376e79145de08b9c316d12bc5e06efc03e
2022-02-05 01:01:07 +00:00
drh
10d29c7a94 One more case of disabling errors for ALTER TABLE RENAME when
writable_schema=ON.

FossilOrigin-Name: c52d0dd8f4f8fab4c3f33cbd26b4012569e76562282e85654018c836dca7b564
2022-02-04 20:07:24 +00:00
drh
5a80050dd3 Allow ALTER TABLE RENAME COLUMN to proceed even if there are errors in
the schema, as long as PRAGMA writable_schema=ON is active.

FossilOrigin-Name: 197cbabf1767d0603928462fb75cf8100f6999f725e0db60d096c7ca20e3da28
2022-02-04 16:43:30 +00:00
drh
69b0ce33fd Fix various harmless compiler warnings.
FossilOrigin-Name: 70049342d5ad57ea3e863bba19253934b868bacdd1c26c9371bac024a829badf
2022-02-04 13:15:01 +00:00
drh
02e3e04134 For the MULTI-INDEX-OR optimization, when pushing down WHERE clause terms from
the main query into the various OR-term subqueries, do not push down slices
of a vector comparison, since the right-hand operand of the comparison might
have only been initialized in a different OR branch that was not taken.
dbsqlfuzz 80a9fade844b4fb43564efc972bcb2c68270f5d1.

FossilOrigin-Name: 9f67ad00cd38b7c5ec6d14b379e1a611777bbdf6901d843a80712ba7d94d6d33
2022-02-04 13:05:29 +00:00
drh
7f1c111948 Minor typo fix in comment. No code changes.
FossilOrigin-Name: f9b763042c5c4446115c5375a8e4731e522e36ad9fc53e9ef775de9bc297ea19
2022-02-03 18:14:22 +00:00
drh
3832c3c10f Prohibit schema changes within xBestIndex callbacks.
FossilOrigin-Name: bb0f056b3f2ecc3893e5e48e99c060788550ea6a8ed02b715953af051bafbad0
2022-02-03 14:19:26 +00:00
drh
19eef9af64 Improvement to the sqlite3_vtab_in_first() documentation.
FossilOrigin-Name: 403e7ac900e53407282393747b784dc0cd4303958394534e3936fce138bc1bc5
2022-02-02 21:06:40 +00:00
drh
044a017abc Add the sqlite3_vtab_in() interface that allows virtual tables to process
IN constraints all at once, rather than one value at a time.

FossilOrigin-Name: 52559af093809b572082b5ebaacf97b727ee1860ae118530761b62e937545163
2022-02-02 19:51:44 +00:00
drh
d96ab99588 Test cases for sqlite3_vtab_in() and sqlite3_vtab_distinct().
FossilOrigin-Name: 21afb81d0a73af39aacd9329b1441faa2b535a52a52036daec89fd303a8b344f
2022-02-02 19:15:53 +00:00
drh
2725db836b Improved documentation for sqlite3_vtab_in(). No code changes.
FossilOrigin-Name: c99df4ab5db2c32b044366c5b0ac70fd8887d1456d53323e75fede23cc61c236
2022-02-02 18:47:56 +00:00
drh
3d7a69e5ef Relax the restriction that the RHS of the IN operator must be a list in order
for sqlite3_vtab_in() to work.  Change an unreachable branch into an assert().

FossilOrigin-Name: 3bf2153440dce0e8c0572c4fd39e6b9f34ead75ccab2cea80a646d4ff9d19146
2022-02-02 16:24:01 +00:00
drh
38d1e44350 Be sure that sqlite3_vtab_in_first() and _next() set the correct encoding.
FossilOrigin-Name: 04edf36ee8e043c83235a5169a7ced23f211edd2f7ef3290d96413d5fd229ad7
2022-02-02 15:10:45 +00:00
drh
30e314e4cb Refactor sqlite3_vtab_in() to make use of the existing
sqlite3_value_pointer() mechanism for passing the list of IN operator
RHS values into xFilter, for improved memory safety.

FossilOrigin-Name: 8965929be236fe1a6994f31b94c1b7590c7c1e809470c542a76f3e0e275d032f
2022-02-02 14:36:58 +00:00
drh
9ede896ac1 Fix a harmless code indentation issue.
FossilOrigin-Name: 41d8d26e48a440da44582763f6b0c097febe3b8ac16adb662f688c3662c301bf
2022-02-02 11:37:49 +00:00
drh
b30298d3ea Tweaks to the sqlite3_vtab_in() interface.
FossilOrigin-Name: 75040183b8e14f20bfedfdcc1a9fb968f2f0193bc698605d1b4791a3699b93d9
2022-02-01 21:59:43 +00:00
drh
a9f18f0172 Index in 2nd argument to sqlite3_vtab_in() should be on the aConstraint[]
array, not the internal array of all constraints.

FossilOrigin-Name: 5acf90a931b27b7d627c0a8fee68170430e09b028d6643b959b0ec14fd59f7ac
2022-02-01 16:30:57 +00:00
drh
0fe7e7d924 Add new interfaces to enable virtual table to process IN operator constraints
all at once, rather than one element at a time.

FossilOrigin-Name: eb84b80e1f6d8c32bf0c9e1731f0233de0160a13f714f766779ae01fdf504e7b
2022-02-01 14:58:29 +00:00
drh
e66532a63b CLI: Take extra care to not split a multi-byte unicode character when doing
wordwrap.

FossilOrigin-Name: 00b1b7020a564976da3237532434e47ccf17eb5d620e6ac45f3e70b5d5739200
2022-02-01 13:17:11 +00:00