mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Improved assert()s on the sqlite3ExprListDup() logic for TK_SELECT_COLUMN.
FossilOrigin-Name: 14da99d41f7968bf816203b4ae11c1f0d1ee0b5d
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Test\scases\sfor\sthe\srow-value\sUPDATE\sTRIGGER\sfix.
|
C Improved\sassert()s\son\sthe\ssqlite3ExprListDup()\slogic\sfor\sTK_SELECT_COLUMN.
|
||||||
D 2017-01-02T23:43:03.976
|
D 2017-01-03T00:27:16.468
|
||||||
F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
|
F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
|
||||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||||
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
|
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
|
||||||
@@ -341,7 +341,7 @@ F src/ctime.c 9f2296a4e5d26ebf0e0d95a0af4628f1ea694e7a
|
|||||||
F src/date.c dc3f1391d9297f8c748132813aaffcb117090d6e
|
F src/date.c dc3f1391d9297f8c748132813aaffcb117090d6e
|
||||||
F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
|
F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
|
||||||
F src/delete.c c8bc10d145c9666a34ae906250326fdaa8d58fa5
|
F src/delete.c c8bc10d145c9666a34ae906250326fdaa8d58fa5
|
||||||
F src/expr.c c2be1c1ae369dc14ba9e76831466b3a494986872
|
F src/expr.c e115097aa866a462051ac8430757638dc1d73f1c
|
||||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||||
F src/fkey.c 2e9aabe1aee76273aff8a84ee92c464e095400ae
|
F src/fkey.c 2e9aabe1aee76273aff8a84ee92c464e095400ae
|
||||||
F src/func.c d8582ee91975975645f206db332c38f534b783ad
|
F src/func.c d8582ee91975975645f206db332c38f534b783ad
|
||||||
@@ -1541,7 +1541,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P 2caaaab5e07f6b76d66fbe4e93a4b956937427d8
|
P b9b964373c89a491649f366ad7d70ae4d69b891d
|
||||||
R 1083f74702d2e1110eb1d37d8553d935
|
R b890811ca8348b8ceda7efec0ae53743
|
||||||
U drh
|
U drh
|
||||||
Z d43bfd5db806552d45260c4ffdcc3bd0
|
Z f487608154c66bed79f05de2b11f93c4
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
b9b964373c89a491649f366ad7d70ae4d69b891d
|
14da99d41f7968bf816203b4ae11c1f0d1ee0b5d
|
||||||
12
src/expr.c
12
src/expr.c
@@ -1295,6 +1295,7 @@ ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){
|
|||||||
ExprList *pNew;
|
ExprList *pNew;
|
||||||
struct ExprList_item *pItem, *pOldItem;
|
struct ExprList_item *pItem, *pOldItem;
|
||||||
int i;
|
int i;
|
||||||
|
Expr *pPriorSelectCol = 0;
|
||||||
assert( db!=0 );
|
assert( db!=0 );
|
||||||
if( p==0 ) return 0;
|
if( p==0 ) return 0;
|
||||||
pNew = sqlite3DbMallocRawNN(db, sizeof(*pNew) );
|
pNew = sqlite3DbMallocRawNN(db, sizeof(*pNew) );
|
||||||
@@ -1311,7 +1312,6 @@ ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){
|
|||||||
Expr *pOldExpr = pOldItem->pExpr;
|
Expr *pOldExpr = pOldItem->pExpr;
|
||||||
Expr *pNewExpr;
|
Expr *pNewExpr;
|
||||||
pItem->pExpr = sqlite3ExprDup(db, pOldExpr, flags);
|
pItem->pExpr = sqlite3ExprDup(db, pOldExpr, flags);
|
||||||
assert( pItem->pExpr==0 || db->mallocFailed==0 );
|
|
||||||
if( pOldExpr
|
if( pOldExpr
|
||||||
&& pOldExpr->op==TK_SELECT_COLUMN
|
&& pOldExpr->op==TK_SELECT_COLUMN
|
||||||
&& (pNewExpr = pItem->pExpr)!=0
|
&& (pNewExpr = pItem->pExpr)!=0
|
||||||
@@ -1319,9 +1319,13 @@ ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){
|
|||||||
assert( pNewExpr->iColumn==0 || i>0 );
|
assert( pNewExpr->iColumn==0 || i>0 );
|
||||||
if( pNewExpr->iColumn==0 ){
|
if( pNewExpr->iColumn==0 ){
|
||||||
assert( pOldExpr->pLeft==pOldExpr->pRight );
|
assert( pOldExpr->pLeft==pOldExpr->pRight );
|
||||||
pNewExpr->pLeft = pNewExpr->pRight;
|
pPriorSelectCol = pNewExpr->pLeft = pNewExpr->pRight;
|
||||||
}else if( ALWAYS(pItem[-1].pExpr!=0) ){
|
}else{
|
||||||
pNewExpr->pLeft = pItem[-1].pExpr->pLeft;
|
assert( i>0 );
|
||||||
|
assert( pItem[-1].pExpr!=0 );
|
||||||
|
assert( pNewExpr->iColumn==pItem[-1].pExpr->iColumn+1 );
|
||||||
|
assert( pPriorSelectCol==pItem[-1].pExpr->pLeft );
|
||||||
|
pNewExpr->pLeft = pPriorSelectCol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
|
pItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
|
||||||
|
|||||||
Reference in New Issue
Block a user