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/records.cc | |
parent | cf20de000bdff07a34a373079991d24837423896 (diff) | |
parent | 52fbe44fbbe60ecaba6453884ec1ad32755d7a04 (diff) | |
download | mariadb-git-0af4b6c6ee2b8a61823478c0a56ebdfa52cae3cc.tar.gz |
5.5 merge
Diffstat (limited to 'sql/records.cc')
-rw-r--r-- | sql/records.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/records.cc b/sql/records.cc index c98532c1424..d28799ea9d2 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -68,6 +68,7 @@ static int rr_index_desc(READ_RECORD *info); void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, bool print_error, uint idx, bool reverse) { + int error; empty_record(table); bzero((char*) info,sizeof(*info)); info->thd= thd; @@ -77,8 +78,13 @@ void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, info->unlock_row= rr_unlock_row; table->status=0; /* And it's always found */ - if (!table->file->inited) - table->file->ha_index_init(idx, 1); + if (!table->file->inited && + (error= table->file->ha_index_init(idx, 1))) + { + if (print_error) + table->file->print_error(error, MYF(0)); + } + /* read_record will be changed to rr_index in rr_index_first */ info->read_record= reverse ? rr_index_last : rr_index_first; } |