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/05/30 08:23:01 UTC

[GitHub] [incubator-shardingsphere] jingshouyan opened a new issue #2473: Insert statement overwrite missing symbol ` on column

jingshouyan opened a new issue #2473: Insert statement overwrite missing symbol ` on column
URL: https://github.com/apache/incubator-shardingsphere/issues/2473
 
 
   ## 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/sharding-sphere/sharding-sphere/issues).
   - Read documentation: [ShardingSphere Doc](http://shardingsphere.io/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-RC1
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-JDBC 
   ### Expected behavior
   #### Logic SQL
   ```
   INSERT INTO `DEMO_USER` (`id`,`name`,`age`,`tags`,`NICK_NAME_TT4`,`ENCRYPT_TEST`,`key`,`acc1`,`acc2`,`localDate`,`createdAt`,`updatedAt`,`deletedAt`)  VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) 
   ```
   #### Expected SQL
   ```
   INSERT INTO `DEMO_USER3` (`id`,`name`,`age`,`tags`,`NICK_NAME_TT4`,`ENCRYPT_TEST`,`key`,`acc1`,`acc2`,`localDate`,`createdAt`,`updatedAt`,`deletedAt`)  VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) 
   ```
   
   ### Actual behavior
   ```
    INSERT INTO `DEMO_USER3`  (id, name, age, tags, NICK_NAME_TT4, ENCRYPT_TEST, key, acc1, acc2, localDate, createdAt, updatedAt, deletedAt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 
   ```
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   ```
   spring
     shardingsphere:
       datasource:
         names: ds0
         ds0:
           type: com.zaxxer.hikari.HikariDataSource
   #        driverClassName: com.mysql.cj.jdbc.Driver
           jdbcUrl: jdbc:mysql://${db.host}:${db.port}/${db.schema}?useUnicode=true&characterEncoding=utf8&useSSL=false
           username: ${db.username}
           password: ${db.password}
       sharding:
         tables:
           DEMO_USER:
             actual-data-nodes: ds0.DEMO_USER$->{0..4}
             table-strategy:
               inline:
                 sharding-column: age
                 algorithm-expression: DEMO_USER$->{age % 5}
       props:
         sql:
           show: true
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   ```
   !@#$`2019-05-30 15:39:31,785`[//]`INFO `main`ShardingSphere-SQL`Rule Type: sharding 
   !@#$`2019-05-30 15:39:31,785`[//]`INFO `main`ShardingSphere-SQL`Logic SQL: INSERT INTO `DEMO_USER` (`id`,`name`,`age`,`tags`,`NICK_NAME_TT4`,`ENCRYPT_TEST`,`key`,`acc1`,`acc2`,`localDate`,`createdAt`,`updatedAt`,`deletedAt`)  VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) 
   !@#$`2019-05-30 15:39:31,785`[//]`INFO `main`ShardingSphere-SQL`SQLStatement: InsertStatement(super=DMLStatement(super=AbstractSQLStatement(type=DML, tables=Tables(tables=[Table(name=DEMO_USER, alias=Optional.absent())]), routeConditions=Conditions(orCondition=OrCondition(andConditions=[AndCondition(conditions=[Condition(column=Column(name=age, tableName=DEMO_USER), operator=EQUAL, compareOperator=null, positionValueMap={}, positionIndexMap={0=2})])])), encryptConditions=Conditions(orCondition=OrCondition(andConditions=[])), sqlTokens=[TableToken(tableName=DEMO_USER, quoteCharacter=BACK_QUOTE, schemaNameLength=0), SQLToken(startIndex=24)], parametersIndex=13, logicSQL=INSERT INTO `DEMO_USER` (`id`,`name`,`age`,`tags`,`NICK_NAME_TT4`,`ENCRYPT_TEST`,`key`,`acc1`,`acc2`,`localDate`,`createdAt`,`updatedAt`,`deletedAt`)  VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)), deleteStatement=false, updateTableAlias={}, updateColumnValues={}, whereStartIndex=0, whereStopIndex=0, whereParameterStartIndex=0, whereParameterEndIndex=0), columnNames=[id, name, age, tags, NICK_NAME_TT4, ENCRYPT_TEST, key, acc1, acc2, localDate, createdAt, updatedAt, deletedAt], values=[InsertValue(columnValues=[org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@142918a0, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@745cf754, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@25bc65ab, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@6eab92f3, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@321b7b9e, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@21eedcde, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@67396475, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@55b74e6b, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@3c1908c8, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@6bc62bb9, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@47f0e078, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@28db2afb, org.apache.shardingsphere.core.parse.old.parser.expression.SQLPlaceholderExpression@5c703860])]) 
   !@#$`2019-05-30 15:39:31,786`[//]`INFO `main`ShardingSphere-SQL`Actual SQL: ds0 ::: INSERT INTO `DEMO_USER3`  (id, name, age, tags, NICK_NAME_TT4, ENCRYPT_TEST, key, acc1, acc2, localDate, createdAt, updatedAt, deletedAt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ::: [U57345@abc, goTmtbNosOdrALL3PQIqOA==, 2333, ivo9Lm8d4771fu2hfAO5vw==, alkaksdjflk, fSPTMmlED6BMfs57Dhwpug==, adf-key, 12.5744334, 1112.578867, 2019-05-30, 1559201970400, 1559201970400, -1] 
   
   ```

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