Skip to content

chore: port MySQL bracketed SELECT in CREATE/ALTER VIEW (#4655)#2667

Merged
benfdking merged 1 commit into
mainfrom
port/sqlfluff-4655
Jun 6, 2026
Merged

chore: port MySQL bracketed SELECT in CREATE/ALTER VIEW (#4655)#2667
benfdking merged 1 commit into
mainfrom
port/sqlfluff-4655

Conversation

@mikills
Copy link
Copy Markdown
Collaborator

@mikills mikills commented Jun 4, 2026

Summary

  • SQLFluff #4655 allows the SelectStatementSegment in MySQL CREATE VIEW and ALTER VIEW to be bracketed. Ported it to sqruff's mysql.rs: wrapped the SelectStatementSegment in both CreateViewStatementSegment and AlterViewStatementSegment with OptionallyBracketed, so CREATE/ALTER VIEW ... AS (SELECT ...) now parses.
  • Updated the create_view and alter_view fixtures (.sql + .yml) with the new bracketed cases; the dialect test parses all statements with no unparsable segments, producing the expected bracketed > select_statement tree.
  • Advances .sqlfluff-sha through #4634 (already ported) to #4655. Parser-only change.

Ported from SQLFluff a44bea7ae99ec7f4440bfd3fa292753524a1a51b
sqlfluff/sqlfluff#4655
sqlfluff/sqlfluff@a44bea7

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 4, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks
⏩ 6 skipped benchmarks1


Comparing port/sqlfluff-4655 (ecb42ec) with main (a653ea0)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Benchmark for 3dea38f

Click to view benchmark
Test Base PR %
DepthMap::from_parent 48.7±1.77µs 48.6±0.29µs -0.21%
fix_complex_query 10.0±0.07ms 10.0±0.08ms 0.00%
fix_superlong 179.8±11.28ms 171.2±8.03ms -4.78%
parse_complex_query 3.3±0.02µs 3.3±0.04µs 0.00%
parse_expression_recursion 5.9±0.09µs 5.9±0.07µs 0.00%
parse_simple_query 831.9±8.46ns 836.9±18.08ns +0.60%

## Summary
- Wrap the SelectStatementSegment in MySQL CREATE VIEW and ALTER VIEW with
  OptionallyBracketed, so `CREATE/ALTER VIEW ... AS (SELECT ...)` parses.
- Update alter_view and create_view fixtures with bracketed cases.
- Advance .sqlfluff-sha through #4634 (already ported) to #4655.

Ported from SQLFluff a44bea7ae99ec7f4440bfd3fa292753524a1a51b
sqlfluff/sqlfluff#4655
sqlfluff/sqlfluff@a44bea7
@benfdking benfdking force-pushed the port/sqlfluff-4655 branch from 4741f3c to ecb42ec Compare June 6, 2026 08:49
@benfdking benfdking merged commit b770429 into main Jun 6, 2026
24 of 26 checks passed
@benfdking benfdking deleted the port/sqlfluff-4655 branch June 6, 2026 08:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2026

Benchmark for f265344

Click to view benchmark
Test Base PR %
DepthMap::from_parent 60.5±0.56µs 62.3±2.04µs +2.98%
fix_complex_query 12.7±0.05ms 12.7±0.06ms 0.00%
fix_superlong 193.6±5.72ms 195.0±5.96ms +0.72%
parse_complex_query 4.3±0.10µs 4.2±0.04µs -2.33%
parse_expression_recursion 7.4±0.08µs 7.3±0.04µs -1.35%
parse_simple_query 1083.4±24.59ns 1120.1±6.11ns +3.39%

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