Skip to content

Commit 24cd1f3

Browse files
committed
test: record PostgreSQL expression coverage gains and API contracts
Refresh the pinned PostgreSQL 18.4 accepted-statement inventory, selected CI fixtures and compatibility report after the native expression grammar changes. The 51,415-statement corpus now contains 26,243 complete-input AST results, up 7,104 from 19,139 before this expression phase. All transitions are gains: 7,074 trailing-input and 30 partial cases become complete; no previously complete case is lost. Newly complete statements comprise 6,454 SELECT, 310 INSERT, 268 EXPLAIN, 55 UPDATE, 14 DELETE, two SET and one CALL. Document canonical cast emission, typed-literal length preservation, lexical type leaves, PostgreSQL symbolic operator precedence, collation and named arguments. Explain bind preservation, appended token/node kinds, planner rejection and remaining grammar limits. Update the AST parameterization guide because supported PostgreSQL CAST and typed string constants now rewrite correctly instead of being rejected as generic functions or string aliases. Retain the authorized phase plan, review rulings and completion evidence. The source commit recorded in the report identifies the same parser sources as the working tree measured immediately before committing. Complete-input coverage checks status, classification, AST presence and consumption; it is not semantic equivalence or a representative production-workload percentage. Type/operator/catalog resolution and complete PostgreSQL grammar remain outside the scope of this increment. Validation: 1,370 C++ tests pass with 37 backend-dependent skips; all 42 focused AST/expression tests pass under ASan/UBSan; all 87 compatibility harness tests and 26,835 refreshed CI fixtures pass. Forty-six focused SQL reconstructions match PostgreSQL ASTs after source positions are removed, and independent review checks all 494 keyword classifications plus ten argument cases. Benchmarks, reports of timings and benchmark build artifacts remain local.
1 parent b06aa50 commit 24cd1f3

6 files changed

Lines changed: 16458 additions & 23200 deletions

File tree

‎docs/ast-utilities.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,20 @@ CURRENT_TIME, LOCALTIME, and LOCALTIMESTAMP remains a syntax constant. MySQL als
111111
preserves precision arguments of NOW, CURTIME, SYSDATE, UTC_TIME, and
112112
UTC_TIMESTAMP; these ordinary function names retain bindable arguments in
113113
PostgreSQL. Quoted function names retain bindable arguments in both dialects.
114-
Aggregate FILTER predicates and window frame offsets are bindable. A manually constructed binary `::` AST is supported; this does not
115-
extend the parser's existing cast grammar.
114+
Aggregate FILTER predicates and window frame offsets are bindable. PostgreSQL
115+
casts and type-prefixed string literals now produce `NODE_TYPE_CAST` with an
116+
expression child and a `NODE_TYPE_NAME` leaf. Cast values are bindable; type
117+
modifiers and array bounds remain intact. Named function argument values are
118+
bindable while their names remain intact. Manually constructed binary `::`
119+
ASTs retain their existing support.
116120

117121
Unsupported roots and contexts return `UnsupportedRoot` or `UnsupportedContext`
118122
with no AST or partial mapping. These include SET/transaction/COPY/DDL/other
119123
utility statements, SELECT INTO, CTEs, generic function-shaped CAST nodes,
120124
opaque subquery/interval fragments, and unknown future node types. PostgreSQL
121-
string-shaped aliases are rejected, including typed string literals currently
122-
misparsed as aliases (for example, `SELECT TIMESTAMP '2020-01-01'`). These
125+
string-shaped aliases are rejected. Supported type-prefixed literals such as
126+
`SELECT TIMESTAMP '2020-01-01'` now parameterize as casts instead of being
127+
misparsed as aliases. These
123128
restrictions reflect contexts where replacing literals or the current emitter
124129
would not produce reliable executable SQL. Parameterization does not change the
125130
existing digest API.

0 commit comments

Comments
 (0)