Documentation Source Text

Check-in [5f361950a7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enhance the PRAGMA journal_mode=OFF documentation to make it clear that ordinary SQL can corrupt the database file while in that mode. See ticket https://www.sqlite.org/src/info/f4ec250930342e0c
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5f361950a72fd1f69e44624e418085ed4d974fbd5eff31984eb8f1fb1a0453c1
User & Date: drh 2019-05-17 20:39:53
Context
2019-05-21
11:14
IE11 does not understand a 308 redirect, so always use a 301 redirect instead. check-in: 91021e98e3 user: drh tags: trunk
2019-05-17
20:39
Enhance the PRAGMA journal_mode=OFF documentation to make it clear that ordinary SQL can corrupt the database file while in that mode. See ticket https://www.sqlite.org/src/info/f4ec250930342e0c check-in: 5f361950a7 user: drh tags: trunk
17:22
Fix a harmless compiler warning about the return value of freopen() in althttpd. check-in: 445195faaf user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/pragma.in.

417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
...
744
745
746
747
748
749
750
751








752
753
754
755
756
757
758
    on the value of the case_sensitive_like pragma.
    ^When case_sensitive_like is disabled, the default LIKE behavior is
    expressed.  ^(When case_sensitive_like is enabled, case becomes
    significant.  So, for example,
    <b>'a' LIKE 'A'</b> is false but <b>'a' LIKE 'a'</b> is still true.)^</p>

    <p>^This pragma uses [sqlite3_create_function()] to overload the
    LIKE functions, which may override previous implementations
    of LIKE registered by the application.  For example, if the application
    is compiled with the [SQLITE_ENABLE_ICU|ICU Extension] which substitutes its
    own LIKE operators that understand Unicode case folding, then invoking
    this pragma will cause LIKE to revert to its default behavior of only
    doing case folding for ASCII characters.

    <p>^(This pragma
    only changes the behavior of the SQL [LIKE] operator.  It does not
    change the behavior of the [sqlite3_strlike()] C-language interface,
    which is always case insensitive.)^  The GLOB operator is always
    case sensitive and is not affected by this PRAGMA.</p>

    <p>If the database schema contains LIKE operators, for example in CHECK
    constraints of table definitions or in the WHERE clause of a
    [partial index], then changing the meaning of the LIKE operator using
    this pragma might cause indexes to disagree with their corresponding
    tables or CHECK constraints to become invalid.  This can lead to
    errors from [PRAGMA integrity_check] and/or incorrect query results
    from queries that use the affected tables or indexes.  For that
    reason, the use of this pragma is discouraged.  This pragma continues
    to be supported for legacy compatibility.  Individual applications
    can disable this pragma at compile-time using the
    [-DSQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA] option.  Future versions
    of SQLite are likely to deprecate this pragma.
}

Pragma cell_size_check {
    <p>^(<b>PRAGMA cell_size_check
       <br>PRAGMA cell_size_check = </b><i>boolean</i><b>;</b></p>
    <p>The cell_size_check pragma enables or disables additional sanity
    checking on database b-tree pages as they are initially read from disk.)^
................................................................................
    journal to delete.  The OFF journaling mode disables the atomic
    commit and rollback capabilities of SQLite. The [ROLLBACK] command
    no longer works; it behaves in an undefined way.  Applications must
    avoid using the [ROLLBACK] command when the journal mode is OFF.
    ^If the application crashes
    in the middle of a transaction when the OFF journaling mode is
    set, then the database file will very likely
    [cfgerrors|go corrupt].</p>









    <p>^Note that the journal_mode for an [in-memory database]
    is either MEMORY or OFF and can not be changed to a different value.
    ^An attempt to change the journal_mode of an [in-memory database] to
    any setting other than MEMORY or OFF is ignored.  ^Note also that
    the journal_mode cannot be changed while a transaction is active.</p>
}







|
|
<
<
<
<
<
<


|
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|
>
>
>
>
>
>
>
>







417
418
419
420
421
422
423
424
425






426
427
428














429
430
431
432
433
434
435
...
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
    on the value of the case_sensitive_like pragma.
    ^When case_sensitive_like is disabled, the default LIKE behavior is
    expressed.  ^(When case_sensitive_like is enabled, case becomes
    significant.  So, for example,
    <b>'a' LIKE 'A'</b> is false but <b>'a' LIKE 'a'</b> is still true.)^</p>

    <p>^This pragma uses [sqlite3_create_function()] to overload the
    LIKE and GLOB functions, which may override previous implementations
    of LIKE and GLOB registered by the application.  ^(This pragma






    only changes the behavior of the SQL [LIKE] operator.  It does not
    change the behavior of the [sqlite3_strlike()] C-language interface,
    which is always case insensitive.)^</p>














}

Pragma cell_size_check {
    <p>^(<b>PRAGMA cell_size_check
       <br>PRAGMA cell_size_check = </b><i>boolean</i><b>;</b></p>
    <p>The cell_size_check pragma enables or disables additional sanity
    checking on database b-tree pages as they are initially read from disk.)^
................................................................................
    journal to delete.  The OFF journaling mode disables the atomic
    commit and rollback capabilities of SQLite. The [ROLLBACK] command
    no longer works; it behaves in an undefined way.  Applications must
    avoid using the [ROLLBACK] command when the journal mode is OFF.
    ^If the application crashes
    in the middle of a transaction when the OFF journaling mode is
    set, then the database file will very likely
    [cfgerrors|go corrupt]. Without a journal, there is no way for
    a statement to unwind partially completed operations following
    a constraint error.  This might also leave the database in a corrupted
    state.  For example, if a duplicate entry causes a 
    [CREATE INDEX|CREATE UNIQUE INDEX] statement to fail half-way through,
    it will leave behind a partially created, and hence corrupt, index.
    Because OFF journaling
    mode allows the database file to be corrupted using ordinary SQL,
    it is disabled when [SQLITE_DBCONFIG_DEFENSIVE] is enabled.</p>

    <p>^Note that the journal_mode for an [in-memory database]
    is either MEMORY or OFF and can not be changed to a different value.
    ^An attempt to change the journal_mode of an [in-memory database] to
    any setting other than MEMORY or OFF is ignored.  ^Note also that
    the journal_mode cannot be changed while a transaction is active.</p>
}