From 48c8c8e8efb56544f2ba86dbb9daa4ea527dedb2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Aug 2004 15:32:57 +0200 Subject: BDB: Bug#4531: unique key prefix interacts poorly with utf8, Bug#4594 column index make = failed for gbk myisam/mi_key.c: cleanup --- myisam/mi_key.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'myisam/mi_key.c') diff --git a/myisam/mi_key.c b/myisam/mi_key.c index 8f5f0e829ef..043dd7c6884 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -25,9 +25,12 @@ #define CHECK_KEYS -#define FIX_LENGTH if (length > char_length) \ - char_length= my_charpos(cs, pos, pos+length, char_length); \ - set_if_smaller(char_length,length); \ +#define FIX_LENGTH \ + do { \ + if (length > char_length) \ + char_length= my_charpos(cs, pos, pos+length, char_length); \ + set_if_smaller(char_length,length); \ + } while(0) static int _mi_put_key_in_record(MI_INFO *info,uint keynr,byte *record); @@ -157,7 +160,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, FIX_LENGTH; memcpy((byte*) key, pos, char_length); if (length > char_length) - bfill(key+char_length, length-char_length, ' '); + cs->cset->fill(cs, key+char_length, length-char_length, ' '); key+= length; } _mi_dpointer(info,key,filepos); @@ -267,7 +270,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, FIX_LENGTH; memcpy((byte*) key, pos, char_length); if (length > char_length) - bfill(key+char_length, length-char_length, ' '); + cs->cset->fill(cs,key+char_length, length-char_length, ' '); key+= length; k_length-=length; } -- cgit v1.2.1