HANDLER is broken with Memory tables

Bug #702786 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Critical
Michael Widenius

Bug Description

In maria-5.3-handler, HANDLER + Memory tables is broken. It also appears that the handler.heap.test was --record-ed improperly, so it does not catch this critical breakage.

To repeat:

create table t1 (f1 integer not null, key (f1)) engine=Memory;
insert into t1 values (1);
HANDLER t1 OPEN;

MariaDB [test]> HANDLER t1 READ f1 NEXT;
ERROR 1031 (HY000): Table storage engine for 't1' doesn't have this option
but should have returned 1 row

MariaDB [test]> HANDLER t1 READ f1 NEXT;
ERROR 1020 (HY000): Record has changed since last read in table 't1'
should have returned an empty row

Related branches

Changed in maria:
milestone: none → 5.3
assignee: nobody → Michael Widenius (monty)
importance: Undecided → Critical
Revision history for this message
Michael Widenius (monty) wrote :

This is not really a bug, just a wrong error message for the second HANDLER read next call.

The issue is that for hash index, you can't scan the full index with NEXT. What you can is to do a key read and then scan all the duplicates for that index.

If you want to do key scan for memory tables, you need to declare your index with 'using btree'.

A fix for the error message will pushed shortly.

Michael Widenius (monty)
Changed in maria:
status: New → Fix Committed
Michael Widenius (monty)
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.