MySQL-on-SQLite does not translate DATE arithmetic with INTERVAL HOUR
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in wp-includes/database/sqlite/class-wp-pdo-mysql-on-sqlite.php and trace how MySQL date arithmetic is translated before the SQLite query executes. Reproduce the SELECT using INTERVAL 5 HOUR, then verify that the generated SQLite datetime expression runs without a syntax error and supports the stated WordPress plugin query.
Written by the indexing model from the issue text.
Description
Bug
The current MySQL-on-SQLite driver leaves MySQL date arithmetic unchanged, causing SQLite syntax errors for queries such as:
SELECT DATE(start_datetime - INTERVAL 5 HOUR) FROM wp_event_dates;
The executed SQLite query still contains INTERVAL 5 HOUR and fails with:
SQLSTATE[HY000]: General error: 1 near \"5\": syntax error
Runtime
- WordPress Playground / WP Codebox
- WordPress 7.0.2
- PHP 8.3.31
- SQLite integration path:
wp-includes/database/sqlite/class-wp-pdo-mysql-on-sqlite.php
Expected
Translate MySQL INTERVAL ... HOUR date arithmetic to an equivalent SQLite datetime modifier so valid WordPress plugin queries can execute under the compatibility layer.
Impact
This blocks focused WordPress PHPUnit coverage for timezone-aware calendar boundaries in Extra-Chill/data-machine-events#489 after its custom test table is successfully created.
- Dominant language
- PHP
- Stars
- 363
- Forks
- 67
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 7
Contributor guide
No contributing guide indexed for this repository
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
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
WordPress/sqlite-database-integration#504 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
WordPress/sqlite-database-integration#478 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in WordPress/sqlite-database-integration
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·