diff options
author | gluh@gluh.mysql.r18.ru <> | 2003-10-21 15:14:06 +0500 |
---|---|---|
committer | gluh@gluh.mysql.r18.ru <> | 2003-10-21 15:14:06 +0500 |
commit | f602be8d3f860d2c59399a5fd7e601871859ad7e (patch) | |
tree | 8ef0c5224c2298c3260a5f59bcc83154a6f45f91 /mysql-test | |
parent | 91f5c5e3379869c82b1477a37cefe54be084f261 (diff) | |
download | mariadb-git-f602be8d3f860d2c59399a5fd7e601871859ad7e.tar.gz |
Fix for bug #1271: Undefined variable in PASSWORD() function is not
handled correctly
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_crypt.result | 10 | ||||
-rw-r--r-- | mysql-test/t/func_crypt.test | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 742de833bf7..96bbaa6cae7 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -7,3 +7,13 @@ old_password('test') password('test') select length(encrypt('test')), encrypt('test','aa'); length(encrypt('test')) encrypt('test','aa') 13 aaqPiZY5xR5l. +drop table if exists t1; +create table t1 (name varchar(50), pw varchar(16)); +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; diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test index f403d96e885..e612405c5e9 100644 --- a/mysql-test/t/func_crypt.test +++ b/mysql-test/t/func_crypt.test @@ -4,3 +4,12 @@ select length(encrypt('foo', 'ff')) <> 0; --replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l. select old_password('test'), password('test'); select length(encrypt('test')), encrypt('test','aa'); + +drop table if exists t1; +create table t1 (name varchar(50), pw varchar(16)); +insert into t1 values ('tom', password('my_pass')); +set @pass='my_pass'; +select name from t1 where name='tom' and pw=password(@pass); +select name from t1 where name='tom' and pw=password(@undefined); +drop table t1; + |