aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/build.c9
-rw-r--r--src/parse.y10
-rw-r--r--src/sqliteInt.h4
3 files changed, 13 insertions, 10 deletions
diff --git a/src/build.c b/src/build.c
index d3b9cb709..92efbf084 100644
--- a/src/build.c
+++ b/src/build.c
@@ -23,7 +23,7 @@
** ROLLBACK
** PRAGMA
**
-** $Id: build.c,v 1.195 2004/05/28 12:11:21 danielk1977 Exp $
+** $Id: build.c,v 1.196 2004/05/28 12:33:31 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1148,7 +1148,8 @@ void sqlite3EndTable(Parse *pParse, Token *pEnd, Select *pSelect){
void sqlite3CreateView(
Parse *pParse, /* The parsing context */
Token *pBegin, /* The CREATE token that begins the statement */
- Token *pName, /* The token that holds the name of the view */
+ Token *pName1, /* The token that holds the name of the view */
+ Token *pName2, /* The token that holds the name of the view */
Select *pSelect, /* A SELECT statement that will become the new view */
int isTemp /* TRUE for a TEMPORARY view */
){
@@ -1157,13 +1158,15 @@ void sqlite3CreateView(
const char *z;
Token sEnd;
DbFixer sFix;
+ Token *pName;
- sqlite3StartTable(pParse, pBegin, pName, 0, isTemp, 1);
+ sqlite3StartTable(pParse, pBegin, pName1, pName2, isTemp, 1);
p = pParse->pNewTable;
if( p==0 || pParse->nErr ){
sqlite3SelectDelete(pSelect);
return;
}
+ resolveSchemaName(pParse, pName1, pName2, &pName);
if( sqlite3FixInit(&sFix, pParse, p->iDb, "view", pName)
&& sqlite3FixSelect(&sFix, pSelect)
){
diff --git a/src/parse.y b/src/parse.y
index 7681ebc41..6f3a34e27 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
-** @(#) $Id: parse.y,v 1.121 2004/05/28 12:11:21 danielk1977 Exp $
+** @(#) $Id: parse.y,v 1.122 2004/05/28 12:33:31 danielk1977 Exp $
*/
%token_prefix TK_
%token_type {Token}
@@ -268,11 +268,11 @@ cmd ::= DROP TABLE nm(X) dbnm(Y). {
///////////////////// The CREATE VIEW statement /////////////////////////////
//
-cmd ::= CREATE(X) temp(T) VIEW nm(Y) AS select(S). {
- sqlite3CreateView(pParse, &X, &Y, S, T);
+cmd ::= CREATE(X) temp(T) VIEW nm(Y) dbnm(Z) AS select(S). {
+ sqlite3CreateView(pParse, &X, &Y, &Z, S, T);
}
-cmd ::= DROP VIEW nm(X). {
- sqlite3DropTable(pParse, &X, 1);
+cmd ::= DROP VIEW nm(X) dbnm(Y). {
+ sqlite3DropTable(pParse, sqlite3SrcListAppend(0,&X,&Y), 1);
}
//////////////////////// The SELECT statement /////////////////////////////////
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 37c94ec08..7f7e049dd 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.258 2004/05/28 12:11:21 danielk1977 Exp $
+** @(#) $Id: sqliteInt.h,v 1.259 2004/05/28 12:33:31 danielk1977 Exp $
*/
#include "config.h"
#include "sqlite.h"
@@ -1209,7 +1209,7 @@ void sqlite3AddCollateType(Parse*, const char*, int);
CollSeq *sqlite3ChangeCollatingFunction(sqlite*,const char*,int,
void*, int(*)(void*,int,const void*,int,const void*));
void sqlite3EndTable(Parse*,Token*,Select*);
-void sqlite3CreateView(Parse*,Token*,Token*,Select*,int);
+void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int);
int sqlite3ViewGetColumnNames(Parse*,Table*);
void sqlite3DropTable(Parse*, SrcList*, int);
void sqlite3DeleteTable(sqlite*, Table*);