Skip to content

Commit fe8b99d

Browse files
committed
MDEV-27104 deprecate DES_ENCRYPT/DECRYPT functions
1 parent 90c3b28 commit fe8b99d

9 files changed

+266
-18
lines changed

mysql-test/main/func_des_encrypt.result

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
select des_encrypt('hello');
22
des_encrypt('hello')
33
��2nV��}
4+
Warnings:
5+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
46
#
57
# Bug #11643: des_encrypt() causes server to die
68
#
79
CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '') ENGINE=MyISAM;
810
INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
911
UPDATE t1 SET des=DES_ENCRYPT('1234');
12+
Warnings:
13+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
1014
SELECT LENGTH(des) FROM t1;
1115
LENGTH(des)
1216
9
@@ -19,20 +23,36 @@ DES_DECRYPT(des)
1923
1234
2024
1234
2125
1234
26+
Warnings:
27+
Note 1287 'des_decrypt' is deprecated and will be removed in a future release
2228
SELECT
2329
LENGTH(DES_ENCRYPT('1234')),
2430
LENGTH(DES_ENCRYPT('12345')),
2531
LENGTH(DES_ENCRYPT('123456')),
2632
LENGTH(DES_ENCRYPT('1234567'));
2733
LENGTH(DES_ENCRYPT('1234')) LENGTH(DES_ENCRYPT('12345')) LENGTH(DES_ENCRYPT('123456')) LENGTH(DES_ENCRYPT('1234567'))
2834
9 9 9 9
35+
Warnings:
36+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
37+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
38+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
39+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
2940
SELECT
3041
DES_DECRYPT(DES_ENCRYPT('1234')),
3142
DES_DECRYPT(DES_ENCRYPT('12345')),
3243
DES_DECRYPT(DES_ENCRYPT('123456')),
3344
DES_DECRYPT(DES_ENCRYPT('1234567'));
3445
DES_DECRYPT(DES_ENCRYPT('1234')) DES_DECRYPT(DES_ENCRYPT('12345')) DES_DECRYPT(DES_ENCRYPT('123456')) DES_DECRYPT(DES_ENCRYPT('1234567'))
3546
1234 12345 123456 1234567
47+
Warnings:
48+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
49+
Note 1287 'des_decrypt' is deprecated and will be removed in a future release
50+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
51+
Note 1287 'des_decrypt' is deprecated and will be removed in a future release
52+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
53+
Note 1287 'des_decrypt' is deprecated and will be removed in a future release
54+
Note 1287 'des_encrypt' is deprecated and will be removed in a future release
55+
Note 1287 'des_decrypt' is deprecated and will be removed in a future release
3656
DROP TABLE t1;
3757
End of 5.0 tests
3858
#
@@ -64,12 +84,29 @@ i NULL
6484
j 000000000009
6585
j NULL
6686
NULL NULL
87+
Warnings:
88+
Note 1287 'des_decrypt' is deprecated and will be removed in a future release
6789
DROP TABLE t1;
6890
CREATE TABLE t1 (a INT);
6991
INSERT t1 VALUES (1),(2);
7092
SELECT CHAR_LENGTH(a), DES_DECRYPT(a) FROM (SELECT _utf8 0xC2A2 AS a FROM t1) AS t2;
7193
CHAR_LENGTH(a) DES_DECRYPT(a)
7294
1 �
7395
1 �
96+
Warnings:
97+
Note 1287 'des_decrypt' is deprecated and will be removed in a future release
7498
DROP TABLE t1;
75-
End of 10.5 tests
99+
#
100+
# End of 10.5 tests
101+
#
102+
#
103+
# MDEV-27104 deprecate DES_ENCRYPT/DECRYPT functions
104+
#
105+
# just show how to disable deprecation note
106+
set sql_notes=0;
107+
select hex(des_encrypt('a'));
108+
hex(des_encrypt('a'))
109+
80E4DE4136BA6CD7F3
110+
#
111+
# End of 10.10 tests
112+
#

mysql-test/main/func_des_encrypt.test

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,17 @@ INSERT t1 VALUES (1),(2);
5757
SELECT CHAR_LENGTH(a), DES_DECRYPT(a) FROM (SELECT _utf8 0xC2A2 AS a FROM t1) AS t2;
5858
DROP TABLE t1;
5959

60-
--Echo End of 10.5 tests
60+
--echo #
61+
--echo # End of 10.5 tests
62+
--echo #
63+
64+
--echo #
65+
--echo # MDEV-27104 deprecate DES_ENCRYPT/DECRYPT functions
66+
--echo #
67+
--echo # just show how to disable deprecation note
68+
set sql_notes=0;
69+
select hex(des_encrypt('a'));
70+
71+
--echo #
72+
--echo # End of 10.10 tests
73+
--echo #

0 commit comments

Comments
 (0)