1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-11 12:22:51 +03:00

Within the special new.* and old.* tables of a trigger, recognize all the

original table names even if those names overload the "rowid", "oid", or
"_rowid_" special names.  Ticket [34d2ae1c6d0].

FossilOrigin-Name: 1a0e5fa9f0ff792c678c99d49960601a0cef925b
This commit is contained in:
drh
2009-12-29 23:39:04 +00:00
parent 8718183ea5
commit 25e978df92
4 changed files with 154 additions and 18 deletions

View File

@@ -243,19 +243,18 @@ static int lookupName(
int iCol;
pSchema = pTab->pSchema;
cntTab++;
if( sqlite3IsRowid(zCol) ){
iCol = -1;
}else{
for(iCol=0; iCol<pTab->nCol; iCol++){
Column *pCol = &pTab->aCol[iCol];
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
if( iCol==pTab->iPKey ){
iCol = -1;
}
break;
for(iCol=0; iCol<pTab->nCol; iCol++){
Column *pCol = &pTab->aCol[iCol];
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
if( iCol==pTab->iPKey ){
iCol = -1;
}
break;
}
}
if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) ){
iCol = -1;
}
if( iCol<pTab->nCol ){
cnt++;
if( iCol<0 ){