diff options
author | unknown <monty@mysql.com> | 2004-12-06 19:18:35 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-12-06 19:18:35 +0200 |
commit | 8379b61efb053da778846416baf23812a26e8f86 (patch) | |
tree | 44698f6f68c51daacf7552356ae071b8e8fdb035 /myisam | |
parent | 19a95482195a158425c66ac629d07da53e4fc1b6 (diff) | |
parent | a8ea31fae6737c453d2dd9719a75f905c06048b3 (diff) | |
download | mariadb-git-8379b61efb053da778846416baf23812a26e8f86.tar.gz |
Merge with new VARCHAR code
configure.in:
Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
Auto merged
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e:
Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
heap/hp_create.c:
Auto merged
heap/hp_delete.c:
Auto merged
heap/hp_hash.c:
Auto merged
heap/hp_write.c:
Auto merged
include/decimal.h:
Auto merged
include/m_ctype.h:
Auto merged
libmysql/libmysql.c:
Auto merged
libmysqld/Makefile.am:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_create.c:
Auto merged
myisam/mi_write.c:
Auto merged
mysql-test/r/ctype_tis620.result:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/r/order_by.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/ps_1general.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/strict.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/type_blob.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/endspace.test:
Auto merged
mysql-test/t/myisam.test:
Auto merged
mysql-test/t/ps_1general.test:
Auto merged
mysql-test/t/strict.test:
Auto merged
mysql-test/t/type_blob.test:
Auto merged
ndb/src/common/util/NdbSqlUtil.cpp:
Auto merged
scripts/mysql_fix_privilege_tables.sh:
Auto merged
sql/field.h:
Auto merged
sql/field_conv.cc:
Auto merged
sql/ha_heap.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_innodb.h:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/structs.h:
Auto merged
sql/table.cc:
Auto merged
strings/ctype-czech.c:
Auto merged
strings/ctype-uca.c:
Auto merged
strings/ctype-utf8.c:
Auto merged
strings/ctype-win1250ch.c:
Auto merged
strings/decimal.c:
Auto merged
tests/client_test.c:
Auto merged
mysql-test/r/bdb.result:
Merge with VARCHAR code
mysql-test/r/heap.result:
Merge with VARCHAR code
mysql-test/r/innodb.result:
Merge with VARCHAR code
mysql-test/r/select.result.es:
Merge with VARCHAR code
mysql-test/t/bdb.test:
Merge with VARCHAR code
mysql-test/t/heap.test:
Merge with VARCHAR code
mysql-test/t/innodb.test:
Merge with VARCHAR code
sql/field.cc:
Merge with VARCHAR code
sql/item.cc:
Merge with VARCHAR code
sql/sql_acl.cc:
Merge with VARCHAR code
sql/sql_parse.cc:
Merge with VARCHAR code
sql/sql_table.cc:
Merge with VARCHAR code
sql/sql_update.cc:
Merge with VARCHAR code
sql/table.h:
Merge with VARCHAR code
strings/ctype-mb.c:
Don't pad my_like_range with max_str for simple LIKE expression
strings/ctype-tis620.c:
Merge with VARCHAR code
strings/ctype-ucs2.c:
Added new argument to my_strnncollsp_ucs2()
Simply code
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_static.c | 2 | ||||
-rw-r--r-- | myisam/ft_test1.c | 2 | ||||
-rw-r--r-- | myisam/ft_update.c | 2 | ||||
-rw-r--r-- | myisam/mi_check.c | 4 | ||||
-rw-r--r-- | myisam/mi_create.c | 15 | ||||
-rw-r--r-- | myisam/mi_key.c | 13 | ||||
-rw-r--r-- | myisam/mi_range.c | 14 | ||||
-rw-r--r-- | myisam/mi_rnext_same.c | 8 | ||||
-rw-r--r-- | myisam/mi_search.c | 10 | ||||
-rw-r--r-- | myisam/mi_test1.c | 8 | ||||
-rw-r--r-- | myisam/mi_unique.c | 53 | ||||
-rw-r--r-- | myisam/mi_write.c | 2 | ||||
-rw-r--r-- | myisam/myisamchk.c | 2 |
13 files changed, 77 insertions, 58 deletions
diff --git a/myisam/ft_static.c b/myisam/ft_static.c index 7168406d027..3b186f7b179 100644 --- a/myisam/ft_static.c +++ b/myisam/ft_static.c @@ -28,7 +28,7 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={ HA_KEYTYPE_VARTEXT, /* type */ 63, /* language (will be overwritten) */ 0, 0, 0, /* null_bit, bit_start, bit_end */ - HA_VAR_LENGTH | HA_PACK_KEY, /* flag */ + HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */ HA_FT_MAXBYTELEN, /* length */ HA_FT_WLEN, /* start */ 0, /* null_pos */ diff --git a/myisam/ft_test1.c b/myisam/ft_test1.c index f4884f8ca39..a92c85924de 100644 --- a/myisam/ft_test1.c +++ b/myisam/ft_test1.c @@ -91,7 +91,7 @@ static int run_test(const char *filename) keyinfo[0].keysegs=1; keyinfo[0].seg[0].type= key_type; keyinfo[0].seg[0].flag= (key_field == FIELD_BLOB)?HA_BLOB_PART: - (key_field == FIELD_VARCHAR)?HA_VAR_LENGTH:0; + (key_field == FIELD_VARCHAR)?HA_VAR_LENGTH_PART:0; keyinfo[0].seg[0].start=recinfo[0].length; keyinfo[0].seg[0].length=key_length; keyinfo[0].seg[0].null_bit= 0; diff --git a/myisam/ft_update.c b/myisam/ft_update.c index beccc062270..8dafefe77a8 100644 --- a/myisam/ft_update.c +++ b/myisam/ft_update.c @@ -77,7 +77,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi) DBUG_RETURN(1); } ftsi->pos= ftsi->rec+ftsi->seg->start; - if (ftsi->seg->flag & HA_VAR_LENGTH) + if (ftsi->seg->flag & HA_VAR_LENGTH_PART) { ftsi->len=uint2korr(ftsi->pos); ftsi->pos+=2; /* Skip VARCHAR length */ diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 2999482549c..112a371c9fe 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -2033,7 +2033,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, sort_param.key_length+=keyseg[i].length; if (keyseg[i].flag & HA_SPACE_PACK) sort_param.key_length+=get_pack_length(keyseg[i].length); - if (keyseg[i].flag & (HA_BLOB_PART | HA_VAR_LENGTH)) + if (keyseg[i].flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART)) sort_param.key_length+=2 + test(keyseg[i].length >= 127); if (keyseg[i].flag & HA_NULL_PART) sort_param.key_length++; @@ -2442,7 +2442,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, sort_param[i].key_length+=keyseg->length; if (keyseg->flag & HA_SPACE_PACK) sort_param[i].key_length+=get_pack_length(keyseg->length); - if (keyseg->flag & (HA_BLOB_PART | HA_VAR_LENGTH)) + if (keyseg->flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART)) sort_param[i].key_length+=2 + test(keyseg->length >= 127); if (keyseg->flag & HA_NULL_PART) sort_param[i].key_length++; diff --git a/myisam/mi_create.c b/myisam/mi_create.c index f99a2c655d2..e139997e0c7 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -276,8 +276,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, goto err; #endif /*HAVE_SPATIAL*/ } - else - if (keydef->flag & HA_FULLTEXT) + else if (keydef->flag & HA_FULLTEXT) { keydef->flag=HA_FULLTEXT | HA_PACK_KEY | HA_VAR_LENGTH_KEY; options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ @@ -311,7 +310,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, /* Only use HA_PACK_KEY when first segment is a variable length key */ if (!(keydef->seg[0].flag & (HA_SPACE_PACK | HA_BLOB_PART | - HA_VAR_LENGTH))) + HA_VAR_LENGTH_PART))) { /* pack relative to previous key */ keydef->flag&= ~HA_PACK_KEY; @@ -345,12 +344,18 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, case HA_KEYTYPE_UINT24: case HA_KEYTYPE_INT8: keyseg->flag|= HA_SWAP_KEY; - /* fall through */ + break; + case HA_KEYTYPE_VARTEXT: + case HA_KEYTYPE_VARBINARY: + if (!(keyseg->flag & HA_BLOB_PART)) + keyseg->flag|= HA_VAR_LENGTH_PART; + break; default: break; } if (keyseg->flag & HA_SPACE_PACK) { + DBUG_ASSERT(!(keyseg->flag & HA_VAR_LENGTH_PART)); keydef->flag |= HA_SPACE_PACK_USED | HA_VAR_LENGTH_KEY; options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ length++; /* At least one length byte */ @@ -361,7 +366,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, length+=2; } } - if (keyseg->flag & (HA_VAR_LENGTH | HA_BLOB_PART)) + if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) { keydef->flag|=HA_VAR_LENGTH_KEY; length++; /* At least one length byte */ diff --git a/myisam/mi_key.c b/myisam/mi_key.c index 3545756779f..a775e0ba2d0 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -102,7 +102,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, key+=char_length; continue; } - if (keyseg->flag & HA_VAR_LENGTH) + if (keyseg->flag & HA_VAR_LENGTH_PART) { uint tmp_length=uint2korr(pos); pos+=2; /* Skip VARCHAR length */ @@ -216,7 +216,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, if (!(*key++= (char) 1-*old++)) /* Copy null marker */ { k_length-=length; - if (keyseg->flag & (HA_VAR_LENGTH | HA_BLOB_PART)) + if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) k_length-=2; /* Skip length */ continue; /* Found NULL */ } @@ -244,7 +244,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, key+= char_length; continue; } - else if (keyseg->flag & (HA_VAR_LENGTH | HA_BLOB_PART)) + else if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) { /* Length of key-part used with mi_rkey() always 2 */ uint tmp_length=uint2korr(pos); @@ -356,7 +356,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, continue; } - if (keyseg->flag & HA_VAR_LENGTH) + if (keyseg->flag & HA_VAR_LENGTH_PART) { uint length; get_key_length(length,key); @@ -364,7 +364,10 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, if (length > keyseg->length || key+length > key_end) goto err; #endif - memcpy(record+keyseg->start,(byte*) key, length); + /* Store key length */ + int2store(record+keyseg->start, length); + /* And key data */ + memcpy(record+keyseg->start+2,(byte*) key, length); key+= length; } else if (keyseg->flag & HA_BLOB_PART) diff --git a/myisam/mi_range.c b/myisam/mi_range.c index 1e0fd42334e..789607c9889 100644 --- a/myisam/mi_range.c +++ b/myisam/mi_range.c @@ -172,9 +172,9 @@ static double _mi_search_pos(register MI_INFO *info, if (flag == MI_FOUND_WRONG_KEY) DBUG_RETURN(-1); /* error */ /* - ** Didn't found match. keypos points at next (bigger) key - * Try to find a smaller, better matching key. - ** Matches keynr + [0-1] + Didn't found match. keypos points at next (bigger) key + Try to find a smaller, better matching key. + Matches keynr + [0-1] */ if (flag > 0 && ! nod_flag) offset= 1.0; @@ -185,8 +185,8 @@ static double _mi_search_pos(register MI_INFO *info, else { /* - ** Found match. Keypos points at the start of the found key - ** Matches keynr+1 + Found match. Keypos points at the start of the found key + Matches keynr+1 */ offset=1.0; /* Matches keynr+1 */ if ((nextflag & SEARCH_FIND) && nod_flag && @@ -194,8 +194,8 @@ static double _mi_search_pos(register MI_INFO *info, key_len != USE_WHOLE_KEY)) { /* - ** There may be identical keys in the tree. Try to match on of those. - ** Matches keynr + [0-1] + There may be identical keys in the tree. Try to match on of those. + Matches keynr + [0-1] */ if ((offset=_mi_search_pos(info,keyinfo,key,key_len,SEARCH_FIND, _mi_kpos(nod_flag,keypos))) < 0) diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index 1342718d6aa..3060a55038a 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -57,7 +57,11 @@ int mi_rnext_same(MI_INFO *info, byte *buf) #endif case HA_KEY_ALG_BTREE: default: - memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); + if (!(info->update & HA_STATE_RNEXT_SAME)) + { + /* First rnext_same; Store old key */ + memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); + } for (;;) { if ((error=_mi_search_next(info,keyinfo,info->lastkey, @@ -81,7 +85,7 @@ int mi_rnext_same(MI_INFO *info, byte *buf) rw_unlock(&info->s->key_root_lock[inx]); /* Don't clear if database-changed */ info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); - info->update|= HA_STATE_NEXT_FOUND; + info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME; if (error) { diff --git a/myisam/mi_search.c b/myisam/mi_search.c index bc8be9c2732..2fef70db9f0 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -364,7 +364,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, if (!(*from++)) continue; } - if (keyseg->flag & (HA_VAR_LENGTH | HA_BLOB_PART | HA_SPACE_PACK)) + if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART | HA_SPACE_PACK)) { get_key_length(l,from); } @@ -831,7 +831,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, continue; } if (keyseg->flag & - (HA_VAR_LENGTH | HA_BLOB_PART | HA_SPACE_PACK)) + (HA_VAR_LENGTH_PART | HA_BLOB_PART | HA_SPACE_PACK)) { uchar *tmp=page; get_key_length(length,tmp); @@ -896,7 +896,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, if (!(*key++ = *from++)) continue; /* Null part */ } - if (keyseg->flag & (HA_VAR_LENGTH | HA_BLOB_PART | HA_SPACE_PACK)) + if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART | HA_SPACE_PACK)) { /* Get length of dynamic length key part */ if (from == from_end) { from=page; from_end=page_end; } @@ -1071,7 +1071,7 @@ uint _mi_keylength(MI_KEYDEF *keyinfo, register uchar *key) if (keyseg->flag & HA_NULL_PART) if (!*key++) continue; - if (keyseg->flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH)) + if (keyseg->flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH_PART)) { uint length; get_key_length(length,key); @@ -1103,7 +1103,7 @@ uint _mi_keylength_part(MI_KEYDEF *keyinfo, register uchar *key, if (keyseg->flag & HA_NULL_PART) if (!*key++) continue; - if (keyseg->flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH)) + if (keyseg->flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH_PART)) { uint length; get_key_length(length,key); diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c index 77c4d3dfbad..15ce7515ac2 100644 --- a/myisam/mi_test1.c +++ b/myisam/mi_test1.c @@ -134,7 +134,7 @@ static int run_test(const char *filename) uniqueseg[1].flag|= HA_BLOB_PART; } else if (extra_field == FIELD_VARCHAR) - uniqueseg[1].flag|= HA_VAR_LENGTH; + uniqueseg[1].flag|= HA_VAR_LENGTH_PART; } else uniques=0; @@ -372,7 +372,7 @@ static void create_key(char *key,uint rownr) } *key++=0; } - if (keyinfo[0].seg[0].flag & (HA_BLOB_PART | HA_VAR_LENGTH)) + if (keyinfo[0].seg[0].flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART)) { uint tmp; create_key_part(key+2,rownr); @@ -524,7 +524,7 @@ static struct my_option my_long_options[] = {"key_binary_pack", 'B', "Undocumented", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"key_blob", 'b', "Undocumented", - 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"key_cache", 'K', "Undocumented", (gptr*) &key_cacheing, (gptr*) &key_cacheing, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"key_length", 'k', "Undocumented", (gptr*) &key_length, (gptr*) &key_length, @@ -617,7 +617,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), key_field=FIELD_VARCHAR; /* varchar keys */ extra_field= FIELD_VARCHAR; key_type= HA_KEYTYPE_VARTEXT; - pack_seg|= HA_VAR_LENGTH; + pack_seg|= HA_VAR_LENGTH_PART; create_flag|= HA_PACK_RECORD; break; case 'K': /* Use key cacheing */ diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c index ad685f4cbdc..c03182456df 100644 --- a/myisam/mi_unique.c +++ b/myisam/mi_unique.c @@ -93,7 +93,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record) } } pos= record+keyseg->start; - if (keyseg->flag & HA_VAR_LENGTH) + if (keyseg->flag & HA_VAR_LENGTH_PART) { uint tmp_length=uint2korr(pos); pos+=2; /* Skip VARCHAR length */ @@ -136,7 +136,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b, for (keyseg=def->seg ; keyseg < def->end ; keyseg++) { enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type; - uint length=keyseg->length; + uint a_length, b_length; + a_length= b_length= keyseg->length; /* If part is NULL it's regarded as different */ if (keyseg->null_bit) @@ -154,43 +155,49 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b, } pos_a= a+keyseg->start; pos_b= b+keyseg->start; - if (keyseg->flag & HA_VAR_LENGTH) + if (keyseg->flag & HA_VAR_LENGTH_PART) { - uint tmp_length=uint2korr(pos_a); - if (tmp_length != uint2korr(pos_b)) - return 1; - pos_a+=2; /* Skip VARCHAR length */ - pos_b+=2; - set_if_smaller(length,tmp_length); + a_length= uint2korr(pos_a); + b_length= uint2korr(pos_b); + pos_a+= 2; /* Skip VARCHAR length */ + pos_b+= 2; + set_if_smaller(a_length, keyseg->length); + set_if_smaller(b_length, keyseg->length); } else if (keyseg->flag & HA_BLOB_PART) { - /* Only compare 'length' characters if length<> 0 */ - uint a_length= _mi_calc_blob_length(keyseg->bit_start,pos_a); - uint b_length= _mi_calc_blob_length(keyseg->bit_start,pos_b); + /* Only compare 'length' characters if length != 0 */ + a_length= _mi_calc_blob_length(keyseg->bit_start,pos_a); + b_length= _mi_calc_blob_length(keyseg->bit_start,pos_b); /* Check that a and b are of equal length */ - if (length && a_length > length) - a_length=length; - if (!length || length > b_length) - length=b_length; - if (length != a_length) - return 1; - /* Both strings are at least 'length' long */ + if (keyseg->length) + { + /* + This is used in some cases when we are not interested in comparing + the whole length of the blob. + */ + set_if_smaller(a_length, keyseg->length); + set_if_smaller(b_length, keyseg->length); + } memcpy_fixed((byte*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*)); memcpy_fixed((byte*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*)); } if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT) { - if (mi_compare_text(keyseg->charset, (uchar *) pos_a, length, - (uchar *) pos_b, length, 0, 0)) - return 1; + if (mi_compare_text(keyseg->charset, (uchar *) pos_a, a_length, + (uchar *) pos_b, b_length, 0, 1)) + return 1; } else { - end= pos_a+length; + if (a_length != b_length) + return 1; + end= pos_a+a_length; while (pos_a != end) + { if (*pos_a++ != *pos_b++) return 1; + } } } return 0; diff --git a/myisam/mi_write.c b/myisam/mi_write.c index 303e924118f..c2f24ae1ae3 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -248,7 +248,7 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key, comp_flag=SEARCH_BIGGER; /* Put after same key */ else if (keyinfo->flag & (HA_NOSAME|HA_FULLTEXT)) { - comp_flag=SEARCH_FIND | SEARCH_UPDATE; /* No dupplicates */ + comp_flag=SEARCH_FIND | SEARCH_UPDATE; /* No duplicates */ if (keyinfo->flag & HA_NULL_ARE_EQUAL) comp_flag|= SEARCH_NULL_ARE_EQUAL; } diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index fe285198641..eeb1ccf528e 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -50,7 +50,7 @@ static int stopwords_inited= 0; static MY_TMPDIR myisamchk_tmpdir; static const char *type_names[]= -{ "?","char","binary", "short", "long", "float", +{ "impossible","char","binary", "short", "long", "float", "double","number","unsigned short", "unsigned long","longlong","ulonglong","int24", "uint24","int8","varchar", "varbin","?", |