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/01/20 09:39:53 UTC

[GitHub] [incubator-shardingsphere] geyi opened a new issue #4051: Actual SQL Missing parameters

geyi opened a new issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051
 
 
   ## Bug Report
   I found a similar problem #3136 
   but this sql still not working:
   insert into t_quiz_order_ref (ORDER_ID, QUESTION_ID, OP_ORDER_ID, START_TIME, EXPIRE_TIME) values (?, ?, ? ,date_add(now(), interval ? second) ,date_add(now(), interval ? second)) 
   
   ShardingSphere version: 4.0.0
   my project use: sharding-jdbc-spring-boot-starter
   
   stack trace log:
   2020-01-20 17:12:29.990[]|GEYI.local|debug|http-nio-8888-exec-1|com.airing.dubbo.mapper.QuizMapper.insertOrderRef|==>  Preparing: INSERT INTO t_quiz_order_ref (ORDER_ID, QUESTION_ID, OP_ORDER_ID, START_TIME, EXPIRE_TIME) VALUES (?, ?, ? ,date_add(now(), interval ? second) ,date_add(now(), interval ? second)) 
   2020-01-20 17:12:30.016[]|GEYI.local|debug|http-nio-8888-exec-1|com.airing.dubbo.mapper.QuizMapper.insertOrderRef|==> Parameters: 61d25387afc34c74a3e4859f4a5cbf19(String), 1(Integer), fc8e54473c4c407fa5e52dec7802ec57(String), 3(Integer), 15(Integer)
   2020-01-20 17:12:30.757[]|GEYI.local|info |http-nio-8888-exec-1|ShardingSphere-SQL|Rule Type: sharding
   2020-01-20 17:12:30.758[]|GEYI.local|info |http-nio-8888-exec-1|ShardingSphere-SQL|Logic SQL: INSERT INTO t_quiz_order_ref
           (ORDER_ID, QUESTION_ID, OP_ORDER_ID, START_TIME, EXPIRE_TIME)
           VALUES
             
               (?, ?, ?
               ,date_add(now(), interval ? second)
               ,date_add(now(), interval ? second))
   2020-01-20 17:12:30.758[]|GEYI.local|info |http-nio-8888-exec-1|ShardingSphere-SQL|SQLStatement: InsertSQLStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.core.parse.sql.statement.dml.InsertStatement@6f7ba39b, tablesContext=TablesContext(tables=[Table(name=t_quiz_order_ref, alias=Optional.absent())], schema=Optional.absent())), columnNames=[order_id, question_id, op_order_id, start_time, expire_time], insertValueContexts=[InsertValueContext(parametersCount=3, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=138, stopIndex=138, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=141, stopIndex=141, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=144, stopIndex=144, parameterMarkerIndex=2), CommonExpressionSegment(startIndex=159, stopIndex=192, text=date_add(now(),interval?second)), CommonExpressionSegment(startIndex=207, stopIndex=240, text=date_add(now(),interval?second))], parameters=[61d25387afc34c74a3e4859f4a5cbf19, 1, fc8e54473c4c407fa5e52dec7802ec57])])
   2020-01-20 17:12:30.759[]|GEYI.local|info |http-nio-8888-exec-1|ShardingSphere-SQL|Actual SQL: ds0 ::: INSERT INTO t_quiz_order_ref1
           (ORDER_ID, QUESTION_ID, OP_ORDER_ID, START_TIME, EXPIRE_TIME)
           VALUES
             
               (?, ?, ?, date_add(now(),interval?second), date_add(now(),interval?second)) ::: [61d25387afc34c74a3e4859f4a5cbf19, 1, fc8e54473c4c407fa5e52dec7802ec57]

----------------------------------------------------------------
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] geyi commented on issue #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
geyi commented on issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051#issuecomment-576199188
 
 
   > @geyi Because parser doesn't support DATE_ADD function. I would like to add the function.
   yes, I didn't see date_add function in the commit c351912092e40f3a41c79acde6b26e03d2316e3e

----------------------------------------------------------------
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] geyi commented on issue #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
geyi commented on issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051#issuecomment-577171238
 
 
   > @geyi The question has already fixed. You could try the dev branch.
   
   i used dev branch, but the same bug happened......
   
   

----------------------------------------------------------------
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] geyi commented on issue #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
geyi commented on issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051#issuecomment-576656615
 
 
   > @geyi The question has already fixed. You could try the dev branch.
   
   thanks

