Commit b25fcad4 authored by unknown's avatar unknown

user_var.result, func_str.result, item_strfunc.cc:

  bug#7839 ncorrect collation for char(ascii('a'))


sql/item_strfunc.cc:
  bug#7839 ncorrect collation for char(ascii('a'))
mysql-test/r/func_str.result:
  bug#7839 ncorrect collation for char(ascii('a'))
mysql-test/r/user_var.result:
  bug#7839 ncorrect collation for char(ascii('a'))
parent c72207e1
...@@ -463,7 +463,7 @@ collation(hex(130)) coercibility(hex(130)) ...@@ -463,7 +463,7 @@ collation(hex(130)) coercibility(hex(130))
latin1_swedish_ci 3 latin1_swedish_ci 3
select collation(char(130)), coercibility(hex(130)); select collation(char(130)), coercibility(hex(130));
collation(char(130)) coercibility(hex(130)) collation(char(130)) coercibility(hex(130))
binary 3 latin1_swedish_ci 3
select collation(format(130,10)), coercibility(format(130,10)); select collation(format(130,10)), coercibility(format(130,10));
collation(format(130,10)) coercibility(format(130,10)) collation(format(130,10)) coercibility(format(130,10))
latin1_swedish_ci 3 latin1_swedish_ci 3
......
...@@ -175,7 +175,7 @@ Log_name Pos Event_type Server_id Orig_log_pos Info ...@@ -175,7 +175,7 @@ Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001 226 User var 1 226 @`var2`=_binary 0x61 COLLATE binary master-bin.000001 226 User var 1 226 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
master-bin.000001 264 Query 1 264 use `test`; insert into t1 values (@var1),(@var2) master-bin.000001 264 Query 1 264 use `test`; insert into t1 values (@var1),(@var2)
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`; SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`;
...@@ -183,7 +183,7 @@ use test; ...@@ -183,7 +183,7 @@ use test;
SET TIMESTAMP=10000; SET TIMESTAMP=10000;
INSERT INTO t1 VALUES(@`a b`); INSERT INTO t1 VALUES(@`a b`);
SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`; SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`;
SET @`var2`:=_binary 0x61 COLLATE `binary`; SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`;
SET TIMESTAMP=10000; SET TIMESTAMP=10000;
insert into t1 values (@var1),(@var2); insert into t1 values (@var1),(@var2);
drop table t1; drop table t1;
......
...@@ -1888,6 +1888,7 @@ b1: str->append((char)(num>>8)); ...@@ -1888,6 +1888,7 @@ b1: str->append((char)(num>>8));
#endif #endif
str->append((char)num); str->append((char)num);
} }
str->set_charset(collation.collation);
str->realloc(str->length()); // Add end 0 (for Purify) str->realloc(str->length()); // Add end 0 (for Purify)
return str; return str;
} }
......
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