Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: preserve optimizer hints in StripComments
  • Loading branch information
replu committed Apr 7, 2026
commit 44d1535db8212df51ff36ee780bbfb2d2c2b3168
5 changes: 5 additions & 0 deletions internal/source/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func StripComments(sql string) (string, []string, error) {
continue
}
if strings.HasPrefix(t, "/*") && strings.HasSuffix(t, "*/") {
if strings.HasPrefix(t, "/*+") {
// Optimizer hints (/*+ ... */) must be preserved in the SQL string
lines = append(lines, t)
continue
}
t = strings.TrimPrefix(t, "/*")
t = strings.TrimSuffix(t, "*/")
comments = append(comments, t)
Expand Down
Loading