You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/10 06:42:18 UTC
[GitHub] [shardingsphere] zgq7 opened a new issue, #14224: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
zgq7 opened a new issue, #14224:
URL: https://github.com/apache/shardingsphere/issues/14224
my project dependency version:
- springboot 2.1.7
- shardingsphere-jdbc-core-spring-boot-starter 5.0.0
- mybatis-plus 3.2.0
- mysql 5.1.27
- mysql-connector 8.0.17
***
i customed xml sql like :
```xml
<select id="getTableNames" resultType="java.lang.String">
SHOW TABLES LIKE #{likeStr}
</select>
```
it‘s worked like :
```sql
SHOW TABLES LIKE 't_order_%' ;
```
when i haven't add sharding-jdbc in my project it worked normally。
but it occured error when I use it after i add sharding-jdbc in my project :
```text
Caused by: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.twoPhaseParse(SQLParserExecutor.java:68)
at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.parse(SQLParserExecutor.java:49)
at org.apache.shardingsphere.sql.parser.api.SQLParserEngine.parse(SQLParserEngine.java:51)
at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:47)
at org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader.load(SQLStatementCacheLoader.java:40)
at org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader.load(SQLStatementCacheLoader.java:29)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
... 89 more
```
you can reproduce this case like this :
```java
@Test
public void build() {
SQLParserExecutor sqlParserExecutor = new SQLParserExecutor("MySQL", false);
try {
sqlParserExecutor.parse("show tables like ? ");
log.info("sharding jdbc sql 编译成功");
} catch (Exception e) {
log.error("sharding jdbc sql 编译报错:", e);
}
}
```
it will occured a error
```text
16:05:17.004 [main] ERROR - sharding jdbc sql 编译报错:
org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.twoPhaseParse(SQLParserExecutor.java:68)
at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.parse(SQLParserExecutor.java:49)
```
how to avoid this :
```java
@Test
public void build() {
SQLParserExecutor sqlParserExecutor = new SQLParserExecutor("MySQL", false);
try {
sqlParserExecutor.parse("show tables like 'table_name' ");
log.info("sharding jdbc sql 编译成功");
} catch (Exception e) {
log.error("sharding jdbc sql 编译报错:", e);
}
}
```
so my mybatis xml code changed like this 👍
```xml
<select id="getTableNames" resultType="java.lang.String">
SHOW TABLES LIKE ${likeStr}
</select>
```
so that the prama value will be like "'t_xxx'" 。
***
my expected
- [ ] :when sharding-jdbc parse the sql which is 'show tables' can use # rather than $ in mybatis xml 。
thanks ! :bug::bug::bug::bug::bug::bug:
@terrymanu
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] github-actions[bot] closed issue #14224: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #14224: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
URL: https://github.com/apache/shardingsphere/issues/14224
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #14224: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
URL: https://github.com/apache/shardingsphere/issues/14224
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax [shardingsphere]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14224:
URL: https://github.com/apache/shardingsphere/issues/14224#issuecomment-2026022127
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] liujia13142324 commented on issue #14224: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
Posted by GitBox <gi...@apache.org>.
liujia13142324 commented on issue #14224:
URL: https://github.com/apache/shardingsphere/issues/14224#issuecomment-1197641199
mark
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #14224:
URL: https://github.com/apache/shardingsphere/issues/14224#issuecomment-2212340295
The version is out of service, please try new version
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] github-actions[bot] commented on issue #14224: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #14224:
URL: https://github.com/apache/shardingsphere/issues/14224#issuecomment-1272350552
Hello , this issue has not received a reply for several days.
This issue is supposed to be closed.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org