1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Fix a memory leak in triggers and update tests to show the latest error

message text. (CVS 886)

FossilOrigin-Name: b90d9de32d10a71fe81f5bfd0cf57faae8c5c3b4
This commit is contained in:
drh
2003-03-30 00:19:49 +00:00
parent 812d7a21dd
commit 0be9df076a
7 changed files with 43 additions and 25 deletions

View File

@@ -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++;