diff options
author | kroki/tomash@moonlight.home <> | 2007-01-09 12:39:05 +0300 |
---|---|---|
committer | kroki/tomash@moonlight.home <> | 2007-01-09 12:39:05 +0300 |
commit | 45e976202729594d4fa7b48c6722ce78ea46ee3f (patch) | |
tree | 1bc7138a113da366360423ab7830eb19d97ba99e /heap/hp_write.c | |
parent | cddbb0f8173800fd8431be4df178bc042702b9eb (diff) | |
parent | 5b4d9d87061e92649ba404a882592c8d96bda141 (diff) | |
download | mariadb-git-45e976202729594d4fa7b48c6722ce78ea46ee3f.tar.gz |
Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-4.0-bug23443
into moonlight.home:/home/tomash/src/mysql_ab/mysql-4.1-bug23443
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 808fe6608b1..841dda6264e 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) |