diff options
author | unknown <igor@igor-inspiron.creware.com> | 2005-06-02 07:27:02 -0700 |
---|---|---|
committer | unknown <igor@igor-inspiron.creware.com> | 2005-06-02 07:27:02 -0700 |
commit | 21989e7d4e281b67f060d61fdd0dd4fa2b4eba54 (patch) | |
tree | acc83f06df7a19c62761f098edfd9c4d26d8d57c /mysql-test/t/case.test | |
parent | 190aafb4d9760976b212db51f2f56c41f16cc376 (diff) | |
download | mariadb-git-21989e7d4e281b67f060d61fdd0dd4fa2b4eba54.tar.gz |
item_func.h:
Fixed bug #9939: a wrong conversion of arguments
for functions COALESCE and IFNULL.
The str_op virtual method was added into Item_func_numhybrid.
item_func.cc:
Fixed bug #9939: a wrong conversion of arguments
for functions COALESCE and IFNULL.
The str_op virtual method was added into Item_func_numhybrid.
item_cmpfunc.h, item_cmpfunc.cc:
Fixed bug #9939: a wrong conversion of arguments
for functions COALESCE and IFNULL.
Item_func_coalesce and Item_func_ifnull now
inherit from a modified Item_func_numhybrid.
case.test, case.result:
Added test cases for bug #9939.
mysql-test/r/case.result:
Added test cases for bug #9939.
mysql-test/t/case.test:
Added test cases for bug #9939.
sql/item_cmpfunc.cc:
Fixed bug #9939: a wrong conversion of arguments
for functions COALESCE and IFNULL.
Item_func_coalesce and Item_func_ifnull now
inherit from a modified Item_func_numhybrid.
sql/item_cmpfunc.h:
Fixed bug #9939: a wrong conversion of arguments
for functions COALESCE and IFNULL.
Item_func_coalesce and Item_func_ifnull now
inherit from a modified Item_func_numhybrid.
sql/item_func.cc:
Fixed bug #9939: a wrong conversion of arguments
for functions COALESCE and IFNULL.
The str_op virtual method was added into Item_func_numhybrid.
sql/item_func.h:
Fixed bug #9939: a wrong conversion of arguments
for functions COALESCE and IFNULL.
he str_op virtual method was added into Item_func_numhybrid.
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'mysql-test/t/case.test')
-rw-r--r-- | mysql-test/t/case.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index fed3ff07a13..f2cfce9085d 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -110,3 +110,22 @@ explain extended SELECT COALESCE('a' COLLATE latin1_bin,'b'); SHOW CREATE TABLE t1; DROP TABLE t1; + +# +# Tests for bug #9939: conversion of the arguments for COALESCE and IFNULL +# + +CREATE TABLE t1 (EMPNUM INT); +INSERT INTO t1 VALUES (0), (2); +CREATE TABLE t2 (EMPNUM DECIMAL (4, 2)); +INSERT INTO t2 VALUES (0.0), (9.0); + +SELECT COALESCE(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM, + t1.EMPNUM AS EMPMUM1, t2.EMPNUM AS EMPNUM2 + FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM; + +SELECT IFNULL(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM, + t1.EMPNUM AS EMPMUM1, t2.EMPNUM AS EMPNUM2 + FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM; + +DROP TABLE t1,t2; |