summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2003-10-22 15:38:20 +0500
committerunknown <gluh@gluh.mysql.r18.ru>2003-10-22 15:38:20 +0500
commit033a038296d8ee9c3fa80ea1c9c468386eb92adb (patch)
tree43c1b64eba4212e2eff964a8e7d158c8957ebd52
parenteb0acc2996daaec13351ae01b775bb2d3aeeca91 (diff)
parent42de9a3ed95af04abfb0a77b79bddd6f2327d6b9 (diff)
downloadmariadb-git-033a038296d8ee9c3fa80ea1c9c468386eb92adb.tar.gz
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.0
into gluh.mysql.r18.ru:/home/gluh/mysql-4.0.pass
-rw-r--r--mysql-test/r/func_crypt.result10
-rw-r--r--mysql-test/t/func_crypt.test9
-rw-r--r--sql/item_func.cc2
3 files changed, 20 insertions, 1 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;
+
diff --git a/sql/item_func.cc b/sql/item_func.cc
index fd6d17d0cf2..8d7ee637d73 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2087,7 +2087,7 @@ void Item_func_get_user_var::fix_length_and_dec()
bool Item_func_get_user_var::const_item() const
{
- return var_entry && current_thd->query_id != var_entry->update_query_id;
+ return (!var_entry || current_thd->query_id != var_entry->update_query_id);
}