You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "GuoHaoZai (via GitHub)" <gi...@apache.org> on 2023/02/12 09:22:48 UTC

[GitHub] [shardingsphere] GuoHaoZai commented on issue #16319: Shardingsphere keyword resolution failed

GuoHaoZai commented on issue #16319:
URL: https://github.com/apache/shardingsphere/issues/16319#issuecomment-1426983335

   > ## Bug Report
   > ### Which version of ShardingSphere did you use?
   > 4.1.1、5.0.0、5.1.0.
   > 
   > ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   > ShardingSphere-JDBC.
   > 
   > ### Expected behavior
   > select over from t_user;
   > 
   > ### Actual behavior
   > 4.1.1: `mismatched input 'over' expecting {'!', '~', '+', '-', '*', '.', '(', '{', '?', '@', TRUNCATE...`
   > 
   > 5.1.0: `Caused by: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax`
   > 
   > ### Reason analyze (If you can)
   > SQL parsing error.
   > 
   > ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   > ```sql
   > CREATE SCHEMA IF NOT EXISTS demo_ds;
   > 
   > CREATE TABLE `t_user` (
   >   `user_id` int(11) NOT NULL AUTO_INCREMENT,
   >   `user_name` varchar(200) DEFAULT NULL,
   >   `pwd` varchar(200) DEFAULT NULL,
   >   `over` varchar(200) DEFAULT NULL,
   >   PRIMARY KEY (`user_id`)
   > ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
   > ```
   > 
   > ### Example codes for reproduce this issue (such as a github link).
   > [Link](https://github.com/acmenlt/shardingsphere-examples/blob/main/jdbc-5.x.x/jdbc-shadow/src/test/java/cn/acmenlt/shardingsphere/examples/jdbc5/shadow/ShadowTests.java)
   > 
   > cn.acmenlt.shardingsphere.examples.jdbc5.shadow.ShadowTests#errorTest
   
   This exception is caused by invalid SQL. over is a SQL keyword, you need modify the SQL in the test case like `select `over` from t_user`


-- 
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