Honor PDO::ATTR_CASE and PDO::ATTR_ORACLE_NULLS without affecting internal queries
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start in WP_MySQL_On_SQLite, focusing on PDO attribute handling and the result-statement layer. Add coverage for constructor options and runtime changes using PDO::CASE_LOWER, PDO::CASE_UPPER, PDO::NULL_TO_STRING, and PDO::NULL_EMPTY_STRING. Done means caller-visible SELECT, SHOW, DESCRIBE, and synthesized results honor the requested modes while internal queries, DDL, schema reconstruction, SHOW CREATE TABLE, fetch modes, object results, and getColumnMeta() remain correct across supported PHP versions.
Written by the indexing model from the issue text.
Description
Problem
WP_MySQL_On_SQLite forwards numeric PDO constructor options and most setAttribute() calls to the underlying SQLite PDO connection. Setting PDO::ATTR_CASE or PDO::ATTR_ORACLE_NULLS therefore changes internal query results as well as caller-visible results.
For PDO::ATTR_CASE, constructing the driver with PDO::CASE_LOWER lowercases keys returned by internal INFORMATION_SCHEMA queries. Driver code expects canonical keys such as COLUMN_NAME, so a subsequent CREATE TABLE emits an undefined-key warning and fails.
PDO::ATTR_ORACLE_NULLS can silently corrupt schema metadata. With PDO::NULL_TO_STRING, even CREATE TABLE t (id INT PRIMARY KEY) creates the SQLite column with DEFAULT ''. With PDO::NULL_EMPTY_STRING, internal metadata fields become null and operations such as SHOW CREATE TABLE fail.
Proposed solution
Treat both attributes as caller-visible wrapper state, similarly to PDO::ATTR_ERRMODE:
- Track the requested case and Oracle null modes in
WP_MySQL_On_SQLiteand expose them throughsetAttribute()andgetAttribute(). - Keep the underlying SQLite connection at
PDO::CASE_NATURALandPDO::NULL_NATURALfor internal queries. - Apply the requested modes only to caller-visible result statements, including
SELECT,SHOW,DESCRIBE, and synthesized result sets. - For
PDO::ATTR_CASE, scope the requested mode around preparing and executing result statements, then restorePDO::CASE_NATURALin afinallyblock. PDO captures folded result-column names when a statement is executed. - For
PDO::ATTR_ORACLE_NULLS, apply the requested null conversion in the result-statement layer. PDO SQLite consults the connection-level setting when rows are fetched, so temporarily changing it only during execution is insufficient and leaving it enabled would affect later internal queries.
Add coverage for constructor options and runtime attribute changes using PDO::CASE_LOWER, PDO::CASE_UPPER, PDO::NULL_TO_STRING, and PDO::NULL_EMPTY_STRING. Verify fetch modes, associative and object results, getColumnMeta(), DDL and schema reconstruction, SHOW CREATE TABLE, and behavior across the supported PHP versions.
This is a follow-up to #471.
- Dominant language
- PHP
- Stars
- 362
- Forks
- 67
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WordPress/sqlite-database-integration
-
MySQL-on-SQLite does not translate DATE arithmetic with INTERVAL HOURPossibly taken @samuelmbabhazi claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
WordPress/sqlite-database-integration#454 · 3 comments ·
Maintainers usually reply within 4 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WordPress/sqlite-database-integration#516 ·
Maintainers usually reply within 4 days
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
WordPress/sqlite-database-integration#515 ·
Maintainers usually reply within 4 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
WordPress/sqlite-database-integration#513 ·
Maintainers usually reply within 4 days
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
WordPress/sqlite-database-integration#504 · 3 comments ·
Maintainers usually reply within 4 days
All issues in WordPress/sqlite-database-integration
Similar issues
-
[CoreBundle] Migrations are silently skipped on MariaDB with DBAL 4 (AbstractMigration::isMySql())OpenPotential Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Sylius/Sylius#19270 · 1 comment · 4 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
invoiceninja/invoiceninja#13320 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Перевод устарел
Difficulty 2/5 1-3 hours Newbie friendliness 68/100