Remove code dealing with old file formats. (CVS 1354)

FossilOrigin-Name: dfde112116b982017a5516590ff1780e8aa519ce
This commit is contained in:
danielk1977 2004-05-11 07:11:51 +00:00
parent 36a3c70b98
commit 3d68f03a96
9 changed files with 28 additions and 78 deletions

View File

@ -1,5 +1,5 @@
C More\sminor\schanges\sto\saccomadate\sthe\snew\sbtree.\sAll\sthe\sselect*\stests\npass\snow.\s(CVS\s1353)
D 2004-05-11T06:55:14
C Remove\scode\sdealing\swith\sold\sfile\sformats.\s(CVS\s1354)
D 2004-05-11T07:11:52
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@ -21,29 +21,29 @@ F spec.template a38492f1c1dd349fc24cb0565e08afc53045304b
F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea
F sqlite.def fc4f5734786fe4743cfe2aa98eb2da4b089edb5f
F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2
F src/attach.c fa9a58234406d84eeb900517d0c0adc4b2da051a
F src/attach.c c315c58cb16fd6e913b3bfa6412aedecb4567fa5
F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79
F src/btree.c 4e9ed30d1239e077d94efe3d6b9a5ee205e2f979
F src/btree.h 578dc465c801cf4e7666efbb0fa1c46a54758008
F src/btree_rb.c 9d7973e266ee6f9c61ce592f68742ce9cd5b10e5
F src/build.c 165424adf8bd134274b7c8f5a7c32b4fcc09c04b
F src/build.c 97d8b3fc6c48fcd355fcfe7b2e291f6e57159d62
F src/copy.c 4d2038602fd0549d80c59bda27d96f13ea9b5e29
F src/date.c 1564caa119511a1bb23dd0b1530ad38ed8c3349b
F src/delete.c 889a7e9f0365622a2ad5859d9c9df10ece12e363
F src/delete.c 30c8c4375e75e811c3668abf3f78970fe549f375
F src/encode.c a876af473d1d636faa3dca51c7571f2e007eea37
F src/expr.c 7667e214b17a100e013005d42c1b91be73d9ecfe
F src/expr.c a3aed7057bafb3a01e8af98a5f74a102621b7a91
F src/func.c 6cf6501f092b41c8cd9368b09c287016c0576438
F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f
F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb
F src/insert.c 2d082257784a8613b1b50cd5bbf42b9466646a0e
F src/main.c 5f8fe4e06fbb79571f4d1a8055bcea2067e2243d
F src/insert.c 1e63d2774c4d893363e0c072f19d4c92a4ab982d
F src/main.c 07dbefd62294f9b5100210161f4af4da2e6fb0ff
F src/md5.c 8e39fdae6d8776b87558e91dcc94740c9b635a9c
F src/os.c ddcda92f7fd71b4513c57c1ec797917f206d504e
F src/os.h fbb2f6595fc34fa351830d88fe1c6b85118f0383
F src/pager.c 43556f37b80efdccb853dbf86b3d09470d791d0d
F src/pager.h 0c95b18f2785b58bfbb2b6f6a221f23caf378687
F src/parse.y d0258aa3cc8b0c5742b07b699d10fa98f3caea7d
F src/pragma.c d9f8332a1a87bc4058113ee9686e0c14286d69fd
F src/pragma.c cef4b66bd22d43f6c71c91e7d6925f9b214c301e
F src/printf.c 8aa5d88509f46f064f57d0a8419e7b5f3b9fd559
F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
F src/select.c ca99ae4db14a45a436ec51d3e6bd48d44a3efb3c
@ -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 16078fe0ea146537f75b869e6b0cce202af6781b
R 523ec6d14e2bf3eef598f38a794aae4e
P 941d0fdc97ad0a2ba0e823ce40022bdef857aa6e
R 16e70b539b0afb4036f677ee3f6bf7c9
U danielk1977
Z 9f15195e10480ed09271da78bde75df2
Z df9cf5602eb49f1df00c4efad7a7a79a

View File

@ -1 +1 @@
941d0fdc97ad0a2ba0e823ce40022bdef857aa6e
dfde112116b982017a5516590ff1780e8aa519ce

View File

