Merge pull request #9941 from dataease/pr@dev-v2@fix_cal

fix: 修复calcite解析SQL单引号报错
This commit is contained in:
Junjun 2024-05-29 14:15:11 +08:00 committed by GitHub
commit ac34ca0633
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,7 @@ import java.util.Optional;
*/
public class SQLUtils {
public static String transKeyword(String value) {
return Optional.ofNullable(value).orElse("").replaceAll("'", "\\\\'");
return Optional.ofNullable(value).orElse("").replaceAll("'", "''");
}
public static String buildOriginPreviewSql(String sql, int limit, int offset) {