aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/build.c10
-rw-r--r--src/trigger.c3
2 files changed, 10 insertions, 3 deletions
diff --git a/src/build.c b/src/build.c
index 12f54a59b..141d15f14 100644
--- a/src/build.c
+++ b/src/build.c
@@ -25,7 +25,7 @@
** ROLLBACK
** PRAGMA
**
-** $Id: build.c,v 1.135 2003/03/27 13:50:00 drh Exp $
+** $Id: build.c,v 1.136 2003/03/30 00:19:50 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1452,7 +1452,13 @@ void sqliteCreateIndex(
pTab = pParse->pNewTable;
}
if( pTab==0 || pParse->nErr ) goto exit_create_index;
- if( !isTemp && (pTab->readOnly || pTab->iDb>=2) ){
+ if( pTab->readOnly ){
+ sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName,
+ " may not be indexed", 0);
+ pParse->nErr++;
+ goto exit_create_index;
+ }
+ if( !isTemp && pTab->iDb>=2 ){
sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName,
" may not have non-temporary indices added", 0);
pParse->nErr++;
diff --git a/src/trigger.c b/src/trigger.c
index 2b7d35a24..7e48e4d57 100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -171,6 +171,7 @@ void sqliteCreateTrigger(
/* Attach it to the table object */
nt->pNext = tab->pTrigger;
tab->pTrigger = nt;
+ sqliteSrcListDelete(pTableName);
return;
}else{
sqliteFree(nt->name);
@@ -380,7 +381,7 @@ void sqliteDropTrigger(Parse *pParse, SrcList *pName, int nested){
if( pTable->iDb ) code = SQLITE_DROP_TEMP_TRIGGER;
if( sqliteAuthCheck(pParse, code, pTrigger->name, pTable->zName) ||
sqliteAuthCheck(pParse, SQLITE_DELETE, SCHEMA_TABLE(pTable->iDb),0) ){
- return;
+ goto drop_trigger_cleanup;
}
}
#endif