Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Allow the INTO clause of VACUUM to be a text-valued expression. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | vacuum-into |
Files: | files | file ages | folders |
SHA3-256: |
af172b53b46759f491f522356e14c5e2 |
User & Date: | drh 2018-12-08 00:43:08.028 |
Context
2018-12-08
| ||
01:09 | Add the --async option to the ".backup" command in the CLI. (check-in: 7b6a605b18 user: drh tags: vacuum-into) | |
00:43 | Allow the INTO clause of VACUUM to be a text-valued expression. (check-in: af172b53b4 user: drh tags: vacuum-into) | |
2018-12-07
| ||
23:48 | Do not allow VACUUM INTO into a file that already exists. (check-in: 92f70e0fa3 user: drh tags: vacuum-into) | |
Changes
Changes to src/parse.y.
︙ | |||
1363 1364 1365 1366 1367 1368 1369 | 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 | - - - - - + + + + + + | // 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/sqliteInt.h.
︙ | |||
3981 3982 3983 3984 3985 3986 3987 | 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 | - - + + | #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.
︙ | |||
98 99 100 101 102 103 104 | 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 | - + - - + - + - + - - - - + + + + + + + - + + + + + + + + + + + + + + + + | ** 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. */ |
︙ | |||
190 191 192 193 194 195 196 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | - + - + | ** that actually made the VACUUM run slower. Very little journalling ** actually occurs when doing a vacuum since the vacuum_db is initially ** empty. Only the journal header is written. Apparently it takes more ** time to parse and run the PRAGMA to turn journalling off than it does ** to write the journal header file. */ nDb = db->nDb; |
︙ | |||
228 229 230 231 232 233 234 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | - + | /* Begin a transaction and take an exclusive lock on the main database ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ rc = execSql(db, pzErrMsg, "BEGIN"); if( rc!=SQLITE_OK ) goto end_of_vacuum; |
︙ | |||
323 324 325 326 327 328 329 | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | - + - + - - - + - + | BTREE_DEFAULT_CACHE_SIZE, 0, /* Preserve the default page cache size */ BTREE_TEXT_ENCODING, 0, /* Preserve the text encoding */ BTREE_USER_VERSION, 0, /* Preserve the user version */ BTREE_APPLICATION_ID, 0, /* Preserve the application id */ }; assert( 1==sqlite3BtreeIsInTrans(pTemp) ); |
︙ |
Changes to src/vdbe.c.
︙ | |||
6680 6681 6682 6683 6684 6685 6686 | 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 | - + - - - + + + - + + | 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/vacuum-into.test.
︙ | |||
50 51 52 53 54 55 56 57 58 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + + + + + + + + + + | do_catchsql_test vacuum-into-150 { VACUUM INTO 'out2.db'; } {1 {output file already exists}} do_catchsql_test vacuum-into-200 { VACUUM main INTO ':memory:'; } {0 {}} # The INTO argument can be an arbitrary expression. # do_execsql_test vacuum-into-300 { CREATE TABLE t2(name TEXT); INSERT INTO t2 VALUES(':memory:'); VACUUM main INTO (SELECT name FROM t2); } {} do_catchsql_test vacuum-into-310 { VACUUM INTO null; } {1 {non-text filename}} finish_test |