summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-08-25 09:15:57 +0300
committerunknown <sanja@montyprogram.com>2012-08-25 09:15:57 +0300
commit4d2b05b7d795bfa980065b4f4465444549401c9f (patch)
tree626681b35c69a1e24539c3da531fbb8c5569386b /sql/sql_select.cc
parentb02ad35e94fcada51befc5469f8d6632c672ad11 (diff)
downloadmariadb-git-4d2b05b7d795bfa980065b4f4465444549401c9f.tar.gz
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.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc4
1 files changed, 2 insertions, 2 deletions
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)
{