diff options
author | unknown <monty@narttu.mysql.fi> | 2003-03-20 21:35:17 +0200 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-03-20 21:35:17 +0200 |
commit | ae18d0134d5d756391b766b32e7e43d6937759ba (patch) | |
tree | bd1ed24d1af97988c378b223b3185f5bb7ab2e59 /sql | |
parent | 79e9917accf6d3de2628c8a3b4ca8cf6280b4a4e (diff) | |
parent | 275e6c35db077f1f5253d5c5bd0191cfc91bad1f (diff) | |
download | mariadb-git-ae18d0134d5d756391b766b32e7e43d6937759ba.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into narttu.mysql.fi:/my/mysql-4.1
sql/password.c:
Auto merged
sql/sql_update.cc:
Auto merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_myisam.cc | 6 | ||||
-rw-r--r-- | sql/item.cc | 27 | ||||
-rw-r--r-- | sql/table.cc | 5 |
3 files changed, 22 insertions, 16 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 126d0628f79..7e8dab5daed 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1049,7 +1049,8 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, &recinfo,(table_arg->fields*2+2)*sizeof(MI_COLUMNDEF), &keydef, table_arg->keys*sizeof(MI_KEYDEF), &keyseg, - ((table_arg->key_parts + table_arg->keys) * sizeof(HA_KEYSEG)), + ((table_arg->key_parts + table_arg->keys) * + sizeof(HA_KEYSEG)), 0))) DBUG_RETURN(1); @@ -1107,7 +1108,8 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, keydef[i].seg[j].null_bit=0; keydef[i].seg[j].null_pos=0; } - if ((field->type() == FIELD_TYPE_BLOB) || (field->type() == FIELD_TYPE_GEOMETRY)) + if (field->type() == FIELD_TYPE_BLOB || + field->type() == FIELD_TYPE_GEOMETRY) { keydef[i].seg[j].flag|=HA_BLOB_PART; /* save number of bytes used to pack length */ diff --git a/sql/item.cc b/sql/item.cc index faf0f245576..aed0a823603 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -93,20 +93,23 @@ bool Item::check_cols(uint c) void Item::set_name(const char *str,uint length, CHARSET_INFO *cs) { if (!length) - length= str ? strlen(str) : 0; - while (length && !my_isgraph(cs,*str)) - { // Fix problem with yacc - length--; - str++; - } - if (!my_charset_same(cs, system_charset_info)) + name= (char*) str; // Empty string, used by AS + else { - String tmp; - tmp.copy(str, length, cs, system_charset_info); - name=sql_strmake(tmp.ptr(),min(tmp.length(),MAX_FIELD_WIDTH)); + while (length && !my_isgraph(cs,*str)) + { // Fix problem with yacc + length--; + str++; + } + if (length && !my_charset_same(cs, system_charset_info)) + { + String tmp; + tmp.copy(str, length, cs, system_charset_info); + name=sql_strmake(tmp.ptr(),min(tmp.length(),MAX_FIELD_WIDTH)); + } + else + name=sql_strmake(str,min(length,MAX_FIELD_WIDTH)); } - else - name=sql_strmake(str,min(length,MAX_FIELD_WIDTH)); } /* diff --git a/sql/table.cc b/sql/table.cc index b36171cab93..17bb15d3033 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -515,6 +515,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, keyinfo->key_length+= HA_KEY_NULL_LENGTH; } if (field->type() == FIELD_TYPE_BLOB || + field->type() == FIELD_TYPE_GEOMETRY || field->real_type() == FIELD_TYPE_VAR_STRING) { if (field->type() == FIELD_TYPE_BLOB) @@ -531,7 +532,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (i == 0) field->key_start|= ((key_map) 1 << key); if (field->key_length() == key_part->length && - field->type() != FIELD_TYPE_BLOB) + !(field->flags & BLOB_FLAG)) { if ((index_flags & HA_KEY_READ_ONLY) && (field->key_type() != HA_KEYTYPE_TEXT || @@ -560,7 +561,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (field->key_length() != key_part->length) { key_part->key_part_flag|= HA_PART_KEY; - if (field->type() != FIELD_TYPE_BLOB) + if (!(field->flags & BLOB_FLAG)) { // Create a new field field=key_part->field=field->new_field(&outparam->mem_root, outparam); |