Also prohibit the use of rowid from a subquery. Add the
SQLITE_ALLOW_ROWID_IN_VIEW compile-time option to restore legacy behavior in case somebody actually needs it. FossilOrigin-Name: 14b1d56ef84b0e62b7f9c4e5f7f985ca10e770c8db59f54004ad892c2a2dcbfb
This commit is contained in:
parent
a6c54def42
commit
6e5020e8da
35
manifest
35
manifest
@ -1,5 +1,5 @@
|
||||
C Raise\san\serror\sif\sa\squery\stries\sto\saccess\sthe\s"rowid"\sof\sa\sview,\sas\sviews\ndo\snot\shave\srowids.
|
||||
D 2021-04-06T19:13:44.770
|
||||
C Also\sprohibit\sthe\suse\sof\srowid\sfrom\sa\ssubquery.\s\sAdd\sthe\nSQLITE_ALLOW_ROWID_IN_VIEW\scompile-time\soption\sto\srestore\slegacy\sbehavior\nin\scase\ssomebody\sactually\sneeds\sit.
|
||||
D 2021-04-07T15:45:01.945
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -486,7 +486,7 @@ F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
|
||||
F src/btree.c 36a162403b7e897668ea3f894e40c647ec8cf7b0e533b8c9e4d0f4450f3b52b0
|
||||
F src/btree.h 096cc53baa58be22b02c896d1cf933c38cfc6d65f9253c1367ece8cc88a24de5
|
||||
F src/btreeInt.h 7bc15a24a02662409ebcd6aeaa1065522d14b7fda71573a2b0568b458f514ae0
|
||||
F src/build.c 9d6002cf6bf15b07c50ce27abb24cefe94355eaa9f517ef8e17a5289d85be308
|
||||
F src/build.c 08b392566d4783f45668e4ac535b23565a6dfa6173a5a0ab3528c564e0cbdcfc
|
||||
F src/callback.c d0b853dd413255d2e337b34545e54d888ea02f20da5ad0e63585b389624c4a6c
|
||||
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
F src/ctime.c 2a322b9a3d75771fb4d99e0702851f4f68dda982507a0f798eefb0712969a410
|
||||
@ -503,7 +503,7 @@ F src/hash.c 8d7dda241d0ebdafb6ffdeda3149a412d7df75102cecfc1021c98d6219823b19
|
||||
F src/hash.h 9d56a9079d523b648774c1784b74b89bd93fac7b365210157482e4319a468f38
|
||||
F src/hwtime.h cb1d7e3e1ed94b7aa6fde95ae2c2daccc3df826be26fc9ed7fd90d1750ae6144
|
||||
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
||||
F src/insert.c 1f5511255cafe9c37e53afcf7af707966319d96418d4054c382ebac77cfe7bdf
|
||||
F src/insert.c ced23759fa5e755c8cbcff4b247bad6ae4d53e7b9bc1cab5730c3d1df7fc866e
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c 8c9c8cd2bd8eecdb06d9b6e89de7e9e65bae45cc8fc33609cc74023a5c296067
|
||||
F src/main.c 2a7ece3a67c646e5fe9984ffe0277d6a76f80ce9715bf2faa591d8cb66b9d913
|
||||
@ -542,7 +542,7 @@ F src/printf.c 78fabb49b9ac9a12dd1c89d744abdc9b67fd3205e62967e158f78b965a29ec4b
|
||||
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
||||
F src/resolve.c fc136d935f19966747663bed605ad7f06f84f9fe7bf7bf79e9bf844ef5c7556d
|
||||
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
|
||||
F src/select.c 06df4a2a94df253b580d38b32573f4b6462fbe39abc31101c9a9fa95215c8479
|
||||
F src/select.c df6863a0e1b981da118da57b1022a1f9a06f7ad72fa8ce5bde4c838dc161de49
|
||||
F src/shell.c.in 9320b476fde0f7c46700e5695b69b435f1e46843a1513cdd187ac426cdbee016
|
||||
F src/sqlite.h.in 18ec33e32001721fd4e9c4705a24a85dff04956ac2c0a21775058884ba845b09
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
@ -609,7 +609,7 @@ F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c 0b9c82fa628b5adce93e2bcaf935a24d43eb83344fb51551f7835526d0693fc4
|
||||
F src/treeview.c 70f57a2b77e20b354724ea69b8ed1ea1df946c48296d695320c741c7d174be90
|
||||
F src/trigger.c f8493674f5c8f103c1a2cd0616af9dca85c7058450f9fe47cacd15cf5d512d52
|
||||
F src/update.c 0f5a61f0787199983530a33f6fffe4f52742f35fcdf6ccfad1078b1a8bc17723
|
||||
F src/update.c 3130bb21a2eb5db2620c084db3225b646834ad3a6d6c2929dcc3dd542eefb3ae
|
||||
F src/upsert.c df8f1727d62b5987c4fd302cd4d7c0c84ae57cd65683c5a34a740dfe24039235
|
||||
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
|
||||
F src/util.c 41c7a72da1df47864faa378a1c720b38adb288c6838cb6be5594511b6287a048
|
||||
@ -629,7 +629,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c 69e770e96fd56cc21608992bf2c6f1f3dc5cf2572d0495c6a643b06c3a679f14
|
||||
F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
|
||||
F src/walker.c d42d6c80ea363ef689a462e65eefcfe87deab924c50de5baa37ecb6af7d7ddaa
|
||||
F src/where.c 9accf968b0e75804b0e99a7500f5310e5213bc3f5a2bd6810e51da354d2cc3b5
|
||||
F src/where.c 16fca8a5ab4f246f4f7e0141688d40c75296c33f3afe576434c6af7eb3d0f823
|
||||
F src/whereInt.h 446e5e8018f83358ef917cf32d8e6a86dc8430113d0b17e720f1839d3faa44c4
|
||||
F src/wherecode.c 8bdc239eae3d39f9f6ace4299eeb86e1e0c56eed88b60f9c473dc85ae79f4e89
|
||||
F src/whereexpr.c 4ba94b8ebbff97c658b212de6ccdb6d3a41847800bdf99e7a2a967c250269f2c
|
||||
@ -697,7 +697,7 @@ F test/autoindex1.test fe27af92eaf884bd9c38f94be3e8afa04ec494e5eefb189902026181a
|
||||
F test/autoindex2.test 12ef578928102baaa0dc23ad397601a2f4ecb0df
|
||||
F test/autoindex3.test 2d13958a5617e987624a428d7aed91bf51f322b49b476e3573fadec697ce6da5
|
||||
F test/autoindex4.test 49d3cd791a9baa16fb461d7ea3de80d019a819cf
|
||||
F test/autoindex5.test 809c59d6bee9a5146bef0809a6a2a050f89b78f63c11db2b84a567403e7dd85a
|
||||
F test/autoindex5.test ee0aa95e3f44190347a29a672c3d4ecf042e3f33c5fa3dc29f0ab6be057bbded
|
||||
F test/autovacuum.test 0831cd34e14695d297187f7f6519265e3121c5b0a1720e548e86829e796129e9
|
||||
F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4
|
||||
F test/avfs.test 0c3a38e03cccb0fc3127838462dc05dc3f4c1480d770c084b388304c25de3652
|
||||
@ -843,7 +843,7 @@ F test/descidx1.test edc8adee58d491b06c7157c50364eaf1c3605c9c19f8093cb1ea2b6184f
|
||||
F test/descidx2.test a0ba347037ff3b811f4c6ceca5fd0f9d5d72e74e59f2d9de346a9d2f6ad78298
|
||||
F test/descidx3.test 953c831df7ea219c73826dfbf2f6ee02d95040725aa88ccb4fa43d1a1999b926
|
||||
F test/diskfull.test 106391384780753ea6896b7b4f005d10e9866b6e
|
||||
F test/distinct.test eefe5a8e47fcb761aaa745838e355ab28586f9f75786a1c098016881344b2a5e
|
||||
F test/distinct.test cfe34694eda13b3fa18199815bde90ec1d2d216147ebbfdbaf8e51df58ff15b3
|
||||
F test/distinct2.test cd1d15a4a2abf579298f7161e821ed50c0119136fe0424db85c52cf0adc230d1
|
||||
F test/distinctagg.test 2ff06cbc65cbc25fff8c9b00004da3aa3431b7001601bdfc7d4eb700ece1c4d0
|
||||
F test/e_blobbytes.test 439a945953b35cb6948a552edaec4dc31fd70a05
|
||||
@ -1193,18 +1193,18 @@ F test/memdb1.test 7b76c3262d63c46dd6b408d18f5721071776f2df4ffeb11e668824e427127
|
||||
F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2
|
||||
F test/memsubsys1.test 9e7555a22173b8f1c96c281ce289b338fcba2abe8b157f8798ca195bbf1d347e
|
||||
F test/memsubsys2.test 3e4a8d0c05fd3e5fa92017c64666730a520c7e08
|
||||
F test/minmax.test 6751e87b409fe11b02e70a306d846fa544e25a41
|
||||
F test/minmax2.test 1edf66901ddfab26ae1e04165e8da834c8d3284e2b20aefb26b80ef217962eab
|
||||
F test/minmax.test 0015e5cd5e7af48bb3364f26d9f3a9cdbea2a442d4774281c39e2229591b7351
|
||||
F test/minmax2.test cf9311babb6f0518d04e42fd6a42c619531c4309a9dd790a2c4e9b3bc595e0de
|
||||
F test/minmax3.test cc1e8b010136db0d01a6f2a29ba5a9f321034354
|
||||
F test/minmax4.test 272ca395257f05937dc96441c9dde4bc9fbf116a8d4fa02baeb0d13d50e36c87
|
||||
F test/misc1.test 7ce84b25df9872e7d7878613a96815d2ba5bc974ac4e15a50118dde8f3917599
|
||||
F test/misc2.test 3d8f161cc5daf7523ef81c13e88e32d4d111636a24cefa396bbf76273d983d7c
|
||||
F test/misc2.test 71e746af479119386ac2ed7ab7d81d99970e75b49ffd3e8efffee100b4b5f350
|
||||
F test/misc3.test cf3dda47d5dda3e53fc5804a100d3c82be736c9d
|
||||
F test/misc4.test 10cd6addb2fa9093df4751a1b92b50440175dd5468a6ec84d0386e78f087db0e
|
||||
F test/misc5.test c4aeaa0fa28faa08f2485309c38db4719e6cd1364215d5687a5b96d340a3fa58
|
||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||
F test/misc7.test d912f3d45c2989191b797504a220ca225d6be80b21acad22ba0d35f4a9ee4579
|
||||
F test/misc8.test 8782708f4c8a459591c3e8fe1215bd2048bffb4024b3df249e9b9ed407dc61ed
|
||||
F test/misc8.test 4db9f8be59834cea08c87e9658014080efa02678ef54a088f84fa5647e81fee0
|
||||
F test/misuse.test 9e7f78402005e833af71dcab32d048003869eca5abcaccc985d4f8dc1d86bcc7
|
||||
F test/mjournal.test 28a08d5cb5fb5b5702a46e19176e45e964e0800d1f894677169e79f34030e152
|
||||
F test/mmap1.test fb04e0c10492455007624ade884ca0c8852ff3e4e11d95408f9709ca2ef7f626
|
||||
@ -1912,10 +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 55cad6f628a4313c6652b36474c3397f097ac5c2503ae94605c030a54dc40916
|
||||
R 5881319da5f75e2988cac64bf40b8cc2
|
||||
T *branch * no-rowid-on-view
|
||||
T *sym-no-rowid-on-view *
|
||||
T -sym-trunk *
|
||||
P 7a73c6166bb1d9f2e2de280fa4e973db152caaf6cc76b8e6a92cfe9560ddc224
|
||||
R 0032824dbcc54de12ba5dee3d7eadcdf
|
||||
U drh
|
||||
Z 8a4e43d596f67bf58ef1d84979a7c8d3
|
||||
Z 53cda2b8f4055af11e267e9b175be4c9
|
||||
|
@ -1 +1 @@
|
||||
7a73c6166bb1d9f2e2de280fa4e973db152caaf6cc76b8e6a92cfe9560ddc224
|
||||
14b1d56ef84b0e62b7f9c4e5f7f985ca10e770c8db59f54004ad892c2a2dcbfb
|
@ -2702,7 +2702,16 @@ void sqlite3CreateView(
|
||||
sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0, noErr);
|
||||
p = pParse->pNewTable;
|
||||
if( p==0 || pParse->nErr ) goto create_view_fail;
|
||||
|
||||
/* Legacy versions of SQLite allowed the use of the magic "rowid" column
|
||||
** on a view, even though views do not have rowids. The following flag
|
||||
** setting fixes this problem. But the fix can be disabled by compiling
|
||||
** with -DSQLITE_ALLOW_ROWID_IN_VIEW in case there are legacy apps that
|
||||
** depend upon the old buggy behavior. */
|
||||
#ifndef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
p->tabFlags |= TF_NoVisibleRowid;
|
||||
#endif
|
||||
|
||||
sqlite3TwoPartName(pParse, pName1, pName2, &pName);
|
||||
iDb = sqlite3SchemaToIndex(db, p->pSchema);
|
||||
sqlite3FixInit(&sFix, pParse, iDb, "view", pName);
|
||||
|
@ -1268,11 +1268,13 @@ void sqlite3Insert(
|
||||
regIns, aRegIdx, 0, appendFlag, bUseSeek
|
||||
);
|
||||
}
|
||||
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
}else if( pParse->bReturning ){
|
||||
/* If there is a RETURNING clause, populate the rowid register with
|
||||
** constant value -1, in case one or more of the returned expressions
|
||||
** refer to the "rowid" of the view. */
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, -1, regRowid);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Update the count of rows that are inserted
|
||||
|
21
src/select.c
21
src/select.c
@ -1807,7 +1807,13 @@ static const char *columnTypeImpl(
|
||||
** of the SELECT statement. Return the declaration type and origin
|
||||
** data for the result-set column of the sub-select.
|
||||
*/
|
||||
if( iCol>=0 && iCol<pS->pEList->nExpr ){
|
||||
if( iCol<pS->pEList->nExpr
|
||||
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
&& iCol>=0
|
||||
#else
|
||||
&& ALWAYS(iCol>=0)
|
||||
#endif
|
||||
){
|
||||
/* If iCol is less than zero, then the expression requests the
|
||||
** rowid of the sub-select or view. This expression is legal (see
|
||||
** test case misc2.2.2) - it always evaluates to NULL.
|
||||
@ -3593,9 +3599,12 @@ static Expr *substExpr(
|
||||
&& pExpr->iTable==pSubst->iTable
|
||||
&& !ExprHasProperty(pExpr, EP_FixedCol)
|
||||
){
|
||||
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
if( pExpr->iColumn<0 ){
|
||||
pExpr->op = TK_NULL;
|
||||
}else{
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
Expr *pNew;
|
||||
Expr *pCopy = pSubst->pEList->a[pExpr->iColumn].pExpr;
|
||||
Expr ifNullRow;
|
||||
@ -5234,7 +5243,13 @@ int sqlite3ExpandSubquery(Parse *pParse, SrcItem *pFrom){
|
||||
sqlite3ColumnsFromExprList(pParse, pSel->pEList,&pTab->nCol,&pTab->aCol);
|
||||
pTab->iPKey = -1;
|
||||
pTab->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
|
||||
pTab->tabFlags |= TF_Ephemeral;
|
||||
#ifndef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
/* The usual case - do not allow ROWID on a subquery */
|
||||
pTab->tabFlags |= TF_Ephemeral | TF_NoVisibleRowid;
|
||||
#else
|
||||
pTab->tabFlags |= TF_Ephemeral; /* Legacy compatibility mode */
|
||||
#endif
|
||||
|
||||
|
||||
return pParse->nErr ? SQLITE_ERROR : SQLITE_OK;
|
||||
}
|
||||
|
@ -799,7 +799,12 @@ void sqlite3Update(
|
||||
|
||||
/* Top of the update loop */
|
||||
if( eOnePass!=ONEPASS_OFF ){
|
||||
if( !isView && aiCurOnePass[0]!=iDataCur && aiCurOnePass[1]!=iDataCur ){
|
||||
if( aiCurOnePass[0]!=iDataCur
|
||||
&& aiCurOnePass[1]!=iDataCur
|
||||
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
&& !isView
|
||||
#endif
|
||||
){
|
||||
assert( pPk );
|
||||
sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey,nKey);
|
||||
VdbeCoverage(v);
|
||||
|
10
src/where.c
10
src/where.c
@ -630,14 +630,14 @@ static void translateColumnToCopy(
|
||||
pOp->p2 = pOp->p3;
|
||||
pOp->p3 = 0;
|
||||
}else if( pOp->opcode==OP_Rowid ){
|
||||
if( iAutoidxCur ){
|
||||
pOp->opcode = OP_Sequence;
|
||||
pOp->p1 = iAutoidxCur;
|
||||
}else{
|
||||
pOp->opcode = OP_Sequence;
|
||||
pOp->p1 = iAutoidxCur;
|
||||
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
if( iAutoidxCur==0 ){
|
||||
pOp->opcode = OP_Null;
|
||||
pOp->p1 = 0;
|
||||
pOp->p3 = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ do_execsql_test 2.1 {
|
||||
SELECT sum(z) FROM vvv WHERE x='aaa'
|
||||
) FROM one;
|
||||
} {8.0}
|
||||
do_execsql_test 2.2 {
|
||||
do_catchsql_test 2.2 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(aaa);
|
||||
INSERT INTO t1(aaa) VALUES(9);
|
||||
@ -136,7 +136,7 @@ do_execsql_test 2.2 {
|
||||
) WHERE bbb = 1
|
||||
)
|
||||
);
|
||||
} {9}
|
||||
} {1 {no such column: rowid}}
|
||||
|
||||
# Ticket https://www.sqlite.org/src/info/787fa716be3a7f65
|
||||
# Segfault due to multiple uses of the same subquery where the
|
||||
|
@ -127,7 +127,6 @@ foreach {tn noop sql} {
|
||||
21 0 "SELECT DISTINCT c2 FROM t3"
|
||||
|
||||
22 0 "SELECT DISTINCT * FROM (SELECT 1, 2, 3 UNION SELECT 4, 5, 6)"
|
||||
23 1 "SELECT DISTINCT rowid FROM (SELECT 1, 2, 3 UNION SELECT 4, 5, 6)"
|
||||
|
||||
24 0 "SELECT DISTINCT rowid/2 FROM t1"
|
||||
25 1 "SELECT DISTINCT rowid/2, rowid FROM t1"
|
||||
|
@ -294,17 +294,22 @@ do_test minmax-8.2 {
|
||||
# is a subquery.
|
||||
#
|
||||
ifcapable {compound && subquery} {
|
||||
do_test minmax-9.0 {
|
||||
execsql {
|
||||
SELECT max(rowid) AS yy FROM t4 UNION SELECT max(rowid) FROM t5
|
||||
}
|
||||
} {3}
|
||||
do_test minmax-9.1 {
|
||||
execsql {
|
||||
SELECT max(rowid) FROM (
|
||||
SELECT max(rowid) FROM t4 UNION SELECT max(rowid) FROM t5
|
||||
SELECT max(yy) FROM (
|
||||
SELECT max(rowid) AS yy FROM t4 UNION SELECT max(rowid) FROM t5
|
||||
)
|
||||
}
|
||||
} {{}}
|
||||
} {3}
|
||||
do_test minmax-9.2 {
|
||||
execsql {
|
||||
SELECT max(rowid) FROM (
|
||||
SELECT max(rowid) FROM t4 EXCEPT SELECT max(rowid) FROM t5
|
||||
SELECT max(yy) FROM (
|
||||
SELECT max(rowid) AS yy FROM t4 EXCEPT SELECT max(rowid) FROM t5
|
||||
)
|
||||
}
|
||||
} {{}}
|
||||
|
@ -283,17 +283,22 @@ do_test minmax2-8.2 {
|
||||
# is a subquery.
|
||||
#
|
||||
ifcapable {compound && subquery} {
|
||||
do_test minmax2-9.0 {
|
||||
execsql {
|
||||
SELECT max(rowid) FROM t4 UNION SELECT max(rowid) FROM t5
|
||||
}
|
||||
} {3}
|
||||
do_test minmax2-9.1 {
|
||||
execsql {
|
||||
SELECT max(rowid) FROM (
|
||||
SELECT max(rowid) FROM t4 UNION SELECT max(rowid) FROM t5
|
||||
SELECT max(yy) FROM (
|
||||
SELECT max(rowid) AS yy FROM t4 UNION SELECT max(rowid) FROM t5
|
||||
)
|
||||
}
|
||||
} {{}}
|
||||
} {3}
|
||||
do_test minmax2-9.2 {
|
||||
execsql {
|
||||
SELECT max(rowid) FROM (
|
||||
SELECT max(rowid) FROM t4 EXCEPT SELECT max(rowid) FROM t5
|
||||
SELECT max(yy) FROM (
|
||||
SELECT max(rowid) AS yy FROM t4 EXCEPT SELECT max(rowid) FROM t5
|
||||
)
|
||||
}
|
||||
} {{}}
|
||||
|
@ -54,17 +54,22 @@ do_test misc2-2.1 {
|
||||
}
|
||||
} {}
|
||||
ifcapable subquery {
|
||||
do_test misc2-2.2 {
|
||||
execsql {
|
||||
SELECT rowid, * FROM (SELECT * FROM t1, t2);
|
||||
}
|
||||
} {{} 1 2 3 7 8 9}
|
||||
do_catchsql_test misc2-2.2 {
|
||||
SELECT rowid, * FROM (SELECT * FROM t1, t2);
|
||||
} {1 {no such column: rowid}}
|
||||
do_catchsql_test misc2-2.2b {
|
||||
SELECT 'rowid', * FROM (SELECT * FROM t1, t2);
|
||||
} {0 {rowid 1 2 3 7 8 9}}
|
||||
}
|
||||
|
||||
ifcapable view {
|
||||
do_catchsql_test misc2-2.3 {
|
||||
CREATE VIEW v1 AS SELECT * FROM t1, t2;
|
||||
SELECT rowid, * FROM v1;
|
||||
} {1 {no such column: rowid}}
|
||||
do_catchsql_test misc2-2.3b {
|
||||
SELECT 'rowid', * FROM v1;
|
||||
} {0 {rowid 1 2 3 7 8 9}}
|
||||
} ;# ifcapable view
|
||||
|
||||
# Ticket #2002 and #1952.
|
||||
|
@ -100,7 +100,7 @@ do_execsql_test misc8-2.1 {
|
||||
|
||||
# 2016-02-26: An assertion fault found by the libFuzzer project
|
||||
#
|
||||
do_execsql_test misc8-3.0 {
|
||||
do_catchsql_test misc8-3.0 {
|
||||
SELECT *
|
||||
FROM
|
||||
(
|
||||
@ -110,7 +110,7 @@ do_execsql_test misc8-3.0 {
|
||||
(SELECT 6 AS j UNION ALL SELECT 7) AS x4
|
||||
WHERE i<rowid
|
||||
ORDER BY 1;
|
||||
} {0 1 6 0 1 7}
|
||||
} {1 {no such column: rowid}}
|
||||
|
||||
# The SQLITE_DBCONFIG_MAINDBNAME interface
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user