diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2009-12-15 21:08:21 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2009-12-15 21:08:21 +0400 |
commit | c5e6a11e149600b3c454043706170fad4e7c6ce4 (patch) | |
tree | bc9c340170fcfbc5a33213fdf3d5f53eecd3704e /sql/item_cmpfunc.h | |
parent | d2e723bf53dd081fe6098feac66bf8934643a278 (diff) | |
download | mariadb-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 'sql/item_cmpfunc.h')
-rw-r--r-- | sql/item_cmpfunc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index d4542dac820..05c9fc96ff5 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -54,10 +54,10 @@ public: /* Allow owner function to use string buffers. */ String value1, value2; - Arg_comparator(): thd(0), a_cache(0), b_cache(0), set_null(0), + Arg_comparator(): thd(0), a_cache(0), b_cache(0), set_null(TRUE), get_value_a_func(0), get_value_b_func(0) {}; Arg_comparator(Item **a1, Item **a2): a(a1), b(a2), thd(0), - a_cache(0), b_cache(0), set_null(0), + a_cache(0), b_cache(0), set_null(TRUE), get_value_a_func(0), get_value_b_func(0) {}; int set_compare_func(Item_result_field *owner, Item_result type); |