Unverified Commit 14461a1c authored by Licho's avatar Licho Committed by GitHub

fix: adapt for sql hints semtanic (#2115)

* refactor: package uri wrong, and trivial optimization * fix: adapt for sql hints * Spotless Apply --------- Co-authored-by: 's avatarleechor <leechor@users.noreply.github.com>
parent c32067d7
...@@ -60,7 +60,8 @@ public class SqlUtil { ...@@ -60,7 +60,8 @@ public class SqlUtil {
// Remove the special-space characters // Remove the special-space characters
sql = sql.replaceAll("\u00A0", " ").replaceAll("[\r\n]+", "\n"); sql = sql.replaceAll("\u00A0", " ").replaceAll("[\r\n]+", "\n");
// Remove annotations Support '--aa' , '/**aaa*/' , '//aa' , '#aaa' // Remove annotations Support '--aa' , '/**aaa*/' , '//aa' , '#aaa'
Pattern p = Pattern.compile("(?ms)('(?:''|[^'])*')|--.*?$|//.*?$|/\\*.*?\\*/|#.*?$|"); Pattern p =
Pattern.compile("(?ms)('(?:''|[^'])*')|--.*?$|//.*?$|/\\*[^+].*?\\*/|#.*?$|");
String presult = p.matcher(sql).replaceAll("$1"); String presult = p.matcher(sql).replaceAll("$1");
return presult.trim(); return presult.trim();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment