summaryrefslogtreecommitdiff
path: root/heap
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.local>2007-01-11 21:59:28 +0300
committerunknown <kostja@bodhi.local>2007-01-11 21:59:28 +0300
commit6ab5bdf311f88391e82843fdceb77e8a3ba543bb (patch)
tree1e195159c577862500f5d2ce9d16857b349b37ae /heap
parent50361d9a44ddce3d0253feba9c658a17b2b0a517 (diff)
parent21311e992de836763ff81064b05eb01114aedc13 (diff)
downloadmariadb-git-6ab5bdf311f88391e82843fdceb77e8a3ba543bb.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into bodhi.local:/opt/local/work/mysql-5.0-runtime heap/hp_block.c: Auto merged mysql-test/r/view.result: Auto merged server-tools/instance-manager/listener.cc: Auto merged sql/item_func.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_string.cc: Auto merged sql/sql_yacc.yy: Auto merged tests/mysql_client_test.c: Auto merged heap/hp_write.c: SCCS merged
Diffstat (limited to 'heap')
-rw-r--r--heap/hp_block.c2
-rw-r--r--heap/hp_write.c12
2 files changed, 10 insertions, 4 deletions
diff --git a/heap/hp_block.c b/heap/hp_block.c
index 35e65a94603..85219380287 100644
--- a/heap/hp_block.c
+++ b/heap/hp_block.c
@@ -75,7 +75,7 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length)
and my_default_record_cache_size we get about 1/128 unused memory.
*/
*alloc_length=sizeof(HP_PTRS)*i+block->records_in_block* block->recbuffer;
- if (!(root=(HP_PTRS*) my_malloc(*alloc_length,MYF(0))))
+ if (!(root=(HP_PTRS*) my_malloc(*alloc_length,MYF(MY_WME))))
return 1;
if (i == 0)
diff --git a/heap/hp_write.c b/heap/hp_write.c
index f8b268ee06a..8a392d54c51 100644
--- a/heap/hp_write.c
+++ b/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", 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)