Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Change the ANALYZE command so that it no longer tried to delete unused sqlite_stat2 and sqlite_stat3 tables. Change the DROP TABLE command so that it is able to drop those tables. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
589f3f5652e3674d3203f8bd32784a46 |
User & Date: | drh 2011-10-07 23:52:25.818 |
Context
2011-10-08
| ||
14:57 | Add the SQLITE_DIRECT_OVERFLOW_READ compile time option. (check-in: 2ab14a8467 user: dan tags: trunk) | |
2011-10-07
| ||
23:52 | Change the ANALYZE command so that it no longer tried to delete unused sqlite_stat2 and sqlite_stat3 tables. Change the DROP TABLE command so that it is able to drop those tables. (check-in: 589f3f5652 user: drh tags: trunk) | |
18:24 | Make sure sqlite3_data_count() behaves as documented, even for EXPLAIN QUERY PLAN queries. (check-in: d4f95b3b6e user: drh tags: trunk) | |
Changes
Changes to src/analyze.c.
︙ | ︙ | |||
144 145 146 147 148 149 150 | const char *zCols; } aTable[] = { { "sqlite_stat1", "tbl,idx,stat" }, #ifdef SQLITE_ENABLE_STAT3 { "sqlite_stat3", "tbl,idx,neq,nlt,ndlt,sample" }, #endif }; | < < < < < < < < < < < < < < < < < | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | const char *zCols; } aTable[] = { { "sqlite_stat1", "tbl,idx,stat" }, #ifdef SQLITE_ENABLE_STAT3 { "sqlite_stat3", "tbl,idx,neq,nlt,ndlt,sample" }, #endif }; int aRoot[] = {0, 0}; u8 aCreateTbl[] = {0, 0}; int i; sqlite3 *db = pParse->db; Db *pDb; Vdbe *v = sqlite3GetVdbe(pParse); if( v==0 ) return; assert( sqlite3BtreeHoldsAllMutexes(db) ); assert( sqlite3VdbeDb(v)==db ); pDb = &db->aDb[iDb]; /* Create new statistic tables if they do not exist, or clear them ** if they do already exist. */ for(i=0; i<ArraySize(aTable); i++){ const char *zTab = aTable[i].zName; Table *pStat; if( (pStat = sqlite3FindTable(db, zTab, pDb->zName))==0 ){ |
︙ | ︙ |
Changes to src/build.c.
︙ | ︙ | |||
2141 2142 2143 2144 2145 2146 2147 | goto exit_drop_table; } if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ goto exit_drop_table; } } #endif | | > | 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 | goto exit_drop_table; } if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ goto exit_drop_table; } } #endif if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){ sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName); goto exit_drop_table; } #ifndef SQLITE_OMIT_VIEW /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. |
︙ | ︙ |
Deleted test/stat3.test.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to test/table.test.
︙ | ︙ | |||
255 256 257 258 259 260 261 262 263 264 265 266 267 268 | } {0 {}} # Try to drop sqlite_master # do_test table-5.2 { catchsql {DROP TABLE IF EXISTS sqlite_master} } {1 {table sqlite_master may not be dropped}} # Make sure an EXPLAIN does not really create a new table # do_test table-5.3 { ifcapable {explain} { execsql {EXPLAIN CREATE TABLE test1(f1 int)} } | > > > > > > > > > > > > | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | } {0 {}} # Try to drop sqlite_master # do_test table-5.2 { catchsql {DROP TABLE IF EXISTS sqlite_master} } {1 {table sqlite_master may not be dropped}} # Dropping sqlite_statN tables is OK. # do_test table-5.2.1 { db eval { ANALYZE; DROP TABLE IF EXISTS sqlite_stat1; DROP TABLE IF EXISTS sqlite_stat2; DROP TABLE IF EXISTS sqlite_stat3; SELECT name FROM sqlite_master WHERE name GLOB 'sqlite_stat*'; } } {} # Make sure an EXPLAIN does not really create a new table # do_test table-5.3 { ifcapable {explain} { execsql {EXPLAIN CREATE TABLE test1(f1 int)} } |
︙ | ︙ |