Skip to content

Fix MariaDB 12.3 conversion metric queries - #5

Merged
bradvin merged 1 commit into
fooplugins:masterfrom
foo-bender:fix/mariadb-12-3-conversion-reserved-word
Sep 13, 2026
Merged

bradvin merged 1 commit into
fooplugins:masterfrom
foo-bender:fix/mariadb-12-3-conversion-reserved-word

Conversation

@foo-bender

@foo-bender foo-bender commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • quote every conversion column reference in FooConvert Pro analytics and experiment SQL
  • update the Pro submodule to the fixed commit from fooplugins/fooconvert-pro#2
  • add regression coverage for the filtered core Query execution paths, including get_all_popup_metrics(), plus experiment result SQL

Problem and root cause

MariaDB 12.3 added CONVERSION as a reserved word. Existing databases can retain the conversion column, but SQL that refers to it without identifier quoting now fails with syntax error 1064. MariaDB documents both the 12.3+ reservation and the requirement to quote reserved identifiers:

https://mariadb.com/docs/server/reference/sql-structure/sql-language-structure/reserved-words

The core schema DDL already quotes this column. The remaining affected paths were the Pro single-popup aggregate, all-popup aggregate (including both seven-day windows), daily activity aggregate, and experiment result aggregate.

Fix

The Pro queries now use backticks around the fixed column identifier. Query values and placeholders are unchanged, so this does not alter metric semantics or weaken $wpdb->prepare() coverage.

Verification

  • RED: the new focused regression failed against the unquoted SQL with the expected assertion
  • GREEN: php tests/cases/mariadb-reserved-conversion-sql.php
  • PHP suite: npm run test:php
  • JavaScript suite: npm run test:js — 24 files / 104 tests passed
  • build: npm run build — passed with the existing webpack asset-size warnings
  • PHP syntax checks passed for both changed Pro files and the new test
  • Composer manifests validated (existing exact-version warnings remain)
  • independent pre-commit review passed with no security or logic findings

MariaDB 12.3.3 runtime check

A disposable MariaDB 12.3.3 server reproduced error 1064 for an unquoted conversion aggregate and accepted the equivalent backtick-quoted identifier. The focused regression separately captures the generated FooConvert queries and verifies every affected conversion reference is quoted, including Query::get_all_popup_metrics().

Compatibility and merge order

Backtick quoting is supported across FooConvert's existing MySQL/MariaDB range and only disambiguates the identifier.

fooplugins/fooconvert-pro#2 should merge first. This PR currently points the submodule at its reviewed head commit (e32664a). If the Pro PR is squash-merged or otherwise rewrites that SHA, update this submodule pointer to the merged Pro commit before merging this PR.

No release or deployment is included.

@foo-bender

Copy link
Copy Markdown
Contributor Author

CI note: the fooconvert-build check reaches WordPress Plugin Check and fails on an existing base-branch release-metadata mismatch: readme.txt has Stable tag: 2.1.2, while fooconvert.php and package.json are 2.1.8. This PR does not change any of those files (git diff origin/master...HEAD -- readme.txt fooconvert.php package.json is empty), so the failure is unrelated to the MariaDB SQL fix. The focused regression, PHP/JS suites, and production build pass locally. I have intentionally not mixed a release-metadata change into this fix.

@bradvin
bradvin merged commit b7b2694 into fooplugins:master Sep 13, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants