1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

More test for MDEV-10134 Add full support for DEFAULT

ENCRYPT(), SHA(), SHA2(),
AES_ENCRYPT(), AES_DECRYPT(),
DES_ENCRYPT(), DES_DECRYPT()
This commit is contained in:
Alexander Barkov
2016-06-10 14:09:05 +04:00
committed by Sergei Golubchik
parent ca8950cc11
commit 8f226121e5
7 changed files with 110 additions and 1 deletions

View File

@@ -2143,3 +2143,19 @@ SELECT * FROM t1;
a b a b
notagoodpwd *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937 notagoodpwd *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(30) DEFAULT ENCRYPT(a,123));
INSERT INTO t1 (a) VALUES ('hello');
SELECT * FROM t1;
a b
hello 12NKz5XM5JeKI
DROP TABLE t1;
CREATE TABLE t1 (
a VARCHAR(30),
b BLOB DEFAULT AES_ENCRYPT(a, 'passwd'),
c TEXT DEFAULT AES_DECRYPT(b, 'passwd')
);
INSERT INTO t1 (a) VALUES ('test');
SELECT c FROM t1;
c
test
DROP TABLE t1;

View File

@@ -1426,3 +1426,22 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def sha2('1',224) 253 56 56 Y 0 39 8 def sha2('1',224) 253 56 56 Y 0 39 8
sha2('1',224) sha2('1',224)
e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178
#
# Start of 10.2 tests
#
#
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (
a VARCHAR(30),
b TEXT DEFAULT SHA(a),
c TEXT DEFAULT SHA2(a,224)
);
INSERT INTO t1 (a) VALUES ('abc');
SELECT * FROM t1;
a b c
abc a9993e364706816aba3e25717850c26c9cd0d89d 23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7
DROP TABLE t1;
#
# End of 10.2 tests
#

View File

@@ -208,3 +208,22 @@ DROP TABLE t1;
# #
# End of 10.1 tests # End of 10.1 tests
# #
#
# Start of 10.2 tests
#
#
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (
a VARCHAR(30),
b BLOB DEFAULT DES_ENCRYPT(a, 'passwd'),
c TEXT DEFAULT DES_DECRYPT(b, 'passwd')
);
INSERT INTO t1 (a) VALUES ('test');
SELECT c FROM t1;
c
test
DROP TABLE t1;
#
# End of 10.2 tests
#

View File

@@ -1702,3 +1702,17 @@ CREATE TABLE t1 (a VARCHAR(30), b TEXT DEFAULT PASSWORD(a));
INSERT INTO t1 (a) VALUES ('notagoodpwd'); INSERT INTO t1 (a) VALUES ('notagoodpwd');
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(30) DEFAULT ENCRYPT(a,123));
INSERT INTO t1 (a) VALUES ('hello');
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (
a VARCHAR(30),
b BLOB DEFAULT AES_ENCRYPT(a, 'passwd'),
c TEXT DEFAULT AES_DECRYPT(b, 'passwd')
);
INSERT INTO t1 (a) VALUES ('test');
SELECT c FROM t1;
DROP TABLE t1;

View File

@@ -494,3 +494,23 @@ SET NAMES latin1;
SELECT sha2('1',224); SELECT sha2('1',224);
--disable_metadata --disable_metadata
--echo #
--echo # Start of 10.2 tests
--echo #
--echo #
--echo # MDEV-10134 Add full support for DEFAULT
--echo #
CREATE TABLE t1 (
a VARCHAR(30),
b TEXT DEFAULT SHA(a),
c TEXT DEFAULT SHA2(a,224)
);
INSERT INTO t1 (a) VALUES ('abc');
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #

View File

@@ -121,3 +121,24 @@ DROP TABLE t1;
--echo # --echo #
--echo # End of 10.1 tests --echo # End of 10.1 tests
--echo # --echo #
--echo #
--echo # Start of 10.2 tests
--echo #
--echo #
--echo # MDEV-10134 Add full support for DEFAULT
--echo #
CREATE TABLE t1 (
a VARCHAR(30),
b BLOB DEFAULT DES_ENCRYPT(a, 'passwd'),
c TEXT DEFAULT DES_DECRYPT(b, 'passwd')
);
INSERT INTO t1 (a) VALUES ('test');
SELECT c FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #