WordPress / WordPress/sqlite-database-integration

MySQL-on-SQLite lacks geo query function compatibility

Open
#455 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
363
Forks
67
Avg merge
2d 15h
Merged PRs (30d)
7

Description

Bug

The current MySQL-on-SQLite driver cannot execute common MySQL geo expressions combining RADIANS(), COS(), SIN(), and SUBSTRING_INDEX() over a comma-separated coordinate value. WP Codebox calendar PHPUnit cases reach these queries but the compatibility layer reports database errors instead of translating or providing the functions.

Representative expression:

RADIANS(CAST(SUBSTRING_INDEX(meta_value, ',', 1) AS DECIMAL(10,7)))

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

Provide compatibility for these MySQL scalar functions, or document a compatibility-layer primitive for registering them in test runtimes.

Impact

This blocks geo-filter assertions in Extra-Chill/data-machine-events CalendarAbilitiesTest under the SQLite-backed WP Codebox runtime.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in wp-includes/database/sqlite/class-wp-pdo-mysql-on-sqlite.php and inspect how SQLite compatibility functions are registered. Reproduce the failing geo queries through the WP Codebox CalendarAbilitiesTest cases, then verify that RADIANS(), COS(), SIN(), and SUBSTRING_INDEX() execute successfully without database errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php, sqlite
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.