mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Remove the SQLITE_PREPARE_SAFEOPT flag. The name is obsolete and it is at the
wrong level. Instead use the SF_UpdateFrom flags on the Select object. FossilOrigin-Name: 78723a9a7e72b42d28fc5645661da17f20cedcf864819b861800ad9340007be1
This commit is contained in:
18
manifest
18
manifest
@@ -1,5 +1,5 @@
|
||||
C Do\snot\sallow\sOOM\sfaults\sin\sEQP\smessages\sassociated\swith\sautomatic\sindexes\non\sco-routines\sto\sgo\sunreported.
|
||||
D 2022-12-09T17:33:21.007
|
||||
C Remove\sthe\sSQLITE_PREPARE_SAFEOPT\sflag.\s\sThe\sname\sis\sobsolete\sand\sit\sis\sat\sthe\nwrong\slevel.\s\sInstead\suse\sthe\sSF_UpdateFrom\sflags\son\sthe\sSelect\sobject.
|
||||
D 2022-12-09T18:26:15.981
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@@ -645,12 +645,12 @@ F src/printf.c e99ee9741e79ae3873458146f59644276657340385ade4e76a5f5d1c25793764
|
||||
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c efea4e5fbecfd6d0a9071b0be0d952620991673391b6ffaaf4c277b0bb674633
|
||||
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
|
||||
F src/select.c 6ec3f7a1760b302193e9155453d42598192f6ad07e875038bf1177e4ce7af728
|
||||
F src/select.c d4df3eb74a1b0e1bd5a95525f2b571baeef3e3bedcc9d6401152dc0e0bdd7384
|
||||
F src/shell.c.in bcf8552c82f2c84650e39a6d638373569c2035942c0497b83eef197169e0305a
|
||||
F src/sqlite.h.in 1fe1836879ecbb2e28f00f44eb6092db09a2a06bf072af351c6c2466bd515496
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h c4b9fa7a7e2bcdf850cfeb4b8a91d5ec47b7a00033bc996fd2ee96cbf2741f5f
|
||||
F src/sqliteInt.h 5a91a427ab821dd3db556411ec0bf0f02bea796ce9927183979c2a1954ae4630
|
||||
F src/sqliteInt.h ef0c1af2d7b46ce89fe698ce5f1a26d19110780ac19ec1ef5a227f7e51e97de3
|
||||
F src/sqliteLimit.h d7323ffea5208c6af2734574bae933ca8ed2ab728083caa117c9738581a31657
|
||||
F src/status.c 160c445d7d28c984a0eae38c144f6419311ed3eace59b44ac6dafc20db4af749
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
@@ -712,13 +712,13 @@ F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c 1305797eab3542a0896b552c6e7669c972c1468e11e92b370533c1f37a37082b
|
||||
F src/treeview.c 29b1dc7e0f84ba090734febe27393d4719682af0cae1b902d5ebf0236ecebea4
|
||||
F src/trigger.c 5e68b790f022b8dafbfb0eb244786512a95c9575fc198719d2557d73e5795858
|
||||
F src/update.c 3cf1cb45674177e09338bdbe5454fb62207c7f2eb8cea288e74286467e901959
|
||||
F src/update.c f118e51768d2c1309e3c81e9f91141b22b8a1339cbc5969b1b2d810feaa25b22
|
||||
F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145
|
||||
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
|
||||
F src/util.c 313f3154e2b85a447326f5dd15de8d31a4df6ab0c3579bd58f426ff634ec9050
|
||||
F src/vacuum.c 84ce7f01f8a7a08748e107a441db83bcec13970190ddcb0c9ff522adbc1c23fd
|
||||
F src/vdbe.c df9ff3fcaa3c60fa9b0bca340c3f3cfc63a51361901ca06fe18bdeadeb2a1a24
|
||||
F src/vdbe.h 934387e28f0a6b1a6a60904ddfe4ab61099e8767daf3cf59e6bbc3981d7ce426
|
||||
F src/vdbe.h 73b904a6b3bb27f308c6cc287a5751ebc7f1f89456be0ed068a12b92844c6e8c
|
||||
F src/vdbeInt.h 8651e4c4e04d1860d0bdcf330cb8294e3778a9d4222be30ce4c490d9220af783
|
||||
F src/vdbeapi.c df3f73a4d0a487f2068e3c84776cd6e3fba5ae80ff612659dcfda4307686420b
|
||||
F src/vdbeaux.c 25691b395bf57ae0a754570fc3ba2d6f8bd2f0a8944f1d2589b9e68114e01c2b
|
||||
@@ -2067,8 +2067,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 9243e850ae656d16adc8f0e5c4dcf3dcf476312cee192c39c38685fc437ccbbd
|
||||
R 007d4f781a18a8f9fcf2791b8d77bab0
|
||||
P d125d5afdf1b0a1c64fc64f180898099af07b8290ea9da49419df75d8b455f71
|
||||
R bf6e5a558d8631cb7969118db6751e4e
|
||||
U drh
|
||||
Z 822da98b746323e73cbe562572963994
|
||||
Z 2ad12df38bfb5c0313f6be39e7ec9c86
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@@ -1 +1 @@
|
||||
d125d5afdf1b0a1c64fc64f180898099af07b8290ea9da49419df75d8b455f71
|
||||
78723a9a7e72b42d28fc5645661da17f20cedcf864819b861800ad9340007be1
|
11
src/select.c
11
src/select.c
@@ -6878,7 +6878,7 @@ static int sameSrcAlias(SrcItem *p0, SrcList *pSrc){
|
||||
** (ii) There is nothing that would prevent the subquery from
|
||||
** being used as the outer loop if the sqlite3WhereBegin()
|
||||
** routine nominates it to that position.
|
||||
** (iii) The SQLITE_PREPARE_SAFEOPT flag is not set
|
||||
** (iii) The query is not a UPDATE ... FROM
|
||||
** (2) The subquery is not a CTE that should be materialized because of
|
||||
** the AS MATERIALIZED keywords
|
||||
** (3) The subquery is not part of a left operand for a RIGHT JOIN
|
||||
@@ -6888,7 +6888,8 @@ static int sameSrcAlias(SrcItem *p0, SrcList *pSrc){
|
||||
static int fromClauseTermCanBeCoroutine(
|
||||
Parse *pParse, /* Parsing context */
|
||||
SrcList *pTabList, /* FROM clause */
|
||||
int i /* Which term of the FROM clause holds the subquery */
|
||||
int i, /* Which term of the FROM clause holds the subquery */
|
||||
int selFlags /* Flags on the SELECT statement */
|
||||
){
|
||||
SrcItem *pItem = &pTabList->a[i];
|
||||
if( pItem->fg.isCte && pItem->u2.pCteUse->eM10d==M10d_Yes ) return 0;/* (2) */
|
||||
@@ -6900,10 +6901,10 @@ static int fromClauseTermCanBeCoroutine(
|
||||
if( i==0 ){
|
||||
if( pTabList->nSrc==1 ) return 1; /* (1a) */
|
||||
if( pTabList->a[1].fg.jointype & JT_CROSS ) return 1; /* (1b) */
|
||||
if( pParse->prepFlags & SQLITE_PREPARE_SAFEOPT ) return 0; /* (1c-iii) */
|
||||
if( selFlags & SF_UpdateFrom ) return 0; /* (1c-iii) */
|
||||
return 1;
|
||||
}
|
||||
if( pParse->prepFlags & SQLITE_PREPARE_SAFEOPT ) return 0; /* (1c-iii) */
|
||||
if( selFlags & SF_UpdateFrom ) return 0; /* (1c-iii) */
|
||||
while( 1 /*exit-by-break*/ ){
|
||||
if( pItem->fg.jointype & (JT_OUTER|JT_CROSS) ) return 0; /* (1c-ii) */
|
||||
if( i==0 ) break;
|
||||
@@ -7302,7 +7303,7 @@ int sqlite3Select(
|
||||
|
||||
/* Generate code to implement the subquery
|
||||
*/
|
||||
if( fromClauseTermCanBeCoroutine(pParse, pTabList, i) ){
|
||||
if( fromClauseTermCanBeCoroutine(pParse, pTabList, i, p->selFlags) ){
|
||||
/* Implement a co-routine that will return a single row of the result
|
||||
** set on each invocation.
|
||||
*/
|
||||
|
@@ -3466,6 +3466,7 @@ struct Select {
|
||||
#define SF_MultiPart 0x2000000 /* Has multiple incompatible PARTITIONs */
|
||||
#define SF_CopyCte 0x4000000 /* SELECT statement is a copy of a CTE */
|
||||
#define SF_OrderByReqd 0x8000000 /* The ORDER BY clause may not be omitted */
|
||||
#define SF_UpdateFrom 0x10000000 /* Query originates with UPDATE FROM */
|
||||
|
||||
/* True if S exists and has SF_NestedFrom */
|
||||
#define IsNestedFrom(S) ((S)!=0 && ((S)->selFlags&SF_NestedFrom)!=0)
|
||||
|
@@ -263,12 +263,12 @@ static void updateFromSelect(
|
||||
}
|
||||
}
|
||||
pSelect = sqlite3SelectNew(pParse, pList,
|
||||
pSrc, pWhere2, pGrp, 0, pOrderBy2, SF_UFSrcCheck|SF_IncludeHidden, pLimit2
|
||||
pSrc, pWhere2, pGrp, 0, pOrderBy2,
|
||||
SF_UFSrcCheck|SF_IncludeHidden|SF_UpdateFrom, pLimit2
|
||||
);
|
||||
if( pSelect ) pSelect->selFlags |= SF_OrderByReqd;
|
||||
sqlite3SelectDestInit(&dest, eDest, iEph);
|
||||
dest.iSDParm2 = (pPk ? pPk->nKeyCol : -1);
|
||||
pParse->prepFlags |= SQLITE_PREPARE_SAFEOPT;
|
||||
sqlite3Select(pParse, pSelect, &dest);
|
||||
sqlite3SelectDelete(db, pSelect);
|
||||
}
|
||||
|
@@ -169,7 +169,6 @@ typedef struct VdbeOpList VdbeOpList;
|
||||
** Additional non-public SQLITE_PREPARE_* flags
|
||||
*/
|
||||
#define SQLITE_PREPARE_SAVESQL 0x80 /* Preserve SQL text */
|
||||
#define SQLITE_PREPARE_SAFEOPT 0x40 /* Use only safe optimizations */
|
||||
#define SQLITE_PREPARE_MASK 0x0f /* Mask of public flags */
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user