summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <peter@mysql.com>2002-12-27 19:47:23 +0300
committerunknown <peter@mysql.com>2002-12-27 19:47:23 +0300
commit3db50925c70d3757f04d8fa0a1a9a02d471c4a47 (patch)
tree6485cac5dd20c207af3147a5cc6823cdf90b98f6 /mysql-test
parentc917474ed23e99ccb28b1c4802acb2a821177aad (diff)
downloadmariadb-git-3db50925c70d3757f04d8fa0a1a9a02d471c4a47.tar.gz
SCRUM
Add optional second parameter to password() function. It can be used to force password() to return fixed values. mysql-test/r/func_crypt.result: New test results mysql-test/t/func_crypt.test: new tests sql/item_strfunc.cc: Add optional second argument to password() function sql/item_strfunc.h: New method sql/sql_yacc.yy: Handling of password with 2 arguments
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_crypt.result11
-rw-r--r--mysql-test/t/func_crypt.test7
2 files changed, 16 insertions, 2 deletions
diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result
index ad3a64ccd1d..461ae1e7e09 100644
--- a/mysql-test/r/func_crypt.result
+++ b/mysql-test/r/func_crypt.result
@@ -1,6 +1,15 @@
select length(encrypt('foo', 'ff')) <> 0;
length(encrypt('foo', 'ff')) <> 0
1
-select old_password('test'),length(password("1")),length(encrypt('test')),encrypt('test','aa');
+select password("a",""), password("a",NULL), password("","a"), password(NULL,"a");
+password("a","") password("a",NULL) password("","a") password(NULL,"a")
+*2517f7235d68d4ba2e5019c93420523101157a792c01 NULL NULL
+select password("aaaaaaaaaaaaaaaa","a"), password("a","aaaaaaaaaaaaaaaa");
+password("aaaaaaaaaaaaaaaa","a") password("a","aaaaaaaaaaaaaaaa")
+*2cd3b9a44e9a9994789a30f935c92f45a96c5472f381 *37c7c5c794ff144819f2531bf03c57772cd84e40db09
+select old_password('test'), length(password("1")), length(encrypt('test')), encrypt('test','aa');
old_password('test') length(password("1")) length(encrypt('test')) encrypt('test','aa')
378b243e220ca493 45 13 aaqPiZY5xR5l.
+select old_password(""), old_password(NULL), password(""), password(NULL);
+old_password("") old_password(NULL) password("") password(NULL)
+ NULL NULL
diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test
index 812bdade39f..af0ef661d06 100644
--- a/mysql-test/t/func_crypt.test
+++ b/mysql-test/t/func_crypt.test
@@ -1,3 +1,8 @@
select length(encrypt('foo', 'ff')) <> 0;
--replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l.
-select old_password('test'),length(password("1")),length(encrypt('test')),encrypt('test','aa');
+
+# Test new and old password handling functions
+select password("a",""), password("a",NULL), password("","a"), password(NULL,"a");
+select password("aaaaaaaaaaaaaaaa","a"), password("a","aaaaaaaaaaaaaaaa");
+select old_password('test'), length(password("1")), length(encrypt('test')), encrypt('test','aa');
+select old_password(""), old_password(NULL), password(""), password(NULL);