#At file:///work/bzrroot/mysql-5.1-bugteam/ based on revid:epotemkin@stripped
3221 Evgeny Potemkin 2009-11-25
Additional fix for the bug#43668.
Arg_comparator now takes into account that some of
optimizations aren't done in the PREPARE stmt.
modified:
sql/item_cmpfunc.cc
=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc 2009-11-24 15:26:13 +0000
+++ b/sql/item_cmpfunc.cc 2009-11-25 09:52:03 +0000
@@ -960,12 +960,23 @@ int Arg_comparator::set_cmp_func(Item_re
(*b)->field_type() == MYSQL_TYPE_YEAR))
{
is_nulls_eq= is_owner_equal_func();
+ year_as_datetime= FALSE;
+
if ((*a)->is_datetime())
{
year_as_datetime= TRUE;
get_value_a_func= &get_datetime_value;
} else if ((*a)->field_type() == MYSQL_TYPE_YEAR)
get_value_a_func= &get_year_value;
+ else
+ {
+ /*
+ Because convert_constant_item is called only for EXECUTE in PS mode
+ the value of get_value_x_func set in PREPARE might be not
+ valid for EXECUTE.
+ */
+ get_value_a_func= NULL;
+ }
if ((*b)->is_datetime())
{
@@ -973,6 +984,8 @@ int Arg_comparator::set_cmp_func(Item_re
get_value_b_func= &get_datetime_value;
} else if ((*b)->field_type() == MYSQL_TYPE_YEAR)
get_value_b_func= &get_year_value;
+ else
+ get_value_b_func= NULL;
func= &Arg_comparator::compare_year;
return 0;
Attachment: [text/bzr-bundle] bzr/epotemkin@mysql.com-20091125095203-992wevyoqaapyu0k.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (epotemkin:3221) Bug#43668 | Evgeny Potemkin | 25 Nov |