From 4d2b05b7d795bfa980065b4f4465444549401c9f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 25 Aug 2012 09:15:57 +0300 Subject: fix for MDEV-367 The problem was that was_null and null_value variables was reset in each reexecution of IN subquery, but engine rerun only for non-constant subqueries. Fixed checking constant in Item_equal sort. Fix constant reporting in Item_subselect. --- sql/sql_select.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_select.cc') diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 14641ee6b04..5f2e97d57c1 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -11621,9 +11621,9 @@ static int compare_fields_by_table_order(Item *field1, bool outer_ref= 0; Item_field *f1= (Item_field *) (field1->real_item()); Item_field *f2= (Item_field *) (field2->real_item()); - if (f1->const_item()) + if (field1->const_item() || f1->const_item()) return 1; - if (f2->const_item()) + if (field2->const_item() || f2->const_item()) return -1; if (f2->used_tables() & OUTER_REF_TABLE_BIT) { -- cgit v1.2.1