diff options
author | unknown <kroki/tomash@moonlight.home> | 2007-01-09 12:40:34 +0300 |
---|---|---|
committer | unknown <kroki/tomash@moonlight.home> | 2007-01-09 12:40:34 +0300 |
commit | 19b95ca2062ece8aafdc562f65f26222e4abb026 (patch) | |
tree | 69a173730fca614ca5aebc884db4421b5e512d80 /heap/hp_write.c | |
parent | d501b2dd3966d4f236b46a3b3bb7b89929e25716 (diff) | |
parent | beac4a6f8a1326f30a2bc96a5eb3aa9d437de614 (diff) | |
download | mariadb-git-19b95ca2062ece8aafdc562f65f26222e4abb026.tar.gz |
Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-4.1-bug23443
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0-bug23443
heap/hp_write.c:
Auto merged
sql/item_func.cc:
Auto merged
Diffstat (limited to 'heap/hp_write.c')
-rw-r--r-- | heap/hp_write.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/heap/hp_write.c b/heap/hp_write.c index 16f02999c93..da61a5aca1d 100644 --- a/heap/hp_write.c +++ b/heap/hp_write.c @@ -68,11 +68,17 @@ int heap_write(HP_INFO *info, const byte *record) DBUG_RETURN(0); err: - DBUG_PRINT("info",("Duplicate key: %d", keydef - share->keydef)); + if (my_errno == HA_ERR_FOUND_DUPP_KEY) + DBUG_PRINT("info",("Duplicate key: %d", 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) |