diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-01-29 15:10:47 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-01-29 15:10:47 +0100 |
commit | 0af4b6c6ee2b8a61823478c0a56ebdfa52cae3cc (patch) | |
tree | 7b24eb150b9cca718c88edaabbfc6c8bb16fd015 /sql/item_subselect.cc | |
parent | cf20de000bdff07a34a373079991d24837423896 (diff) | |
parent | 52fbe44fbbe60ecaba6453884ec1ad32755d7a04 (diff) | |
download | mariadb-git-0af4b6c6ee2b8a61823478c0a56ebdfa52cae3cc.tar.gz |
5.5 merge
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 2ee513320ce..8b3ce257642 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -3258,11 +3258,14 @@ int subselect_uniquesubquery_engine::scan_table() TABLE *table= tab->table; DBUG_ENTER("subselect_uniquesubquery_engine::scan_table"); - if (table->file->inited) - table->file->ha_index_end(); - - if (table->file->ha_rnd_init_with_error(1)) - DBUG_RETURN(1); + if ((table->file->inited && + (error= table->file->ha_index_end())) || + (error= table->file->ha_rnd_init(1))) + { + (void) report_error(table, error); + DBUG_RETURN(true); + } + table->file->extra_opt(HA_EXTRA_CACHE, current_thd->variables.read_buff_size); table->null_row= 0; @@ -3398,8 +3401,13 @@ int subselect_uniquesubquery_engine::exec() DBUG_RETURN(0); } - if (!table->file->inited) - table->file->ha_index_init(tab->ref.key, 0); + if (!table->file->inited && + (error= table->file->ha_index_init(tab->ref.key, 0))) + { + (void) report_error(table, error); + DBUG_RETURN(true); + } + error= table->file->ha_index_read_map(table->record[0], tab->ref.key_buff, make_prev_keypart_map(tab-> @@ -3563,8 +3571,13 @@ int subselect_indexsubquery_engine::exec() DBUG_RETURN(0); } - if (!table->file->inited) - table->file->ha_index_init(tab->ref.key, 1); + if (!table->file->inited && + (error= table->file->ha_index_init(tab->ref.key, 1))) + { + (void) report_error(table, error); + DBUG_RETURN(true); + } + error= table->file->ha_index_read_map(table->record[0], tab->ref.key_buff, make_prev_keypart_map(tab-> |