mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-08 22:58:17 -04:00
sqlite_db_readonly requires SQLite 3.7.11
This commit is contained in:
parent
fcb048e838
commit
b624002827
2 changed files with 6 additions and 1 deletions
2
dbdimp.c
2
dbdimp.c
|
@ -703,12 +703,14 @@ sqlite_db_STORE_attrib(SV *dbh, imp_dbh_t *imp_dbh, SV *keysv, SV *valuesv)
|
||||||
DBIc_set(imp_dbh, DBIcf_AutoCommit, SvTRUE(valuesv));
|
DBIc_set(imp_dbh, DBIcf_AutoCommit, SvTRUE(valuesv));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#if SQLITE_VERSION_NUMBER >= 3007011
|
||||||
if (strEQ(key, "ReadOnly")) {
|
if (strEQ(key, "ReadOnly")) {
|
||||||
if (SvTRUE(valuesv) && !sqlite3_db_readonly(imp_dbh->db, "main")) {
|
if (SvTRUE(valuesv) && !sqlite3_db_readonly(imp_dbh->db, "main")) {
|
||||||
sqlite_error(dbh, 0, "ReadOnly is set but it's only advisory");
|
sqlite_error(dbh, 0, "ReadOnly is set but it's only advisory");
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (strEQ(key, "sqlite_allow_multiple_statements")) {
|
if (strEQ(key, "sqlite_allow_multiple_statements")) {
|
||||||
imp_dbh->allow_multiple_statements = !(! SvTRUE(valuesv));
|
imp_dbh->allow_multiple_statements = !(! SvTRUE(valuesv));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -6,9 +6,12 @@ BEGIN {
|
||||||
$^W = 1;
|
$^W = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
use t::lib::Test qw/connect_ok/;
|
use t::lib::Test qw/connect_ok requires_sqlite/;
|
||||||
use Test::More;
|
use Test::More;
|
||||||
use DBD::SQLite::Constants qw/SQLITE_OPEN_READONLY/;
|
use DBD::SQLite::Constants qw/SQLITE_OPEN_READONLY/;
|
||||||
|
|
||||||
|
BEGIN { requires_sqlite('3.7.11') }
|
||||||
|
|
||||||
use Test::NoWarnings;
|
use Test::NoWarnings;
|
||||||
|
|
||||||
plan tests => 14;
|
plan tests => 14;
|
||||||
|
|
Loading…
Add table
Reference in a new issue