@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the ATTACH and DETACH commands.
**
** $Id: attach.c,v 1.11 2004/05/08 08:23:21 danielk1977 Exp $
** $Id: attach.c,v 1.12 2004/05/11 07:11:52 danielk1977 Exp $
*/
#include "sqliteInt.h"
@ -34,12 +34,6 @@ void sqlite3Attach(Parse *pParse, Token *pFilename, Token *pDbname, Token *pKey)
sqlite3VdbeAddOp(v, OP_Halt, 0, 0);
if( pParse->explain ) return;
db = pParse->db;
if( db->file_format<4 ){
sqlite3ErrorMsg(pParse, "cannot attach auxiliary databases to an "
"older format master database", 0);
pParse->rc = SQLITE_ERROR;
return;
}
if( db->nDb>=MAX_ATTACHED+2 ){
sqlite3ErrorMsg(pParse, "too many attached databases - max %d",
MAX_ATTACHED);

View File

@ -23,7 +23,7 @@
** ROLLBACK
** PRAGMA
**
** $Id: build.c,v 1.180 2004/05/11 06:55:14 danielk1977 Exp $
** $Id: build.c,v 1.181 2004/05/11 07:11:52 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@ -699,8 +699,7 @@ void sqlite3AddPrimaryKey(Parse *pParse, IdList *pList, int onError){
if( iCol>=0 && iCol<pTab->nCol ){
zType = pTab->aCol[iCol].zType;
}
if( pParse->db->file_format>=1 &&
zType && sqlite3StrICmp(zType, "INTEGER")==0 ){
if( zType && sqlite3StrICmp(zType, "INTEGER")==0 ){
pTab->iPKey = iCol;
pTab->keyConf = onError;
}else{
@ -1721,7 +1720,7 @@ void sqlite3CreateIndex(
}
}
sqlite3VdbeAddOp(v, OP_MakeIdxKey, pIndex->nColumn, 0);
if( db->file_format>=4 ) sqlite3AddIdxKeyType(v, pIndex);
sqlite3AddIdxKeyType(v, pIndex);
sqlite3VdbeOp3(v, OP_IdxPut, 1, pIndex->onError!=OE_None,
"indexed columns are not unique", P3_STATIC);
sqlite3VdbeAddOp(v, OP_Next, 2, lbl1);

View File

@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle DELETE FROM statements.
**
** $Id: delete.c,v 1.63 2004/05/10 10:34:35 danielk1977 Exp $
** $Id: delete.c,v 1.64 2004/05/11 07:11:53 danielk1977 Exp $
*/
#include "sqliteInt.h"
@ -387,7 +387,7 @@ void sqlite3GenerateRowIndexDelete(
}
}
sqlite3VdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0);
if( db->file_format>=4 ) sqlite3AddIdxKeyType(v, pIdx);
sqlite3AddIdxKeyType(v, pIdx);
sqlite3VdbeAddOp(v, OP_IdxDelete, iCur+i, 0);
}
}

View File

