diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-03-25 22:41:18 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-03-25 22:41:18 +0100 |
commit | 413113dad68736d7411c71f8cb44bf88f0f2f5e1 (patch) | |
tree | e0f1fafe651b6fa8eb6bf5795984a801ca5ecbae /sql/ha_partition.cc | |
parent | cb0a661cd753c5d6cbae74a9d28b9a318eea6ac5 (diff) | |
download | mariadb-git-413113dad68736d7411c71f8cb44bf88f0f2f5e1.tar.gz |
move file->position() down, to make sure it's executed only when
previous file->index_next (or other file->... index access method)
succeeded
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 37c3b172bc4..ab4afc03fac 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -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)); |