/ Check-in [03573887]
Login

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

Overview
Comment:If no KEY is specified on ATTACH, copy the main schema key if the key size is non-zero. In other words, allow for -1 as a valid key size in support of the --textkey to SEE.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 03573887dbf357f8aa54e4a1cd03b82b0ded8139
User & Date: drh 2016-09-16 19:42:47
Context
2016-09-16
20:39
Fix typo in the name of a Win32 string conversion routine. Replace several uses of raw_printf() with utf8_printf() in the shell. check-in: 6fc95dd7 user: mistachkin tags: trunk
19:42
If no KEY is specified on ATTACH, copy the main schema key if the key size is non-zero. In other words, allow for -1 as a valid key size in support of the --textkey to SEE. check-in: 03573887 user: drh tags: trunk
19:11
Fix problems with the fileRead() function in the command-line shell. Fix a harmless memory leak in the command-line shell, to make validation testing easier. check-in: e660402e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/attach.c.

   188    188           zKey = (char *)sqlite3_value_blob(argv[2]);
   189    189           rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
   190    190           break;
   191    191   
   192    192         case SQLITE_NULL:
   193    193           /* No key specified.  Use the key from the main database */
   194    194           sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
   195         -        if( nKey>0 || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){
          195  +        if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){
   196    196             rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
   197    197           }
   198    198           break;
   199    199       }
   200    200     }
   201    201   #endif
   202    202