2727** Change 4: Call sqlite3mcBtreeSetPageSize instead of sqlite3BtreeSetPageSize for main database
2828** (sqlite3mcBtreeSetPageSize allows to reduce the number of reserved bytes)
2929**
30- ** This code is generated by the script rekeyvacuum.sh from SQLite version 3.52.0 amalgamation.
30+ ** This code is generated by the script rekeyvacuum.sh from SQLite version 3.51.3 amalgamation.
3131*/
3232SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3mcRunVacuumForRekey (
3333 char * * pzErrMsg , /* Write error message here */
@@ -118,19 +118,9 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3mcRunVacuumForRekey(
118118 pDb = & db -> aDb [nDb ];
119119 assert ( strcmp (pDb -> zDbSName ,zDbVacuum )== 0 );
120120 pTemp = pDb -> pBt ;
121-
122- /* A VACUUM cannot change the pagesize of an encrypted database. */
123- if ( db -> nextPagesize ){
124- extern void sqlite3mcCodecGetKey (sqlite3 * , int , void * * , int * );
125- int nKey ;
126- char * zKey ;
127- sqlite3mcCodecGetKey (db , iDb , (void * * )& zKey , & nKey );
128- if ( nKey ) db -> nextPagesize = 0 ;
129- }
130121 if ( pOut ){
131122 sqlite3_file * id = sqlite3PagerFile (sqlite3BtreePager (pTemp ));
132123 i64 sz = 0 ;
133- const char * zFilename ;
134124 if ( id -> pMethods != 0 && (sqlite3OsFileSize (id , & sz )!= SQLITE_OK || sz > 0 ) ){
135125 rc = SQLITE_ERROR ;
136126 sqlite3SetString (pzErrMsg , db , "output file already exists" );
@@ -142,14 +132,15 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3mcRunVacuumForRekey(
142132 ** they are for the database being vacuumed, except that PAGER_CACHESPILL
143133 ** is always set. */
144134 pgflags = db -> aDb [iDb ].safety_level | (db -> flags & PAGER_FLAGS_MASK );
135+ }
145136
146- /* If the VACUUM INTO target file is a URI filename and if the
147- ** "reserve=N" query parameter is present, reset the reserve to the
148- ** amount specified, if the amount is within range */
149- zFilename = sqlite3BtreeGetFilename ( pTemp ) ;
150- if ( ALWAYS ( zFilename ) ){
151- int nNew = ( int ) sqlite3_uri_int64 ( zFilename , "reserve" , nRes );
152- }
137+ /* A VACUUM cannot change the pagesize of an encrypted database. */
138+ if ( db -> nextPagesize ){
139+ extern void sqlite3mcCodecGetKey ( sqlite3 * , int , void * * , int * );
140+ int nKey ;
141+ char * zKey ;
142+ sqlite3mcCodecGetKey ( db , iDb , ( void * * ) & zKey , & nKey );
143+ if ( nKey ) db -> nextPagesize = 0 ;
153144 }
154145
155146 sqlite3BtreeSetCacheSize (pTemp , db -> aDb [iDb ].pSchema -> cache_size );
0 commit comments