23826 Commits

Author SHA1 Message Date
drh
c9373e86e8 An optimization to initMemArray() saves almost 500K cycles. But it seems a
little dodgy.  I want to think about this more before merging to trunk.
Perhaps there is a cleaner way to accomplish the same.

FossilOrigin-Name: 7fefd8676110a53e6c98a697e2dbf820740fe602a1e83b6caa8d099c41a15d80
2022-02-28 03:25:13 +00:00
drh
b3d981c3b7 Avoid unnecessary deinitialization of the Mem.flags field.
FossilOrigin-Name: bb520293d8c11518ba153b986662f081ebfd781d38eb624c509605fa9148f6e9
2022-02-28 02:35:48 +00:00
drh
f357cafaf5 Cache values of UnpackedRecord.aMem[0] into new fields of UnpackedRecord.
This avoids extra indirections and saves about 750K cycles.

FossilOrigin-Name: 7cf2d1f0396362aae7b93da75c2036d52ba86acba1cc90abca560bcf0314a22f
2022-02-27 21:10:49 +00:00
drh
a1e951fa48 Bypass a single branch in vdbeRecordCompareString() in the common case, for
a performance increase of over 600K CPU cycles.

FossilOrigin-Name: 36f0f07e505dfb38c61d3b4d5b947013c8793e6796fe690e53864479b9276abb
2022-02-27 18:54:33 +00:00
drh
a0318fd7b4 Remove an unnecessary local variable for a small performance increase and size
reduction.

FossilOrigin-Name: 9bda611f0d182a62ac1b68610313143c2e28868c16c7d4362a8f5945c27dd88e
2022-02-26 23:01:25 +00:00
drh
9090df6f73 Allow the OP_Column opcode to read rows that are larger than
SQLITE_LIMIT_LENGTH as long as the specific field being read out is
less than or equal to SQLITE_LIMIT_LENGTH.

FossilOrigin-Name: 1bf4848995ab094ad84ef4aa1563bce641d5acf7335fb4630c892b16cf7d7edd
2022-02-26 14:39:08 +00:00
drh
fc56950337 Revise the initialization processing for OP_Column to make it about
1.8 million cycles faster.

FossilOrigin-Name: 3b7259ebd5b9b1f75577521c4d0d96f5503d302a513b20a0b17dbe8c3823dd33
2022-02-25 20:11:59 +00:00
drh
a10be3da20 Fix the OP_NullRow documentation so that it accurately describes what it
actually does for a pseudo-cursor.

FossilOrigin-Name: 4e269902094e8f9d852e5fc852e473167048fdeb9034f1fb1436f6df205de926
2022-02-25 18:51:09 +00:00
drh
7fd6a7761f Improved comment on the codeDeferredSeek() routine. No code changes.
FossilOrigin-Name: 54f49f65ac943263a1622b1efe519c8a61f30f23694fd4fec89ad2bf0e17b473
2022-02-25 13:29:56 +00:00
drh
d1f0a86c12 Fix unimportant typos in comment text.
FossilOrigin-Name: 393460132994d6ca133e52af57374e43a2795a9e7fc7781bd9dea752a2b52c6a
2022-02-25 11:30:29 +00:00
drh
9606a13432 Invoking SQLITE_TESTCTRL_INTERNAL_FUNCTIONS causes the flags field of the
PRAGMA function_list to show all bits, including internal-use-only bits,
rather than just the bits that are part of the API.

FossilOrigin-Name: ad1be34828726bfef0dbc0ce16090400cf3530e7b5077849af96774d7428387b
2022-02-25 01:23:17 +00:00
drh
c45924ebc2 Remove unused P4 types on the Opcode object. Saves a few bytes of code
space and simplifies the code.

FossilOrigin-Name: aca538435939e6146f9a42e72e3a65030bbc5f646a0bbc7684e43688a0339888
2022-02-25 01:10:57 +00:00
drh
a7c9dd546b Change the OP_Next and OP_Prev opcodes so that they invoke
sqlite3BtreeNext() and sqlite3BtreePrevious() directly rather than through
a function pointer, for improved performance and a decrease in code size.

