Skip to content

Fix GH-12633: remove 'PRAGMA writable_schema;' #12636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

SakiTakamachi
Copy link
Member

@SakiTakamachi SakiTakamachi commented Nov 9, 2023

Closes #12633

Originally, PRAGMA writable_schema; seems to have no meaning as it simply returns 1.

@SakiTakamachi SakiTakamachi changed the base branch from master to PHP-8.1 November 9, 2023 00:16
@andypost
Copy link
Contributor

andypost commented Nov 9, 2023

used to test and it fails as

TEST 3/3 [ext/sqlite3/tests/sqlite3_defensive.phpt]
========DIFF========
002+ int(0)
     int(1)
003- int(1)
     
     Warning: SQLite3::querySingle(): Unable to prepare statement: 1, table sqlite_master may not be modified in %s on line %d
     bool(false)

@SakiTakamachi
Copy link
Member Author

Oops, I made a mistake in the correction.

@SakiTakamachi SakiTakamachi changed the title Fix GH-12633: remove 'PRAGMA writable_schema = ON;' Fix GH-12633: remove 'PRAGMA writable_schema;' Nov 9, 2023
@andypost
Copy link
Contributor

andypost commented Nov 9, 2023

Latest change passed, thank you!

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the sqlite3 changelog, this makes sense to me

nielsdos pushed a commit that referenced this pull request Nov 9, 2023
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.
@nielsdos nielsdos closed this in 78fba9c Nov 9, 2023
@SakiTakamachi SakiTakamachi deleted the fix/gh-12633 branch November 21, 2023 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sqlite3_defensive.phpt fails with sqlite 3.44.0
3 participants