Skip to content

Fix line comments in literal column names#11160

Open
puneetdixit200 wants to merge 1 commit into
dolthub:mainfrom
puneetdixit200:fix-sql-comment-literal-column-names
Open

Fix line comments in literal column names#11160
puneetdixit200 wants to merge 1 commit into
dolthub:mainfrom
puneetdixit200:fix-sql-comment-literal-column-names

Conversation

@puneetdixit200

Copy link
Copy Markdown

Fixes #10868.

Summary

  • Clear Vitess-captured raw select expression text when an unaliased projection includes SQL comments outside quotes
  • Add regression coverage for NULL, numeric, and string literals with trailing line comments

Verification

  • CGO_CPPFLAGS=-I/opt/homebrew/opt/icu4c@78/include CGO_LDFLAGS=-L/opt/homebrew/opt/icu4c@78/lib go test ./cmd/dolt/commands -run TestSqlLiteralColumnNamesIgnoreTrailingLineComments -count=1
  • CGO_CPPFLAGS=-I/opt/homebrew/opt/icu4c@78/include CGO_LDFLAGS=-L/opt/homebrew/opt/icu4c@78/lib go test ./cmd/dolt/commands -run 'TestSql|TestSqlBatchMode|TestSqlSelect' -count=1\n- CGO_CPPFLAGS=-I/opt/homebrew/opt/icu4c@78/include CGO_LDFLAGS=-L/opt/homebrew/opt/icu4c@78/lib go test ./cmd/dolt/commands -skip TestSignAndVerifyCommit -count=1\n- git diff --check\n\nNote: the unskipped full package run fails locally because TestSignAndVerifyCommit requires gpg, which is not installed in this environment.

@zachmu

zachmu commented Jun 5, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution.

This change is in the right direction, but this fix is applied at the wrong place. We don't want to do this processing in the dolt SQL shell, as that doesn't fix the underlying problem of column names at the server layer. Rather, this fix should take place in dolthub/vitess at the same time that we capture the query text for column aliasing purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Line comments somehow getting included in column names for literals

3 participants