FossilOrigin-Name: 9d13cbbef3cf64f281d3e100f23f1b2ed6e8d65920c7517a84e1e4f964ceff2e
2022-02-24 14:44:23 +00:00
larrybr
b2d594a19b Spell fix, no code change
FossilOrigin-Name: f2597fae3c2b8f77f98a3ba9420b309f649b4008f9530d3cfaeeba1e2bf5d8a3
2022-02-24 11:09:08 +00:00
drh
cdc59c82ad Fix an assert() so that it is still valid following OOM with the latest
enhancements.

FossilOrigin-Name: ecf832f71fbaee36ee10f6da5bde19a8af9f90adbba06e8c5706d18b768bae1f
2022-02-24 01:41:14 +00:00
drh
fc4fe5a837 Update the version number of version 3.39.0 for the next development cycle.
FossilOrigin-Name: 9542e9bebbd25b20228fa2366b76d55845a40f12fdc4bbd077d1cb48e32b8cf2
2022-02-24 01:08:53 +00:00
drh
19ae01be13 Add a new subclass for MemPage.xCellSize specifically for the case of a leaf
page in a B+Tree, that is optimized for that cases.  This gains a half million
cycles or more at the cost of less than 200 bytes of code space.

FossilOrigin-Name: 7ad829224adbec5d74ff9e5ab040eb2ad3e17fe45da7a2cf0cca770a0731401a
2022-02-23 22:56:10 +00:00
drh
009a48e0ad Optimize calls to get2byte() in btree.c for almost a one-million cycle
performance gain and a few bytes less code.

FossilOrigin-Name: 41061f29969dc546c2702f7f412127070a4dd54593827692df93a83c939dfb61
2022-02-23 18:23:15 +00:00
drh
eac750e9a6 Defer the check for error check Pgno zero until after the page fetch misses,
to gain a few CPU cycles and a small size reduction.

FossilOrigin-Name: ece326db50201937eb688809df39edc7fb97413b4614d2e2e783418192f7b02a
2022-02-23 17:16:30 +00:00
drh
584bfcaeb6 Store the page number for the PENDING_BYTE page in the Pager object, rather
than computing the page number every time it is needed, because it turns out
that number is needed quite frequently.  This saves a few hundred thousand
CPU cycles and a few bytes of code space.

FossilOrigin-Name: 5aa9c3eb45514d5eb7b32696d25a9aeb7dad485e1ea5adb833fac6d1f2105f1a
2022-02-23 17:00:44 +00:00
drh
f2a777fa5d For the "PRAGMA database_list" statement, do not check to see if the schema
is up-to-date and do not try to reload the schema.

FossilOrigin-Name: 710de6a2137c872812effa43ea888aa77d339362ca0b6c8990d4426c8fb20689
2022-02-22 20:29:31 +00:00
drh
98095e3949 Version 3.38.0
FossilOrigin-Name: 40fa792d359f84c3b9e9d6623743e1a59826274e221df1bde8f47086968a1bab
version-3.38.0
2022-02-22 18:58:40 +00:00
drh
60f3657b4a Fix an undersized memory allocation in the test harness for RTREE. This
error was in test logic only, not in the SQLite library itself.
[forum:/forumpost/35470a0a72a005e1|forum post 35470a0a72a005e1]

