You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decouple driver internals from PDO::ATTR_STRINGIFY_FETCHES #451
The MySQL-on-SQLite driver currently relies on PDO::ATTR_STRINGIFY_FETCHES being enabled for some of its internal metadata queries.
When stringification is disabled (the default for PDO SQLite), SQLite metadata values are returned as integers on current PHP versions. Several driver paths compare those values strictly against strings, so changing a public PDO fetch attribute can alter internal DDL and emulation behavior.
Known examples include:
detecting temporary information-schema tables with fetchColumn() === '1'
restoring PRAGMA foreign_keys only when its value is strictly '1'
interpreting NON_UNIQUE only when its value is strictly '0'
reconstructing columns and indexes by comparing notnull, pk, and unique metadata to string values
This was observed while simplifying the driver API in #449. With PDO::ATTR_STRINGIFY_FETCHES disabled, translation tests failed because unique indexes were recreated as non-unique and foreign-key state handling was skipped.
WordPress and the MySQL binary protocol adapter may still choose to enable stringified fetches for their outward compatibility. The driver's internal correctness should not depend on that caller-facing setting.
Expected behavior
Normalize or cast internal SQLite metadata independently of PDO::ATTR_STRINGIFY_FETCHES.
Produce identical DDL, index, foreign-key, and information-schema behavior whether stringified fetches are enabled or disabled.
Continue honoring PDO::ATTR_STRINGIFY_FETCHES for result values returned through the public PDO-compatible API.
Add coverage for both attribute states, including unique index reconstruction and foreign-key handling.
Activity
Fix temporary table lookup without stringified fetches and with a dif…
Fix unique keys and foreign key restore without stringified fetches (W…