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 2019/12/27 10:28:14 UTC

[GitHub] [incubator-shardingsphere] caszhou opened a new issue #3822: SQLParseEngine parse mysql update sql fail

caszhou opened a new issue #3822: SQLParseEngine parse mysql update sql fail
URL: https://github.com/apache/incubator-shardingsphere/issues/3822
 
 
   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/incubator-shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   4.0.0-RC3
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-JDBC
   ### Expected behavior
   Get right SQLStatement
   ### Actual behavior
   Throw java.lang.IllegalStateException
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
     public static void main(String[] args) {
       SQLParseEngine engine = new SQLParseEngine(new MySQLDatabaseType());
       System.out.println(engine.parse("UPDATE tenant_vehicle  SET tenant_id=?,\nvin=?,\nsource=?,\n\n\n\ncreate_time=?,\nupdate_time=?,\nversion=?  WHERE id=?   AND version=?", true));
     }
   ### Example codes for reproduce this issue (such as a github link).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] caszhou commented on issue #3822: SQLParseEngine parse mysql update sql fail

Posted by GitBox <gi...@apache.org>.
caszhou commented on issue #3822: SQLParseEngine parse mysql update sql fail
URL: https://github.com/apache/incubator-shardingsphere/issues/3822#issuecomment-569255919
 
 
   > @caszhou Yeah, the bug is that MySQLParser parses exception for update statement including more than 1 `\n`. @terrymanu Please assign to me to fix this bug.
   
   3Q, waiting for release.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu commented on issue #3822: SQLParseEngine parse mysql update sql fail

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #3822: SQLParseEngine parse mysql update sql fail
URL: https://github.com/apache/incubator-shardingsphere/issues/3822#issuecomment-569251039
 
 
   @SteNicholas Thank you, assigned.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] caszhou commented on issue #3822: SQLParseEngine parse mysql update sql fail

Posted by GitBox <gi...@apache.org>.
caszhou commented on issue #3822: SQLParseEngine parse mysql update sql fail
URL: https://github.com/apache/incubator-shardingsphere/issues/3822#issuecomment-569898856
 
 
   > @caszhou You should modify the SQL like
   > 
   > ```
   > System.out.println(engine.parse("UPDATE tenant_vehicle SET tenant_id=?,\nvin=?,\nsource=?,\ncreate_time=?,\nupdate_time=?,\nversion=? WHERE id=? AND version=?", true));
   > ```
   > 
   > or
   > 
   > ```
   > System.out.println(engine.parse("UPDATE tenant_vehicle SET tenant_id=?,'\n'vin=?,'\n'source=?,'\n''\n''\n'create_time=?,'\n'update_time=?,'\n'version=? WHERE id=? AND version=?", true));
   > ```
   
   The really reason for this error is the field `source`.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] SteNicholas commented on issue #3822: SQLParseEngine parse mysql update sql fail

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #3822: SQLParseEngine parse mysql update sql fail
URL: https://github.com/apache/incubator-shardingsphere/issues/3822#issuecomment-569899437
 
 
   > > @caszhou You should modify the SQL like
   > > ```
   > > System.out.println(engine.parse("UPDATE tenant_vehicle SET tenant_id=?,\nvin=?,\nsource=?,\ncreate_time=?,\nupdate_time=?,\nversion=? WHERE id=? AND version=?", true));
   > > ```
   > > 
   > > 
   > > or
   > > ```
   > > System.out.println(engine.parse("UPDATE tenant_vehicle SET tenant_id=?,'\n'vin=?,'\n'source=?,'\n''\n''\n'create_time=?,'\n'update_time=?,'\n'version=? WHERE id=? AND version=?", true));
   > > ```
   > 
   > The really reason for this error is the field `source`.
   
   `SOURCE` is unreserved word. This is the bug, but `\n\n\n` doesn't support.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] SteNicholas commented on issue #3822: SQLParseEngine parse mysql update sql fail

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #3822: SQLParseEngine parse mysql update sql fail
URL: https://github.com/apache/incubator-shardingsphere/issues/3822#issuecomment-569452195
 
 
   @caszhou You should modify the SQL like
   ```
   System.out.println(engine.parse("UPDATE tenant_vehicle SET tenant_id=?,\nvin=?,\nsource=?,\ncreate_time=?,\nupdate_time=?,\nversion=? WHERE id=? AND version=?", true));
   ```
   or
   ```
   System.out.println(engine.parse("UPDATE tenant_vehicle SET tenant_id=?,'\n'vin=?,'\n'source=?,'\n''\n''\n'create_time=?,'\n'update_time=?,'\n'version=? WHERE id=? AND version=?", true));
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu closed issue #3822: SQLParseEngine parse mysql update sql fail

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #3822: SQLParseEngine parse mysql update sql fail
URL: https://github.com/apache/incubator-shardingsphere/issues/3822
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] SteNicholas commented on issue #3822: SQLParseEngine parse mysql update sql fail

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #3822: SQLParseEngine parse mysql update sql fail
URL: https://github.com/apache/incubator-shardingsphere/issues/3822#issuecomment-569250813
 
 
   @caszhou Yeah, the bug is that MySQLParser parses exception for update statement including more than 1 `\n`. @terrymanu Please assign to me to fix this bug.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services