summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 3d1b764bd14..54df7941526 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -3556,9 +3556,17 @@ public:
*/
virtual int rnd_pos_by_record(uchar *record)
{
+ int error;
DBUG_ASSERT(table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION);
+
+ error = ha_rnd_init(false);
+ if (error != 0)
+ return error;
+
position(record);
- return rnd_pos(record, ref);
+ error = ha_rnd_pos(record, ref);
+ ha_rnd_end();
+ return error;
}
virtual int read_first_row(uchar *buf, uint primary_key);
public: