You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2023/07/27 01:48:45 UTC

[shardingsphere] branch master updated: Fix encryption distinct select bug #20096 (#26305)

This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a42f63edb6 Fix encryption distinct select bug #20096 (#26305)
1a42f63edb6 is described below

commit 1a42f63edb6f4711eedaa8950064984d065c2b41
Author: wangtiga <39...@users.noreply.github.com>
AuthorDate: Thu Jul 27 09:48:38 2023 +0800

    Fix encryption distinct select bug #20096 (#26305)
---
 .../encrypt/case/query-with-cipher/dml/select/select-order-by.xml  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/it/rewriter/src/test/resources/scenario/encrypt/case/query-with-cipher/dml/select/select-order-by.xml b/test/it/rewriter/src/test/resources/scenario/encrypt/case/query-with-cipher/dml/select/select-order-by.xml
index 1a12ead3396..6730842c676 100644
--- a/test/it/rewriter/src/test/resources/scenario/encrypt/case/query-with-cipher/dml/select/select-order-by.xml
+++ b/test/it/rewriter/src/test/resources/scenario/encrypt/case/query-with-cipher/dml/select/select-order-by.xml
@@ -36,5 +36,10 @@
         <input sql="SELECT account_id, password, amount AS a, status AS s FROM t_account WHERE account_id = 1 AND password = 'aaa' AND password like 'aaa' AND amount = '1000' AND status = 'OK' order by amount desc" />
         <output sql="SELECT account_id, cipher_password AS password, cipher_amount AS a, status AS s FROM t_account WHERE account_id = 1 AND assisted_query_password = 'assisted_query_aaa' AND like_query_password like 'like_query_aaa' AND cipher_amount = 'encrypt_1000' AND status = 'OK' order by cipher_amount desc" />
     </rewrite-assertion>
-    
+
+    <rewrite-assertion id="select_distinct_cipher_field_without_order_by_cipher" db-types="MySQL">
+        <input sql="SELECT distinct amount FROM t_account" />
+        <output sql="SELECT distinct cipher_amount AS amount FROM t_account" />
+    </rewrite-assertion>
+
 </rewrite-assertions>