chenguo-design opened a new issue, #32977:
URL: https://github.com/apache/shardingsphere/issues/32977

   ### Which version of ShardingSphere did you use?
   5.5.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Actual behavior
   The following error occurred:
   
`org.apache.shardingsphere.infra.exception.kernel.metadata.ColumnNotFoundException:
 Unknown column 'MICROSECOND' in 'unknown clause'.
        at 
org.apache.shardingsphere.infra.binder.segment.expression.impl.ColumnSegmentBinder.lambda$findInputColumnSegment$3(ColumnSegmentBinder.java:161)
        at 
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions.checkState(ShardingSpherePreconditions.java:41)
        at 
org.apache.shardingsphere.infra.binder.segment.expression.impl.ColumnSegmentBinder.findInputColumnSegment(ColumnSegmentBinder.java:160)
        at 
org.apache.shardingsphere.infra.binder.segment.expression.impl.ColumnSegmentBinder.bind(ColumnSegmentBinder.java:82)
        at 
org.apache.shardingsphere.infra.binder.segment.expression.ExpressionSegmentBinder.bind(ExpressionSegmentBinder.java:81)
        at 
org.apache.shardingsphere.infra.binder.segment.expression.impl.FunctionExpressionSegmentBinder.bind(FunctionExpressionSegmentBinder.java:52)
        at 
org.apache.shardingsphere.infra.binder.segment.expression.ExpressionSegmentBinder.bind(ExpressionSegmentBinder.java:84)
        at 
org.apache.shardingsphere.infra.binder.segment.assign.AssignmentSegmentBinder.bindValue(AssignmentSegmentBinder.java:73)
        at 
org.apache.shardingsphere.infra.binder.segment.assign.AssignmentSegmentBinder.bind(AssignmentSegmentBinder.java:57)
        at 
org.apache.shardingsphere.infra.binder.statement.dml.UpdateStatementBinder.lambda$bind$0(UpdateStatementBinder.java:55)
        at java.util.Optional.ifPresent(Optional.java:159)
        at 
org.apache.shardingsphere.infra.binder.statement.dml.UpdateStatementBinder.bind(UpdateStatementBinder.java:55)
        at 
org.apache.shardingsphere.infra.binder.statement.dml.UpdateStatementBinder.bind(UpdateStatementBinder.java:43)
        at 
org.apache.shardingsphere.infra.binder.engine.SQLBindEngine.bindDMLStatement(SQLBindEngine.java:88)
        at 
org.apache.shardingsphere.infra.binder.engine.SQLBindEngine.bind(SQLBindEngine.java:72)
        at 
org.apache.shardingsphere.infra.binder.engine.SQLBindEngine.bind(SQLBindEngine.java:63)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:207)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:172)
        at 
org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection.prepareStatement(ShardingSphereConnection.java:94)
        at 
com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337)
        at 
com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
        at 
org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:235)
        at 
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:649)
        at 
org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960)
        at 
org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:981)
        at 
org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:328)
        at 
org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:333)
        at 
net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.lambda$execute$0(JdbcTemplateStorageAccessor.java:117)
        at 
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
        at 
net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.execute(JdbcTemplateStorageAccessor.java:117)
        at 
net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.updateRecord(JdbcTemplateStorageAccessor.java:82)
        at 
net.javacrumbs.shedlock.support.StorageBasedLockProvider.doLock(StorageBasedLockProvider.java:93)
        at 
net.javacrumbs.shedlock.support.StorageBasedLockProvider.lock(StorageBasedLockProvider.java:65)`
   
   ### Reason analyze (If you can)
   
   my project is spring project, i used @Scheduler and @SchedulerLock  
annotation in my project, which will automatically generate statements like 
'UPDATE shedlock SET lock_until = TIMESTAMPADD(MICROSECOND, ?, 
UTC_TIMESTAMP(3)), locked_at = UTC_TIMESTAMP(3), locked_by = ? WHERE name = ? 
AND lock_until <= UTC_TIMESTAMP(3) ::: [120000000, cg, TestJob]', and  
shardingshpre-jdbc misidentify the 'MICROSECOND' as a column, then throw this 
exception
   
   
![image](https://github.com/user-attachments/assets/90fd74ef-9ea5-4fb0-8e53-55044ac86404)
   
   
   ### Example codes for reproduce this issue (such as a github link).
   
![image](https://github.com/user-attachments/assets/08a6fb78-3f65-43ad-8bd9-2c6edc82d600)
   
   


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

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to