Commit 413113da authored by Sergei Golubchik's avatar Sergei Golubchik

move file->position() down, to make sure it's executed only when

previous file->index_next (or other file->... index access method)
succeeded
parent cb0a661c
......@@ -5765,12 +5765,6 @@ int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same)
error= file->ha_index_next_same(rec_buf, m_start_key.key,
m_start_key.length);
if (!m_using_extended_keys)
{
file->position(rec_buf);
memcpy(rec_buf + m_rec_length, file->ref, file->ref_length);
}
if (error)
{
if (error == HA_ERR_END_OF_FILE)
......@@ -5788,6 +5782,13 @@ int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same)
}
DBUG_RETURN(error);
}
if (!m_using_extended_keys)
{
file->position(rec_buf);
memcpy(rec_buf + m_rec_length, file->ref, file->ref_length);
}
queue_replace_top(&m_queue);
return_top_record(buf);
DBUG_PRINT("info", ("Record returned from partition %u", m_top_entry));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment