diff options
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f2dec1b5af3..f9cbab64aad 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -443,7 +443,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, goto err; } if (!(thd->options & OPTION_BIG_SELECTS) && - join.best_read > (double) thd->max_join_size && + join.best_read > (double) thd->variables.max_join_size && !(select_options & SELECT_DESCRIBE)) { /* purecov: inspected */ result->send_error(ER_TOO_BIG_SELECT,ER(ER_TOO_BIG_SELECT)); /* purecov: inspected */ @@ -4911,7 +4911,8 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), error=join->result->send_data(*join->fields); if (error) DBUG_RETURN(-1); /* purecov: inspected */ - if (++join->send_records >= join->thd->select_limit && join->do_send_rows) + if (++join->send_records >= join->thd->select_limit && + join->do_send_rows) { if (join->select_options & OPTION_FOUND_ROWS) { @@ -5003,7 +5004,8 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), join->send_records++; DBUG_RETURN(0); } - if (!error && ++join->send_records >= join->thd->select_limit && + if (!error && + ++join->send_records >= join->thd->select_limit && join->do_send_rows) { if (!(join->select_options & OPTION_FOUND_ROWS)) @@ -5793,7 +5795,7 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having) if (!field_count) { // only const items - join->thd->select_limit=1; // Only send first row + join->thd->select_limit=1; // Only send first row DBUG_RETURN(0); } Field **first_field=entry->field+entry->fields - field_count; |