diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-07-05 20:45:42 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-07-05 20:45:42 +0200 |
commit | 58fa29e0ff35b10bbbdf605faf2592a0040214c1 (patch) | |
tree | 6e6bc168f4621519a3023f8ff9670fae1ff076fe /sql/sql_select.cc | |
parent | d3157e239a3fc15e68ea90c65ed0b94ebb53fc81 (diff) | |
download | mariadb-git-58fa29e0ff35b10bbbdf605faf2592a0040214c1.tar.gz |
MDEV-4610 SQL query crashes MariaDB with derived_with_keys
MDEV-4643 MariaDB crashes consistently when trying a SELECT on VIEW with a UNION and an additional JOIN in SELECT
open derived temp tables *before* trying QUICK_SELECT for them,
handler::multi_range_read_info() needs an open table.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cc94df82095..40021baa954 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -18941,6 +18941,9 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order, MYF(MY_WME | MY_ZEROFILL)); table->status=0; // May be wrong if quick_select + if (!tab->preread_init_done && tab->preread_init()) + goto err; + // If table has a range, move it to select if (select && !select->quick && tab->ref.key >= 0) { @@ -18977,8 +18980,6 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order, get_schema_tables_result(join, PROCESSED_BY_CREATE_SORT_INDEX)) goto err; - if (!tab->preread_init_done && tab->preread_init()) - goto err; if (table->s->tmp_table) table->file->info(HA_STATUS_VARIABLE); // Get record count table->sort.found_records=filesort(thd, table,join->sortorder, length, |