summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index c2b5662d436..f464c237d78 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3554,9 +3554,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
param->recinfo=recinfo;
store_record(table,2); // Make empty default record
- table->max_rows=(((table->db_type == DB_TYPE_HEAP) ?
- min(tmp_table_size, max_heap_table_size) : tmp_table_size)/
- table->reclength);
+ if (tmp_table_size == ~(ulong) 0) // No limit
+ table->max_rows= ~(ha_rows) 0;
+ else
+ table->max_rows=(((table->db_type == DB_TYPE_HEAP) ?
+ min(tmp_table_size, max_heap_table_size) :
+ tmp_table_size)/ table->reclength);
set_if_bigger(table->max_rows,1); // For dummy start options
keyinfo=param->keyinfo;