[regression test]add encryption function test case (#9920)
This commit is contained in:
@ -0,0 +1,43 @@
|
||||
-- This file is automatically generated. You should know what you did if you want to edit this
|
||||
-- !sql --
|
||||
wr2JEDVXzL9+2XtRhgIloA==
|
||||
|
||||
-- !sql --
|
||||
tsmK1HzbpnEdR2//WhO+MA==
|
||||
|
||||
-- !sql --
|
||||
text
|
||||
|
||||
-- !sql --
|
||||
\N
|
||||
|
||||
-- !sql --
|
||||
900150983cd24fb0d6963f7d28e17f72
|
||||
|
||||
-- !sql --
|
||||
e2fc714c4727ee9395f324cd2e7f331f
|
||||
|
||||
-- !sql --
|
||||
e2fc714c4727ee9395f324cd2e7f331f
|
||||
|
||||
-- !sql --
|
||||
aDjwRflBrDjhBZIOFNw3Tg==
|
||||
|
||||
-- !sql --
|
||||
1Y4NGIukSbv9OrkZnRD1bQ==
|
||||
|
||||
-- !sql --
|
||||
text
|
||||
|
||||
-- !sql --
|
||||
\N
|
||||
|
||||
-- !sql --
|
||||
66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0
|
||||
|
||||
-- !sql --
|
||||
82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e
|
||||
|
||||
-- !sql --
|
||||
82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
|
||||
suite("test_encryption_function", "query") {
|
||||
sql "set enable_vectorized_engine = true;"
|
||||
sql "set batch_size = 4096;"
|
||||
|
||||
sql "set block_encryption_mode=\"AES_256_CBC\";"
|
||||
qt_sql "SELECT TO_BASE64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3'));"
|
||||
qt_sql "SELECT TO_BASE64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', '0123456789'));"
|
||||
qt_sql "SELECT AES_DECRYPT(FROM_BASE64('wr2JEDVXzL9+2XtRhgIloA=='),'F3229A0B371ED2D9441B830D21A390C3');"
|
||||
qt_sql "SELECT AES_DECRYPT(FROM_BASE64('mvZT1KJw7N0RJf27aipUpg=='),'F3229A0B371ED2D9441B830D21A390C3', '0123456789');"
|
||||
|
||||
qt_sql "SELECT MD5(\"abc\");"
|
||||
|
||||
qt_sql "SELECT MD5(\"abcd\");"
|
||||
qt_sql "SELECT MD5SUM(\"ab\",\"cd\");"
|
||||
|
||||
sql "set block_encryption_mode=\"SM4_128_CBC\";"
|
||||
qt_sql "SELECT TO_BASE64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3'));"
|
||||
qt_sql "SELECT TO_BASE64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', '0123456789'));"
|
||||
qt_sql "SELECT SM4_DECRYPT(FROM_BASE64('aDjwRflBrDjhBZIOFNw3Tg=='),'F3229A0B371ED2D9441B830D21A390C3');"
|
||||
qt_sql "SELECT SM4_DECRYPT(FROM_BASE64('G7yqOKfEyxdagboz6Qf01A=='),'F3229A0B371ED2D9441B830D21A390C3', '0123456789');"
|
||||
|
||||
qt_sql "SELECT SM3(\"abc\");"
|
||||
qt_sql "select sm3(\"abcd\");"
|
||||
qt_sql "select sm3sum(\"ab\",\"cd\");"
|
||||
}
|
||||
Reference in New Issue
Block a user