dynamic-datasource-spring-boot-starter Version(required): 3.0.0 (or any other version)
druid Version(optional): 1.1.13
Describe
execute sql error, when my postgresql with below part:
SELECT ...,TO_CHAR(lasttime, 'yyyy-mm-dd') >= TO_CHAR(CURRENT_DATE AT TIME ZONE 'utc' - INTERVAL '${offsetDays - 1}' DAY, 'yyyy-mm-dd') AS isAdded,
It seems to be not available when many key words appeared in a selected column.
When I comment dependency 'dynamic-datasource-spring-boot-starter', the sql works well.
Expected Result:
execute sql success
Actual Result: java.sql.SQLException: sql injection violation, syntax error: syntax error, expect RPAREN, actual IDENTIFIER pos 238, line 5, column 73, token IDENTIFIER AT
Step 2
use these below sqls to run application:
SELECT now() AT TIME ZONE 'utc';SELECT TO_CHAR(now() - INTERVAL '1' DAY, 'yyyy-mm-dd');SELECT TO_CHAR(now() AT TIME ZONE 'utc', 'yyyy-mm-dd');
Enviroment
JDK Version(required): 1.8
SpringBoot Version(required): 1.5.21.RELEASE
dynamic-datasource-spring-boot-starter Version(required): 3.0.0 (or any other version)
druid Version(optional): 1.1.13
Describe
execute sql error, when my postgresql with below part:
SELECT ...,
TO_CHAR(lasttime, 'yyyy-mm-dd') >= TO_CHAR(CURRENT_DATE AT TIME ZONE 'utc' - INTERVAL '${offsetDays - 1}' DAY, 'yyyy-mm-dd') AS isAdded,
It seems to be not available when many key words appeared in a selected column. When I comment dependency 'dynamic-datasource-spring-boot-starter', the sql works well.
Expected Result: execute sql success
Actual Result:
java.sql.SQLException: sql injection violation, syntax error: syntax error, expect RPAREN, actual IDENTIFIER pos 238, line 5, column 73, token IDENTIFIER AT
Steps to reproduce
Step 1 add dependency 'dynamic-datasource-spring-boot-starter'
Step 2 use these below sqls to run application:
SELECT now() AT TIME ZONE 'utc';
SELECT TO_CHAR(now() - INTERVAL '1' DAY, 'yyyy-mm-dd');
SELECT TO_CHAR(now() AT TIME ZONE 'utc', 'yyyy-mm-dd');
Step 3 check result