-C Use\ssqlite3NestedParse\sto\simplement\sCREATE\sINDEX.\s(CVS\s2070)
-D 2004-11-05T20:58:40
+C Use\ssqlite3NestedParse\sto\simplement\sDROP\sINDEX.\s(CVS\s2071)
+D 2004-11-05T22:18:49
F Makefile.in c4d2416860f472a1e3393714d0372074197565df
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
F src/auth.c 3b81f2a42f48a62c2c9c9b0eda31a157c681edea
F src/btree.c bf0d3d59ec076f0a37378f8ac6090d157d925c24
F src/btree.h 861e40b759a195ba63819740e484390012cf81ab
-F src/build.c d1234774c8eec8f4e0365da14931236ac9ff323b
+F src/build.c e498f958ebb4678e103224edd3a5c2ebcc42d18f
F src/date.c 34bdb0082db7ec2a83ef00063f7b44e61ee19dad
F src/delete.c f0af21a1ede15524a5edd59fe10ef486283a1ee9
F src/expr.c be18081d2959a2cc53846d0fbedfec40fbfa1d6e
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl fdacb0ba2d39831e8a6240d05a490026ad4c4e4c
-P b0506bdd701339d63166ada065445776dd499588
-R b008b9e3c2a495feb1a9866c40c60982
+P 47d8ebdaaddcb7a05e1917dd1dee2029c34228a4
+R d45e3580de79d7367f59fbd57af5e6a1
U drh
-Z 363f59f6d239c3e53daa03d8d94862e0
+Z 4c43f2f11733856473822a7670e21c59
** PRAGMA
**
<<<<<<< build.c
-** $Id: build.c,v 1.269 2004/11/05 20:58:40 drh Exp $
+** $Id: build.c,v 1.270 2004/11/05 22:18:49 drh Exp $
=======
-** $Id: build.c,v 1.269 2004/11/05 20:58:40 drh Exp $
+** $Id: build.c,v 1.270 2004/11/05 22:18:49 drh Exp $
>>>>>>> 1.262
*/
#include "sqliteInt.h"
*/
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){
sqlite3BeginWriteOperation(pParse, 0, iDb);
+
/* Every time a new table is created the file-format
** and encoding meta-values are set in the database, in
** case this is the first table created.
/* This just creates a place-holder record in the sqlite_master table.
** The record created does not contain anything yet. It will be replaced
** by the real entry in code generated at sqlite3EndTable().
+ **
+ ** The rowid for the new entry is left on the top of the stack.
+ ** The rowid value is needed by the code that sqlite3EndTable will
+ ** generate.
*/
sqlite3OpenMasterTable(v, iDb);
sqlite3VdbeAddOp(v, OP_NewRecno, 0, 0);
/* Generate code to remove the index and from the master table */
v = sqlite3GetVdbe(pParse);
if( v ){
- static const VdbeOpList dropIndex[] = {
- { OP_Rewind, 0, ADDR(9), 0},
- { OP_String8, 0, 0, 0}, /* 1 */
- { OP_MemStore, 1, 1, 0},
- { OP_MemLoad, 1, 0, 0}, /* 3 */
- { OP_Column, 0, 1, 0},
- { OP_Eq, 0, ADDR(8), 0},
- { OP_Next, 0, ADDR(3), 0},
- { OP_Goto, 0, ADDR(9), 0},
- { OP_Delete, 0, 0, 0}, /* 8 */
- };
- int base;
-
- sqlite3BeginWriteOperation(pParse, 0, pIndex->iDb);
- sqlite3OpenMasterTable(v, pIndex->iDb);
- base = sqlite3VdbeAddOpList(v, ArraySize(dropIndex), dropIndex);
- sqlite3VdbeChangeP3(v, base+1, pIndex->zName, 0);
- sqlite3ChangeCookie(db, v, pIndex->iDb);
- /* sqlite3VdbeAddOp(v, OP_Destroy, pIndex->tnum, pIndex->iDb); */
- destroyRootPage(pParse, pIndex->tnum, pIndex->iDb);
- sqlite3VdbeAddOp(v, OP_Close, 0, 0);
- sqlite3VdbeOp3(v, OP_DropIndex, pIndex->iDb, 0, pIndex->zName, 0);
+ int iDb = pIndex->iDb;
+ sqlite3NestedParse(pParse,
+ "DELETE FROM %Q.%s WHERE name=%Q",
+ db->aDb[iDb].zName, SCHEMA_TABLE(iDb),
+ pIndex->zName
+ );
+ sqlite3ChangeCookie(db, v, iDb);
+ destroyRootPage(pParse, pIndex->tnum, iDb);
+ sqlite3VdbeOp3(v, OP_DropIndex, iDb, 0, pIndex->zName, 0);
}
exit_drop_index: