From 8e150818ecf97953d982bbce041c6a3b80bd4fc1 Mon Sep 17 00:00:00 2001 From: danielk1977 Date: Mon, 10 May 2004 01:17:37 +0000 Subject: [PATCH] Change some code that assumes the root-page of sqlite_master is 2 (it is now 1) (CVS 1333) FossilOrigin-Name: 37ae528fb85799007f4ddfc56a7d9493dbb29cbf --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/build.c | 4 ++-- src/main.c | 8 +++++--- src/sqliteInt.h | 7 ++++++- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index 7c7ec4f546..3e44a9cb21 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\stemporary\ssqlite2BtreeKeyCompare()\sfunction\sto\shelp\sget\nregression\stests\spassing\sagain.\s(CVS\s1332) -D 2004-05-09T23:23:57 +C Change\ssome\scode\sthat\sassumes\sthe\sroot-page\sof\ssqlite_master\sis\s2\s(it\sis\nnow\s1)\s(CVS\s1333) +D 2004-05-10T01:17:37 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -26,7 +26,7 @@ F src/auth.c a2a46e3ed7799134cf3d2dd5ae6650115f26b653 F src/btree.c b4c04b7867ccabaa1b04d5691a1bc6d0a27e6c6b F src/btree.h 7c3939a2e5f782c1ebac3bf43c02a16febad6df1 F src/btree_rb.c 47e5b5ec90846af392b5668b34648198ba459561 -F src/build.c 21b6645c966970dac51bcccfa8650403a3f56210 +F src/build.c 44ee22de8168465ba99d780dbb2091b9c2822e56 F src/copy.c 3c33157f6b4919d6851602b78008c67d466cdadd F src/date.c ca325e0752a88656ba798bc0666fa41498941732 F src/delete.c c6f881904504619ef00c495d535aa0c60a1ddbdc @@ -36,7 +36,7 @@ F src/func.c f87eec5cf103f739ba32866660ce22d000c5723f F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb F src/insert.c 954c0ddabc10899526c975b403ca4352d253f2e0 -F src/main.c b6e249c71c3f815d7551ddf1b914f4bb45a4bd67 +F src/main.c f60224784f2f3d862ad116777cfe6596dbaaeb16 F src/md5.c 01d2f55b06316d242749759b6a37186439ef7fe3 F src/os.c 4092dcc87e66f49ed660fae1519569a0cee34da0 F src/os.h fbb2f6595fc34fa351830d88fe1c6b85118f0383 @@ -49,7 +49,7 @@ F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3 F src/select.c d3868613e70ac09cf2fb4ddd211f088351d1fe51 F src/shell.c 9a242ad03c8726823f182bff81c5e12ef2882f93 F src/sqlite.h.in 532e08163a8df8b71faf7be4e69ba208938eb312 -F src/sqliteInt.h 60f087f2d1dae5ece1615a840ddfe797433b06ff +F src/sqliteInt.h 92fb41170e75e1ce9ad8aea591fd55e7cf49b815 F src/table.c 882b0ae9524c67758157540dd6467c9a5de52335 F src/tclsqlite.c 21147148e7b57a0bb7409cff5878c60470df9acc F src/test1.c 67a72fa1f5f6d41c838fa97f324f8dbfb4051413 @@ -187,7 +187,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P 9379c7c9cf8b0770a0c8d1feb5ffdba342173589 -R f3af99fed24e4ae37a57f15e0ab75548 +P d8d1c91e55f24d17233414facaa03136b3b320d5 +R d45fafcad74fbf012530271bdce1ade4 U danielk1977 -Z d8cf5004a19237d514fe82cdbc9ee318 +Z c59557a5034f7f7676ea623232f2d759 diff --git a/manifest.uuid b/manifest.uuid index 4cfea88a59..d3899f7ff7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d8d1c91e55f24d17233414facaa03136b3b320d5 \ No newline at end of file +37ae528fb85799007f4ddfc56a7d9493dbb29cbf \ No newline at end of file diff --git a/src/build.c b/src/build.c index 7d57086422..d3174831ba 100644 --- a/src/build.c +++ b/src/build.c @@ -23,7 +23,7 @@ ** ROLLBACK ** PRAGMA ** -** $Id: build.c,v 1.177 2004/05/08 08:23:23 danielk1977 Exp $ +** $Id: build.c,v 1.178 2004/05/10 01:17:37 danielk1977 Exp $ */ #include "sqliteInt.h" #include @@ -400,7 +400,7 @@ char *sqlite3TableNameFromToken(Token *pName){ */ void sqlite3OpenMasterTable(Vdbe *v, int isTemp){ sqlite3VdbeAddOp(v, OP_Integer, isTemp, 0); - sqlite3VdbeAddOp(v, OP_OpenWrite, 0, 2); + sqlite3VdbeAddOp(v, OP_OpenWrite, 0, MASTER_ROOT); } /* diff --git a/src/main.c b/src/main.c index 9d96e6a966..6c98985db4 100644 --- a/src/main.c +++ b/src/main.c @@ -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.166 2004/05/08 10:11:37 drh Exp $ +** $Id: main.c,v 1.167 2004/05/10 01:17:37 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -231,8 +231,10 @@ static int sqlite3InitOne(sqlite *db, int iDb, char **pzErrMsg){ ** not exist then.) */ static char init_script[] = +/****** FIX ME "SELECT type, name, rootpage, sql, 1 FROM sqlite_temp_master " "UNION ALL " +*/ "SELECT type, name, rootpage, sql, 0 FROM sqlite_master"; static char older_init_script[] = "SELECT type, name, rootpage, sql, 1 FROM sqlite_temp_master " @@ -251,7 +253,7 @@ static int sqlite3InitOne(sqlite *db, int iDb, char **pzErrMsg){ sqlite3SafetyOff(db); azArg[0] = "table"; azArg[1] = MASTER_NAME; - azArg[2] = "2"; + azArg[2] = "1"; azArg[3] = master_schema; sprintf(zDbNum, "%d", iDb); azArg[4] = zDbNum; @@ -278,7 +280,7 @@ static int sqlite3InitOne(sqlite *db, int iDb, char **pzErrMsg){ /* Create a cursor to hold the database open */ if( db->aDb[iDb].pBt==0 ) return SQLITE_OK; - rc = sqlite3BtreeCursor(db->aDb[iDb].pBt, 2, 0, 0, 0, &curMain); + rc = sqlite3BtreeCursor(db->aDb[iDb].pBt, MASTER_ROOT, 0, 0, 0, &curMain); if( rc ){ sqlite3SetString(pzErrMsg, sqlite_error_string(rc), (char*)0); return rc; diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 3c25146dcb..a3e28d2a2e 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.224 2004/05/08 08:23:36 danielk1977 Exp $ +** @(#) $Id: sqliteInt.h,v 1.225 2004/05/10 01:17:37 danielk1977 Exp $ */ #include "config.h" #include "sqlite.h" @@ -217,6 +217,11 @@ extern int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ #define MASTER_NAME "sqlite_master" #define TEMP_MASTER_NAME "sqlite_temp_master" +/* +** The root-page of the master database table. +*/ +#define MASTER_ROOT 1 + /* ** The name of the schema table. */