/ Check-in [4a190bea]
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 | SQL archive
Timelines: family | ancestors | descendants | both | application-id
Files: files | file ages | folders
SHA1: 4a190bea18e156b6fa4dc9f21c3ad32409049603
User & Date: drh 2013-05-01 20:36:23
Context
2013-05-01
20:40
Fix comments in the magic number file. Closed-Leaf check-in: 5a500848 user: drh tags: application-id
20:36
Preserve the application-ID across VACUUM. Updates to the magic number file. check-in: 4a190bea 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: 28c9e7fd user: drh tags: application-id
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to magic.txt.

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

Changes to src/vacuum.c.

   285    285       ** connections to the same database will know to reread the schema.
   286    286       */
   287    287       static const unsigned char aCopy[] = {
   288    288          BTREE_SCHEMA_VERSION,     1,  /* Add one to the old schema cookie */
   289    289          BTREE_DEFAULT_CACHE_SIZE, 0,  /* Preserve the default page cache size */
   290    290          BTREE_TEXT_ENCODING,      0,  /* Preserve the text encoding */
   291    291          BTREE_USER_VERSION,       0,  /* Preserve the user version */
          292  +       BTREE_APPLICATION_ID,     0,  /* Preserve the application id */
   292    293       };
   293    294   
   294    295       assert( 1==sqlite3BtreeIsInTrans(pTemp) );
   295    296       assert( 1==sqlite3BtreeIsInTrans(pMain) );
   296    297   
   297    298       /* Copy Btree meta values */
   298    299       for(i=0; i<ArraySize(aCopy); i+=2){