mirror of
https://github.com/MariaDB/server.git
synced 2026-05-10 00:54:30 +02:00
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:
parent
b043f06666
commit
8bee96ab0a
37 changed files with 366 additions and 325 deletions
|
|
@ -228,7 +228,7 @@ static void do_conv_blob(Copy_field *copy)
|
|||
{
|
||||
copy->from_field->val_str(©->tmp,©->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(©->tmp,©->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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue