apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.94k stars 6.74k forks source link

Column "TODO" not found exception occurs when I run integration test with jdbc, Standalone, PostgreSQL and encrypt param #23626

Open strongduanmu opened 1 year ago

strongduanmu commented 1 year ago

Bug Report

Which version of ShardingSphere did you use?

f52f484

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

Expected behavior

Execute INSERT INTO t_user (user_id, user_name_cipher, user_name_like, user_name_plain, password_cipher, email_cipher, telephone_cipher, telephone_like, telephone_plain, creation_date) VALUES (?, ?, ?, ?, 'MyOShk4kjRnds7CZfU5NCw==', 'VvWKtMDr5+58OMAAu6BH5A==', '8Rj1Bg696vJMKwPNxzxGOg==', '01450145014', '12341234123', '2018-08-08'), (?, ?, ?, ?, 'qbUuBn0oxdrV8sNNyoqDCg==', 'FRo1h44oclER1+0MeI1T0w==', 'cD36lxxtVApK4QLzec87zg==', '14541454545', '23452345456', '2019-08-08') successfully with JDBC executeUpdateForPreparedStatementWithColumnNames interface

Actual behavior

Error:  assertExecuteUpdateWithColumnNames[jdbc: encrypt -> H2 -> Placeholder -> INSERT INTO t_user {user_id, user_name, password, email, telephone, creation_date} VALUES {?, ?, '123456', 'tomas@gmail.com', '12341234123', '2018-08-08'}, {?, ?, '23456', 'mike@qq.com', '23452345456', '2019-08-08'}]  Time elapsed: 0.013 s  <<< ERROR!
org.h2.jdbc.JdbcSQLSyntaxErrorException: 
Column "TODO" not found; SQL statement:
INSERT INTO t_user (user_id, user_name_cipher, user_name_like, user_name_plain, password_cipher, email_cipher, telephone_cipher, telephone_like, telephone_plain, creation_date) VALUES (?, ?, ?, ?, 'MyOShk4kjRnds7CZfU5NCw==', 'VvWKtMDr5+58OMAAu6BH5A==', '8Rj1Bg696vJMKwPNxzxGOg==', '01450145014', '12341234123', '2018-08-08'), (?, ?, ?, ?, 'qbUuBn0oxdrV8sNNyoqDCg==', 'FRo1h44oclER1+0MeI1T0w==', 'cD36lxxtVApK4QLzec87zg==', '14541454545', '23452345456', '2019-08-08') [42122-214]
    at org.apache.shardingsphere.test.e2e.engine.dml.AdditionalDMLE2EIT.executeUpdateForPreparedStatementWithColumnNames(AdditionalDMLE2EIT.java:143)
    at org.apache.shardingsphere.test.e2e.engine.dml.AdditionalDMLE2EIT.assertExecuteUpdateWithColumnNames(AdditionalDMLE2EIT.java:127)

Error:  assertExecuteWithColumnNames[jdbc: encrypt -> H2 -> Literal -> UPDATE t_user u SET u.password = ? WHERE u.user_id = ?]  Time elapsed: 0.014 s  <<< ERROR!
org.h2.jdbc.JdbcSQLSyntaxErrorException: 
Column "TODO" not found; SQL statement:
UPDATE t_user u SET password_cipher = 'wuhmEKgdgrWQYt+Ev0hgGA==' WHERE u.user_id = 10 [42122-214]
    at org.apache.shardingsphere.test.e2e.engine.dml.AdditionalDMLE2EIT.executeForStatementWithColumnNames(AdditionalDMLE2EIT.java:252)
    at org.apache.shardingsphere.test.e2e.engine.dml.AdditionalDMLE2EIT.assertExecuteWithColumnNames(AdditionalDMLE2EIT.java:245)

Error:  assertExecuteWithColumnNames[jdbc: encrypt -> H2 -> Placeholder -> UPDATE t_user u SET u.password = ? WHERE u.user_id = ?]  Time elapsed: 0.016 s  <<< ERROR!
org.h2.jdbc.JdbcSQLSyntaxErrorException: 
Column "TODO" not found; SQL statement:
UPDATE t_user u SET password_cipher = ? WHERE u.user_id = ? [42122-214]
    at org.apache.shardingsphere.test.e2e.engine.dml.AdditionalDMLE2EIT.executeForPreparedStatementWithColumnNames(AdditionalDMLE2EIT.java:262)
    at org.apache.shardingsphere.test.e2e.engine.dml.AdditionalDMLE2EIT.assertExecuteWithColumnNames(AdditionalDMLE2EIT.java:245)

Error:  assertExecuteUpdateWithColumnNames[jdbc: encrypt -> H2 -> Placeholder -> UPDATE t_user u SET u.password = ? WHERE u.user_id = ?]  Time elapsed: 0.014 s  <<< ERROR!
org.h2.jdbc.JdbcSQLSyntaxErrorException: 
Column "TODO" not found; SQL statement:
UPDATE t_user u SET password_cipher = ? WHERE u.user_id = ? [42122-214]
    at org.apache.shardingsphere.test.e2e.engine.dml.AdditionalDMLE2EIT.executeUpdateForPreparedStatementWithColumnNames(AdditionalDMLE2EIT.java:143)
    at org.apache.shardingsphere.test.e2e.engine.dml.AdditionalDMLE2EIT.assertExecuteUpdateWithColumnNames(AdditionalDMLE2EIT.java:127)

Reason analyze (If you can)

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

Example codes for reproduce this issue (such as a github link).

lushaorong commented 1 year ago

I want to try it

strongduanmu commented 1 year ago

@lushaorong Welcome, I will assign this issue to you.

lushaorong commented 1 year ago

I run AdditionalDMLE2EIT.assertExecuteUpdateWithColumnIndexes test and I get error message No tests found matching assertExecuteUpdateWithColumnIndexes with any parameter from org.junit.runner.Request. It doesn't seem to work. @strongduanmu

lushaorong commented 1 year ago

Sorry, I can't finish this task,Please reassign someone else to finish it.

strongduanmu commented 1 year ago

@lushaorong Thank you for your remind.