summaryrefslogtreecommitdiff
path: root/myisammrg
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-06-25 15:12:13 +0200
committerunknown <serg@serg.mylan>2004-06-25 15:12:13 +0200
commitc79039b861eb2dbf2a98a2681a2aaf5bd6d10fd1 (patch)
treeab0efb23a703bc511f61c4ac63c0c4da1e8ce346 /myisammrg
parentd57aeec9a1f2a106cfe559ad979df715158d843e (diff)
downloadmariadb-git-c79039b861eb2dbf2a98a2681a2aaf5bd6d10fd1.tar.gz
bug#4008 - merge table cannot determine what key caused "dupl. key" error
myisammrg/myrg_write.c: set info->current_table correctly mysql-test/r/merge.result: bug#4008 mysql-test/t/merge.test: bug#4008
Diffstat (limited to 'myisammrg')
-rw-r--r--myisammrg/myrg_write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/myisammrg/myrg_write.c b/myisammrg/myrg_write.c
index 0f191edc23c..532709e361d 100644
--- a/myisammrg/myrg_write.c
+++ b/myisammrg/myrg_write.c
@@ -22,9 +22,9 @@ int myrg_write(register MYRG_INFO *info, byte *rec)
{
/* [phi] MERGE_WRITE_DISABLED is handled by the else case */
if (info->merge_insert_method == MERGE_INSERT_TO_FIRST)
- return mi_write(info->open_tables[0].table,rec);
+ return mi_write((info->current_table=info->open_tables)->table,rec);
else if (info->merge_insert_method == MERGE_INSERT_TO_LAST)
- return mi_write(info->end_table[-1].table,rec);
+ return mi_write((info->current_table=info->end_table-1)->table,rec);
else /* unsupported insertion method */
return (my_errno= HA_ERR_WRONG_COMMAND);
}