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 2022/06/29 09:33:58 UTC

[GitHub] [shardingsphere] dissdic commented on issue #15134: to consider the sqlType of value parameter when setting the value to the corresponding placeholder in a executing SQL

dissdic commented on issue #15134:
URL: https://github.com/apache/shardingsphere/issues/15134#issuecomment-1169757336

   I've copy the stacktrace info and paste it below.
   Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT kkk.id as id,kkk.name as name,kkk.domain_name as domain_name,kkk."version" as "version",kkk.insert_user as insert_user,kkk.insert_date as insert_date,kkk.update_user as update_user,kkk.update_date as update_date FROM wms_kkk as kkk &nbsp;WHERE kkk.id = ? ]; nested exception is org.postgresql.util.PSQLException: 错误: 操作符不存在: bigint = character varying
   &nbsp;&nbsp;建议:没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
   &nbsp;&nbsp;位置:256
   at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
   at logwire.web.service.query.sql.jdbc.JdbcTemplateUtil.translateException(JdbcTemplateUtil.java:79)
   at logwire.web.service.query.sql.jdbc.JdbcTemplateUtil.execute(JdbcTemplateUtil.java:61)
   at logwire.web.service.query.sql.DynamicSqlSelect.doSelect(DynamicSqlSelect.java:733)
   at logwire.web.service.query.sql.DynamicSqlSelect.doSelect(DynamicSqlSelect.java:660)
   at logwire.web.service.query.sql.DynamicSqlSelect.forIterator(DynamicSqlSelect.java:443)
   at logwire.web.service.query.sql.DynamicSqlSelect.getSingleRow(DynamicSqlSelect.java:601)
   ... 54 common frames omitted
   Caused by: org.postgresql.util.PSQLException: 错误: 操作符不存在: bigint = character varying
   &nbsp;&nbsp;建议:没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
   &nbsp;&nbsp;位置:256
   at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2468)
   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2211)
   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:309)
   at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446)
   at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370)
   at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:149)
   at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:108)
   at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
   at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
   at org.apache.shardingsphere.driver.executor.callback.impl.PreparedStatementExecuteQueryCallback.executeQuery(PreparedStatementExecuteQueryCallback.java:40)
   at org.apache.shardingsphere.driver.executor.callback.ExecuteQueryCallback.executeSQL(ExecuteQueryCallback.java:44)
   at org.apache.shardingsphere.driver.executor.callback.ExecuteQueryCallback.executeSQL(ExecuteQueryCallback.java:36)
   at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:85)
   at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:64)
   at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:101)
   at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.serialExecute(ExecutorEngine.java:87)
   at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:81)
   at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:65)
   at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:49)
   at org.apache.shardingsphere.driver.executor.DriverJDBCExecutor.executeQuery(DriverJDBCExecutor.java:73)
   at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery0(ShardingSpherePreparedStatement.java:212)
   at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery(ShardingSpherePreparedStatement.java:181)
   at logwire.web.service.query.sql.DynamicSqlSelect.lambda$doSelect$15(DynamicSqlSelect.java:725)
   at logwire.web.service.query.sql.jdbc.JdbcTemplateUtil.execute(JdbcTemplateUtil.java:46)
   ... 58 common frames omitted
   for set values in to a SQL,we use the&nbsp;setValues(PreparedStatement ps) in&nbsp;PreparedStatementSetter,as you can see:
   
   
   and the implementation of this abstract method is like this:
   
   
   
   
   
   and the code of the another setValue method is:
   
   
   the core code is&nbsp;
   field.setValueIgnoreCheck(ps, index + 1, values.get(i), this.dialect);which present as:
   
   the code of the method&nbsp;setValueInPreparedStatement is:
   
   
   
   despite these execution process,we can see the explicit detail info of this method while debugging:
   
   
   
   this shows that eventually the setValue of ShardingSpherePreparedStatement was invoked.and I got the Exception written in the beginning.
   ------------------&nbsp;原始邮件&nbsp;------------------
   发件人:                                                                                                                        "apache/shardingsphere"                                                                                    ***@***.***&gt;;
   发送时间:&nbsp;2022年6月14日(星期二) 中午12:56
   ***@***.***&gt;;
   ***@***.******@***.***&gt;;
   主题:&nbsp;Re: [apache/shardingsphere] to consider the sqlType of value parameter when setting the value to the corresponding placeholder in a executing SQL (Issue #15134)
   
   
   
   
   
    
   Hi @dissdic
    Any update here?
    
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   You are receiving this because you were mentioned.Message ID: ***@***.***&gt;


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