Skip to content

Commit

Permalink
Add SQLite version 3.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
resilar committed Apr 24, 2019
1 parent 8b01111 commit 2ef0996
Show file tree
Hide file tree
Showing 5 changed files with 5,017 additions and 3,720 deletions.
16 changes: 11 additions & 5 deletions rekeyvacuum.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
** Change 2: Remove local variable 'int nRes'
** Change 3: Remove initialization 'nRes = sqlite3BtreeGetOptimalReserve(pMain)'
**
** Code generated by script/rekeyvacuum.sh from SQLite v3.27.2 amalgamation.
** Code generated by script/rekeyvacuum.sh from SQLite v3.28.0 amalgamation.
*/
SQLITE_PRIVATE int sqlite3RekeyVacuum(
SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3RekeyVacuum(
char **pzErrMsg, /* Write error message here */
sqlite3 *db, /* Database connection */
int iDb, /* Which attached DB to vacuum */
sqlite3_value *pOut /* Write results here, if not NULL */
sqlite3_value *pOut /* Write results here, if not NULL. VACUUM INTO */
, int nRes){
int rc = SQLITE_OK; /* Return code from service routines */
Btree *pMain; /* The database being vacuumed */
Expand All @@ -23,6 +23,7 @@ SQLITE_PRIVATE int sqlite3RekeyVacuum(
u64 saved_flags; /* Saved value of db->flags */
int saved_nChange; /* Saved value of db->nChange */
int saved_nTotalChange; /* Saved value of db->nTotalChange */
u32 saved_openFlags; /* Saved value of db->openFlags */
u8 saved_mTrace; /* Saved trace settings */
Db *pDb = 0; /* Database to detach at end of vacuum */
int isMemDb; /* True if vacuuming a :memory: database */
Expand All @@ -32,18 +33,21 @@ SQLITE_PRIVATE int sqlite3RekeyVacuum(

if( !db->autoCommit ){
sqlite3SetString(pzErrMsg, db, "cannot VACUUM from within a transaction");
return SQLITE_ERROR;
return SQLITE_ERROR; /* IMP: R-12218-18073 */
}
if( db->nVdbeActive>1 ){
sqlite3SetString(pzErrMsg, db,"cannot VACUUM - SQL statements in progress");
return SQLITE_ERROR;
return SQLITE_ERROR; /* IMP: R-15610-35227 */
}
saved_openFlags = db->openFlags;
if( pOut ){
if( sqlite3_value_type(pOut)!=SQLITE_TEXT ){
sqlite3SetString(pzErrMsg, db, "non-text filename");
return SQLITE_ERROR;
}
zOut = (const char*)sqlite3_value_text(pOut);
db->openFlags &= ~SQLITE_OPEN_READONLY;
db->openFlags |= SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE;
}else{
zOut = "";
}
Expand Down Expand Up @@ -82,6 +86,7 @@ SQLITE_PRIVATE int sqlite3RekeyVacuum(
*/
nDb = db->nDb;
rc = execSqlF(db, pzErrMsg, "ATTACH %Q AS vacuum_db", zOut);
db->openFlags = saved_openFlags;
if( rc!=SQLITE_OK ) goto end_of_vacuum;
assert( (db->nDb-1)==nDb );
pDb = &db->aDb[nDb];
Expand All @@ -95,6 +100,7 @@ SQLITE_PRIVATE int sqlite3RekeyVacuum(
sqlite3SetString(pzErrMsg, db, "output file already exists");
goto end_of_vacuum;
}
db->mDbFlags |= DBFLAG_VacuumInto;
}

/* A VACUUM cannot change the pagesize of an encrypted database. */
Expand Down
2 changes: 1 addition & 1 deletion script/rekeyvacuum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cat <<EOF
** Code generated by script/rekeyvacuum.sh from SQLite v$VERSION amalgamation.
*/
EOF
sed -n '/^SQLITE_PRIVATE int sqlite3RunVacuum([^;]*$/,/^}$/p' "$INPUT" \
sed -n '/^SQLITE_PRIVATE .*int sqlite3RunVacuum([^;]*$/,/^}$/p' "$INPUT" \
| sed 's/sqlite3RunVacuum/sqlite3RekeyVacuum/' \
| sed 's/^\([^ )][^)]*\)\?){$/\1, int nRes){/' \
| grep -v "int nRes;\|nRes = " \
Expand Down
Loading

0 comments on commit 2ef0996

Please sign in to comment.