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 2020/09/04 09:06:24 UTC

[GitHub] [shardingsphere] goool opened a new issue #7252: sharding-proxy error: insert into table with blob value like x'123456'

goool opened a new issue #7252:
URL: https://github.com/apache/shardingsphere/issues/7252


   ### Which version of ShardingSphere did you use?
   4.1.0, and 4.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   mysql> insert into t_test_blob values ( x'123456' );
   Query OK, 1 row affected (0.00 sec)
   
   ### Actual behavior
   mysql> insert into t_test_blob values ( x'123456' );
   ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '123456')' at line 1
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   #### 1. Connect to mysql on 3306 port
   
   mysql> show create table t_test_blob \G
   *************************** 1. row ***************************
          Table: t_test_blob
   Create Table: CREATE TABLE `t_test_blob` (
     `bytes` tinyblob
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
   1 row in set (0.01 sec)
   
   mysql> insert into t_test_blob values ( x'12AB34' );
   Query OK, 1 row affected (0.00 sec)
   
   mysql> select HEX(bytes) from t_test_blob;
   +------------+
   | HEX(bytes) |
   +------------+
   | 12AB34     |
   +------------+
   1 row in set (0.01 sec)
   
   #### 2. then connect to sharding-proxy on 3307 port:
   mysql> select HEX(bytes) from t_test_blob;
   +------------+
   | HEX(bytes) |
   +------------+
   | 12AB34     |
   +------------+
   1 row in set (0.08 sec)
   
   mysql> insert into t_test_blob values ( x'123456' );
   ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '123456')' at line 1
   
   #### 3. and this is sharding-proxy logs/stdout.log
   
   [INFO ] 16:54:45.013 [ShardingSphere-Command-6] ShardingSphere-SQL - Logic SQL: insert into t_test_blob values ( x'123456' )
   [INFO ] 16:54:45.020 [ShardingSphere-Command-6] ShardingSphere-SQL - SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@5140f9c7, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@5a97dec5), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@5a97dec5, columnNames=[bytes], insertValueContexts=[InsertValueContext(parametersCount=0, valueExpressions=[LiteralExpressionSegment(startIndex=33, stopIndex=41, literals='123456)], parameters=[])], generatedKeyContext=Optional.empty)
   [INFO ] 16:54:45.020 [ShardingSphere-Command-6] ShardingSphere-SQL - Actual SQL: espl ::: insert into t_test_blob values (''123456')
   
   Logic SQL is correct,but there is an incorrect quotation mark in Actual SQL.


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



[GitHub] [shardingsphere] jingshanglu commented on issue #7252: sharding-proxy error: insert into table with blob value like x'123456'

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on issue #7252:
URL: https://github.com/apache/shardingsphere/issues/7252#issuecomment-693214321


   @goool It has been fixed on master branch,new version will be ok, also, you can try the master branch.


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



[GitHub] [shardingsphere] goool closed issue #7252: sharding-proxy error: insert into table with blob value like x'123456'

Posted by GitBox <gi...@apache.org>.
goool closed issue #7252:
URL: https://github.com/apache/shardingsphere/issues/7252


   


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