=== modified file 'sql/opt_range.cc' --- a/sql/opt_range.cc 2014-04-01 16:59:51 +0000 +++ b/sql/opt_range.cc 2014-04-18 10:07:54 +0000 @@ -2181,7 +2181,7 @@ int QUICK_ROR_INTERSECT_SELECT::init_ror quick->record= head->record[0]; } - if (need_to_fetch_row && head->file->ha_rnd_init_with_error(1)) + if (need_to_fetch_row && head->file->ha_rnd_init_with_error(false))
{ DBUG_PRINT("error", ("ROR index_merge rnd_init call failed")); DBUG_RETURN(1); @@ -2363,8 +2363,13 @@ int QUICK_ROR_UNION_SELECT::reset() quick->save_last_pos(); queue_insert(&queue, (uchar*)quick); } - - if ((error= head->file->ha_rnd_init(1))) + /* Prepare for ha_rnd_pos calls. */ + if (head->file->inited && (error= head->file->ha_rnd_end())) + { + DBUG_PRINT("error", ("ROR index_merge rnd_end call failed")); + DBUG_RETURN(error); + } + if ((error= head->file->ha_rnd_init(false))) { DBUG_PRINT("error", ("ROR index_merge rnd_init call failed")); DBUG_RETURN(error); _______________________________________________
--
Jan Lindström, Principal Engineer
SkySQL - The MariaDB Company
MariaDB | MaxScale | skype: jan_p_lindstrom