summaryrefslogtreecommitdiff
path: root/mysql-test/main/func_des_encrypt.result
blob: 9ce577a5794a47fa0146e3a68ef5696a762aba0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
select des_encrypt('hello');
des_encrypt('hello')
€Ö2nV“Ø}
Warnings:
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
#
# Bug #11643: des_encrypt() causes server to die
#
CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '') ENGINE=MyISAM;
INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
UPDATE t1 SET des=DES_ENCRYPT('1234');
Warnings:
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
SELECT LENGTH(des) FROM t1;
LENGTH(des)
9
9
9
9
SELECT DES_DECRYPT(des) FROM t1;
DES_DECRYPT(des)
1234
1234
1234
1234
Warnings:
Note	1287	'des_decrypt' is deprecated and will be removed in a future release
SELECT 
LENGTH(DES_ENCRYPT('1234')), 
LENGTH(DES_ENCRYPT('12345')), 
LENGTH(DES_ENCRYPT('123456')), 
LENGTH(DES_ENCRYPT('1234567'));
LENGTH(DES_ENCRYPT('1234'))	LENGTH(DES_ENCRYPT('12345'))	LENGTH(DES_ENCRYPT('123456'))	LENGTH(DES_ENCRYPT('1234567'))
9	9	9	9
Warnings:
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
SELECT 
DES_DECRYPT(DES_ENCRYPT('1234')), 
DES_DECRYPT(DES_ENCRYPT('12345')), 
DES_DECRYPT(DES_ENCRYPT('123456')), 
DES_DECRYPT(DES_ENCRYPT('1234567'));
DES_DECRYPT(DES_ENCRYPT('1234'))	DES_DECRYPT(DES_ENCRYPT('12345'))	DES_DECRYPT(DES_ENCRYPT('123456'))	DES_DECRYPT(DES_ENCRYPT('1234567'))
1234	12345	123456	1234567
Warnings:
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
Note	1287	'des_decrypt' is deprecated and will be removed in a future release
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
Note	1287	'des_decrypt' is deprecated and will be removed in a future release
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
Note	1287	'des_decrypt' is deprecated and will be removed in a future release
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
Note	1287	'des_decrypt' is deprecated and will be removed in a future release
DROP TABLE t1;
End of 5.0 tests
#
# MDEV-23330 Server crash or ASAN negative-size-param in
# my_strnncollsp_binary / SORT_FIELD_ATTR::compare_packed_varstrings
#
CREATE TABLE t1 (a CHAR(240), b BIT(48));
INSERT INTO t1 VALUES ('a',b'0001'),('b',b'0010'),('c',b'0011'),('d',b'0100'),('e',b'0001'),('f',b'0101'),('g',b'0110'),('h',b'0111'),('i',b'1000'),('j',b'1001');
SELECT DES_DECRYPT(a, 'x'), HEX(BINARY b) FROM t1 GROUP BY 1, 2 WITH ROLLUP;
DES_DECRYPT(a, 'x')	HEX(BINARY b)
a	000000000001
a	NULL
b	000000000002
b	NULL
c	000000000003
c	NULL
d	000000000004
d	NULL
e	000000000001
e	NULL
f	000000000005
f	NULL
g	000000000006
g	NULL
h	000000000007
h	NULL
i	000000000008
i	NULL
j	000000000009
j	NULL
NULL	NULL
Warnings:
Note	1287	'des_decrypt' is deprecated and will be removed in a future release
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT t1 VALUES (1),(2);
SELECT CHAR_LENGTH(a), DES_DECRYPT(a) FROM (SELECT _utf8 0xC2A2 AS a FROM t1) AS t2;
CHAR_LENGTH(a)	DES_DECRYPT(a)
1	¢
1	¢
Warnings:
Note	1287	'des_decrypt' is deprecated and will be removed in a future release
DROP TABLE t1;
#
# End of 10.5 tests
#
#
# MDEV-27104 deprecate DES_ENCRYPT/DECRYPT functions
#
# just show how to disable deprecation note
set sql_notes=0;
select hex(des_encrypt('a'));
hex(des_encrypt('a'))
80E4DE4136BA6CD7F3
#
# End of 10.10 tests
#