Commit 8f226121 authored by Alexander Barkov's avatar Alexander Barkov Committed by Sergei Golubchik

More test for MDEV-10134 Add full support for DEFAULT

ENCRYPT(), SHA(), SHA2(),
AES_ENCRYPT(), AES_DECRYPT(),
DES_ENCRYPT(), DES_DECRYPT()
parent ca8950cc
......@@ -2143,3 +2143,19 @@ SELECT * FROM t1;
a b
notagoodpwd *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937
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;
......@@ -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
sha2('1',224)
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
#
......@@ -208,3 +208,22 @@ DROP TABLE t1;
#
# 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
#
......@@ -446,7 +446,7 @@ DROP TABLE t1;
#
End of 5.1 tests.
#
# MDEV-10134 Add full support for DEFAULT
# MDEV-10134 Add full support for DEFAULT
#
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
SELECT METAPHON('Hello');
......
......@@ -1702,3 +1702,17 @@ CREATE TABLE t1 (a VARCHAR(30), b TEXT DEFAULT PASSWORD(a));
INSERT INTO t1 (a) VALUES ('notagoodpwd');
SELECT * FROM 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;
......@@ -494,3 +494,23 @@ SET NAMES latin1;
SELECT sha2('1',224);
--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 #
......@@ -121,3 +121,24 @@ DROP TABLE t1;
--echo #
--echo # End of 10.1 tests
--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 #
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment