Commit dbd1e63e authored by ram@mysql.r18.ru's avatar ram@mysql.r18.ru

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

into mysql.r18.ru:/usr/home/ram/work/mysql-4.1.bdb
parents 495b2d73 df64544b
......@@ -470,10 +470,11 @@ static void make_sortkey(register SORTPARAM *param,
switch (sort_field->result_type) {
case STRING_RESULT:
{
CHARSET_INFO *cs=item->charset();
if (item->maybe_null)
*to++=1;
/* 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);
if (!res)
{
......@@ -488,7 +489,6 @@ static void make_sortkey(register SORTPARAM *param,
break;
}
length=res->length();
CHARSET_INFO *cs=res->charset();
int diff=(int) (sort_field->length-length);
if (diff < 0)
{
......
......@@ -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+
FIELDFLAG_PACK)))
{
/* BAR TODO: I'm not sure this should be system_charset_info */
if (my_strnncoll(system_charset_info,
if (my_strnncoll(key_part->field->charset(),
(const uchar*) key, length,
(const uchar*) table->record[0]+key_part->offset,length))
return 1;
......
......@@ -929,7 +929,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
{
bool like_error;
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;
if (!field->optimize_range(param->real_keynr[key_part->key]))
......@@ -2793,7 +2793,7 @@ static void
print_key(KEY_PART *key_part,const char *key,uint used_length)
{
char buff[1024];
String tmp(buff,sizeof(buff),default_charset_info);
String tmp(buff,sizeof(buff),NULL);
for (uint length=0;
length < used_length ;
......
......@@ -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);
bzero((char*) &create_info,sizeof(create_info));
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;
strmov(path,table->path);
......@@ -580,7 +580,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
}
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
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