FossilOrigin-Name: 7e3c9594390ac8defaf9825e14b4c19ef8c123b747971dd3d4df16110f443d3b
2022-02-22 15:47:55 +00:00
drh
16f56e8416 Fix compiler warnings for older compilers (ex: gcc 4.0.1 powerpc-apple-darwin).
FossilOrigin-Name: 5c188243d769681c68938c8e432155c8ec838d9e32fe8d1b12286ebc9d0e87f1
2022-02-21 14:30:59 +00:00
drh
a12500005f Remove stray tab characters from auxiliary source code files.
FossilOrigin-Name: e25e33582b69289a2c3a6bc403e3911de22a3b529db1a565efb9f1af01b9e382
2022-02-21 13:44:51 +00:00
drh
91260dcf83 Add SQLITE_OMIT_JSON to the compile-time option test sequence.
FossilOrigin-Name: f36325a6e21c4d3b6ab48ebfb2efabda089281344d1e61949d1c9290e88395b1
2022-02-21 13:02:23 +00:00
drh
d01a1bd94a Do not allow error messages from sqlite3NestedParse() to leak up into the
main parse.

FossilOrigin-Name: 9c4e21abdca664d6b7bcf0043fe9ec05ef8b2949ba6ee7208abaaec1ff4ed679
2022-02-21 00:23:49 +00:00
larrybr
a7919add6a Improve .backup and .save help text
FossilOrigin-Name: 741651fd4b1b776b4dea156cdc987f426f7c668ece203bda6654b2c7117c8933
2022-02-19 21:25:48 +00:00
drh
1ff855b22e Add a NEVER() to a branch that is unreachable for STAT4.
FossilOrigin-Name: e4e97505af4016c48465009686bfeffe9627e225a5b2082a5bf4baeee40db5c9
2022-02-19 15:57:28 +00:00
drh
b15a3940d1 Enhance the documentation on sqlite3_stmt_readonly() to explain that
EXPLAIN and EXPLAIN QUERY PLAN do not affect the return value.  Add test
cases to verify this.  Add new test cases and requirements marks for
complete requirements test coverage on this interface.

FossilOrigin-Name: a6fbb7ba0583b3981e2d8b809006b902b3e97e516dbd3ab7d905c5ea73df2272
2022-02-17 17:24:39 +00:00
drh
dedd51aed4 Remove references to the now-defunct SQLITE_ENABLE_JSON1 compile-time option.
FossilOrigin-Name: db950192c93db7f5eb4ffcce41d0ea374c58450405945cfb8ebe0c93070b7c48
2022-02-17 14:33:13 +00:00
drh
24ea5fb3e8 Fix a testing error on Windows that was recently added to shell5.test.
FossilOrigin-Name: 6cace54320997dcbbdd49017f20eecafa88ebcc4b264ee800954f25d9605023d
2022-02-17 14:29:39 +00:00
drh
be4e3c88f5 Make the sqlite3_error_offset() interface accessible from TCL using the
new "erroroffset" method on the sqlite3 object.

FossilOrigin-Name: 3454a1222bedefba527af98c0284ed0bfbd28dd941885d9a0ac9a44aea2fc8ec
2022-02-16 15:11:01 +00:00
drh
537a6bf189 Improved rendering of floating point numbers without a fractional part in
".dump" output from the CLI.
[forum:/forumpost/550d877659f37cb2|Forum post 550d877659f37cb2].

FossilOrigin-Name: 9edaeed56f2282fd4da935454178c38ab49d259aed96d4e720aae09050a53006
2022-02-15 13:23:09 +00:00
drh
0ca0988355 New assert() statements to help prove correctness of memjournal.c.
FossilOrigin-Name: d74ec88c2f9b9e056988add8322186750229e14a609d1a6969ba393a5b8c5174
2022-02-15 11:46:31 +00:00
drh
e63b7bdac8 Generalize the in-memory journal so that it is able to accept writes that
begin at any offset less than or equal to the current file size.

FossilOrigin-Name: c039d5476e0836c16d8c1ad99a2620f7fd04eb4b0e5dcb2246b42dde2ae1f95a
2022-02-14 21:11:17 +00:00
larrybr
7d5113f0a3 CLI .import can auto-rename non-unique column names when it creates a new table
FossilOrigin-Name: 4b5d07ea7e6f5d6f1279c88bc474ee4bc8bd2cebe38a268f211f47e44569e4b1
2022-02-14 18:55:19 +00:00
drh
9a4e88604c Minor correction to the early corruption detection added by
[a6fda39e81d0da98|check-in a6fda39e81d0da98] so that it works even if
the page being cleared in page 1 of the database.

