SQLite

Check-in [4a190bea18]
Login

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

Overview
Comment:Preserve the application-ID across VACUUM. Updates to the magic number file.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | application-id
Files: files | file ages | folders
SHA1: 4a190bea18e156b6fa4dc9f21c3ad32409049603
User & Date: drh 2013-05-01 20:36:23.594
Context
2013-05-01
20:40
Fix comments in the magic number file. (Closed-Leaf check-in: 5a500848d2 user: drh tags: application-id)
20:36
Preserve the application-ID across VACUUM. Updates to the magic number file. (check-in: 4a190bea18 user: drh tags: application-id)
19:49
Allocate 4 bytes of unused header space for an "Application ID". Add the "PRAGMA application_id" command to set and query this identifier. Add the "magic.txt" file to show how the posix file command might use this application id. (check-in: 28c9e7fdee user: drh tags: application-id)
Changes
Unified Diff Ignore Whitespace Patch
Changes to magic.txt.
13
14
15
16
17
18
19
20
21
22
23
24
25
26

27
28
# the tests below, this integer is sometimes rendered as a string.  For
# example, instead of "belong =1598444364" we write "string =_FSL" and
# instead of "belong =1598903374" we write "string =_MTN".
#
# The Monotone application used "PRAGMA user_version=1598903374;" to set
# its identifier long before "PRAGMA application_id" became available.
# The user_version is very similar to application_id except that it is
# stored at offset 60 instead of offset 68.  The user of 
# "PRAGMA application_id" is preferred now.  The rules using offset 60
# for Monotone are for historical compatibility only.
#
0    string  =SQLite\ format\ 3
>68  string  =_FSL     Fossil repository
>68  belong  =0

>>60 string  =_MTN     Monotone source repository
>>60 string  !_MTN     SQLite 3.x database







|




|
|
>
|
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# the tests below, this integer is sometimes rendered as a string.  For
# example, instead of "belong =1598444364" we write "string =_FSL" and
# instead of "belong =1598903374" we write "string =_MTN".
#
# The Monotone application used "PRAGMA user_version=1598903374;" to set
# its identifier long before "PRAGMA application_id" became available.
# The user_version is very similar to application_id except that it is
# stored at offset 68 instead of offset 60.  The user of 
# "PRAGMA application_id" is preferred now.  The rules using offset 60
# for Monotone are for historical compatibility only.
#
0    string  =SQLite\ format\ 3
>68  belong  =0x0f055111  Fossil repository -
>68  belong  =0x0f055112  Fossil checkout - 
>68  belong  =0x0f055113  Fossil global configuration - 
>60  belong  =0x5f4d544e  Monotone source repository -
>0   string  =SQLite      SQLite3 database
Changes to src/vacuum.c.
285
286
287
288
289
290
291

292
293
294
295
296
297
298
    ** connections to the same database will know to reread the schema.
    */
    static const unsigned char aCopy[] = {
       BTREE_SCHEMA_VERSION,     1,  /* Add one to the old schema cookie */
       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 */

    };

    assert( 1==sqlite3BtreeIsInTrans(pTemp) );
    assert( 1==sqlite3BtreeIsInTrans(pMain) );

    /* Copy Btree meta values */
    for(i=0; i<ArraySize(aCopy); i+=2){







>







285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
    ** connections to the same database will know to reread the schema.
    */
    static const unsigned char aCopy[] = {
       BTREE_SCHEMA_VERSION,     1,  /* Add one to the old schema cookie */
       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) );
    assert( 1==sqlite3BtreeIsInTrans(pMain) );

    /* Copy Btree meta values */
    for(i=0; i<ArraySize(aCopy); i+=2){