mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
ctype_utf8.result, ctype_utf8.test, item.cc:
Bug#12371 executing prepared statement fails (illegal mix of collations) After review fixes. sql/item.cc: Bug#12371 executing prepared statement fails (illegal mix of collations) After review fixes. mysql-test/t/ctype_utf8.test: Bug#12371 executing prepared statement fails (illegal mix of collations) After review fixes. mysql-test/r/ctype_utf8.result: Bug#12371 executing prepared statement fails (illegal mix of collations) After review fixes.
This commit is contained in:
parent
527a9cad7e
commit
593f03d94b
3 changed files with 12 additions and 1 deletions
|
@ -1001,6 +1001,9 @@ set @a:='bar';
|
|||
execute my_stmt using @a;
|
||||
a b
|
||||
bar kostja
|
||||
set @a:=NULL;
|
||||
execute my_stmt using @a;
|
||||
a b
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
a varchar(255) NOT NULL default '',
|
||||
|
|
|
@ -840,6 +840,8 @@ insert into t1 values ('bar','kostja');
|
|||
prepare my_stmt from "select * from t1 where a=?";
|
||||
set @a:='bar';
|
||||
execute my_stmt using @a;
|
||||
set @a:=NULL;
|
||||
execute my_stmt using @a;
|
||||
drop table t1;
|
||||
|
||||
|
||||
|
|
|
@ -290,7 +290,13 @@ Item *Item_param::safe_charset_converter(CHARSET_INFO *tocs)
|
|||
{
|
||||
Item_string *conv;
|
||||
uint conv_errors;
|
||||
String tmp, cstr, *ostr= val_str(&tmp);
|
||||
char buf[MAX_FIELD_WIDTH];
|
||||
String tmp(buf, sizeof(buf), &my_charset_bin);
|
||||
String cstr, *ostr= val_str(&tmp);
|
||||
/*
|
||||
As safe_charset_converter is not executed for
|
||||
a parameter bound to NULL, ostr should never be 0.
|
||||
*/
|
||||
cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors);
|
||||
if (conv_errors || !(conv= new Item_string(cstr.ptr(), cstr.length(),
|
||||
cstr.charset(),
|
||||
|
|
Loading…
Reference in a new issue