@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.116 2004/05/10 10:34:37 danielk1977 Exp $
** $Id: expr.c,v 1.117 2004/05/11 07:11:53 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@ -1072,7 +1072,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
case TK_GE:
case TK_NE:
case TK_EQ: {
if( pParse->db->file_format>=4 && sqlite3ExprType(pExpr)==SQLITE_SO_TEXT ){
if( sqlite3ExprType(pExpr)==SQLITE_SO_TEXT ){
op += 6; /* Convert numeric opcodes to text opcodes */
}
/* Fall through into the next case */
@ -1334,7 +1334,7 @@ void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
case TK_EQ: {
sqlite3ExprCode(pParse, pExpr->pLeft);
sqlite3ExprCode(pParse, pExpr->pRight);
if( pParse->db->file_format>=4 && sqlite3ExprType(pExpr)==SQLITE_SO_TEXT ){
if( sqlite3ExprType(pExpr)==SQLITE_SO_TEXT ){
op += 6; /* Convert numeric opcodes to text opcodes */
}
sqlite3VdbeAddOp(v, op, jumpIfNull, dest);
@ -1427,7 +1427,7 @@ void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
case TK_GE:
case TK_NE:
case TK_EQ: {
if( pParse->db->file_format>=4 && sqlite3ExprType(pExpr)==SQLITE_SO_TEXT ){
if( sqlite3ExprType(pExpr)==SQLITE_SO_TEXT ){
/* Convert numeric comparison opcodes into text comparison opcodes.
** This step depends on the fact that the text comparision opcodes are
** always 6 greater than their corresponding numeric comparison

View File

@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
** $Id: insert.c,v 1.96 2004/05/10 10:34:40 danielk1977 Exp $
** $Id: insert.c,v 1.97 2004/05/11 07:11:53 danielk1977 Exp $
*/
#include "sqliteInt.h"
@ -773,7 +773,7 @@ void sqlite3GenerateConstraintChecks(
}
}
jumpInst1 = sqlite3VdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0);
if( pParse->db->file_format>=4 ) sqlite3AddIdxKeyType(v, pIdx);
sqlite3AddIdxKeyType(v, pIdx);
/* Find out what action to take in case there is an indexing conflict */
onError = pIdx->onError;

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.169 2004/05/10 23:29:50 drh Exp $
** $Id: main.c,v 1.170 2004/05/11 07:11:53 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@ -388,44 +388,6 @@ int sqlite3Init(sqlite *db, char **pzErrMsg){
sqlite3CommitInternalChanges(db);
}
/* If the database is in formats 1 or 2, then upgrade it to
** version 3. This will reconstruct all indices. If the
** upgrade fails for any reason (ex: out of disk space, database
** is read only, interrupt received, etc.) then fail the init.
*/
if( rc==SQLITE_OK && db->file_format<3 ){
char *zErr = 0;
InitData initData;
int meta[SQLITE_N_BTREE_META];
db->magic = SQLITE_MAGIC_OPEN;
initData.db = db;
initData.pzErrMsg = &zErr;
db->file_format = 3;
rc = sqlite3_exec(db,
"BEGIN; SELECT name FROM sqlite_master WHERE type='table';",
upgrade_3_callback,
&initData,
&zErr);
if( rc==SQLITE_OK ){
int ii;
for(ii=0; rc==SQLITE_OK && ii<SQLITE_N_BTREE_META; ii++){
rc = sqlite3BtreeGetMeta(db->aDb[0].pBt, ii+1, &meta[ii]);
}
meta[2] = 4;
for(ii=0; rc==SQLITE_OK && ii<SQLITE_N_BTREE_META; ii++){
rc = sqlite3BtreeUpdateMeta(db->aDb[0].pBt, ii+1, meta[ii]);
}
sqlite3_exec(db, "COMMIT", 0, 0, 0);
}
if( rc!=SQLITE_OK ){
sqlite3SetString(pzErrMsg,
"unable to upgrade database to the version 2.6 format",
zErr ? ": " : 0, zErr, (char*)0);
}
sqlite3_freemem(zErr);
}
if( rc!=SQLITE_OK ){
db->flags &= ~SQLITE_Initialized;
}
@ -700,11 +662,6 @@ int sqlite3_compile(
*pzErrMsg = 0;
}
}
if( db->file_format<3 ){
sqlite3SafetyOff(db);
sqlite3SetString(pzErrMsg, "obsolete database file format", (char*)0);
return SQLITE_ERROR;
}
}
assert( (db->flags & SQLITE_Initialized)!=0 || db->init.busy );
if( db->pVdbe==0 ){ db->nChange = 0; }

View File

@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the PRAGMA command.
**
** $Id: pragma.c,v 1.20 2004/05/08 08:23:31 danielk1977 Exp $
** $Id: pragma.c,v 1.21 2004/05/11 07:11:53 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@ -667,7 +667,7 @@ void sqlite3Pragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){
}
}
sqlite3VdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0);
if( db->file_format>=4 ) sqlite3AddIdxKeyType(v, pIdx);
sqlite3AddIdxKeyType(v, pIdx);
jmp2 = sqlite3VdbeAddOp(v, OP_Found, j+2, 0);
addr = sqlite3VdbeAddOpList(v, ArraySize(idxErr), idxErr);
sqlite3VdbeChangeP3(v, addr+4, pIdx->zName, P3_STATIC);