drh
cce70d52d0
Avoid having to reinitialize Vdbe.pResultRow upon each call to sqlite3_step()
...
for a small size reduction and performance increase.
FossilOrigin-Name: 6a00d67f5955ab86eea982c27b3a03b680fdf644ec63f49586ade6342a4d64a6
2022-12-22 19:12:48 +00:00
drh
edc2713fdc
Rename the Vdbe.pResultSet field to pResultRow in order to better distinguish
...
it from other variables with similar names.
FossilOrigin-Name: 1fd6211ef7bd26ed625177bfedfd5153ace547de6a71365ecfa076578d043f1a
2022-12-22 18:44:39 +00:00
drh
c2d853e562
Small performance optimization associated with shared cache in the
...
byte-code engine.
FossilOrigin-Name: 3181331c1c0259d5cd274dcb33faba930dae51b1f0fe51e8a0318d9c564b94f9
2022-12-22 18:35:21 +00:00
drh
57366d8cec
Small performance optimization on the OP_Insert opcode.
...
FossilOrigin-Name: 781fdcb9ce85aa2844ef8c00cf908f1a87eeff80dadaf73a71f88b4279260e57
2022-12-22 17:36:02 +00:00
drh
1c70429569
Add NEVER/ALWAYS to branches that have become unreachable due to recent
...
enhancements.
FossilOrigin-Name: b4281db4e4762773684d27b809ef911da08b81cb953b3666e535b990d4d5f701
2022-12-17 12:49:04 +00:00
drh
00d6b2755f
Create a new affinity called FLEXNUM that works like NUMERIC except that it
...
never tries to convert integer to real or real to integer. The affinity is
only used internally - it is not possible to create a table column with this
affinity. This affinity is used on subqueries and views that are built off
of a compound SELECT and where the datatype is controlled by a CAST expression.
dbsqlfuzz c9ee6f9a0a8b8fefb02cf69de2a8b67ca39525c8
FossilOrigin-Name: 44135d6ea84f7ba6b36549954b38a8bc048d5ffea5a9779e35950afa4eb2dfb2
2022-12-15 20:03:08 +00:00
drh
a8b5c8739c
Back out the part of the change in [88a05141c28e5ff1] that adds affinity to
...
the materialization of a view, as the affinity can be undefined for a compound
query. This passes all TCL tests, but shows failures in the TH3 tests derived
from [forum:/forumpost/6f842bc5b2dadcb2|forum post 6f842bc5b2dadcb2], presumably
because the WHERE clause of the query uses constraints of the form
"source_crs_code='8675'" instead of "source_crs_code=8675". Perhaps further
changes on this branch should reimplement affinity on joins in cases where
the affinity is unambiguous.
FossilOrigin-Name: fe5a77bcc4de8f49cc4fe6bd2e2e1f31da8d3bc84120daaa99eb853b06291d15
2022-12-14 09:06:45 +00:00
dan
7f4b066eb2
Reduce the overhead of SQLITE_ENABLE_STMT_SCANSTATUS some.
...
FossilOrigin-Name: 212927e97e7be7d237de08359dce0dfb9211ac406b32009a6e15afd79c006475
2022-12-07 20:09:54 +00:00
dan
2adb309ead
Have sqlite3_stmt_scanstatus_v2() return an NCYCLE value for all loops, not just virtual tables ones. The value returned is the sum of the NCYCLE counts for the various opcodes that move or read data from the table or index cursor associated with the loop.
...
FossilOrigin-Name: 9499b2f51e8174c6b8a67840c92ba23b7dd1dc8dc2b91fca0c5dc07b71662149
2022-12-06 18:48:06 +00:00
dan
a3d0c158a0
Add loops and rows counters to "USE TEMP B-TREE FOR ORDER BY" records. Also fix the sqliteHwtime() function so that it returns a 64-bit value.
...
FossilOrigin-Name: 41a0e05e8c0fca3b803fe4bd017a157c172b2ca518356a2a4d4ed4f12d01a1e3
2022-12-05 18:19:56 +00:00
dan
231ff4b027
Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of easier to read query performance reports.
...
FossilOrigin-Name: 55800833645739efeddcacef464c623931cb6aeb43f4219b4e4faf473c25c8bb
2022-12-02 20:32:22 +00:00
drh
7741f3457a
Change the handling of hwtime.h to make it easier to compile performance
...
measurement builds that make use of hwtime.h. This should not affect
productions builds.
FossilOrigin-Name: f64a224244743ab121371abd516fccbfc93c110e0952211764bd1b217e792c1b
2022-11-29 17:52:04 +00:00
drh
ecba10730d
New assert()s confirm that BTREE_PREFORMAT must be the same value as
...
OPFLAG_PREFORMAT.
FossilOrigin-Name: f40bf2c642643ae61d331e8d4815f601224fa258ab34344c6756966163a89f4a
2022-11-19 20:10:55 +00:00
drh
921acff927
Optimize the IS NULL and IS NOT NULL operators so that they avoid loading
...
large strings or blobs off of disk if all it needs to know is whether or
not the string or blob is NULL.
FossilOrigin-Name: cb94350185f555c333b628ee846c47bcc9df5f76bb82de569b8322f30dbbe1bc
2022-10-13 15:09:44 +00:00
drh
eddfa9840e
Improvements to the description of the OPFLAG_TYPEOFARG option to OP_Column.
...
FossilOrigin-Name: 5e9c67ba18b701aabbb0546acdfc532c9e8f0d27fb0a2c899415a5c47096c90b
2022-10-13 14:54:32 +00:00
drh
7ca4af6a9f
Fix a typo in the documentation of the OP_Column opcode.
...
[forum:/forumpost/a2b5bd6d43|Forum post a2b5bd6d43].
FossilOrigin-Name: 043e76e6166da5cf8e213cce46aaccb1f910e1fdbdb5556576eafb81b3bc5faa
2022-10-13 14:01:11 +00:00
drh
c2777abc2d
Enhance the OP_IsType opcode so that it is slightly smaller and faster and
...
so that it works correctly with invalid serial-type codes 10 and 11.
FossilOrigin-Name: 846f863e0d55eb7e78c8d355bbbcd73e1946d0ba566c2cb31683cde5f4353d1b
2022-10-11 13:57:55 +00:00
drh
c9ef12f62b
Code clean-up for the integrity_check enhancement.
...
FossilOrigin-Name: a140173102febe9ef8064ee9b95bee489db54caba149e577d69e4d75161bf390
2022-10-10 21:21:04 +00:00
drh
49d77ee642
An attempt to enhance PRAGMA integrity check so that it does data type
...
checking on non-STRICT tables. Specifically: (1) Columns with TEXT affinity
should not contain numeric values, and (2) columns with numeric affinity should
not contain text values that can be converted to numeric.
FossilOrigin-Name: 8b1e7f0524637728cebe81c7d3ff8ad8a5a55782eac6409b425dad538024f596
2022-10-10 18:25:05 +00:00
dan
73c586bcbf
Fix a problem causing the seek-scan optimization to skip over valid rows that could occur when it is used with expressions of the form (a IN (?,?..) AND b >= ?). dbsqlfuzz ab1db6dc0efb04cba1cd3431ee6da4894fdc4520.
...
FossilOrigin-Name: 63d9efe277759d4daa29794846b60c6f55491496618f423f61468df72d0a4633
2022-10-07 18:57:15 +00:00
drh
8a2254fa1f
Improved tracing output for showing all registers used by the
...
OP_SeekGE opcode. This applies to debugging builds only.
FossilOrigin-Name: 0aa6dee7f72279114a47cbb69fdbda0b916a2c365f7a147946869f167bd018b7
2022-10-07 15:55:35 +00:00
drh
8b9a3d1fc8
Modify the OP_IfNotOpen opcode so that the jump is taken if the cursor is open
...
but was previously set to a NULL row using OP_NullRow.
FossilOrigin-Name: 1292d68caa7086610ddda343f3852e63de8da1eb66536ee4716b6529f5a31bc6
2022-09-20 19:22:17 +00:00
dan
aa07b36dd5
Remove a NEVER() macro for a condition that is actually reachable following an OOM. dbsqlfuzz crash-6ef3cd3b18ccc5de86120950a0498641acd90a33.txt.
...
FossilOrigin-Name: b573e2cffa5fedc893ed30e76e47022b3617ac5583e1eb486afa810b2514c419
2022-08-25 13:32:55 +00:00
drh
35908b167f
Enhance assert() statements to enforce tighter bounds on the P5 operand of
...
the OP_Next and OP_Prev opcodes.
FossilOrigin-Name: 4e0a07fc6f96e6e7726506b7a5ee942461c1381501f253893fa94d76023b634f
2022-08-23 17:51:39 +00:00
drh
f0d12d87fa
Fix another harmless comment typo that causes a typo in the documentation.
...
FossilOrigin-Name: bb084adb53386d8e52ca1e818a8322d2ec641b73fd8568cee01cc74c0ee9f265
2022-08-10 18:40:43 +00:00
drh
26e817f69b
Avoid trying to cast an over-sized floating point value into an integer.
...
FossilOrigin-Name: 3518cd7cb1feeefc3963da72c2d258d81d8914f1e1f427da28a00b6228cf126c
2022-08-08 16:25:13 +00:00
drh
5e10d892d6
Remove an unreachable branch in the numericType() helper routine.
...
FossilOrigin-Name: a99cc008e46ab1a4fdbe2fa87202d026a10c57be55e3e9fedd935795ed6dc694
2022-08-08 13:04:08 +00:00
drh
a3a4da0922
Do not attempt to convert an oversized floating point value into an integer.
...
FossilOrigin-Name: 6c4fc8385ee22516e0b87fb647327ee7d1a564040ebe2a4d66fc999ef2908df2
2022-08-08 12:19:13 +00:00
drh
e24a6f58ae
Fix a typo on a comment used to generate bytecode documentation.
...
FossilOrigin-Name: 64348d0b665f61c3a89f51341f23ca87f939dd9e306dc58c2004e46ab04e696e
2022-08-04 14:02:35 +00:00
drh
3cf46ee508
Performance optimization to the math opcodes of the bytecode engine.
...
FossilOrigin-Name: 597347d9c39f6ed068ac942a8c9853b1b745fce1eb5e9dd30f6c1cb312b36f53
2022-08-03 19:53:54 +00:00
drh
54f1fc4f94
Put an ALWAYS() on an unreachable branch.
...
FossilOrigin-Name: 58caa50a410b7eb0e68658ea1e606d75ea85cdae04e864270c932246ba990b5e
2022-06-25 20:32:29 +00:00
drh
fe9833482f
Allow flattening of a subquery that is the right operand of a LEFT JOIN
...
in an aggregate query as long as there is no GROUP BY clause. (The GROUP BY
clause will interfere with the operation of the TK_IF_NULL_ROW expression
nodes.)
FossilOrigin-Name: 2cf373b10c9bc4cbc5fe63d0a6948011df7bbc2f40dc025c9349f875da782b88
2022-06-25 19:43:44 +00:00
drh
86bc5e41bb
Fix a harmless UBSAN warning associated with PRAGMA schema_version
...
found by OSSFuzz.
FossilOrigin-Name: e93fd170ce4ae91d572c46d03f68f55d00091d0188030517455017d90d212587
2022-06-24 12:56:48 +00:00
drh
d198183465
Add back the ability to flatten a LEFT JOIN subquery - previously removed
...
due to ticket [cad1ab4cb7b0fc344].
FossilOrigin-Name: f8fe936ad4f7678f9b26ba6fab41c5df9f4938634cdb3286b0f2dcd1357f919a
2022-06-23 15:15:03 +00:00
drh
2591cfb673
Additional enhancements to comments. No changes to code.
...
FossilOrigin-Name: d9a320448f5693d906adf437800675cd4773701db065f3ed238b933fb80f6681
2022-06-22 14:25:12 +00:00
drh
01156ec1c9
Fix the OP_Concat operator such that when concatenating a BLOB with an
...
odd number of bytes on a database that is UTF16, the size of the resulting
string is reduced to a multiple of two.
FossilOrigin-Name: 5eb2c23635320b76f5e1aea4d94375b847fe4b38cdb4e287fba188753f4773b1
2022-06-17 21:31:30 +00:00
drh
27a242c634
Fix the OP_NullRow opcode so that it works even if it applied to an
...
ephemeral cursor that has not yet been created.
FossilOrigin-Name: 0e925654c24774933c7738c68f704b229c68e18c8baa45f506b8d6f09164d0d8
2022-06-14 22:21:23 +00:00
drh
a27e350b6f
Fix a faulty assert() statement identified by
...
[forum:/forumpost/0b91a75039|forum post 0b91a75039].
FossilOrigin-Name: 1f132bb03a22479ceeca0fd14940e2a1b29ce54b7784d5b0133450056813d877
2022-06-10 10:10:31 +00:00
drh
e5dea28482
Prevent subtype values from slipping across a subquery boundry when the
...
subquery is implemented as a co-routine.
FossilOrigin-Name: 9e51a6c0fbfb1899b2b01888430125fba6d4da9bad9eeaa3ad41e29fca54bbe5
2022-06-09 17:17:14 +00:00
drh
8878f8a8d3
The subtype of a value should not propagate across a subquery boundary.
...
Proposed fix for the problem reported by
[forum:/forumpost/3d9caa45cbe38c78|forum post 3d9caa45cbe38c78].
Additional works is needed as not all cases are covered.
FossilOrigin-Name: 08af1fe27ebd0edf6e0f1ac477deea033e7f7c813f1016b75196836daf02d2e4
2022-06-09 16:19:01 +00:00
dan
0a841a2b85
Avoid zeroing the value returned by sqlite3_changes() when a DML statement is automatically reprepared in sqlite3_step().
...
FossilOrigin-Name: 09c8f9f1970cd5b369d98a2b38f0b04d44ed095cb0bda80f7968bb6be4e0263b
2022-06-08 18:20:36 +00:00
drh
207f626356
Add assert()s to show that jumps always land an an instruction that is between
...
1 and Vdbe.nOp-1. Had these assert()s been in place before, they would have
caused an assertion fault for the byte-code error reported by
[forum:/forumpost/2482b32700|forum post 2482b32700].
FossilOrigin-Name: 8f8a58feb7047d19522ca32efbe42fd9ddf49aaf9064f7373eb56a88982406a2
2022-05-03 12:11:16 +00:00
drh
6dab33bf40
Fix harmless compiler warnings.
...
FossilOrigin-Name: 29255664127a975e5b0d5767cd4e56d93ff2ea1994702cdfbdca1b700952502e
2022-04-21 19:25:51 +00:00
drh
088b615acd
Improved comment field in the bytecode generated for OP_Column and OP_Rowid.
...
FossilOrigin-Name: 009bbf8026106c5a74cced06cced48badb870a4b6e6a2f8104a544d2a8d79e45
2022-04-18 13:57:57 +00:00
drh
2bd9f44a18
Change OP_Return such that if P3 is 1, the Return is a no-op when the
...
P1 register contains a NULL.
FossilOrigin-Name: c90602328a4b26f06d76c5343d29ebb7a782186c86ea88f5965a41040cff5346
2022-04-17 20:30:52 +00:00
drh
d549a702b3
Check for interrupts and invoke the progress handler following a Gosub
...
opcode, to avoid and recover from infinite subroutine loops.
FossilOrigin-Name: 647211e044a5856ceb6bf3e7b78e650fe7d81f8b7bf34568b99b346405ba520c
2022-04-14 18:19:06 +00:00
drh
c504f677b6
Previous check-in accidentally inverted a test on an assert(). Fix that.
...
FossilOrigin-Name: 5ec4f806c569428851b6f0159451aa3ed66b3bc61a845fd7c543cffb694b882d
2022-04-14 14:19:23 +00:00
drh
eab6c125bd
Fix assert() statements associated with artifical null-value cursors
...
created by RIGHT JOIN.
FossilOrigin-Name: f5bce5f152259767497ae6826c558003822d976b3f35f4d74edee59a3490efb2
2022-04-14 12:59:25 +00:00
drh
95b1036e9a
Fix a harmless (false-positive) unused variable compiler warning on MSVC.
...
FossilOrigin-Name: 63b04c63de680261a0d3eaf27154a1e8e77e3e166c3f2dbaea985603991c74f7
2022-04-13 19:00:57 +00:00
drh
7c96039492
Fix an assert() in OP_Column so that it accounts for the new type of
...
pseudo-cursor that always returns NULL for any column.
FossilOrigin-Name: 371ddc97bef8e0d88ad965f00d27e010880174312ea36c4f1165dcf08441f40a
2022-04-13 18:20:23 +00:00