Merge latest trunk changes into this branch.
FossilOrigin-Name: 72f7807b34eee1fcfd94f72d27535e5273ed1f7ff3d464179a774b7c7241f5f5
This commit is contained in:
+3
-3
@@ -541,7 +541,7 @@ struct fts5_api {
|
||||
int (*xCreateTokenizer)(
|
||||
fts5_api *pApi,
|
||||
const char *zName,
|
||||
void *pContext,
|
||||
void *pUserData,
|
||||
fts5_tokenizer *pTokenizer,
|
||||
void (*xDestroy)(void*)
|
||||
);
|
||||
@@ -550,7 +550,7 @@ struct fts5_api {
|
||||
int (*xFindTokenizer)(
|
||||
fts5_api *pApi,
|
||||
const char *zName,
|
||||
void **ppContext,
|
||||
void **ppUserData,
|
||||
fts5_tokenizer *pTokenizer
|
||||
);
|
||||
|
||||
@@ -558,7 +558,7 @@ struct fts5_api {
|
||||
int (*xCreateFunction)(
|
||||
fts5_api *pApi,
|
||||
const char *zName,
|
||||
void *pContext,
|
||||
void *pUserData,
|
||||
fts5_extension_function xFunction,
|
||||
void (*xDestroy)(void*)
|
||||
);
|
||||
|
||||
@@ -1689,7 +1689,7 @@ static int fts5UpdateMethod(
|
||||
** VIRTUAL TABLE statement contained "contentless_delete=1". */
|
||||
if( eType0==SQLITE_INTEGER
|
||||
&& pConfig->eContent==FTS5_CONTENT_NONE
|
||||
&& (nArg>1 || pConfig->bContentlessDelete==0)
|
||||
&& pConfig->bContentlessDelete==0
|
||||
){
|
||||
pTab->p.base.zErrMsg = sqlite3_mprintf(
|
||||
"cannot %s contentless fts5 table: %s",
|
||||
@@ -2544,6 +2544,12 @@ static int fts5ColumnMethod(
|
||||
sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pStmt, iCol+1));
|
||||
}
|
||||
pConfig->pzErrmsg = 0;
|
||||
}else if( pConfig->bContentlessDelete && sqlite3_vtab_nochange(pCtx) ){
|
||||
char *zErr = sqlite3_mprintf("cannot UPDATE a subset of "
|
||||
"columns on fts5 contentless-delete table: %s", pConfig->zName
|
||||
);
|
||||
sqlite3_result_error(pCtx, zErr, -1);
|
||||
sqlite3_free(zErr);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -188,11 +188,11 @@ do_execsql_test 5.2 {
|
||||
|
||||
do_catchsql_test 5.3 {
|
||||
UPDATE ft SET x='four six' WHERE rowid=3
|
||||
} {1 {cannot UPDATE contentless fts5 table: ft}}
|
||||
} {0 {}}
|
||||
|
||||
do_execsql_test 5.4 {
|
||||
SELECT rowid FROM ft('one');
|
||||
} {1 3 4 5}
|
||||
} {1 4 5}
|
||||
|
||||
do_execsql_test 5.5 {
|
||||
REPLACE INTO ft(rowid, x) VALUES(3, 'four six');
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# 2023 August 7
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# This file contains tests for the content= and content_rowid= options.
|
||||
#
|
||||
|
||||
source [file join [file dirname [info script]] fts5_common.tcl]
|
||||
set testprefix fts5contentless5
|
||||
|
||||
# If SQLITE_ENABLE_FTS5 is defined, omit this file.
|
||||
ifcapable !fts5 {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
CREATE VIRTUAL TABLE t1 USING fts5(a, b, c, content='', contentless_delete=1);
|
||||
INSERT INTO t1 VALUES('A', 'B', 'C');
|
||||
INSERT INTO t1 VALUES('D', 'E', 'F');
|
||||
INSERT INTO t1 VALUES('G', 'H', 'I');
|
||||
}
|
||||
|
||||
do_execsql_test 1.01 {
|
||||
CREATE TABLE t2(x, y);
|
||||
INSERT INTO t2 VALUES('x', 'y');
|
||||
}
|
||||
|
||||
# explain_i "UPDATE t1 SET a='a' WHERE t1.rowid=1"
|
||||
breakpoint
|
||||
explain_i "UPDATE t1 SET a='a' FROM t2 WHERE t1.rowid=1 AND b IS NULL"
|
||||
|
||||
#breakpoint
|
||||
#explain_i "UPDATE t1 SET a='a' WHERE b IS NULL AND rowid=?"
|
||||
|
||||
foreach {tn up err} {
|
||||
1 "UPDATE t1 SET a='a', b='b', c='c' WHERE rowid=1" 0
|
||||
2 "UPDATE t1 SET a='a', b='b' WHERE rowid=1" 1
|
||||
3 "UPDATE t1 SET b='b', c='c' WHERE rowid=1" 1
|
||||
4 "UPDATE t1 SET a='a', c='c' WHERE rowid=1" 1
|
||||
5 "UPDATE t1 SET a='a', c='c' WHERE t1.rowid=1 AND b IS NULL" 1
|
||||
6 "UPDATE t1 SET a='a' FROM t2 WHERE t1.rowid=1" 1
|
||||
7 "UPDATE t1 SET a='a', b='b', c='c' FROM t2 WHERE t1.rowid=1" 0
|
||||
} {
|
||||
|
||||
set res(0) {0 {}}
|
||||
set res(1) {1 {cannot UPDATE a subset of columns on fts5 contentless-delete table: t1}}
|
||||
do_catchsql_test 1.$tn $up $res($err)
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -854,12 +854,18 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//! Documented elsewhere in this file.
|
||||
exportFile(name){
|
||||
const sah = this.#mapFilenameToSAH.get(name) || toss("File not found:",name);
|
||||
const n = sah.getSize() - HEADER_OFFSET_DATA;
|
||||
const b = new Uint8Array(n>=0 ? n : 0);
|
||||
if(n>0) sah.read(b, {at: HEADER_OFFSET_DATA});
|
||||
const b = new Uint8Array(n>0 ? n : 0);
|
||||
if(n>0){
|
||||
const nRead = sah.read(b, {at: HEADER_OFFSET_DATA});
|
||||
if(nRead != n){
|
||||
toss("Expected to read "+n+" bytes but read "+nRead+".");
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@@ -879,8 +885,13 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
const sah = this.#mapFilenameToSAH.get(name)
|
||||
|| this.nextAvailableSAH()
|
||||
|| toss("No available handles to import to.");
|
||||
sah.write(bytes, {at: HEADER_OFFSET_DATA});
|
||||
this.setAssociatedPath(sah, name, capi.SQLITE_OPEN_MAIN_DB);
|
||||
const nWrote = sah.write(bytes, {at: HEADER_OFFSET_DATA});
|
||||
if(nWrote != n){
|
||||
this.setAssociatedPath(sah, '', 0);
|
||||
toss("Expected to write "+n+" bytes but wrote "+nWrote+".");
|
||||
}else{
|
||||
this.setAssociatedPath(sah, name, capi.SQLITE_OPEN_MAIN_DB);
|
||||
}
|
||||
}
|
||||
|
||||
}/*class OpfsSAHPool*/;
|
||||
@@ -1087,6 +1098,9 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
automatically clean up any non-database files so importing them
|
||||
is pointless.
|
||||
|
||||
On a write error, the handle is removed from the pool and made
|
||||
available for re-use.
|
||||
|
||||
- [async] number reduceCapacity(n)
|
||||
|
||||
Removes up to `n` entries from the pool, with the caveat that it can
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
C Merge\sthe\sjson_remove()\sbug\sfix\sfrom\strunk\sinto\sthe\swal2\sbranch.
|
||||
D 2023-08-04T13:24:40.223
|
||||
C Merge\slatest\strunk\schanges\sinto\sthis\sbranch.
|
||||
D 2023-08-10T17:03:33.071
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@@ -86,7 +86,7 @@ F ext/fts3/unicode/UnicodeData.txt cd07314edb62d49fde34debdaf92fa2aa69011e7
|
||||
F ext/fts3/unicode/mkunicode.tcl d5aebf022fa4577ee8cdf27468f0d847879993959101f6dbd6348ef0cfc324a7
|
||||
F ext/fts3/unicode/parseunicode.tcl a981bd6466d12dd17967515801c3ff23f74a281be1a03cf1e6f52a6959fc77eb
|
||||
F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0
|
||||
F ext/fts5/fts5.h f6051cafb7304576a2ec270d8b7c53d5bf81b35f381f3637665a97ca38b2ba19
|
||||
F ext/fts5/fts5.h 9bebc9fb8b75b0777e741c758540e07c3c80ce75204198979028fe6cc4c59486
|
||||
F ext/fts5/fts5Int.h 78a63cc0795186cde5384816a9403a68c65774b35d952e05b81a1b4b158e07c8
|
||||
F ext/fts5/fts5_aux.c 572d5ec92ba7301df2fea3258576332f2f4d2dfd66d8263afd157d9deceac480
|
||||
F ext/fts5/fts5_buffer.c 3001fbabb585d6de52947b44b455235072b741038391f830d6b729225eeaf6a5
|
||||
@@ -94,7 +94,7 @@ F ext/fts5/fts5_config.c 054359543566cbff1ba65a188330660a5457299513ac71c53b3a07d
|
||||
F ext/fts5/fts5_expr.c 2473c13542f463cae4b938c498d6193c90d38ea1a2a4f9849c0479736e50d24d
|
||||
F ext/fts5/fts5_hash.c 65e7707bc8774706574346d18c20218facf87de3599b995963c3e6d6809f203d
|
||||
F ext/fts5/fts5_index.c 93b4cd116b76b6adf224cd3d213f1e06cfe10ae0eb21d6372b1c53b8f0c382a3
|
||||
F ext/fts5/fts5_main.c 2f87ee44fdb21539c264541149f07f70e065d58f37420063e5ddef80ba0f5ede
|
||||
F ext/fts5/fts5_main.c 7070031993ba5b5d89b13206ec4ef624895f2f7c0ec72725913d301e4d382445
|
||||
F ext/fts5/fts5_storage.c 3c9b41fce41b6410f2e8f82eb035c6a29b2560483f773e6dc98cf3cb2e4ddbb5
|
||||
F ext/fts5/fts5_tcl.c b1445cbe69908c411df8084a10b2485500ac70a9c747cdc8cda175a3da59d8ae
|
||||
F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee
|
||||
@@ -133,10 +133,11 @@ F ext/fts5/test/fts5config.test 60094712debc59286c59aef0e6cf511c37d866802776a825
|
||||
F ext/fts5/test/fts5conflict.test 655925678e630d3cdf145d18725a558971806416f453ac8410ca8c04d934238d
|
||||
F ext/fts5/test/fts5connect.test 08030168fc96fc278fa81f28654fb7e90566f33aff269c073e19b3ae9126b2f4
|
||||
F ext/fts5/test/fts5content.test 213506436fb2c87567b8e31f6d43ab30aab99354cec74ed679f22aad0cdbf283
|
||||
F ext/fts5/test/fts5contentless.test 9a42a86822670792ba632f5c57459addeb774d93b29d5e6ddae08faa64c2b6d9
|
||||
F ext/fts5/test/fts5contentless.test eb31159d62811b3a32fb1cfb36be20f9d9db75637c7fe6aa7f5c533db2d00576
|
||||
F ext/fts5/test/fts5contentless2.test 12c778d134a121b8bad000fbf3ae900d53226fee840ce36fe941b92737f1fda7
|
||||
F ext/fts5/test/fts5contentless3.test 487dce16b6677f68b44d7cbd158b9b7275d25e2c14d713f9188d9645bb699286
|
||||
F ext/fts5/test/fts5contentless4.test 0f43ededc2874f65d7da99b641a82239854d98d3fa43db729f284b723f23b69f
|
||||
F ext/fts5/test/fts5contentless5.test 216962d51376b62e4ff45e8db00aa3e1ab548cb36b7fd450633e73b2d678f88e
|
||||
F ext/fts5/test/fts5corrupt.test 77ae6f41a7eba10620efb921cf7dbe218b0ef232b04519deb43581cb17a57ebe
|
||||
F ext/fts5/test/fts5corrupt2.test 7453752ba12ce91690c469a6449d412561cc604b1dec994e16ab132952e7805f
|
||||
F ext/fts5/test/fts5corrupt3.test 7da9895dafa404efd20728f66ff4b94399788bdc042c36fe2689801bba2ccd78
|
||||
@@ -509,7 +510,7 @@ F ext/wasm/api/sqlite3-api-worker1.js 9f32af64df1a031071912eea7a201557fe39b17386
|
||||
F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
|
||||
F ext/wasm/api/sqlite3-opfs-async-proxy.js 8cf8a897726f14071fae6be6648125162b256dfb4f96555b865dbb7a6b65e379
|
||||
F ext/wasm/api/sqlite3-v-helper.js 7daa0eab0a513a25b05e9abae7b5beaaa39209b3ed12f86aeae9ef8d2719ed25
|
||||
F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 54cee22aacadb9dfaea438d72ac0882249d028c37903208d48c52871290ceff7
|
||||
F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js abb69b5e008961026bf5ff433d7116cb046359af92a5daf73208af2e7ac80ae7
|
||||
F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js e7a690e0e78ff4d563f2eca468f91db69f001ff4b79c6d2304cbb6f62dca437d
|
||||
F ext/wasm/api/sqlite3-wasm.c 8867f1d41c112fb4a2cfe22ff224eccaf309fcdea266cee0ec554f85db72ef0f
|
||||
F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js f10c3ecd9df06f6320073c2ce230a7ed7c56034d8b88c1e57095f2a97faf423a
|
||||
@@ -595,7 +596,7 @@ F src/date.c f73f203b3877cef866c60ab402aec2bf89597219b60635cf50cbe3c5e4533e94
|
||||
F src/dbpage.c f3eea5f7ec47e09ee7da40f42b25092ecbe961fc59566b8e5f705f34335b2387
|
||||
F src/dbstat.c ec92074baa61d883de58c945162d9e666c13cd7cf3a23bc38b4d1c4d0b2c2bef
|
||||
F src/delete.c cb766727c78e715f9fb7ec8a7d03658ed2a3016343ca687acfcec9083cdca500
|
||||
F src/expr.c ef4a81822da6f767696bd7f4b9983328af061158958138540142285a5b1181b7
|
||||
F src/expr.c 1affe0cc049683ef0ef3545d9b6901508556b0ef7e2892a344c3df6d7288d79d
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c a7fcbf7e66d14dbb73cf49f31489ebf66d0e6006c62b95246924a3bae9f37b36
|
||||
F src/func.c cc1da67fd643a43cfe691784158ec656d8ec6d13bb17e67018b01b38b3e4f5ab
|
||||
@@ -645,12 +646,12 @@ F src/printf.c e3ba080e2f409f9bfcc8d34724e6fc160e9c718dc92d0548f6b71b8b6f860ce2
|
||||
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c 37953a5f36c60bea413c3c04efcd433b6177009f508ef2ace0494728912fe2e9
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c abf48be202d35c4f450325b61992e98ac4aa81ed1e29709069432877d3b555d3
|
||||
F src/select.c 5f545a2c8702d4d3430bbb188cfec47d6c122d899061ef00cbe56af14591c574
|
||||
F src/shell.c.in 694aaf751f00610381533d4a31c83d142cfc83ef91ef65e2aa6912ace7c39b40
|
||||
F src/sqlite.h.in 7b07a33d2af82ee974aa91e6294abce0282b2f4c5934b291d2fff961810dd867
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h da473ce2b3d0ae407a6300c4a164589b9a6bfdbec9462688a8593ff16f3bb6e4
|
||||
F src/sqliteInt.h bdf30ea8552626736f7fc2d216beb4e6ee556d1afc39d20afa1697ea259463ca
|
||||
F src/sqliteInt.h 025ed58a41968ef80d64cdc194caa8dd207b0256b147253d762fdac7a62408f9
|
||||
F src/sqliteLimit.h 33b1c9baba578d34efe7dfdb43193b366111cdf41476b1e82699e14c11ee1fb6
|
||||
F src/status.c 160c445d7d28c984a0eae38c144f6419311ed3eace59b44ac6dafc20db4af749
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
@@ -710,12 +711,12 @@ F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c 0fb405f9adf3f757c26bfc1ae6d58ac5dccbb918917ba9e5ef0e6673a06563d3
|
||||
F src/treeview.c 1d52fbc4e97161e65858d36e3424ea6e3fc045dd8a679c82b4b9593dc30de3bd
|
||||
F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0
|
||||
F src/update.c d5b755580a86d235b12faf10de81e60ad97c8117f8c3063d92c772df94455d44
|
||||
F src/update.c 0bb9171afaa4d0b100ad946873bccda7aef90ffe083ef5c63668fce08c4df9da
|
||||
F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145
|
||||
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
|
||||
F src/util.c b3532a95ad56db67b3acd3955e688e4cb80ebec6fd1f459a8eb51cceedd6de69
|
||||
F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104
|
||||
F src/vdbe.c 291ce57dbcf10eff4c1e7ff76c11e81f6b1e012f5209662b8a93ff4c42be2740
|
||||
F src/vdbe.c 11f1a00443991bd12bd0c97050b2614f7fd3e82b9cc0ffdb13d14d424d733e77
|
||||
F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0
|
||||
F src/vdbeInt.h 949669dfd8a41550d27dcb905b494f2ccde9a2e6c1b0b04daa1227e2e74c2b2c
|
||||
F src/vdbeapi.c f37822f215740ede2a8fcae99bc13f2cc3a72dd0e1d22b81b9298c5ca67dbc38
|
||||
@@ -1997,7 +1998,7 @@ F tool/mkshellc.tcl b7adf08b82de60811d2cb6af05ff59fc17e5cd6f3e98743c14eaaa3f8971
|
||||
F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
|
||||
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
|
||||
F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f
|
||||
F tool/mksqlite3c.tcl 44bc3bdb675a9e3a507f4d82575332bccd7e6f830a47c9aa29460ea2240593a9
|
||||
F tool/mksqlite3c.tcl 49e39b1e616abc92fd8c24445f2b0a38881825f764541e0026f72371f0d84b65
|
||||
F tool/mksqlite3h.tcl d391cff7cad0a372ee1406faee9ccc7dad9cb80a0c95cae0f73d10dd26e06762
|
||||
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
|
||||
F tool/mkvsix.tcl b9e0777a213c23156b6542842c238479e496ebf5
|
||||
@@ -2063,8 +2064,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 6fa71e11197111ab52d1983b35190899a5881dcb9ed822488c92bc839c72cb55 ba7a66db13b28da0b41f03be825a593608474a5ebda89e12d58d89db709b8f65
|
||||
R cef0de709be49642d9e25d028826ad6e
|
||||
U drh
|
||||
Z e02f148a6f9cb0e9347800ebbe37eb6f
|
||||
P e6c066cae4ed5d698820c0c1ea8840773146e9d1a665551d8d51bb9df121cdb7 aa6de539c09faa320b68c63659e602107145c4263fa680d5b40fe4d7d7ac4534
|
||||
R f99f5fc942bd03ff500daadad5540cf1
|
||||
U dan
|
||||
Z ffac72e58a992aabc015a8c1dc573638
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
e6c066cae4ed5d698820c0c1ea8840773146e9d1a665551d8d51bb9df121cdb7
|
||||
72f7807b34eee1fcfd94f72d27535e5273ed1f7ff3d464179a774b7c7241f5f5
|
||||
@@ -3972,10 +3972,13 @@ int sqlite3ExprCodeGetColumn(
|
||||
u8 p5 /* P5 value for OP_Column + FLAGS */
|
||||
){
|
||||
assert( pParse->pVdbe!=0 );
|
||||
assert( (p5 & (OPFLAG_NOCHNG|OPFLAG_TYPEOFARG|OPFLAG_LENGTHARG))==p5 );
|
||||
assert( IsVirtual(pTab) || (p5 & OPFLAG_NOCHNG)==0 );
|
||||
sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pTab, iTable, iColumn, iReg);
|
||||
if( p5 ){
|
||||
VdbeOp *pOp = sqlite3VdbeGetLastOp(pParse->pVdbe);
|
||||
if( pOp->opcode==OP_Column ) pOp->p5 = p5;
|
||||
if( pOp->opcode==OP_VColumn ) pOp->p5 = (p5 & OPFLAG_NOCHNG);
|
||||
}
|
||||
return iReg;
|
||||
}
|
||||
|
||||
@@ -1298,6 +1298,16 @@ static void selectInnerLoop(
|
||||
testcase( eDest==SRT_Fifo );
|
||||
testcase( eDest==SRT_DistFifo );
|
||||
sqlite3VdbeAddOp3(v, OP_MakeRecord, regResult, nResultCol, r1+nPrefixReg);
|
||||
#if !defined(SQLITE_ENABLE_NULL_TRIM) && defined(SQLITE_DEBUG)
|
||||
/* A destination of SRT_Table and a non-zero iSDParm2 parameter means
|
||||
** that this is an "UPDATE ... FROM" on a virtual table or view. In this
|
||||
** case set the p5 parameter of the OP_MakeRecord to OPFLAG_NOCHNG_MAGIC.
|
||||
** This does not affect operation in any way - it just allows MakeRecord
|
||||
** to process OPFLAG_NOCHANGE values without an assert() failing. */
|
||||
if( eDest==SRT_Table && pDest->iSDParm2 ){
|
||||
sqlite3VdbeChangeP5(v, OPFLAG_NOCHNG_MAGIC);
|
||||
}
|
||||
#endif
|
||||
#ifndef SQLITE_OMIT_CTE
|
||||
if( eDest==SRT_DistFifo ){
|
||||
/* If the destination is DistFifo, then cursor (iParm+1) is open
|
||||
|
||||
+5
-6
@@ -894,7 +894,7 @@ typedef INT16_TYPE LogEst;
|
||||
/*
|
||||
** P is one byte past the end of a large buffer. Return true if a span of bytes
|
||||
** between S..E crosses the end of that buffer. In other words, return true
|
||||
** if the sub-buffer S..E-1 overflows the buffer show last byte is P-1.
|
||||
** if the sub-buffer S..E-1 overflows the buffer whose last byte is P-1.
|
||||
**
|
||||
** S is the start of the span. E is one byte past the end of end of span.
|
||||
**
|
||||
@@ -1257,7 +1257,6 @@ typedef struct Cte Cte;
|
||||
typedef struct CteUse CteUse;
|
||||
typedef struct Db Db;
|
||||
typedef struct DbFixer DbFixer;
|
||||
typedef struct DblDbl DblDbl;
|
||||
typedef struct Schema Schema;
|
||||
typedef struct Expr Expr;
|
||||
typedef struct ExprList ExprList;
|
||||
@@ -3778,6 +3777,9 @@ struct Parse {
|
||||
int regRoot; /* Register holding root page number for new objects */
|
||||
int nMaxArg; /* Max args passed to user function by sub-program */
|
||||
int nSelect; /* Number of SELECT stmts. Counter for Select.selId */
|
||||
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
u32 nProgressSteps; /* xProgress steps taken during sqlite3_prepare() */
|
||||
#endif
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
int nTableLock; /* Number of locks in aTableLock */
|
||||
TableLock *aTableLock; /* Required table locks for shared-cache mode */
|
||||
@@ -3791,12 +3793,9 @@ struct Parse {
|
||||
int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
|
||||
Returning *pReturning; /* The RETURNING clause */
|
||||
} u1;
|
||||
LogEst nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
|
||||
u32 oldmask; /* Mask of old.* columns referenced */
|
||||
u32 newmask; /* Mask of new.* columns referenced */
|
||||
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
u32 nProgressSteps; /* xProgress steps taken during sqlite3_prepare() */
|
||||
#endif
|
||||
LogEst nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
|
||||
u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */
|
||||
u8 bReturning; /* Coding a RETURNING trigger */
|
||||
u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */
|
||||
|
||||
+3
-1
@@ -1259,7 +1259,9 @@ static void updateVirtualTable(
|
||||
sqlite3ExprDup(db, pChanges->a[aXRef[i]].pExpr, 0)
|
||||
);
|
||||
}else{
|
||||
pList = sqlite3ExprListAppend(pParse, pList, exprRowColumn(pParse, i));
|
||||
Expr *pRow = exprRowColumn(pParse, i);
|
||||
if( pRow ) pRow->op2 = OPFLAG_NOCHNG;
|
||||
pList = sqlite3ExprListAppend(pParse, pList, pRow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-15
@@ -2360,10 +2360,10 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */
|
||||
** opcodes are allowed to occur between this instruction and the previous
|
||||
** OP_Lt or OP_Gt.
|
||||
**
|
||||
** If result of an OP_Eq comparison on the same two operands as the
|
||||
** prior OP_Lt or OP_Gt would have been true, then jump to P2.
|
||||
** If the result of an OP_Eq comparison on the two previous
|
||||
** operands would have been false or NULL, then fall through.
|
||||
** If the result of an OP_Eq comparison on the same two operands as
|
||||
** the prior OP_Lt or OP_Gt would have been true, then jump to P2. If
|
||||
** the result of an OP_Eq comparison on the two previous operands
|
||||
** would have been false or NULL, then fall through.
|
||||
*/
|
||||
case OP_ElseEq: { /* same as TK_ESCAPE, jump */
|
||||
|
||||
@@ -2793,7 +2793,7 @@ case OP_IsType: { /* jump */
|
||||
/* Opcode: ZeroOrNull P1 P2 P3 * *
|
||||
** Synopsis: r[P2] = 0 OR NULL
|
||||
**
|
||||
** If all both registers P1 and P3 are NOT NULL, then store a zero in
|
||||
** If both registers P1 and P3 are NOT NULL, then store a zero in
|
||||
** register P2. If either registers P1 or P3 are NULL then put
|
||||
** a NULL in register P2.
|
||||
*/
|
||||
@@ -5194,13 +5194,13 @@ case OP_IfNotOpen: { /* jump */
|
||||
** operands to OP_NotFound and OP_IdxGT.
|
||||
**
|
||||
** This opcode is an optimization attempt only. If this opcode always
|
||||
** falls through, the correct answer is still obtained, but extra works
|
||||
** falls through, the correct answer is still obtained, but extra work
|
||||
** is performed.
|
||||
**
|
||||
** A value of N in the seekHit flag of cursor P1 means that there exists
|
||||
** a key P3:N that will match some record in the index. We want to know
|
||||
** if it is possible for a record P3:P4 to match some record in the
|
||||
** index. If it is not possible, we can skips some work. So if seekHit
|
||||
** index. If it is not possible, we can skip some work. So if seekHit
|
||||
** is less than P4, attempt to find out if a match is possible by running
|
||||
** OP_NotFound.
|
||||
**
|
||||
@@ -5766,10 +5766,10 @@ case OP_RowCell: {
|
||||
** left in an undefined state.
|
||||
**
|
||||
** If the OPFLAG_AUXDELETE bit is set on P5, that indicates that this
|
||||
** delete one of several associated with deleting a table row and all its
|
||||
** associated index entries. Exactly one of those deletes is the "primary"
|
||||
** delete. The others are all on OPFLAG_FORDELETE cursors or else are
|
||||
** marked with the AUXDELETE flag.
|
||||
** delete is one of several associated with deleting a table row and
|
||||
** all its associated index entries. Exactly one of those deletes is
|
||||
** the "primary" delete. The others are all on OPFLAG_FORDELETE
|
||||
** cursors or else are marked with the AUXDELETE flag.
|
||||
**
|
||||
** If the OPFLAG_NCHANGE flag of P2 (NB: P2 not P5) is set, then the row
|
||||
** change count is incremented (otherwise not).
|
||||
@@ -5941,7 +5941,7 @@ case OP_SorterCompare: {
|
||||
** Write into register P2 the current sorter data for sorter cursor P1.
|
||||
** Then clear the column header cache on cursor P3.
|
||||
**
|
||||
** This opcode is normally use to move a record out of the sorter and into
|
||||
** This opcode is normally used to move a record out of the sorter and into
|
||||
** a register that is the source for a pseudo-table cursor created using
|
||||
** OpenPseudo. That pseudo-table cursor is the one that is identified by
|
||||
** parameter P3. Clearing the P3 column cache as part of this opcode saves
|
||||
@@ -6750,7 +6750,7 @@ case OP_IdxGE: { /* jump, ncycle */
|
||||
** file is given by P1.
|
||||
**
|
||||
** The table being destroyed is in the main database file if P3==0. If
|
||||
** P3==1 then the table to be clear is in the auxiliary database file
|
||||
** P3==1 then the table to be destroyed is in the auxiliary database file
|
||||
** that is used to store tables create using CREATE TEMPORARY TABLE.
|
||||
**
|
||||
** If AUTOVACUUM is enabled then it is possible that another root page
|
||||
@@ -6810,8 +6810,8 @@ case OP_Destroy: { /* out2 */
|
||||
** in the database file is given by P1. But, unlike Destroy, do not
|
||||
** remove the table or index from the database file.
|
||||
**
|
||||
** The table being clear is in the main database file if P2==0. If
|
||||
** P2==1 then the table to be clear is in the auxiliary database file
|
||||
** The table being cleared is in the main database file if P2==0. If
|
||||
** P2==1 then the table to be cleared is in the auxiliary database file
|
||||
** that is used to store tables create using CREATE TEMPORARY TABLE.
|
||||
**
|
||||
** If the P3 value is non-zero, then the row change count is incremented
|
||||
|
||||
+2
-2
@@ -87,7 +87,7 @@ set out [open $fname w]
|
||||
# Force the output to use unix line endings, even on Windows.
|
||||
fconfigure $out -translation lf
|
||||
set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
|
||||
puts $out \
|
||||
puts $out [subst \
|
||||
{/******************************************************************************
|
||||
** This file is an amalgamation of many separate C source files from SQLite
|
||||
** version $VERSION. By combining all the individual C code files into this
|
||||
@@ -106,7 +106,7 @@ puts $out \
|
||||
** if you want a wrapper to interface SQLite with your choice of programming
|
||||
** language. The code for the "sqlite3" command-line shell is also in a
|
||||
** separate file. This file contains only code for the core SQLite library.
|
||||
**}
|
||||
**}]
|
||||
set srcroot [file dirname [file dirname [info script]]]
|
||||
if {$tcl_platform(platform)=="windows"} {
|
||||
set vsrcprog src-verify.exe
|
||||
|
||||
Reference in New Issue
Block a user