1-- source include/have_ssl_crypto_functs.inc
2
3# This test can't be in func_encrypt.test, because it requires
4# --des-key-file to not be set.
5
6#
7# Bug #11643: des_encrypt() causes server to die
8#
9select des_encrypt('hello');
10
11# End of 4.1 tests
12
13--echo #
14--echo # Bug #11643: des_encrypt() causes server to die
15--echo #
16
17CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '') ENGINE=MyISAM;
18
19INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
20
21UPDATE t1 SET des=DES_ENCRYPT('1234');
22
23SELECT LENGTH(des) FROM t1;
24SELECT DES_DECRYPT(des) FROM t1;
25
26SELECT
27 LENGTH(DES_ENCRYPT('1234')),
28 LENGTH(DES_ENCRYPT('12345')),
29 LENGTH(DES_ENCRYPT('123456')),
30 LENGTH(DES_ENCRYPT('1234567'));
31SELECT
32 DES_DECRYPT(DES_ENCRYPT('1234')),
33 DES_DECRYPT(DES_ENCRYPT('12345')),
34 DES_DECRYPT(DES_ENCRYPT('123456')),
35 DES_DECRYPT(DES_ENCRYPT('1234567'));
36
37DROP TABLE t1;
38
39--Echo End of 5.0 tests
40