Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Improve JSON Functions
Space around the `:` delimiter of JSON Functions
  • Loading branch information
manticore-projects committed Apr 7, 2022
commit be61ae28971703c8a5de275e7993b7b757c49bb2
5 changes: 3 additions & 2 deletions src/test/java/net/sf/jsqlparser/test/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ public class TestUtils {
private static final Pattern SQL_SANITATION_PATTERN
= Pattern.compile("(\\s+)", Pattern.MULTILINE);

// Assure SPACE around Syntax Characters
private static final Pattern SQL_SANITATION_PATTERN2
= Pattern.compile("\\s*([!/,()=+\\-*|\\]<>])\\s*", Pattern.MULTILINE);
= Pattern.compile("\\s*([!/,()=+\\-*|\\]<>:])\\s*", Pattern.MULTILINE);

/**
* @param statement
Expand Down Expand Up @@ -265,7 +266,7 @@ public static String buildSqlString(final String originalSql, boolean laxDeparsi
// redundant white space
sanitizedSqlStr = SQL_SANITATION_PATTERN.matcher(sanitizedSqlStr).replaceAll(" ");

// replace some more stuff
// assure spacing around Syntax Characters
sanitizedSqlStr = SQL_SANITATION_PATTERN2.matcher(sanitizedSqlStr).replaceAll("$1");
return sanitizedSqlStr.trim().toLowerCase();
} else {
Expand Down