• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AfterShip / clickhouse-sql-parser / 28729129888

05 Jul 2026 04:11AM UTC coverage: 53.971% (+0.5%) from 53.445%
28729129888

push

github

web-flow
Fix Accept/Walk field-level drift and InsertStmt End panic (#284)

The two traversal engines each encode every node's children by hand, and
the existing drift test only asserts that both engines know the same
node TYPES - it cannot see a child FIELD one engine traverses and the
other forgot. A new static test compares, per node type, the fields
referenced by Accept against the fields referenced by Walk's case, and
it immediately found ten drifted fields:

Accept was missing (Walk visited them):
- AlterTableDropPartition.Settings
- CreateDatabase.Name, CreateDatabase.Comment
- CreateTable.Comment
- IntervalFrom.Interval
- ProjectionOrderByClause.Columns
- SelectQuery.DistinctOn
- UUID.Value

Walk was missing (Accept visited them):
- InsertStmt.Values (INSERT ... VALUES rows were never walked)
- SelectQuery.Except
- WhenClause.Else

Also:
- InsertStmt.End() panicked on `INSERT INTO t FORMAT CSV`: with the
  data arriving out of band there are no Values and no SelectExpr, and
  the method indexed Values[len-1] unguarded. It now falls back to
  Format, ColumnNames, then Table.
- InsertStmt.Accept visited Format before Table, violating source
  order; it now matches Walk (Table, ColumnNames, Format, Values,
  SelectExpr).
- DestinationClause.Accept did not visit its own TableSchema;
  CreateMaterializedView.Accept compensated by reaching into its child,
  so any other DestinationClause holder silently skipped the schema and
  the visit happened outside the destination's Enter/Leave bracket.
  The clause now owns its child, and its End() includes the schema.

No golden fixture changed.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

12 of 61 new or added lines in 2 files covered. (19.67%)

3 existing lines in 1 file now uncovered.

8807 of 16318 relevant lines covered (53.97%)

3031.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

15.37
/parser/ast.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc