summaryrefslogtreecommitdiff
path: root/storage/heap/hp_write.c
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.home>2007-01-09 12:44:16 +0300
committerunknown <kroki/tomash@moonlight.home>2007-01-09 12:44:16 +0300
commitca83b5473211850ae7866f11c7b3e3af1eb990fa (patch)
treeb46c11522c0c2885e731c2f13b7b8f2fa4149a08 /storage/heap/hp_write.c
parent8c352e71270b8f1490ba9961f7b4a39ac03b2094 (diff)
parent19b95ca2062ece8aafdc562f65f26222e4abb026 (diff)
downloadmariadb-git-ca83b5473211850ae7866f11c7b3e3af1eb990fa.tar.gz
Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0-bug23443
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1-bug23443 sql/item_func.cc: Auto merged storage/heap/hp_block.c: Auto merged storage/heap/hp_write.c: Manual merge.
Diffstat (limited to 'storage/heap/hp_write.c')
-rw-r--r--storage/heap/hp_write.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/storage/heap/hp_write.c b/storage/heap/hp_write.c
index f8b268ee06a..fd51b6f00c2 100644
--- a/storage/heap/hp_write.c
+++ b/storage/heap/hp_write.c
@@ -67,11 +67,17 @@ int heap_write(HP_INFO *info, const byte *record)
DBUG_RETURN(0);
err:
- DBUG_PRINT("info",("Duplicate key: %d", (int) (keydef - share->keydef)));
+ if (my_errno == HA_ERR_FOUND_DUPP_KEY)
+ DBUG_PRINT("info",("Duplicate key: %d", (int) keydef - share->keydef));
info->errkey= keydef - share->keydef;
- if (keydef->algorithm == HA_KEY_ALG_BTREE)
+ /*
+ We don't need to delete non-inserted key from rb-tree. Also, if
+ we got ENOMEM, the key wasn't inserted, so don't try to delete it
+ either. Otherwise for HASH index on HA_ERR_FOUND_DUPP_KEY the key
+ was inserted and we have to delete it.
+ */
+ if (keydef->algorithm == HA_KEY_ALG_BTREE || my_errno == ENOMEM)
{
- /* we don't need to delete non-inserted key from rb-tree */
keydef--;
}
while (keydef >= share->keydef)