2003-11-04 08:40:36 +01:00
|
|
|
drop table if exists t1;
|
2001-09-28 07:05:54 +02:00
|
|
|
select length(encrypt('foo', 'ff')) <> 0;
|
2001-05-23 01:30:17 +02:00
|
|
|
length(encrypt('foo', 'ff')) <> 0
|
|
|
|
1
|
2003-11-04 13:09:03 +01:00
|
|
|
create table t1 (name varchar(50), pw varchar(64));
|
2003-10-21 12:14:06 +02:00
|
|
|
insert into t1 values ('tom', password('my_pass'));
|
|
|
|
set @pass='my_pass';
|
|
|
|
select name from t1 where name='tom' and pw=password(@pass);
|
|
|
|
name
|
|
|
|
tom
|
|
|
|
select name from t1 where name='tom' and pw=password(@undefined);
|
|
|
|
name
|
|
|
|
drop table t1;
|
2003-07-08 00:36:14 +02:00
|
|
|
select password('abc');
|
|
|
|
password('abc')
|
2003-09-03 14:43:41 +02:00
|
|
|
*0D3CED9BEC10A777AEC23CCC353A8C08A633045E
|
2003-07-08 00:36:14 +02:00
|
|
|
select password('');
|
|
|
|
password('')
|
|
|
|
|
|
|
|
select old_password('abc');
|
|
|
|
old_password('abc')
|
|
|
|
7cd2b5942be28759
|
|
|
|
select old_password('');
|
|
|
|
old_password('')
|
|
|
|
|
|
|
|
select password('gabbagabbahey');
|
|
|
|
password('gabbagabbahey')
|
2003-09-03 14:43:41 +02:00
|
|
|
*B0F99D2963660DD7E16B751EC9EE2F17B6A68FA6
|
2003-07-08 00:36:14 +02:00
|
|
|
select old_password('idkfa');
|
|
|
|
old_password('idkfa')
|
|
|
|
5c078dc54ca0fcca
|
|
|
|
select length(password('1'));
|
|
|
|
length(password('1'))
|
|
|
|
41
|
|
|
|
select length(encrypt('test'));
|
|
|
|
length(encrypt('test'))
|
|
|
|
13
|
|
|
|
select encrypt('test','aa');
|
|
|
|
encrypt('test','aa')
|
|
|
|
aaqPiZY5xR5l.
|
|
|
|
select old_password(NULL);
|
|
|
|
old_password(NULL)
|
|
|
|
NULL
|
|
|
|
select password(NULL);
|
|
|
|
password(NULL)
|
2013-07-05 08:52:31 +02:00
|
|
|
|
2003-07-08 00:36:14 +02:00
|
|
|
set global old_passwords=on;
|
|
|
|
select password('');
|
|
|
|
password('')
|
|
|
|
|
|
|
|
select old_password('');
|
|
|
|
old_password('')
|
|
|
|
|
|
|
|
select password('idkfa');
|
|
|
|
password('idkfa')
|
2003-09-03 14:43:41 +02:00
|
|
|
*B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA
|
2003-07-08 00:36:14 +02:00
|
|
|
select old_password('idkfa');
|
|
|
|
old_password('idkfa')
|
|
|
|
5c078dc54ca0fcca
|
|
|
|
set old_passwords=on;
|
|
|
|
select password('idkfa');
|
|
|
|
password('idkfa')
|
|
|
|
5c078dc54ca0fcca
|
|
|
|
select old_password('idkfa');
|
|
|
|
old_password('idkfa')
|
|
|
|
5c078dc54ca0fcca
|
|
|
|
set global old_passwords=off;
|
|
|
|
select password('idkfa');
|
|
|
|
password('idkfa')
|
|
|
|
5c078dc54ca0fcca
|
|
|
|
select old_password('idkfa');
|
|
|
|
old_password('idkfa')
|
|
|
|
5c078dc54ca0fcca
|
|
|
|
set old_passwords=off;
|
|
|
|
select password('idkfa ');
|
|
|
|
password('idkfa ')
|
2003-09-03 14:43:41 +02:00
|
|
|
*2DC31D90647B4C1ABC9231563D2236E96C9A2DB2
|
2003-07-08 00:36:14 +02:00
|
|
|
select password('idkfa');
|
|
|
|
password('idkfa')
|
2003-09-03 14:43:41 +02:00
|
|
|
*B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA
|
2003-07-08 00:36:14 +02:00
|
|
|
select password(' idkfa');
|
|
|
|
password(' idkfa')
|
2003-09-03 14:43:41 +02:00
|
|
|
*12B099E56BB7FE8D43C78FD834A9D1D11178D045
|
2003-07-08 00:36:14 +02:00
|
|
|
select old_password('idkfa');
|
|
|
|
old_password('idkfa')
|
|
|
|
5c078dc54ca0fcca
|
|
|
|
select old_password(' i d k f a ');
|
|
|
|
old_password(' i d k f a ')
|
|
|
|
5c078dc54ca0fcca
|
2003-11-07 08:43:24 +01:00
|
|
|
explain extended select password('idkfa '), old_password('idkfa');
|
2006-07-28 19:27:01 +02:00
|
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
2003-11-07 08:43:24 +01:00
|
|
|
Warnings:
|
2008-02-12 20:09:16 +01:00
|
|
|
Note 1003 select password('idkfa ') AS `password('idkfa ')`,old_password('idkfa') AS `old_password('idkfa')`
|
2005-10-07 01:15:53 +02:00
|
|
|
select encrypt('1234','_.');
|
|
|
|
encrypt('1234','_.')
|
|
|
|
#
|
2009-05-27 12:20:57 +02:00
|
|
|
#
|
|
|
|
# Bug #44767: invalid memory reads in password() and old_password()
|
|
|
|
# functions
|
|
|
|
#
|
|
|
|
CREATE TABLE t1(c1 MEDIUMBLOB);
|
|
|
|
INSERT INTO t1 VALUES (REPEAT('a', 1024));
|
|
|
|
SELECT OLD_PASSWORD(c1), PASSWORD(c1) FROM t1;
|
|
|
|
OLD_PASSWORD(c1) PASSWORD(c1)
|
|
|
|
77023ffe214c04ff *82E58A2C08AAFE72C8EB523069CD8ADB33F78F58
|
|
|
|
DROP TABLE t1;
|
|
|
|
End of 5.0 tests
|
2016-06-26 20:44:32 +02:00
|
|
|
Start of 10.2 tests
|
|
|
|
CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(30) DEFAULT ENCRYPT(a,123));
|
|
|
|
SHOW CREATE TABLE t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
|
|
|
`a` varchar(10) DEFAULT NULL,
|
2016-11-07 17:17:40 +01:00
|
|
|
`b` varchar(30) DEFAULT encrypt(`a`,123)
|
2016-06-26 20:44:32 +02:00
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
|
|
|
INSERT INTO t1 (a) VALUES ('hello');
|
|
|
|
SELECT * FROM t1;
|
|
|
|
a b
|
|
|
|
hello 12NKz5XM5JeKI
|
|
|
|
DROP TABLE t1;
|