Skip to content

MySQL-on-SQLite does not translate DATE arithmetic with INTERVAL HOUR #454

Description

@chubes4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions