Repository navigation
feat: minimal engine enablers for the GQL extension (incl. standalone-call rewrite batch fix) - #1104
Conversation
getRewriteQuery() left the previous statement's rewrite text in place, so a multi-statement batch could leak one statement's rewrite into statements that have none (and into statements whose rewrite failed to fire). rewriteFunc has no in-tree provider yet (the hook is exercised by the GQL extension suite in LadybugDB/extensions), so this is not observable in core tests today; the fix is the mechanical reset.
Catalog::setFunctionFallback lets a graph catalog resolve functions that live in the main catalog; without it, USE GRAPH makes CALL of any main-catalog function fail with 'function does not exist'. Required by the GQL extension, whose functions are registered on main.
ExtensionManager::setData/getData attach a named, per-database blob to an extension (ownership: the extension). The GQL extension uses the slot for its graph-type registry, which must survive across calls and be scoped per database.
BoundPathExpression never carried its name, so consumers that need the path variable's name (e.g. whole-path predicates like IS_TRAIL(p) emitted by the GQL translation layer) could not resolve it. Naming only; no query-semantics change.
|
This looks good to go. Some followups/questions:
|
|
Thanks for the review and the merge — and for the three questions. Each answer verified against the merged code: 1. Macros excluded from fallback — intentional? 2. SHOW FUNCTIONS / dropFunction asymmetry — conscious? 3. Attached-DB scope — out of design? Follow-ups you listed
|
…ql/tck 190/206) Evolution of this extension's translator into a TCK-verified generation, building on the existing scaffold (parser vendoring, build system incl. ANTLR4CPP_STATIC/macOS symbol export, and the original basic.test by @adsharma — kept and evolved). - transformer: ground-up rework — explicit per-statement dispatch, SELECT/GROUP BY/HAVING, writes, transactions/sessions, schema-namespace registry; multi-hop quantified path patterns (bounded expansion, ISO list bindings); exact TRAIL/ACYCLIC/SIMPLE path modes (whole-path predicates where the engine's *ACYCLIC is weaker); value-model bridges for ANY-graph JSON properties (comparison/order/total-order aggregates); narrow GQLSTATUS stamping - loud-rejection policy: unmapped constructs fail fast with 'GQL feature not supported: <construct>' — zero silent wrong answers - tests: 161 dual-run parity cases across 18 suites (evolved from basic.test); opengql/tck harness with three-tier GQLSTATUS assertions and corpus-integrity footnotes — 190/206 green (70 passed + 120 passed-with-note), 9 loud-rejection failures, wrong-GQLSTATUS=0; REPORT.md included - docs: README (graded compatibility matrix, 23 known semantic differences), THIRD_PARTY_NOTICES.md (Apache-2.0 sources the mapping rules were adapted from) - build: +yyjson include + gql_json_functions sources Requires the engine-side enablers in LadybugDB/ladybug#1104.
Per #1096, this is the engine-side half of the GQL contribution: four small, independent concerns (~48 lines total) that the GQL→Cypher translation layer needs from core. Happy to split into separate PRs if preferred.
Changes
standalone_call_rewriter.cpp, +4) —getRewriteQuery()left the previous statement's rewrite text in place, so a multi-statement batch could leak one statement's rewrite into statements that have none (and into statements whose rewrite failed to fire). Mechanical reset; see the testing note below.catalog.h/.cpp,database_manager.cpp) —Catalog::setFunctionFallbacklets a graph catalog resolve functions that live in the main catalog. Without it,USE GRAPHmakes any main-catalog function call fail with "function does not exist".extension_manager.h/.cpp) —ExtensionManager::setData/getDataattach a named per-database blob to an extension. The GQL extension uses the slot for its graph-type registry (per-database, survives across calls).bind_graph_pattern.cpp, +4) —BoundPathExpressionnever carried its name; whole-path predicates (IS_TRAIL(p)etc.) emitted by the GQL translation layer need to resolve it. Naming only; no query-semantics change.Types of changes
Testing
-Werror) including these changes: CI run 37164343158. On Windows/MSVC: 1972/1975 — the 3 failures are the extension-registry INSTALL cases in a build config where CMake's optionalfind_package(OpenSSL 3)is not satisfied (bundled cpp-httplib built without SSL); they pass with OpenSSL + network and are unrelated to these changes.rewriteFunchas no in-tree provider (the hook is assigned only by extensions), so the leak in (1) is not observable in core tests today; (2)–(4) are consumed by the GQL extension's suite. Positive coverage arrives with the extension PR to LadybugDB/extensions (161 dual-run parity cases + an opengql/tck run — see Feature: ISO GQL compatibility layer extension (CALL GQL → Cypher translation) — contribution offer / RFC #1096). Happy to add a core-level test if there is a way to exerciserewriteFuncin-tree that we have missed.Checklist