mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Combine the Parse.ckBase and Parse.iSelfTab fields into just Parse.iSelfTab.
This fixes a problem with date/time functions in check-constraints. Add some test cases for date/time functions in index expressions and check constraints. FossilOrigin-Name: 22eda0985ecd1f456c073e6ad735a8417f3ff1fb6aaad1640e1cec01e50c51d8
This commit is contained in:
@@ -3484,9 +3484,9 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
|
||||
case TK_COLUMN: {
|
||||
int iTab = pExpr->iTable;
|
||||
if( iTab<0 ){
|
||||
if( pParse->ckBase>0 ){
|
||||
if( pParse->iSelfTab<0 ){
|
||||
/* Generating CHECK constraints or inserting into partial index */
|
||||
return pExpr->iColumn + pParse->ckBase;
|
||||
return pExpr->iColumn - pParse->iSelfTab;
|
||||
}else{
|
||||
/* Coding an expression that is part of an index where column names
|
||||
** in the index refer to the table to which the index belongs */
|
||||
|
||||
Reference in New Issue
Block a user