1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 22:28:47 -04:00

backup feature is only available for sqlite 3.6.11 and newer

This commit is contained in:
Kenichi Ishigaki 2010-06-10 06:21:23 +00:00
parent 52b266333e
commit f26fd5cfe8

View file

@ -1761,12 +1761,13 @@ sqlite_db_set_authorizer(pTHX_ SV *dbh, SV *authorizer)
int int
sqlite_db_backup_from_file(pTHX_ SV *dbh, char *filename) sqlite_db_backup_from_file(pTHX_ SV *dbh, char *filename)
{ {
D_imp_dbh(dbh);
#if SQLITE_VERSION_NUMBER >= 3006011
int rc; int rc;
sqlite3 *pFrom; sqlite3 *pFrom;
sqlite3_backup *pBackup; sqlite3_backup *pBackup;
D_imp_dbh(dbh);
croak_if_db_is_null(); croak_if_db_is_null();
rc = sqlite_open(filename, &pFrom); rc = sqlite_open(filename, &pFrom);
@ -1789,6 +1790,10 @@ sqlite_db_backup_from_file(pTHX_ SV *dbh, char *filename)
} }
return TRUE; return TRUE;
#else
sqlite_error(dbh, SQLITE_ERROR, form("backup feature requires SQLite 3.6.11 and newer"));
return FALSE;
#endif
} }
/* Accesses the SQLite Online Backup API, and copies the currently loaded /* Accesses the SQLite Online Backup API, and copies the currently loaded
@ -1799,12 +1804,13 @@ sqlite_db_backup_from_file(pTHX_ SV *dbh, char *filename)
int int
sqlite_db_backup_to_file(pTHX_ SV *dbh, char *filename) sqlite_db_backup_to_file(pTHX_ SV *dbh, char *filename)
{ {
D_imp_dbh(dbh);
#if SQLITE_VERSION_NUMBER >= 3006011
int rc; int rc;
sqlite3 *pTo; sqlite3 *pTo;
sqlite3_backup *pBackup; sqlite3_backup *pBackup;
D_imp_dbh(dbh);
croak_if_db_is_null(); croak_if_db_is_null();
rc = sqlite_open(filename, &pTo); rc = sqlite_open(filename, &pTo);
@ -1827,6 +1833,10 @@ sqlite_db_backup_to_file(pTHX_ SV *dbh, char *filename)
} }
return TRUE; return TRUE;
#else
sqlite_error(dbh, SQLITE_ERROR, form("backup feature requires SQLite 3.6.11 and newer"));
return FALSE;
#endif
} }
/* end */ /* end */