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/03/25 13:28:19 UTC

[GitHub] [shardingsphere] NJCrazyRen opened a new issue #16379: ShardingSphere-proxy返回的ResultSet的MetaData信息不正确

NJCrazyRen opened a new issue #16379:
URL: https://github.com/apache/shardingsphere/issues/16379


   我有一个MySQL库,里面有一些数据表字段是加密的,所以希望使用ShardingSphere-proxy作为中间件来实现对应用透明的自动加解密。然而在测试过程中发现同样的查询SQL,通过JDBC发到后端真实库中执行得到的结果集(ResultSet)与发到ShardingSphere-proxy执行得到的结果集,它们的MetaData里的列数据类型并不完全一致,甚至再Decimal类型上还发生了精度缩减的情况,导致应用程序发生异常报错。
   例如:
   真实库中字段类型为 decimal(5, 2)
   JDBC直接访问真实库查询得到的结果集MetaData中也是 decimal(5, 2)
   但是JDBC访问ShardingSphere-proxy查询得到的结果MetaData中却是 decimal(3, 2)
   其它decimal类型的字段也是同样,看起来都是 precision 莫名少了 2


-- 
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] NJCrazyRen commented on issue #16379: ShardingSphere-proxy返回的ResultSet的MetaData信息不正确

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


   > @NJCrazyRen Hello, Can your translate english for your question?
   
   OK, thanks for your reply. Forgive my poor English.
   The question is that I have a MySQL database and there are some columns storing encrypted data, but I need plain text data in my spark application. So I tried to use ShardingSphere-proxy with corrent encrypt config as middleware between my apache spark application and MySQL. It works well when I use DBeaver to execute query, I got the plain data. But the exception below occured in my spark application:
   `requirement failed: Decimal precision 5 exceeds max precision 3`
   The real column data type in MySQL is decimal(5, 2), but spark got decimal(3, 2) from ShardingSphere-proxy. In fact, not only one column data type is incorrect, the data types of other decimal columns are also incorrect. I found the similarity is the precision got from ShardingSphere-proxy be 2 less than the correct precision in database.
   I changed my spark application code, connecting to database directly for getting right schema, passing it to spark DataFrameReader with JDBC format for workaround. Although it can avoid the exception, but it's too much trouble.
   
   The software version in my case: MySQL 5.7.33, ShardingSphere-proxy 5.1.0, mysql-connector-java-8.0.26


-- 
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] TeslaCN closed issue #16379: ShardingSphere-proxy返回的ResultSet的MetaData信息不正确

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


   


-- 
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] TeslaCN commented on issue #16379: ShardingSphere-proxy返回的ResultSet的MetaData信息不正确

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


   Opened in #16424.


-- 
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] zjcnb commented on issue #16379: ShardingSphere-proxy返回的ResultSet的MetaData信息不正确

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


   @NJCrazyRen Hello, Can your translate english for your question?


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