Correctly capture the error when a RETURNING clause appears on an

attempt to UPDATE an eponymous virtual table.
dbsqlfuzz 486f791cbe2dc45839310073e71367a1d8ad22dd.

FossilOrigin-Name: 778a9a6e6f8d960fd55ac9be7eea20b1875a46192db85e63dddc61b632b30173
This commit is contained in:
drh 2021-04-02 20:43:26 +00:00
parent aecc04d642
commit 9af69ff547
4 changed files with 15 additions and 10 deletions

View File

@ -1,5 +1,5 @@
C Add\sexperimental\sSQLITE_FCNTL_EXTERNAL_READER\sfile\scontrol.
D 2021-04-02T19:55:48.856
C Correctly\scapture\sthe\serror\swhen\sa\sRETURNING\sclause\sappears\son\san\s\nattempt\sto\sUPDATE\san\seponymous\svirtual\stable.\ndbsqlfuzz\s486f791cbe2dc45839310073e71367a1d8ad22dd.
D 2021-04-02T20:43:26.666
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -608,7 +608,7 @@ F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
F src/tokenize.c 0b9c82fa628b5adce93e2bcaf935a24d43eb83344fb51551f7835526d0693fc4
F src/treeview.c 70f57a2b77e20b354724ea69b8ed1ea1df946c48296d695320c741c7d174be90
F src/trigger.c 7bb95fda4d9c9dd4009a7fc6ef2194c76ba1ba60e4b49c364e1cb3a064704e39
F src/trigger.c 28f439bb454a46ba191817c8c5b6468f7ef236233b14155fd3b10c12bc6f868e
F src/update.c 0f5a61f0787199983530a33f6fffe4f52742f35fcdf6ccfad1078b1a8bc17723
F src/upsert.c df8f1727d62b5987c4fd302cd4d7c0c84ae57cd65683c5a34a740dfe24039235
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
@ -1297,7 +1297,7 @@ F test/releasetest.tcl fb76d8fcc95ac29d6356cd9e52b726ab9e43a24082897618dfbcb7c2b
F test/releasetest_data.tcl 3d41ddb3f04f474ac9d925485da24ce6576ff0ebc4c7201c8a340bc09846c261
F test/resetdb.test 8062cf10a09d8c048f8de7711e94571c38b38168db0e5877ba7561789e5eeb2b
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
F test/returning1.test 541a4b5746279d308d6c15e033de4ed3158f4c80260ff4222dab511c4887ce10
F test/returning1.test 23dd8e28e69fb2f4e1a2173a241d5fb84846cac651096ad378980e4b7a79b434
F test/rollback.test 06680159bc6746d0f26276e339e3ae2f951c64812468308838e0a3362d911eaa
F test/rollback2.test 3f3a4e20401825017df7e7671e9f31b6de5fae5620c2b9b49917f52f8c160a8f
F test/rollbackfault.test 0e646aeab8840c399cfbfa43daab46fd609cf04a
@ -1912,7 +1912,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P f3a2eb979f1003e8249e613b34afd345f157c0d54b4f05ea0db230ef70e71351
R 7052bf13a0b7767c57dc2a61770c6de9
U dan
Z 52db8ae5f9c9b6085061c878477364c6
P e16da5af822ef31d7e05992403cf9787fbb3d9abb0b5283aba55ea07e1830a72
R 31cf23d11c71c31febdef8457989c710
U drh
Z bb6d981e49a44d67794ddc6bc2f09d25

View File

@ -1 +1 @@
e16da5af822ef31d7e05992403cf9787fbb3d9abb0b5283aba55ea07e1830a72
778a9a6e6f8d960fd55ac9be7eea20b1875a46192db85e63dddc61b632b30173

View File

@ -69,7 +69,7 @@ Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){
){
pTrig->pNext = pList;
pList = pTrig;
}else if( pTrig->op==TK_RETURNING ){
}else if( pTrig->op==TK_RETURNING && pParse->db->pVtabCtx==0 ){
assert( pParse->bReturning );
assert( &(pParse->u1.pReturning->retTrig) == pTrig );
pTrig->table = pTab->zName;

View File

@ -184,4 +184,9 @@ do_catchsql_test 8.4 {
INSERT INTO t1 VALUES(3) RETURNING a, (SELECT c FROM t2 WHERE t1.a=t2.b) AS x;
} {0 {3 40}}
# dbsqlfuzz finds/crash-486f791cbe2dc45839310073e71367a1d8ad22dd
do_catchsql_test 9.1 {
UPDATE pragma_encoding SET encoding='UTF-8' RETURNING a, b, *;
} {1 {table pragma_encoding may not be modified}}
finish_test