mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
New testcase() macros. Fix a problem with INSERT when the IPK is to the
right of generated columns. FossilOrigin-Name: 412799fc5527aaca987e4e04b8a4f774dcdb70fb80e3a126dc3a26d48a66935c
This commit is contained in:
12
src/update.c
12
src/update.c
@@ -313,7 +313,9 @@ void sqlite3Update(
|
||||
chngPk = 1;
|
||||
}
|
||||
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
else if( pTab->aCol[j].colFlags & (COLFLAG_STORED|COLFLAG_VIRTUAL) ){
|
||||
else if( pTab->aCol[j].colFlags & COLFLAG_GENERATED ){
|
||||
testcase( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL );
|
||||
testcase( pTab->aCol[i].colFlags & COLFLAG_STORED );
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"cannot UPDATE generated column \"%s\"",
|
||||
pTab->aCol[j].zName);
|
||||
@@ -693,7 +695,9 @@ void sqlite3Update(
|
||||
}
|
||||
}
|
||||
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
if( pTab->tabFlags & (TF_HasStored|TF_HasVirtual) ){
|
||||
if( pTab->tabFlags & TF_HasGenerated ){
|
||||
testcase( pTab->tabFlags & TF_HasVirtual );
|
||||
testcase( pTab->tabFlags & TF_HasStored );
|
||||
sqlite3ComputeGeneratedColumns(pParse, regNew, pTab);
|
||||
}
|
||||
#endif
|
||||
@@ -737,7 +741,9 @@ void sqlite3Update(
|
||||
}
|
||||
}
|
||||
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
if( pTab->tabFlags & (TF_HasStored|TF_HasVirtual) ){
|
||||
if( pTab->tabFlags & TF_HasGenerated ){
|
||||
testcase( pTab->tabFlags & TF_HasVirtual );
|
||||
testcase( pTab->tabFlags & TF_HasStored );
|
||||
sqlite3ComputeGeneratedColumns(pParse, regNew, pTab);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user