Remove the unused upgrade_3_schema subroutine from main.c. (CVS 1356)

FossilOrigin-Name: b5d2771ee0e9c77967b4a64a97dcd56c067bc7b8
This commit is contained in:
drh 2004-05-11 09:05:48 +00:00
parent 9400f26176
commit 33825340cb
3 changed files with 9 additions and 62 deletions

View File

@ -1,5 +1,5 @@
C More\ssmall\schanges\sto\sget\stest\scases\sto\sexecute.\s(CVS\s1355)
D 2004-05-11T08:48:11
C Remove\sthe\sunused\supgrade_3_schema\ssubroutine\sfrom\smain.c.\s(CVS\s1356)
D 2004-05-11T09:05:49
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@ -36,7 +36,7 @@ F src/func.c 6cf6501f092b41c8cd9368b09c287016c0576438
F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f
F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb
F src/insert.c 1e63d2774c4d893363e0c072f19d4c92a4ab982d
F src/main.c 2732115c888440caaebf50fc791b13cfdcc5dcd7
F src/main.c 170992aeeec83b260ef5cfb1e56ecf94b6d79b46
F src/md5.c 8e39fdae6d8776b87558e91dcc94740c9b635a9c
F src/os.c ddcda92f7fd71b4513c57c1ec797917f206d504e
F src/os.h fbb2f6595fc34fa351830d88fe1c6b85118f0383
@ -188,7 +188,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
P dfde112116b982017a5516590ff1780e8aa519ce
R a865e61ee80395ceaf86ba7cc2e435b0
U danielk1977
Z d6e32fdd48dc789f36c98b88caac2221
P 6dc6004684a97fbdba2f2dce94086dc2c4967a42
R 2f7606b77bec37379c738329814fe8c4
U drh
Z 1c7a05de9e42438d1c26640df8e9bcae

View File

@ -1 +1 @@
6dc6004684a97fbdba2f2dce94086dc2c4967a42
b5d2771ee0e9c77967b4a64a97dcd56c067bc7b8

View File

@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.171 2004/05/11 08:48:11 danielk1977 Exp $
** $Id: main.c,v 1.172 2004/05/11 09:05:49 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@ -123,59 +123,6 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
return nErr;
}
/*
** This is a callback procedure used to reconstruct a table. The
** name of the table to be reconstructed is passed in as argv[0].
**
** This routine is used to automatically upgrade a database from
** format version 1 or 2 to version 3. The correct operation of
** this routine relys on the fact that no indices are used when
** copying a table out to a temporary file.
**
** The change from version 2 to version 3 occurred between SQLite
** version 2.5.6 and 2.6.0 on 2002-July-18.
*/
static
int upgrade_3_callback(void *pInit, int argc, char **argv, char **NotUsed){
InitData *pData = (InitData*)pInit;
int rc;
Table *pTab;
Trigger *pTrig;
char *zErr = 0;
pTab = sqlite3FindTable(pData->db, argv[0], 0);
assert( pTab!=0 );
assert( sqlite3StrICmp(pTab->zName, argv[0])==0 );
if( pTab ){
pTrig = pTab->pTrigger;
pTab->pTrigger = 0; /* Disable all triggers before rebuilding the table */
}
rc = sqlite3_exec_printf(pData->db,
"CREATE TEMP TABLE sqlite_x AS SELECT * FROM '%q'; "
"DELETE FROM '%q'; "
"INSERT INTO '%q' SELECT * FROM sqlite_x; "
"DROP TABLE sqlite_x;",
0, 0, &zErr, argv[0], argv[0], argv[0]);
if( zErr ){
if( *pData->pzErrMsg ) sqlite3_freemem(*pData->pzErrMsg);
*pData->pzErrMsg = zErr;
}
/* If an error occurred in the SQL above, then the transaction will
** rollback which will delete the internal symbol tables. This will
** cause the structure that pTab points to be deleted. In case that
** happened, we need to refetch pTab.
*/
pTab = sqlite3FindTable(pData->db, argv[0], 0);
if( pTab ){
assert( sqlite3StrICmp(pTab->zName, argv[0])==0 );
pTab->pTrigger = pTrig; /* Re-enable triggers */
}
return rc!=SQLITE_OK;
}
/*
** Attempt to read the database schema and initialize internal
** data structures for a single database file. The index of the