Skip to content

fix(sql): correct error position for syntax errors in CREATE AS SELECT#5756

Merged
bluestreak01 merged 1 commit intomasterfrom
jh_create_as_select_errorpos
Jun 17, 2025
Merged

fix(sql): correct error position for syntax errors in CREATE AS SELECT#5756
bluestreak01 merged 1 commit intomasterfrom
jh_create_as_select_errorpos

Conversation

@jerrinot
Copy link
Copy Markdown
Contributor

@jerrinot jerrinot commented Jun 17, 2025

Problem

When a syntax error occurred inside the SELECT clause, the error position was calculated relative to the SELECT statement start, not the beginning of the entire query.

Example

Before this fix:

CREATE TABLE foo AS (SELECT non_existing(x) FROM long_sequence(1));
       ^^^^^                     

After the fix:

CREATE TABLE foo AS (SELECT non_existing(x) FROM long_sequence(1));
                            ^^^^^^^^^^^^^^^

@jerrinot jerrinot added Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution labels Jun 17, 2025
@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 4 / 5 (80.00%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/SqlCompilerImpl.java 4 5 80.00%

@bluestreak01 bluestreak01 merged commit d6cbc83 into master Jun 17, 2025
41 checks passed
@bluestreak01 bluestreak01 deleted the jh_create_as_select_errorpos branch June 17, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants