diff --git a/mysql-test/t/count_distinct2.test b/mysql-test/t/count_distinct2.test index 9100f622dec1d6b334a81ead1dfadd16445184a3..2b982e3e6207b6475594d31713b77f47d2ccd272 100644 --- a/mysql-test/t/count_distinct2.test +++ b/mysql-test/t/count_distinct2.test @@ -64,7 +64,7 @@ select count(distinct n) from t1; show status like 'Created_tmp_disk_tables'; drop table t1; -#test conversion from heap to MyISAM +# Test use of MyISAM tmp tables create table t1 (s text); let $1=5000; disable_query_log; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index b79edb9bebcf44155e66180b5fa04778a732a4b2..174e2ba4b85c6d3c2950a953c4693c23810ecb6e 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2228,14 +2228,14 @@ bool Item_sum_count_distinct::setup(THD *thd) return FALSE; if (!(tmp_table_param= new TMP_TABLE_PARAM)) - return 1; + return TRUE; /* Create a table with an unique key over all parameters */ for (uint i=0; i < arg_count ; i++) { Item *item=args[i]; if (list.push_back(item)) - return 1; // End of memory + return TRUE; // End of memory if (item->const_item()) { (void) item->val_int(); @@ -2244,14 +2244,14 @@ bool Item_sum_count_distinct::setup(THD *thd) } } if (always_null) - return 0; + return FALSE; count_field_types(tmp_table_param,list,0); DBUG_ASSERT(table == 0); if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1, 0, select_lex->options | thd->options, HA_POS_ERROR, (char*)""))) - return 1; + return TRUE; table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows table->no_rows=1;