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 2020/05/09 06:59:55 UTC

[GitHub] [shardingsphere] KomachiSion opened a new issue #2884: Repeated column when use encrypt with JPA + Springboot

KomachiSion opened a new issue #2884:
URL: https://github.com/apache/shardingsphere/issues/2884


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   4.0.0-RC2-SNAPSHOT
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   
   Sharding-JDBC
   
   ### Expected behavior
   
   Insert encrypt successfully.
   
   ### Actual behavior
   
   ```
   Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Column 'user_name_plain' specified twice
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   	at com.mysql.jdbc.Util.getInstance(Util.java:408)
   	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
   	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
   	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
   	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
   	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
   	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
   	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
   	at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
   	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
   	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
   	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.EncryptPreparedStatement.executeUpdate(EncryptPreparedStatement.java:120)
   	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
   	... 23 more
   ```
   
   ### Reason analyze (If you can)
   
   Logic SQL: `insert into t_user (assisted_query_pwd, pwd, user_name, user_name_plain, user_id) values (?, ?, ?, ?, ?)`
   
   actual SQL: `insert into t_user (assisted_query_pwd, pwd, user_name, user_name_plain, user_id, assisted_query_pwd, user_name_plain) values (?, ?, ?, ?, ?, ?, ?) `
   
   SQL generated by JPA has included `user_name_plain `, but encrypt add `user_name_plain` again.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   clone example code.
   run `sharding-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/boot/SpringBootExample.java`
   
   ### Example codes for reproduce this issue (such as a github link).
   
   https://github.com/apache/incubator-shardingsphere-example


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

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



[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #2884: Repeated column when use encrypt with JPA + Springboot

Posted by GitBox <gi...@apache.org>.
KomachiSion commented on issue #2884: Repeated column when use encrypt with JPA + Springboot
URL: https://github.com/apache/incubator-shardingsphere/issues/2884#issuecomment-569036709
 
 
   PR#3663 will cause new issue #3770 , so revert this PR and reopen this issue.
   
   I think we should fix this issue with implementing the DDL of encrypt.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu closed issue #2884: Repeated column when use encrypt with JPA + Springboot

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #2884: Repeated column when use encrypt with JPA + Springboot
URL: https://github.com/apache/incubator-shardingsphere/issues/2884
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero closed issue #2884: Repeated column when use encrypt with JPA + Springboot

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #2884: Repeated column when use encrypt with JPA + Springboot
URL: https://github.com/apache/incubator-shardingsphere/issues/2884
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [shardingsphere] kimmking commented on issue #2884: Repeated column when use encrypt with JPA + Springboot

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


   It still here.


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

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



[GitHub] [shardingsphere] kimmking closed issue #2884: Repeated column when use encrypt with JPA + Springboot

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


   


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

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



[GitHub] [incubator-shardingsphere] terrymanu commented on issue #2884: Repeated column when use encrypt with JPA + Springboot

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #2884: Repeated column when use encrypt with JPA + Springboot
URL: https://github.com/apache/incubator-shardingsphere/issues/2884#issuecomment-600536158
 
 
   Fixed at #3340

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion opened a new issue #2884: Repeated column when use encrypt with JPA + Springboot

Posted by GitBox <gi...@apache.org>.
KomachiSion opened a new issue #2884: Repeated column when use encrypt with JPA + Springboot
URL: https://github.com/apache/incubator-shardingsphere/issues/2884
 
 
   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   4.0.0-RC2-SNAPSHOT
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   
   Sharding-JDBC
   
   ### Expected behavior
   
   Insert encrypt successfully.
   
   ### Actual behavior
   
   ```
   Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Column 'user_name_plain' specified twice
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   	at com.mysql.jdbc.Util.getInstance(Util.java:408)
   	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
   	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
   	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
   	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
   	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
   	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
   	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
   	at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
   	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
   	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
   	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.EncryptPreparedStatement.executeUpdate(EncryptPreparedStatement.java:120)
   	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
   	... 23 more
   ```
   
   ### Reason analyze (If you can)
   
   Logic SQL: `insert into t_user (assisted_query_pwd, pwd, user_name, user_name_plain, user_id) values (?, ?, ?, ?, ?)`
   
   actual SQL: `insert into t_user (assisted_query_pwd, pwd, user_name, user_name_plain, user_id, assisted_query_pwd, user_name_plain) values (?, ?, ?, ?, ?, ?, ?) `
   
   SQL generated by JPA has included `user_name_plain `, but encrypt add `user_name_plain` again.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   clone example code.
   run `sharding-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/boot/SpringBootExample.java`
   
   ### Example codes for reproduce this issue (such as a github link).
   
   https://github.com/apache/incubator-shardingsphere-example

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [shardingsphere] AINewBegin commented on issue #2884: Repeated column when use encrypt with JPA + Springboot

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


   > repeated column is okay now.
   > but example can't be running now.
   > I will fix it.
   
   4.1.0 still has it


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

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



[GitHub] [incubator-shardingsphere] KomachiSion opened a new issue #2884: Repeated column when use encrypt with JPA + Springboot

Posted by GitBox <gi...@apache.org>.
KomachiSion opened a new issue #2884: Repeated column when use encrypt with JPA + Springboot
URL: https://github.com/apache/incubator-shardingsphere/issues/2884
 
 
   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   4.0.0-RC2-SNAPSHOT
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   
   Sharding-JDBC
   
   ### Expected behavior
   
   Insert encrypt successfully.
   
   ### Actual behavior
   
   ```
   Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Column 'user_name_plain' specified twice
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   	at com.mysql.jdbc.Util.getInstance(Util.java:408)
   	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
   	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
   	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
   	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
   	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
   	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
   	at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
   	at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
   	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
   	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
   	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.EncryptPreparedStatement.executeUpdate(EncryptPreparedStatement.java:120)
   	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
   	... 23 more
   ```
   
   ### Reason analyze (If you can)
   
   Logic SQL: `insert into t_user (assisted_query_pwd, pwd, user_name, user_name_plain, user_id) values (?, ?, ?, ?, ?)`
   
   actual SQL: `insert into t_user (assisted_query_pwd, pwd, user_name, user_name_plain, user_id, assisted_query_pwd, user_name_plain) values (?, ?, ?, ?, ?, ?, ?) `
   
   SQL generated by JPA has included `user_name_plain `, but encrypt add `user_name_plain` again.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   clone example code.
   run `sharding-jdbc-example/other-feature-example/encrypt-example/encrypt-spring-boot-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/spring/boot/SpringBootExample.java`
   
   ### Example codes for reproduce this issue (such as a github link).
   
   https://github.com/apache/incubator-shardingsphere-example

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [shardingsphere] kimmking commented on issue #2884: Repeated column when use encrypt with JPA + Springboot

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


   repeated column is okay now.
   but example can't be running now.
   I will fix it.


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

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