lwtdev commented on a change in pull request #8604:
URL: https://github.com/apache/shardingsphere/pull/8604#discussion_r543295607
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java
##########
@@ -117,7 +117,7 @@ private String getLiteralSQL(final String sql, final
List<?> parameters) {
if (null == parameters || parameters.isEmpty()) {
return sql;
}
- return String.format(sql.replace("%", "$").replace("?", "%s"),
parameters.toArray()).replace("$", "%").replace("%%", "%").replace("'%'",
"'%%'");
+ return String.format(sql.replace("%", "$$").replace("?", "%s"),
parameters.toArray()).replace("$$", "%").replace("%%", "%").replace("'%'",
"'%%'");
Review comment:
@jingshanglu `$` is used to temporarily replace `%`, but in
[MySQL](https://dev.mysql.com/doc/refman/5.7/en/json.html#json-path-syntax), it
used to be the Path syntax of JSON, representing a JSON document.
The test case is not working properly.
Maybe using a non-printable character here is better than "$$ "?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]