diff options
author | unknown <lars/lthalmann@mysql.com/dl145h.mysql.com> | 2006-10-25 17:08:57 +0200 |
---|---|---|
committer | unknown <lars/lthalmann@mysql.com/dl145h.mysql.com> | 2006-10-25 17:08:57 +0200 |
commit | 2ab335a5b8bb3a25796824aa14325c777ce07a86 (patch) | |
tree | 57d9243f53489b77fb5dfd83e2d17f5278d73d89 /myisam | |
parent | 0153d67e59c3049b94d7a28fa96cd963c202027d (diff) | |
parent | caa1d80231e590220527fdb7cefed88ffd167fe3 (diff) | |
download | mariadb-git-2ab335a5b8bb3a25796824aa14325c777ce07a86.tar.gz |
Merge mysql.com:/users/lthalmann/bkroot/mysql-4.1-rpl
into mysql.com:/users/lthalmann/bk/MERGE/mysql-4.1-merge
myisam/mi_open.c:
Auto merged
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_key.c | 15 | ||||
-rw-r--r-- | myisam/mi_open.c | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/myisam/mi_key.c b/myisam/mi_key.c index eaa854b1a37..9d538d58817 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -42,7 +42,7 @@ static int _mi_put_key_in_record(MI_INFO *info,uint keynr,byte *record); uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, const byte *record, my_off_t filepos) { - byte *pos,*end; + byte *pos; uchar *start; reg1 HA_KEYSEG *keyseg; my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT; @@ -84,18 +84,17 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, pos= (byte*) record+keyseg->start; if (keyseg->flag & HA_SPACE_PACK) { - end= pos + length; if (type != HA_KEYTYPE_NUM) { - while (end > pos && end[-1] == ' ') - end--; + length= cs->cset->lengthsp(cs, pos, length); } else { + byte *end= pos + length; while (pos < end && pos[0] == ' ') pos++; + length=(uint) (end-pos); } - length=(uint) (end-pos); FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); memcpy((byte*) key,(byte*) pos,(size_t) char_length); @@ -358,8 +357,10 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, pos= record+keyseg->start; if (keyseg->type != (int) HA_KEYTYPE_NUM) { - memcpy(pos,key,(size_t) length); - bfill(pos+length,keyseg->length-length,' '); + memcpy(pos,key,(size_t) length); + keyseg->charset->cset->fill(keyseg->charset, + pos + length, keyseg->length - length, + ' '); } else { diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 4f298397615..4cac19a24bd 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -326,6 +326,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) goto err; } } + else if (pos->type == HA_KEYTYPE_BINARY) + pos->charset= &my_charset_bin; } if (share->keyinfo[i].flag & HA_SPATIAL) { |