1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-07 20:22:20 +03:00

Add support for DROP TABLE IF EXISTS. (CVS 2843)

FossilOrigin-Name: a4c547de83d8b27f06a58f9e530a7c983ec1dc3a
This commit is contained in:
drh
2005-12-29 01:11:36 +00:00
parent ab8aa68325
commit a073384f08
9 changed files with 56 additions and 35 deletions

View File

@@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
** $Id: build.c,v 1.361 2005/12/21 18:36:46 drh Exp $
** $Id: build.c,v 1.362 2005/12/29 01:11:37 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1754,7 +1754,7 @@ static void destroyTable(Parse *pParse, Table *pTab){
** This routine is called to do the work of a DROP TABLE statement.
** pName is the name of the table to be dropped.
*/
void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
Table *pTab;
Vdbe *v;
sqlite3 *db = pParse->db;
@@ -1764,7 +1764,12 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
assert( pName->nSrc==1 );
pTab = sqlite3LocateTable(pParse, pName->a[0].zName, pName->a[0].zDatabase);
if( pTab==0 ) goto exit_drop_table;
if( pTab==0 ){
if( noErr ){
sqlite3ErrorClear(pParse);
}
goto exit_drop_table;
}
iDb = pTab->iDb;
assert( iDb>=0 && iDb<db->nDb );
#ifndef SQLITE_OMIT_AUTHORIZATION