FossilOrigin-Name: a5ec16907ef6ab50e041101d87c5756c71469923872a86c3ab383f188673d7a5
2022-02-14 18:18:56 +00:00
drh
0aa0945111 Fix a bad assert() (it needs an "||CORRUPT_DB" term) in b-tree, discovered
by dbsqlfuzz.

FossilOrigin-Name: f5f263cc626d6a8bea3e85e28bb716e3eac0d9cd199cc060c0c8b0c77b280a45
2022-02-14 13:53:49 +00:00
larrybr
3363386145 CLI's .import column rename made more minimal, and reports renames.
FossilOrigin-Name: c626cff7f99ec502ebd46f9cdafc3d088697544ef5d6559b6b3ae85679b4f9fa
2022-02-14 01:12:46 +00:00
larrybr
42de1c52dd Sync w/trunk, fix zAutoColumns placement blunder, all to pass all TCL tests
FossilOrigin-Name: 67dc59f46d742ad69742fb34540a3074af163a3f1a0f9093f83db2276bf944ca
2022-02-13 22:18:22 +00:00
dan
dfcb11de18 Do not run merge1.test with SQLITE_OMIT_VIRTUALTABLE builds.
FossilOrigin-Name: bf8dbfd499e732f14c7a8efee527e8ce155937dbb2a3e85213f8aa64ac497189
2022-02-12 18:56:24 +00:00
dan
02ede43da2 Fix a possible user-after-free in ALTER TABLE found by asan.
FossilOrigin-Name: 9252619d410293ddefd108f5cf81b6fb4932bd3f2ceaaa92abb7542e34f66111
2022-02-12 16:02:37 +00:00
dan
8443505dc9 Update fuzz.test to account for a change in error message made in the core.
FossilOrigin-Name: c57601b51f9b59e9d8f0eb06580fa14f49525e56bd0190c02865e478bd1f48e7
2022-02-12 13:45:02 +00:00
dan
af7b8dcb58 Avoid dropping SQLITE_TOOBIG errors in the quote() function.
FossilOrigin-Name: 115c3051a1ff7567e84f14fc4c49efe61bc2850248533449b0195c305ab6516e
2022-02-12 13:37:27 +00:00
larrybr
43a196a3bb For .import auto-column, aid build-time override of rename decoration.
FossilOrigin-Name: 433e5ead2b711d1e3b0b62cf8cb5a8a65e2474c68ef2173317ed4323fc8bdc58
2022-02-12 13:12:03 +00:00
larrybr
0a704c3145 Fix auto-column bug noted by post https://sqlite.org/forum/forumpost/d102c15d63
FossilOrigin-Name: 689137e1b5bc78b0f16e5db86d16415b9fa77d22ded59e93d75e7033b465e673
2022-02-12 10:48:42 +00:00
larrybr
78138397b5 Sync w/trunk, allow build-time override of auto-column decorating character
FossilOrigin-Name: caaef4c592c980889efb349fa73b61303ec493172d90cd67d54ffde0855e4138
2022-02-12 02:15:37 +00:00
drh
f17f607556 Fix a test in without_rowid1.test so that it is disabled without
ALTER TABLE support, as it uses ALTER TABLE.

FossilOrigin-Name: ca22a64e6f05a6688974f4cff1a0ff2c873aad1947f3cf6ffaeee8bb074b2627
2022-02-11 21:20:46 +00:00
dan
7b57aa3da9 Update some OOM tests of the ALTER TABLE command to account for an error message which may be returned if opening the temp db fails.
FossilOrigin-Name: 3409fd4150df059d7308f79fa3672a330af9cefe2ad9120c3da5ef1413921e96
2022-02-11 19:41:03 +00:00