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 2021/06/28 07:11:37 UTC

[GitHub] [shardingsphere] trycache0828 opened a new issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

trycache0828 opened a new issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041


   ## Bug Report
   
   line 1:349 no viable alternative at input 'YEAR(NOW)'.
   
   [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'
   
   The condition ‘AND YEAR(tn.create_date) = YEAR(NOW())’ resolved to  ‘AND YEAR(tn.create_date) = YEAR(NOW)’
   
   ### Which version of ShardingSphere did you use?
   
   4.1.1
   
       <dependency>
           <groupId>org.apache.shardingsphere</groupId>
           <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
           <version>4.1.1</version>
       </dependency>
   
       <dependency>
           <groupId>org.apache.shardingsphere</groupId>
           <artifactId>sharding-jdbc-core</artifactId>
           <version>4.1.1</version>
       </dependency>
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ## Usage scenarios
   
   Spring 3.x + Hibernate 4.x + Sharding-JDBC 4.1.1
   
   ### Expected behavior
   
   Missing parentheses for function now().The MySQL function now() is resolved to the column name now.
   
   ### Actual behavior
   
   MySQL function now() should be resolved to function now ()
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] avalon5666 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-870187916


   Can you set sql.show=true, and provider the configuration and full exception log? I need to confirm the logical sql and actual sql.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] trycache0828 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
trycache0828 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-870257490


   > It seem the executing sql missing parenthesis, pls confirm the sql gen by hibernate is correct.
   
   ![image](https://user-images.githubusercontent.com/14318621/123744246-1070c800-d8e1-11eb-9f47-c5061aa12e60.png)
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] trycache0828 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
trycache0828 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-870184148






-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] avalon5666 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-870269274


   The logical sql is pass by user code, pls confirm you sql is correct. 


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] trycache0828 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
trycache0828 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-870193812


   > Can you set sql.show=true, and provider the configuration and full exception log? I need to confirm the logical sql and actual sql.
   
   The print result of logical SQL parsing is also wrong.Missing parentheses for function now().The MySQL function now() is resolved to the column name now.
   
   ## SQL
   
   [ShardingSphere-SQL]Logic SQL: SELECT tnc.id, tnc.name, tnc.create_date AS createDate FROM t_user_child AS tnc, t_user AS tn WHERE YEAR(tn.create_date) = YEAR(NOW) ORDER BY tnc.create_date DESC
   
   [ShardingSphere-SQL]Actual SQL: SELECT tnc.id, tnc.name, tnc.create_date AS createDate FROM t_user_child AS tnc, t_user_2019 AS tn WHERE YEAR(tn.create_date) = YEAR(NOW) ORDER BY tnc.create_date DESC


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] avalon5666 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-869691777






-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] avalon5666 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-869691777


   Can you set sql.show=true, and provider the configuration and full exception log?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] trycache0828 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
trycache0828 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-870184148


   > Can you set sql.show=true, and provider the configuration and full exception log?
   
   ## The configration:
   
   https://github.com/apache/shardingsphere/issues/10843


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] trycache0828 closed issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
trycache0828 closed issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] avalon5666 commented on issue #11041: sharding-jdbc 4.1.1:[org.hibernate.engine.jdbc.spi.SqlExceptionHelper]Unknown column 'NOW' in 'where clause'

Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #11041:
URL: https://github.com/apache/shardingsphere/issues/11041#issuecomment-870205794


   It seem the executing sql missing parenthesis, pls confirm the sql gen by hibernate is correct.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org