summaryrefslogtreecommitdiff
path: root/mysql-test/r/select.result
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2009-12-15 21:08:21 +0400
committerRamil Kalimullin <ramil@mysql.com>2009-12-15 21:08:21 +0400
commitc5e6a11e149600b3c454043706170fad4e7c6ce4 (patch)
treebc9c340170fcfbc5a33213fdf3d5f53eecd3704e /mysql-test/r/select.result
parentd2e723bf53dd081fe6098feac66bf8934643a278 (diff)
downloadmariadb-git-c5e6a11e149600b3c454043706170fad4e7c6ce4.tar.gz
Fix for bug#49517: Inconsistent behavior while using
NULLable BIGINT and INT columns in comparison Problem: a consequence of the fix for 43668. Some Arg_comparator inner initialization missed, that may lead to unpredictable (wrong) comparison results. Fix: always properly initialize Arg_comparator before its usage. mysql-test/r/select.result: Fix for bug#49517: Inconsistent behavior while using NULLable BIGINT and INT columns in comparison -test result. mysql-test/t/select.test: Fix for bug#49517: Inconsistent behavior while using NULLable BIGINT and INT columns in comparison -test case. sql/item_cmpfunc.cc: Fix for bug#49517: Inconsistent behavior while using NULLable BIGINT and INT columns in comparison - now all Arg_comparator::set_cmp_func() set Arg_comparator::set_null to ensure its proper initialization in all cases (by default it's set to TRUE in constructors). sql/item_cmpfunc.h: Fix for bug#49517: Inconsistent behavior while using NULLable BIGINT and INT columns in comparison - now all Arg_comparator::set_cmp_func() set Arg_comparator::set_null to ensure its proper initialization in all cases (by default it's set to TRUE in constructors).
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r--mysql-test/r/select.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 1750051289a..f38af4ceb32 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4619,4 +4619,19 @@ c1
9.1234
DROP TABLE t1;
# End of test for bug#49489.
+#
+# Bug #49517: Inconsistent behavior while using
+# NULLable BIGINT and INT columns in comparison
+#
+CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL);
+INSERT INTO t1 VALUES(105, NULL, NULL);
+SELECT * FROM t1 WHERE b < 102;
+a b c
+SELECT * FROM t1 WHERE c < 102;
+a b c
+SELECT * FROM t1 WHERE 102 < b;
+a b c
+SELECT * FROM t1 WHERE 102 < c;
+a b c
+DROP TABLE t1;
End of 5.1 tests