diff options
author | Mattias Jonsson <mattias.jonsson@sun.com> | 2009-08-21 17:38:29 +0200 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@sun.com> | 2009-08-21 17:38:29 +0200 |
commit | 586ee5d616f55120aaa31f98be60ccae0523cd6c (patch) | |
tree | e442e8440551a156fee2ed3c9a84e26953cdccf8 /storage/myisam | |
parent | 43851cb81186084f7a144fc0b47db87d3b32c4a6 (diff) | |
download | mariadb-git-586ee5d616f55120aaa31f98be60ccae0523cd6c.tar.gz |
Bug#46639: 1030 (HY000): Got error 124 from storage engine on
INSERT ... SELECT ...
Problem was that when bulk insert is used on an empty
table/partition, it disables the indexes for better
performance, but in this specific case it also tries
to read from that partition using an index, which is
not possible since it has been disabled.
Solution was to allow index reads on disabled indexes
if there are no records.
Also reverted the patch for bug#38005, since that was a workaround
in the partitioning engine instead of a fix in myisam.
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/mi_search.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index 1dd6c6b5f0d..766e54bde30 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -28,9 +28,15 @@ int _mi_check_index(MI_INFO *info, int inx) { if (inx == -1) /* Use last index */ inx=info->lastinx; - if (inx < 0 || ! mi_is_key_active(info->s->state.key_map, inx)) + if (inx < 0) { - my_errno=HA_ERR_WRONG_INDEX; + my_errno= HA_ERR_WRONG_INDEX; + return -1; + } + if (!mi_is_key_active(info->s->state.key_map, inx)) + { + my_errno= info->s->state.state.records ? HA_ERR_WRONG_INDEX : + HA_ERR_END_OF_FILE; return -1; } if (info->lastinx != inx) /* Index changed */ |