diff options
author | drh <drh@noemail.net> | 2018-11-06 14:03:07 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-11-06 14:03:07 +0000 |
commit | fc25721c9e044a23b2a4ab904c68bbbe338d8165 (patch) | |
tree | 71cc4c91b9cc9c71756582ced2e6282d2339ea31 /src/delete.c | |
parent | 5a65470300814c4f26c4952487385e33e5f286c2 (diff) | |
download | sqlite-fc25721c9e044a23b2a4ab904c68bbbe338d8165.tar.gz sqlite-fc25721c9e044a23b2a4ab904c68bbbe338d8165.zip |
Only allow shadow table to be written from within a recursive SQL call.
Omit the SQLITE_PREPARE_SHADOW flag. Some tests are failing because the
tests depend on being able to write to shadow tables.
FossilOrigin-Name: d890c6582524677666e6f5b5817331dec332ade16b2f744cbb8a3c7dd9b63e21
Diffstat (limited to 'src/delete.c')
-rw-r--r-- | src/delete.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/delete.c b/src/delete.c index c015eb43e..932520382 100644 --- a/src/delete.c +++ b/src/delete.c @@ -57,8 +57,9 @@ int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){ ** 2) It is a system table (i.e. sqlite_master), this call is not ** part of a nested parse and writable_schema pragma has not ** been specified. - ** 3) The table is a shadow table and the SQLITE_PREPARE_SHADOW flag - ** is omitted. + ** 3) The table is a shadow table and the current sqlite3_prepare() + ** is for a top-level SQL statement, not a nested SQL statement + ** issued by a virtual table implementation. ** ** In either case leave an error message in pParse and return non-zero. */ @@ -68,7 +69,7 @@ int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){ && sqlite3WritableSchema(pParse->db)==0 && pParse->nested==0) || ( (pTab->tabFlags & TF_Shadow)!=0 - && pParse->writeShadow==0) + && pParse->db->nVdbeExec==0) ){ sqlite3ErrorMsg(pParse, "table %s may not be modified", pTab->zName); return 1; |