summaryrefslogtreecommitdiff
path: root/myisam/mi_write.c
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2002-08-30 12:40:40 +0300
committermonty@narttu.mysql.fi <>2002-08-30 12:40:40 +0300
commit7134ffec210edde21860a2b2c2654be481de49b4 (patch)
tree1bb81fd601075133af9ee99bd7ac94baf5ffc46c /myisam/mi_write.c
parent921f7c9c551d9e1bdd5083ebe71d204ab6246ba1 (diff)
parentdd5382187e68ff5337e1fe7ba5f86f0d9cdd31d5 (diff)
downloadmariadb-git-7134ffec210edde21860a2b2c2654be481de49b4.tar.gz
Merge with 4.0.3
Some simple optimzations, more comments and indentation changes. Add ` around database in 'use database' in binary log. Moved max_error_count and max_warning_count to variables struct. Removed SHOW_WARNS_COUNT and SHOW_ERRORS_COUNT calls. Changed string functions to use character set of first string argument as default return characterset (Each string function can change the above assumption if needed)
Diffstat (limited to 'myisam/mi_write.c')
-rw-r--r--myisam/mi_write.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/myisam/mi_write.c b/myisam/mi_write.c
index cfacd0bc4d5..5d22ebfe5b5 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -17,6 +17,8 @@
/* Write a row to a MyISAM table */
#include "fulltext.h"
+#include "rt_index.h"
+
#ifdef __WIN__
#include <errno.h>
#endif
@@ -121,17 +123,17 @@ int mi_write(MI_INFO *info, byte *record)
}
else
{
- uint key_length=_mi_make_key(info,i,buff,record,filepos);
- if (_mi_ck_write(info,i,buff,key_length))
- {
- if (local_lock_tree)
- rw_unlock(&share->key_root_lock[i]);
- DBUG_PRINT("error",("Got error: %d on write",my_errno));
- goto err;
- }
+ if (share->keyinfo[i].ck_insert(info,i,buff,
+ _mi_make_key(info,i,buff,record,filepos)))
+ {
+ if (local_lock_tree)
+ rw_unlock(&share->key_root_lock[i]);
+ DBUG_PRINT("error",("Got error: %d on write",my_errno));
+ goto err;
+ }
}
if (local_lock_tree)
- rw_unlock(&share->key_root_lock[i]);
+ rw_unlock(&share->key_root_lock[i]);
}
}
if (share->calc_checksum)
@@ -751,7 +753,8 @@ int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key,
DBUG_ENTER("_mi_ck_write_tree");
error= tree_insert(&info->bulk_insert[keynr], key,
- key_length + info->s->rec_reflength) ? 0 : HA_ERR_OUT_OF_MEM ;
+ key_length + info->s->rec_reflength,
+ info->bulk_insert[keynr].custom_arg) ? 0 : HA_ERR_OUT_OF_MEM ;
DBUG_RETURN(error);
} /* _mi_ck_write_tree */
@@ -762,7 +765,7 @@ int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key,
static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2)
{
uint not_used;
- return _mi_key_cmp(param->info->s->keyinfo[param->keynr].seg,
+ return ha_key_cmp(param->info->s->keyinfo[param->keynr].seg,
key1, key2, USE_WHOLE_KEY, SEARCH_SAME,
&not_used);
}