Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch vacuum-attached-db Excluding Merge-Ins
This is equivalent to a diff from cb9865e1 to ad35ef11
2016-08-19
| ||
15:15 | Enhance the VACUUM command so that it can operate on an attached database. (check-in: 083f9e62 user: drh tags: trunk) | |
15:12 | Disable row counting on queries run while doing a VACUUM. (Closed-Leaf check-in: ad35ef11 user: drh tags: vacuum-attached-db) | |
14:20 | Add the capability to VACUUM an attached database by specifying the schema name as an argument to the VACUUM command. Since version 2.0, VACUUM has accepted an argument which was silently ignored. Now it has meaning. (check-in: 29d63059 user: drh tags: vacuum-attached-db) | |
2016-08-18
| ||
22:44 | Add the SQLITE_DBCONFIG_MAINDBNAME interface. (check-in: d6e3d579 user: drh tags: dbconfig_maindbname) | |
22:19 | Change the name of Db.zName to Db.zDbSName for improved long-term code maintainability. (check-in: cb9865e1 user: drh tags: trunk) | |
20:56 | Fix a zName to zDbSName conversion missed in the previous check-in. (Closed-Leaf check-in: d7cf423c user: drh tags: zDbSName) | |
2016-08-17
| ||
11:14 | Fix a problem in the fts5 snippet() auxiliary function. (check-in: a861713c user: dan tags: trunk) | |
Changes to src/build.c.
︙ | |||
769 770 771 772 773 774 775 | 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | - + | *pUnqual = pName2; iDb = sqlite3FindDb(db, pName1); if( iDb<0 ){ sqlite3ErrorMsg(pParse, "unknown database %T", pName1); return -1; } }else{ |
︙ | |||
2007 2008 2009 2010 2011 2012 2013 | 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 | - + | sqlite3DbFree(db, zStmt); sqlite3ChangeCookie(pParse, iDb); #ifndef SQLITE_OMIT_AUTOINCREMENT /* Check to see if we need to create an sqlite_sequence table for ** keeping track of autoincrement keys. */ |
︙ |
Changes to src/insert.c.
︙ | |||
196 197 198 199 200 201 202 | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | - + + + | return 0; } #ifndef SQLITE_OMIT_AUTOINCREMENT /* ** Locate or create an AutoincInfo structure associated with table pTab ** which is in database iDb. Return the register number for the register |
︙ | |||
219 220 221 222 223 224 225 | 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | - + + + | */ static int autoIncBegin( Parse *pParse, /* Parsing context */ int iDb, /* Index of the database holding pTab */ Table *pTab /* The table we are writing to */ ){ int memId = 0; /* Register holding maximum rowid */ |
︙ |
Changes to src/parse.y.
︙ | |||
1281 1282 1283 1284 1285 1286 1287 | 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 | - - + + | // cmd ::= DROP INDEX ifexists(E) fullname(X). {sqlite3DropIndex(pParse, X, E);} ///////////////////////////// The VACUUM command ///////////////////////////// // %ifndef SQLITE_OMIT_VACUUM %ifndef SQLITE_OMIT_ATTACH |
︙ |
Changes to src/prepare.c.
︙ | |||
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | + - + + | }else if( sqlite3_strnicmp(argv[2],"create ",7)==0 ){ /* Call the parser to process a CREATE TABLE, INDEX or VIEW. ** But because db->init.busy is set to 1, no VDBE code is generated ** or executed. All the parser does is build the internal data ** structures that describe the table, index, or view. */ int rc; u8 saved_iDb = db->init.iDb; sqlite3_stmt *pStmt; TESTONLY(int rcp); /* Return code from sqlite3_prepare() */ assert( db->init.busy ); db->init.iDb = iDb; db->init.newTnum = sqlite3Atoi(argv[1]); db->init.orphanTrigger = 0; TESTONLY(rcp = ) sqlite3_prepare(db, argv[2], -1, &pStmt, 0); rc = db->errCode; assert( (rc&0xFF)==(rcp&0xFF) ); |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
3697 3698 3699 3700 3701 3702 3703 | 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 | - - + + | #define LOCATE_VIEW 0x01 #define LOCATE_NOERR 0x02 Table *sqlite3LocateTable(Parse*,u32 flags,const char*, const char*); Table *sqlite3LocateTableItem(Parse*,u32 flags,struct SrcList_item *); Index *sqlite3FindIndex(sqlite3*,const char*, const char*); void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*); void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*); |
︙ |
Changes to src/vacuum.c.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | - - - - - - - - - - + - - - - + + + + + + + + - + - - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + - - - - - - + + + - - + + - - - - + + + - - - + + - - - - | ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. */ #include "sqliteInt.h" #include "vdbeInt.h" #if !defined(SQLITE_OMIT_VACUUM) && !defined(SQLITE_OMIT_ATTACH) |
︙ | |||
97 98 99 100 101 102 103 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | - + + - - - + + + - + - + - - + + + + - + - - - - - - - - - + + + + + - - - + - + - + - - + | ** the copy of step (3) were replaced by deleting the original database ** and renaming the transient database as the original. But that will ** not work if other processes are attached to the original database. ** And a power loss in between deleting the original and renaming the ** transient would cause the database file to appear to be deleted ** following reboot. */ |
︙ | |||
229 230 231 232 233 234 235 | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | + - - - - + + + + + - - - + + + + + - + - - - - - - - - - + + + + - - + + - - - - - - - - - - - - - - - - - + + - - - - + + + + | sqlite3BtreeSetAutoVacuum(pTemp, db->nextAutovac>=0 ? db->nextAutovac : sqlite3BtreeGetAutoVacuum(pMain)); #endif /* Query the schema of the main database. Create a mirror schema ** in the temporary database. */ db->init.iDb = nDb; /* force new CREATE statements into vacuum_db */ |
︙ | |||
340 341 342 343 344 345 346 347 348 349 350 351 352 353 | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | + | } assert( rc==SQLITE_OK ); rc = sqlite3BtreeSetPageSize(pMain, sqlite3BtreeGetPageSize(pTemp), nRes,1); end_of_vacuum: /* Restore the original value of db->flags */ db->init.iDb = 0; db->flags = saved_flags; db->nChange = saved_nChange; db->nTotalChange = saved_nTotalChange; db->mTrace = saved_mTrace; sqlite3BtreeSetPageSize(pMain, -1, -1, 1); /* Currently there is an SQL level transaction open on the vacuum |
︙ |
Changes to src/vdbe.c.
︙ | |||
6258 6259 6260 6261 6262 6263 6264 | 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 | - + - - + + - - + | sqlite3VdbeChangeEncoding(pOut, encoding); if( rc ) goto abort_due_to_error; break; }; #endif /* SQLITE_OMIT_PRAGMA */ #if !defined(SQLITE_OMIT_VACUUM) && !defined(SQLITE_OMIT_ATTACH) |
︙ |
Changes to test/e_vacuum.test.
︙ | |||
198 199 200 201 202 203 204 | 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | - + - - - - | ATTACH 'test.db2' AS aux; PRAGMA aux.page_size = 1024; CREATE TABLE aux.t3 AS SELECT * FROM t1; DELETE FROM t3; } {} set original_size [file size test.db2] |
︙ |
Added test/vacuum5.test.