----------------------------------------------------------------
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] geyi commented on issue #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
geyi commented on issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051#issuecomment-577580765
 
 
   > @geyi Does you mean that `DATE_ADD` doesn't support on dev branch? But I have already add this function unittest and the test worked well.
   
   yes, i clone dev branch, then execute mvn clean install -Prelease
   import sharding-distribution/sharding-jdbc-distribution/target/apache-shardingsphere-incubating-5.0.0-RC1-SNAPSHOT-sharding-jdbc-bin/lib
   exception log:
   2020-01-23 16:31:01.406[]|10.0.0.5|debug|http-nio-8888-exec-1|com.airing.dubbo.mapper.QuizMapper.insertOrderRef|==>  Preparing: INSERT INTO t_quiz_order_ref (ID, ORDER_ID, QUESTION_ID, OP_ORDER_ID, START_TIME, EXPIRE_TIME) VALUES (?, ?, ?, ? ,date_add(now(), interval ? second) ,date_add(now(), interval ? second)) 
   2020-01-23 16:31:01.407[]|10.0.0.5|debug|http-nio-8888-exec-1|com.airing.dubbo.mapper.QuizMapper.insertOrderRef|==> Parameters: 10001001(Long), 616eff9eadc84b72a7be0b59855a7c8a(String), 1(Integer), 8abe71763a6b4fc7b28bd7970751b14c(String), 3(Integer), 15(Integer)
   2020-01-23 16:31:01.515[]|10.0.0.5|info |http-nio-8888-exec-1|ShardingSphere-SQL|Rule Type: sharding
   2020-01-23 16:31:01.515[]|10.0.0.5|info |http-nio-8888-exec-1|ShardingSphere-SQL|Logic SQL: INSERT INTO t_quiz_order_ref
           (ID, ORDER_ID, QUESTION_ID, OP_ORDER_ID, START_TIME, EXPIRE_TIME)
           VALUES
             
               (?, ?, ?, ?
               ,date_add(now(), interval ? second)
               ,date_add(now(), interval ? second))
   2020-01-23 16:31:01.515[]|10.0.0.5|info |http-nio-8888-exec-1|ShardingSphere-SQL|SQLStatement: InsertSQLStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@667b90ee, tablesContext=TablesContext(tables=[Table(name=t_quiz_order_ref, alias=Optional.absent())], schema=Optional.absent())), columnNames=[id, order_id, question_id, op_order_id, start_time, expire_time], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=142, stopIndex=142, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=145, stopIndex=145, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=148, stopIndex=148, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=151, stopIndex=151, parameterMarkerIndex=3), org.apache.shardingsphere.sql.parser.sql.segment.dml.item.ExpressionProjectionSegment@384b21df, org.apache.shardingsphere.sql.parser.sql.segment.dml.item.ExpressionProjectionSegment@4cdd92e9], parameters=[10001001, 616eff9eadc84b72a7be0b59855a7c8a, 1, 8abe71763a6b4fc7b28bd7970751b14c])])
   2020-01-23 16:31:01.515[]|10.0.0.5|info |http-nio-8888-exec-1|ShardingSphere-SQL|Actual SQL: ds0 ::: INSERT INTO t_quiz_order_ref0
           (ID, ORDER_ID, QUESTION_ID, OP_ORDER_ID, START_TIME, EXPIRE_TIME)
           VALUES
             
               (?, ?, ?, ?, date_add(now(),interval?second), date_add(now(),interval?second)) ::: [10001001, 616eff9eadc84b72a7be0b59855a7c8a, 1, 8abe71763a6b4fc7b28bd7970751b14c]

----------------------------------------------------------------
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 #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051#issuecomment-577245392
 
 
   @geyi  Does you mean that `DATE_ADD` doesn't support on dev branch? But I have already add this function unittest and the test worked well.

----------------------------------------------------------------
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 #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051
 
 
   

----------------------------------------------------------------
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 #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051#issuecomment-576591091
 
 
   @geyi The question has already fixed. You could try the dev 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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] SteNicholas commented on issue #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051#issuecomment-576192260
 
 
   @geyi Because parser doesn't support DATE_ADD function. I would like to add the function.

----------------------------------------------------------------
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] geyi commented on issue #4051: Actual SQL Missing parameters

Posted by GitBox <gi...@apache.org>.
geyi commented on issue #4051: Actual SQL Missing parameters
URL: https://github.com/apache/incubator-shardingsphere/issues/4051#issuecomment-578385985
 
 
   @SteNicholas 
   **eg1:**
   Actual SQL: ds0 :::
   INSERT INTO t_quiz_order_ref0 (START_TIME, ID, ORDER_ID, QUESTION_ID)
   VALUES
   (date_add(now(),interval?second), ?, ?, ?)
   ::: [3, 10000008, 616eff9eadc84b72a7be0b59855a7c8a]
   **exception:**
   No value specified for parameter 4
   
   **eg2:**
   Actual SQL: ds0 :::
   INSERT INTO t_quiz_order_ref0 (ID, ORDER_ID, QUESTION_ID, START_TIME)
   VALUES
   (?, ?, ?, date_add(now(),interval?second))
   ::: [10000008, 616eff9eadc84b72a7be0b59855a7c8a, 1]
   **exception:**
   No value specified for parameter 4

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