mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Add support for IF NOT EXISTS on CREATE VIRTUAL TABLE.
FossilOrigin-Name: 230983e86a897caa91a487ef2d4c1c7fb7c79f10
This commit is contained in:
@@ -278,13 +278,14 @@ void sqlite3VtabBeginParse(
|
||||
Parse *pParse, /* Parsing context */
|
||||
Token *pName1, /* Name of new table, or database name */
|
||||
Token *pName2, /* Name of new table or NULL */
|
||||
Token *pModuleName /* Name of the module for the virtual table */
|
||||
Token *pModuleName, /* Name of the module for the virtual table */
|
||||
int ifNotExists /* No error if the table already exists */
|
||||
){
|
||||
int iDb; /* The database the table is being created in */
|
||||
Table *pTable; /* The new virtual table */
|
||||
sqlite3 *db; /* Database connection */
|
||||
|
||||
sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0);
|
||||
sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, ifNotExists);
|
||||
pTable = pParse->pNewTable;
|
||||
if( pTable==0 ) return;
|
||||
assert( 0==pTable->pIndex );
|
||||
@@ -319,7 +320,7 @@ void sqlite3VtabBeginParse(
|
||||
** virtual table currently under construction in pParse->pTable.
|
||||
*/
|
||||
static void addArgumentToVtab(Parse *pParse){
|
||||
if( pParse->sArg.z && ALWAYS(pParse->pNewTable) ){
|
||||
if( pParse->sArg.z && pParse->pNewTable ){
|
||||
const char *z = (const char*)pParse->sArg.z;
|
||||
int n = pParse->sArg.n;
|
||||
sqlite3 *db = pParse->db;
|
||||
|
Reference in New Issue
Block a user