Commit df64544b authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

Merge abarkov@work.mysql.com:/home/bk/mysql-4.1

into bar.mysql.r18.ru:/usr/home/bar/mysql-4.1.wrk
parents 734a98d0 6bcc5157
...@@ -470,10 +470,11 @@ static void make_sortkey(register SORTPARAM *param, ...@@ -470,10 +470,11 @@ static void make_sortkey(register SORTPARAM *param,
switch (sort_field->result_type) { switch (sort_field->result_type) {
case STRING_RESULT: case STRING_RESULT:
{ {
CHARSET_INFO *cs=item->charset();
if (item->maybe_null) if (item->maybe_null)
*to++=1; *to++=1;
/* All item->str() to use some extra byte for end null.. */ /* All item->str() to use some extra byte for end null.. */
String tmp((char*) to,sort_field->length+4,default_charset_info); String tmp((char*) to,sort_field->length+4,cs);
String *res=item->val_str(&tmp); String *res=item->val_str(&tmp);
if (!res) if (!res)
{ {
...@@ -488,7 +489,6 @@ static void make_sortkey(register SORTPARAM *param, ...@@ -488,7 +489,6 @@ static void make_sortkey(register SORTPARAM *param,
break; break;
} }
length=res->length(); length=res->length();
CHARSET_INFO *cs=res->charset();
int diff=(int) (sort_field->length-length); int diff=(int) (sort_field->length-length);
if (diff < 0) if (diff < 0)
{ {
......
...@@ -192,8 +192,7 @@ int key_cmp(TABLE *table,const byte *key,uint idx,uint key_length) ...@@ -192,8 +192,7 @@ int key_cmp(TABLE *table,const byte *key,uint idx,uint key_length)
if (!(key_part->key_type & (FIELDFLAG_NUMBER+FIELDFLAG_BINARY+ if (!(key_part->key_type & (FIELDFLAG_NUMBER+FIELDFLAG_BINARY+
FIELDFLAG_PACK))) FIELDFLAG_PACK)))
{ {
/* BAR TODO: I'm not sure this should be system_charset_info */ if (my_strnncoll(key_part->field->charset(),
if (my_strnncoll(system_charset_info,
(const uchar*) key, length, (const uchar*) key, length,
(const uchar*) table->record[0]+key_part->offset,length)) (const uchar*) table->record[0]+key_part->offset,length))
return 1; return 1;
......
...@@ -929,7 +929,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, ...@@ -929,7 +929,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
{ {
bool like_error; bool like_error;
char buff1[MAX_FIELD_WIDTH],*min_str,*max_str; char buff1[MAX_FIELD_WIDTH],*min_str,*max_str;
String tmp(buff1,sizeof(buff1),default_charset_info),*res; String tmp(buff1,sizeof(buff1),value->charset()),*res;
uint length,offset,min_length,max_length; uint length,offset,min_length,max_length;
if (!field->optimize_range(param->real_keynr[key_part->key])) if (!field->optimize_range(param->real_keynr[key_part->key]))
...@@ -2793,7 +2793,7 @@ static void ...@@ -2793,7 +2793,7 @@ static void
print_key(KEY_PART *key_part,const char *key,uint used_length) print_key(KEY_PART *key_part,const char *key,uint used_length)
{ {
char buff[1024]; char buff[1024];
String tmp(buff,sizeof(buff),default_charset_info); String tmp(buff,sizeof(buff),NULL);
for (uint length=0; for (uint length=0;
length < used_length ; length < used_length ;
......
...@@ -536,7 +536,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) ...@@ -536,7 +536,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK); table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
bzero((char*) &create_info,sizeof(create_info)); bzero((char*) &create_info,sizeof(create_info));
create_info.auto_increment_value= table->file->auto_increment_value; create_info.auto_increment_value= table->file->auto_increment_value;
create_info.table_charset=default_charset_info; create_info.table_charset=table->table_charset;
db_type table_type=table->db_type; db_type table_type=table->db_type;
strmov(path,table->path); strmov(path,table->path);
...@@ -580,7 +580,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) ...@@ -580,7 +580,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
} }
bzero((char*) &create_info,sizeof(create_info)); bzero((char*) &create_info,sizeof(create_info));
create_info.table_charset=default_charset_info; create_info.table_charset=table_list->table->table_charset;
*fn_ext(path)=0; // Remove the .frm extension *fn_ext(path)=0; // Remove the .frm extension
error= ha_create_table(path,&create_info,1) ? -1 : 0; error= ha_create_table(path,&create_info,1) ? -1 : 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment