diff options
author | unknown <jimw@mysql.com> | 2005-06-01 09:48:25 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-06-01 09:48:25 -0700 |
commit | f20c56a9e7cc12a65068392ee733fff2ff4b805a (patch) | |
tree | 0e2a4cd0776aae89279894b81f2357603834300d /mysql-test | |
parent | 853a55ad215db4f44bee4281de57054bf2f7da17 (diff) | |
download | mariadb-git-f20c56a9e7cc12a65068392ee733fff2ff4b805a.tar.gz |
Fix handling of NULL fields in FIELD(). (Bug #10944)
mysql-test/r/func_str.result:
Update results
mysql-test/t/func_str.test:
Add regression tests
sql/item_func.cc:
Handle NULL as first argument to FIELD()
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_str.result | 6 | ||||
-rw-r--r-- | mysql-test/t/func_str.test | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 5405dbf53d9..ea1efbc7c0a 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -783,3 +783,9 @@ id aes_decrypt(str, 'bar') 1 foo 2 NULL DROP TABLE t1, t2; +select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0); +field(0,NULL,1,0) field("",NULL,"bar","") field(0.0,NULL,1.0,0.0) +3 3 3 +select field(NULL,1,2,NULL), field(NULL,1,2,0); +field(NULL,1,2,NULL) field(NULL,1,2,0) +0 0 diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 22028437111..a5536f7a0be 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -521,3 +521,9 @@ SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id DROP TABLE t1, t2; + +# +# Bug #10944: Mishandling of NULL arguments in FIELD() +# +select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0); +select field(NULL,1,2,NULL), field(NULL,1,2,0); |