This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 79eb36782ae [Bug](function) fix encryption_function return wrong
result at const column (#40201)
79eb36782ae is described below
commit 79eb36782aea695a98c283f41270295289ce52c0
Author: zhangstar333 <[email protected]>
AuthorDate: Mon Sep 2 13:49:09 2024 +0800
[Bug](function) fix encryption_function return wrong result at const column
(#40201)
## Proposed changes
the string object have error of order, should be src, key,iv,mode
<!--Describe your changes.-->
---
be/src/vec/functions/function_encryption.cpp | 2 +-
.../encryption_digest/test_encryption_function.out | 3 +++
.../encryption_digest/test_encryption_function.groovy | 17 +++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/functions/function_encryption.cpp
b/be/src/vec/functions/function_encryption.cpp
index 32eeb5b2cfc..f63e9bca1b0 100644
--- a/be/src/vec/functions/function_encryption.cpp
+++ b/be/src/vec/functions/function_encryption.cpp
@@ -335,7 +335,7 @@ struct EncryptionAndDecryptFourImpl {
return Status::OK();
}
- static void vector_const(const ColumnString* column, StringRef iv_arg,
StringRef key_arg,
+ static void vector_const(const ColumnString* column, StringRef key_arg,
StringRef iv_arg,
StringRef mode_arg, size_t input_rows_count,
ColumnString::Chars& result_data,
ColumnString::Offsets& result_offset,
NullMap& null_map) {
diff --git
a/regression-test/data/query_p0/sql_functions/encryption_digest/test_encryption_function.out
b/regression-test/data/query_p0/sql_functions/encryption_digest/test_encryption_function.out
index c260c12470a..9e920596f89 100644
---
a/regression-test/data/query_p0/sql_functions/encryption_digest/test_encryption_function.out
+++
b/regression-test/data/query_p0/sql_functions/encryption_digest/test_encryption_function.out
@@ -137,3 +137,6 @@ text
-- !sql --
82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e
+-- !sql --
+aaaaaa
+
diff --git
a/regression-test/suites/query_p0/sql_functions/encryption_digest/test_encryption_function.groovy
b/regression-test/suites/query_p0/sql_functions/encryption_digest/test_encryption_function.groovy
index afa8c2c132b..4b0fd3d497d 100644
---
a/regression-test/suites/query_p0/sql_functions/encryption_digest/test_encryption_function.groovy
+++
b/regression-test/suites/query_p0/sql_functions/encryption_digest/test_encryption_function.groovy
@@ -132,4 +132,21 @@ suite("test_encryption_function") {
qt_sql "SELECT SM3(\"abc\");"
qt_sql "select sm3(\"abcd\");"
qt_sql "select sm3sum(\"ab\",\"cd\");"
+ sql "DROP TABLE IF EXISTS quantile_table"
+ sql"""
+ CREATE TABLE quantile_table
+ (
+ id int,
+ k string
+ )
+ ENGINE=OLAP
+ UNIQUE KEY(id)
+ DISTRIBUTED BY HASH(id) BUCKETS 4
+ PROPERTIES (
+ "enable_unique_key_merge_on_write" = "true",
+ "replication_num" = "1"
+ );
+ """
+ sql""" insert into quantile_table values(1,"aaaaaa");"""
+ qt_sql """ select
sm4_decrypt(sm4_encrypt(k,"doris","0123456789abcdef"),"doris","0123456789abcdef")
from quantile_table; """
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]