shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

SUM(IF(INTERVAL print error log "no viable alternative at input"

Open code2free2 opened this issue 7 years ago • 1 comments

Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

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

Actual behavior

line 3:68 no viable alternative at input 'SUM(if(state=0andINTERVAL(total_amount,0,200.00)=1,' (It runs fine on version 3.0.0.M4)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

SQL like: select SUM(if(state=0 and INTERVAL(total_amount,${rangeParam.range1},${rangeParam.range2})=1,1,0)) as successNum1 from order;

code2free2 avatar May 05 '19 16:05 code2free2

INTERVAL is MySQL keyword, function name need include this keyword

codefairy08 avatar May 06 '19 06:05 codefairy08