Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Change the journal_mode pragma to remove the "default journal mode" concept. The journal_mode pragma only effects currently attached databases and does not change the behavior of future attachments. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
e396184cd3bdb96e29ac33af5d1f631c |
User & Date: | drh 2010-07-08 17:40:38.000 |
Context
2010-07-08
| ||
18:32 | Fix test case numbering in backup_malloc.test and issue when running under Windows. (check-in: aef2643852 user: shaneh tags: trunk) | |
17:40 | Change the journal_mode pragma to remove the "default journal mode" concept. The journal_mode pragma only effects currently attached databases and does not change the behavior of future attachments. (check-in: e396184cd3 user: drh tags: trunk) | |
16:50 | Merged experimental crashsql() into trunk. (check-in: 01b575ff1a user: shaneh tags: trunk) | |
Changes
Changes to src/attach.c.
︙ | |||
139 140 141 142 143 144 145 | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | - - | }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){ zErrDyn = sqlite3MPrintf(db, "attached databases must use the same text encoding as main database"); rc = SQLITE_ERROR; } pPager = sqlite3BtreePager(aNew->pBt); sqlite3PagerLockingMode(pPager, db->dfltLockMode); |
︙ | |||
336 337 338 339 340 341 342 | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | - - - - - - - - - - - | assert( v || db->mallocFailed ); if( v ){ sqlite3VdbeAddOp3(v, OP_Function, 0, regArgs+3-pFunc->nArg, regArgs+3); assert( pFunc->nArg==-1 || (pFunc->nArg&0xff)==pFunc->nArg ); sqlite3VdbeChangeP5(v, (u8)(pFunc->nArg)); sqlite3VdbeChangeP4(v, -1, (char *)pFunc, P4_FUNCDEF); |
︙ |
Changes to src/build.c.
︙ | |||
3419 3420 3421 3422 3423 3424 3425 | 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 | - | } db->aDb[1].pBt = pBt; assert( db->aDb[1].pSchema ); if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, -1, 0) ){ db->mallocFailed = 1; return 1; } |
︙ |
Changes to src/pragma.c.
︙ | |||
531 532 533 534 535 536 537 | 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 | - + + + + + + + + - - + + - - - - - - - - - - + + - - - - - - - - - - + - - - - - - - + + + + + + - - | /* ** PRAGMA [database.]journal_mode ** PRAGMA [database.]journal_mode = ** (delete|persist|off|truncate|memory|wal|off) */ if( sqlite3StrICmp(zLeft,"journal_mode")==0 ){ |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
793 794 795 796 797 798 799 | 793 794 795 796 797 798 799 800 801 802 803 804 805 806 | - | int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ int errCode; /* Most recent error code (SQLITE_*) */ int errMask; /* & result codes with this before returning */ u8 autoCommit; /* The auto-commit flag. */ u8 temp_store; /* 1: file 2: memory 0: default */ u8 mallocFailed; /* True if we have seen a malloc failure */ u8 dfltLockMode; /* Default locking-mode for attached dbs */ |
︙ |
Changes to src/vdbe.c.
︙ | |||
5161 5162 5163 5164 5165 5166 5167 | 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 | - - - - - | ** PAGER_JOURNALMODE_XXX values. If changing between the various rollback ** modes (delete, truncate, persist, off and memory), this is a simple ** operation. No IO is required. ** ** If changing into or out of WAL mode the procedure is more complicated. ** ** Write a string containing the final journal-mode to register P2. |
︙ | |||
5263 5264 5265 5266 5267 5268 5269 | 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 | - | rc = sqlite3BtreeSetVersion(pBt, (eNew==PAGER_JOURNALMODE_WAL ? 2 : 1)); } } } #endif /* ifndef SQLITE_OMIT_WAL */ if( rc ){ |
︙ |
Changes to test/crash8.test.
︙ | |||
254 255 256 257 258 259 260 261 262 263 264 265 266 267 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | + | INSERT INTO ab VALUES(2, NULL); INSERT INTO ab VALUES(3, NULL); INSERT INTO ab VALUES(4, NULL); INSERT INTO ab VALUES(5, NULL); INSERT INTO ab VALUES(6, NULL); UPDATE ab SET b = randstr(1000,1000); ATTACH 'test2.db' AS aux; PRAGMA aux.journal_mode = persist; CREATE TABLE aux.ab(a, b); INSERT INTO aux.ab SELECT * FROM main.ab; UPDATE aux.ab SET b = randstr(1000,1000) WHERE a>=1; UPDATE ab SET b = randstr(1000,1000) WHERE a>=1; } list [file exists test.db-journal] [file exists test2.db-journal] |
︙ |
Changes to test/jrnlmode.test.
︙ | |||
128 129 130 131 132 133 134 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | - + | PRAGMA aux1.journal_mode; } } [list off [temp_journal_mode persist] memory] do_test jrnlmode-1.11 { execsql { PRAGMA journal_mode; } |
︙ | |||
313 314 315 316 317 318 319 320 321 | 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | + - + + - - + + + + | do_test jrnlmode-5.2 { execsql { PRAGMA journal_size_limit } } {-1} do_test jrnlmode-5.3 { execsql { ATTACH 'test2.db' AS aux; PRAGMA aux.journal_mode=persist; PRAGMA aux.journal_size_limit; } |
︙ |
Changes to test/walmode.test.
︙ | |||
299 300 301 302 303 304 305 | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | - + - + - + - + | sqlite3 db test.db execsql { PRAGMA journal_mode = WAL; CREATE TABLE t1(a, b); } } {wal} foreach {tn sql result} { |
︙ | |||
337 338 339 340 341 342 343 | 337 338 339 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 380 | - + - + + + + + + + + + + - | do_execsql_test walmode-8.1 { CREATE TABLE t1(a, b); PRAGMA journal_mode = WAL; ATTACH 'test.db2' AS two; CREATE TABLE two.t2(a, b); } {wal} do_execsql_test walmode-8.2 { PRAGMA main.journal_mode } {wal} |