Skip to content

Commit 2a4775d

Browse files
SakiTakamachinielsdos
authored andcommitted
Fix GH-12633: sqlite3_defensive.phpt fails with sqlite 3.44.0
Removes 'PRAGMA writable_schema;'. From sqlite changelog https://www.sqlite.org/releaselog/3_44_0.html: > The SQLITE_DBCONFIG_DEFENSIVE setting now prevents PRAGMA writable_schema > from being turned on. > Previously writable_schema could be turned on, but would not actually allow > the schema to be writable. Now it simply cannot be turned on. Closes GH-12636.
1 parent 78fba9c commit 2a4775d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ PHP NEWS
88
- Standard:
99
. Fix memory leak in syslog device handling. (danog)
1010

11+
- SQLite3:
12+
. Fixed bug GH-12633 (sqlite3_defensive.phpt fails with sqlite 3.44.0).
13+
(SakiTakamachi)
14+
1115
23 Nov 2023, PHP 8.1.26
1216

1317
- Core:

ext/sqlite3/tests/sqlite3_defensive.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ var_dump($db->exec('CREATE TABLE test (a, b);'));
2020

2121
// This does not generate an error!
2222
var_dump($db->exec('PRAGMA writable_schema = ON;'));
23-
var_dump($db->querySingle('PRAGMA writable_schema;'));
2423

2524
// Should be 1
2625
var_dump($db->querySingle('SELECT COUNT(*) FROM sqlite_master;'));
@@ -35,8 +34,7 @@ var_dump($db->querySingle('SELECT COUNT(*) FROM sqlite_master;'));
3534
bool(true)
3635
bool(true)
3736
int(1)
38-
int(1)
3937

4038
Warning: SQLite3::querySingle(): Unable to prepare statement: 1, table sqlite_master may not be modified in %s on line %d
4139
bool(false)
42-
int(1)
40+
int(1)

0 commit comments

Comments
 (0)