1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

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.

FossilOrigin-Name: 03573887dbf357f8aa54e4a1cd03b82b0ded8139
This commit is contained in:
drh
2016-09-16 19:42:47 +00:00
parent d145915a59
commit 7152cc0641
3 changed files with 8 additions and 8 deletions

View File

@@ -192,7 +192,7 @@ static void attachFunc(
case SQLITE_NULL:
/* No key specified. Use the key from the main database */
sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
if( nKey>0 || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){
if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){
rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
}
break;