You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/02/05 07:56:26 UTC

[shardingsphere] branch master updated: Add test case for select join (#9346)

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

panjuan 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 49a7700  Add test case for select join (#9346)
49a7700 is described below

commit 49a77008912513c1fc9a9b2e78df6e7446cbf3fa
Author: Liang Zhang <te...@163.com>
AuthorDate: Fri Feb 5 15:56:01 2021 +0800

    Add test case for select join (#9346)
---
 .../src/test/resources/encrypt/select_for_query_with_cipher.xml    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-rewrite/src/test/resources/encrypt/select_for_query_with_cipher.xml b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-rewrite/src/test/resources/encrypt/select_for_query_with_cipher.xml
index 4d7a967..8856917 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-rewrite/src/test/resources/encrypt/select_for_query_with_cipher.xml
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-rewrite/src/test/resources/encrypt/select_for_query_with_cipher.xml
@@ -68,9 +68,14 @@
         <input sql="SELECT a.* FROM t_account a" />
         <output sql="SELECT `a`.`account_id`, `a`.`cipher_certificate_number` AS certificate_number, `a`.`cipher_password` AS password, `a`.`cipher_amount` AS amount, `a`.`status` FROM t_account a" />
     </rewrite-assertion>
-
+    
     <rewrite-assertion id="select_with_mix_qualified_shorthand_and_other_projection">
         <input sql="SELECT a.*, account_id, 1+1 FROM t_account a" />
         <output sql="SELECT `a`.`account_id`, `a`.`cipher_certificate_number` AS certificate_number, `a`.`cipher_password` AS password, `a`.`cipher_amount` AS amount, `a`.`status`, account_id, 1+1 FROM t_account a" />
     </rewrite-assertion>
+    
+    <rewrite-assertion id="select_with_join">
+        <input sql="SELECT t_account.amount, t_account_bak.amount FROM t_account LEFT JOIN t_account_bak ON t_account.id = t_account_bak.id WHERE t_account.amount = ? OR t_account_bak.amount = ?" parameters="1, 2" />
+        <output sql="SELECT t_account.cipher_amount AS amount, t_account_bak.cipher_amount AS amount FROM t_account LEFT JOIN t_account_bak ON t_account.id = t_account_bak.id WHERE t_account.cipher_amount = ? OR t_account_bak.cipher_amount = ?" parameters="encrypt_1, encrypt_2" />
+    </rewrite-assertion>
 </rewrite-assertions>