Skip to content

native: expand scalar projection functions - #382

Closed
chubes4 wants to merge 3 commits into
mainfrom
fix/terra-mdi-372-20260908
Closed

chubes4 wants to merge 3 commits into
mainfrom
fix/terra-mdi-372-20260908

Conversation

@chubes4

@chubes4 chubes4 commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve scalar-containing WHERE clauses as generic OR-of-AND boolean groups, including WordPress Date Query-style OR with a normal conjunct.
  • Force scalar residual filters to run before LIMIT; apply scalar HAVING after aggregate grouping.
  • Fail closed instead of silently bypassing scalar clauses on JOINs or scalar/subquery mixtures.

Verification

  • php -l inc/native/class-wp-markdown-native-query-{ast,contracts,parser,executor}.php
  • php tests/smoke-native-scalar-projection.php
  • php tests/smoke-native-scalar-clauses.php
  • Lab: isolated native scalar smoke passed.
  • Lab: disposable MariaDB 11.4 matched Date Query OR (1,3), calendar buckets (2024-01:2,2024-02:1), and geo order (3,2,1).
  • Lab: WordPress Codebox coverage completed and recognized all three scalar statement surfaces.

Limits

  • The Codebox coverage report is not a complete pass (38/39 statements, 16/24 operations), due to unrelated existing unsupported shapes.
  • SQLite differential smoke is blocked before comparison by a missing generated result_envelope artifact in this checkout.
  • Scalar work is residual after a full safe read; scalar JOIN/subquery mixtures fail closed. Grouped-result ORDER BY/LIMIT is still unsupported.

AI Assistance Disclosure

Implemented and tested with OpenAI GPT-5.6 Terra (openai/gpt-5.6-terra) using OpenCode. I reviewed and repaired parser/plan/executor semantics, added regression coverage, and ran the listed native, MariaDB, and WordPress Codebox workflows.

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.

1 participant