From 44d1535db8212df51ff36ee780bbfb2d2c2b3168 Mon Sep 17 00:00:00 2001 From: natsumi kojima Date: Wed, 8 Apr 2026 01:16:42 +0900 Subject: [PATCH] feat: preserve optimizer hints in StripComments --- internal/source/code.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/source/code.go b/internal/source/code.go index 8b88a24136..7da4a71849 100644 --- a/internal/source/code.go +++ b/internal/source/code.go @@ -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)