summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2013-08-20 14:48:29 +0300
committerunknown <sanja@montyprogram.com>2013-08-20 14:48:29 +0300
commit35b2883643e337a8ec9c3cf7494363ae9889119c (patch)
treeeb2e7d833ed965b30f8b8485cfdac31abfea6c97 /mysql-test/t/select.test
parentdafa458262fb47a2c9534bcc36088b15e26307c2 (diff)
parentb59738a598569ace75be5e63b7ed6ca69afe6ebc (diff)
downloadmariadb-git-35b2883643e337a8ec9c3cf7494363ae9889119c.tar.gz
merge 5.5 -> 10.0-base
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 6a82a2901c5..80ca862b74e 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -4518,3 +4518,34 @@ DROP TABLE t1, t2;
--echo End of 5.3 tests
+--echo #
+--echo # mysql BUG#1271 Undefined variable in PASSWORD()
+--echo # function is not handled correctly
+--echo #
+
+create table t1 (
+name VARCHAR(50) NOT NULL PRIMARY KEY,
+pw VARCHAR(41) NOT NULL);
+
+INSERT INTO t1 (name, pw)
+VALUES ('tom', PASSWORD('my_pw'));
+
+SET @pass='my_pw';
+SET @wrong='incorrect';
+
+select * from t1;
+select length(PASSWORD(@pass));
+
+
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@pass);
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@wrong);
+SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined);
+
+
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@pass));
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@wrong));
+select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined));
+
+drop table t1;
+
+--echo End of 10.0 tests