mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 03:47:17 +02:00
Bug #17903: cast to char results in binary
The character set was not being properly initialized in CAST() with a type like "CHAR(2) BINARY", which resulted in incorrect results or even a crash. mysql-test/r/cast.result: Add new results mysql-test/t/cast.test: Add new regression test sql/sql_yacc.yy: Make sure Lex->charset is set to NULL when nothing follows BINARY in type declaration.
This commit is contained in:
parent
a7dddd3b67
commit
2fc276d54f
3 changed files with 25 additions and 2 deletions
|
|
@ -381,3 +381,14 @@ DROP TABLE t1;
|
|||
select cast(NULL as decimal(6)) as t1;
|
||||
t1
|
||||
NULL
|
||||
set names latin1;
|
||||
select hex(cast('a' as char(2) binary));
|
||||
hex(cast('a' as char(2) binary))
|
||||
61
|
||||
select hex(cast('a' as binary(2)));
|
||||
hex(cast('a' as binary(2)))
|
||||
6100
|
||||
select hex(cast('a' as char(2) binary));
|
||||
hex(cast('a' as char(2) binary))
|
||||
61
|
||||
End of 5.0 tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue