1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Add tests to ensure an INSERT/UPDATE/DELETE immediately after virtual table construction does not fail. (CVS 3270)

FossilOrigin-Name: 144d0eb13aed4507e93edec781b1819a068f4a70
This commit is contained in:
danielk1977
2006-06-19 03:05:10 +00:00
parent fdb83b2fa1
commit b3d24bf8ee
8 changed files with 97 additions and 24 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** in order to generate code for DELETE FROM statements.
**
** $Id: delete.c,v 1.126 2006/06/16 16:08:55 danielk1977 Exp $
** $Id: delete.c,v 1.127 2006/06/19 03:05:10 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -155,7 +155,7 @@ void sqlite3DeleteFrom(
/* If pTab is really a view, make sure it has been initialized.
*/
if( isView && sqlite3ViewGetColumnNames(pParse, pTab) ){
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
goto delete_from_cleanup;
}

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
** $Id: insert.c,v 1.169 2006/06/16 16:08:55 danielk1977 Exp $
** $Id: insert.c,v 1.170 2006/06/19 03:05:10 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -272,8 +272,10 @@ void sqlite3Insert(
assert( pTab!=0 );
/* If pTab is really a view, make sure it has been initialized.
** ViewGetColumnNames() is a no-op if pTab is not a view (or virtual
** module table).
*/
if( isView && sqlite3ViewGetColumnNames(pParse, pTab) ){
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
goto insert_cleanup;
}

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle UPDATE statements.
**
** $Id: update.c,v 1.130 2006/06/17 09:39:56 danielk1977 Exp $
** $Id: update.c,v 1.131 2006/06/19 03:05:10 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -141,10 +141,8 @@ void sqlite3Update(
if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){
goto update_cleanup;
}
if( isView ){
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
goto update_cleanup;
}
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
goto update_cleanup;
}
aXRef = sqliteMallocRaw( sizeof(int) * pTab->nCol );
if( aXRef==0 ) goto update_cleanup;