mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Allow CREATE and DROP VIEW on attached databases. (CVS 1485)
FossilOrigin-Name: ad879a957d93c0b49c289947826b451d3ea37e5b
This commit is contained in:
@@ -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)
|
||||
){
|
||||
|
||||
Reference in New Issue
Block a user