mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Do not allow triggers on the SQLITE_MASTER table. (CVS 579)
FossilOrigin-Name: 275ba356f351abcf9a079ac16b765c9443750f0e
This commit is contained in:
@ -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.66 2002/05/21 11:38:12 drh Exp $
|
||||
** @(#) $Id: parse.y,v 1.67 2002/05/23 00:30:31 drh Exp $
|
||||
*/
|
||||
%token_prefix TK_
|
||||
%token_type {Token}
|
||||
@ -124,6 +124,7 @@ id(A) ::= OFFSET(X). {A = X;}
|
||||
id(A) ::= PRAGMA(X). {A = X;}
|
||||
id(A) ::= REPLACE(X). {A = X;}
|
||||
id(A) ::= ROW(X). {A = X;}
|
||||
id(A) ::= STATEMENT(X). {A = X;}
|
||||
id(A) ::= TEMP(X). {A = X;}
|
||||
id(A) ::= TRIGGER(X). {A = X;}
|
||||
id(A) ::= VACUUM(X). {A = X;}
|
||||
|
@ -15,7 +15,7 @@
|
||||
** individual tokens and sends those tokens one-by-one over to the
|
||||
** parser for analysis.
|
||||
**
|
||||
** $Id: tokenize.c,v 1.41 2002/05/15 08:30:14 danielk1977 Exp $
|
||||
** $Id: tokenize.c,v 1.42 2002/05/23 00:30:31 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@ -100,6 +100,7 @@ static Keyword aKeywordTable[] = {
|
||||
{ "ROW", 0, TK_ROW, 0 },
|
||||
{ "SELECT", 0, TK_SELECT, 0 },
|
||||
{ "SET", 0, TK_SET, 0 },
|
||||
{ "STATEMENT", 0, TK_STATEMENT, 0 },
|
||||
{ "TABLE", 0, TK_TABLE, 0 },
|
||||
{ "TEMP", 0, TK_TEMP, 0 },
|
||||
{ "TEMPORARY", 0, TK_TEMP, 0 },
|
||||
|
@ -60,6 +60,12 @@ void sqliteCreateTrigger(
|
||||
pParse->nErr++;
|
||||
goto trigger_cleanup;
|
||||
}
|
||||
if( sqliteStrICmp(tab->zName, MASTER_NAME)==0 ){
|
||||
sqliteSetString(&pParse->zErrMsg, "cannot create trigger on system "
|
||||
"table: " MASTER_NAME, 0);
|
||||
pParse->nErr++;
|
||||
goto trigger_cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/* Build the Trigger object */
|
||||
|
Reference in New Issue
Block a user