Now string values are created and filled with charset field

SELECT func(charset2) FROM t ORDER BY 1 works in correct charset
This commit is contained in:
unknown 2002-05-17 16:29:52 +05:00
commit 8bee96ab0a
37 changed files with 366 additions and 325 deletions

View file

@ -228,7 +228,7 @@ static void do_conv_blob(Copy_field *copy)
{
copy->from_field->val_str(&copy->tmp,&copy->tmp);
((Field_blob *) copy->to_field)->store(copy->tmp.ptr(),
copy->tmp.length());
copy->tmp.length(),default_charset_info);
}
/* Save blob in copy->tmp for GROUP BY */
@ -236,20 +236,20 @@ static void do_conv_blob(Copy_field *copy)
static void do_save_blob(Copy_field *copy)
{
char buff[MAX_FIELD_WIDTH];
String res(buff,sizeof(buff));
String res(buff,sizeof(buff),default_charset_info);
copy->from_field->val_str(&res,&res);
copy->tmp.copy(res);
((Field_blob *) copy->to_field)->store(copy->tmp.ptr(),
copy->tmp.length());
copy->tmp.length(),default_charset_info);
}
static void do_field_string(Copy_field *copy)
{
char buff[MAX_FIELD_WIDTH];
copy->tmp.set_quick(buff,sizeof(buff));
copy->tmp.set_quick(buff,sizeof(buff),default_charset_info);
copy->from_field->val_str(&copy->tmp,&copy->tmp);
copy->to_field->store(copy->tmp.c_ptr_quick(),copy->tmp.length());
copy->to_field->store(copy->tmp.c_ptr_quick(),copy->tmp.length(),default_charset_info);
}
@ -508,7 +508,7 @@ void field_conv(Field *to,Field *from)
if (!blob->value.is_alloced() &&
from->real_type() != FIELD_TYPE_STRING)
blob->value.copy();
blob->store(blob->value.ptr(),blob->value.length());
blob->store(blob->value.ptr(),blob->value.length(),default_charset_info);
return;
}
if ((from->result_type() == STRING_RESULT &&
@ -518,9 +518,9 @@ void field_conv(Field *to,Field *from)
to->type() == FIELD_TYPE_DECIMAL)
{
char buff[MAX_FIELD_WIDTH];
String result(buff,sizeof(buff));
String result(buff,sizeof(buff),default_charset_info);
from->val_str(&result,&result);
to->store(result.c_ptr_quick(),result.length());
to->store(result.c_ptr_quick(),result.length(),default_charset_info);
}
else if (from->result_type() == REAL_RESULT)
to->store(from->val_real());