mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
Merge mysql.com:/home/ram/work/mysql-5.0-maint
into mysql.com:/home/ram/work/b31615/b31615.5.0
This commit is contained in:
commit
1cf8aaff52
4 changed files with 43 additions and 0 deletions
|
@ -811,6 +811,14 @@ quote(name)
|
|||
????????
|
||||
????????????????
|
||||
drop table bug20536;
|
||||
set names ucs2;
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
|
||||
set names ucs2 collate ucs2_bin;
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
|
||||
set character_set_client= ucs2;
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
|
||||
set character_set_client= concat('ucs', substr('2', 1));
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
|
||||
End of 4.1 tests
|
||||
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
|
||||
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
|
||||
|
|
|
@ -547,6 +547,18 @@ select quote(name) from bug20536;
|
|||
|
||||
drop table bug20536;
|
||||
|
||||
#
|
||||
# Bug #31615: crash after set names ucs2 collate xxx
|
||||
#
|
||||
--error 1231
|
||||
set names ucs2;
|
||||
--error 1231
|
||||
set names ucs2 collate ucs2_bin;
|
||||
--error 1231
|
||||
set character_set_client= ucs2;
|
||||
--error 1231
|
||||
set character_set_client= concat('ucs', substr('2', 1));
|
||||
|
||||
--echo End of 4.1 tests
|
||||
|
||||
#
|
||||
|
|
|
@ -2222,6 +2222,21 @@ sys_var_character_set_filesystem::set_default(THD *thd, enum_var_type type)
|
|||
}
|
||||
|
||||
|
||||
bool sys_var_character_set_client::check(THD *thd, set_var *var)
|
||||
{
|
||||
if (sys_var_character_set::check(thd, var))
|
||||
return 1;
|
||||
/* Currently, UCS-2 cannot be used as a client character set */
|
||||
if (var->save_result.charset->mbminlen > 1)
|
||||
{
|
||||
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name,
|
||||
var->save_result.charset->csname);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
CHARSET_INFO **
|
||||
sys_var_character_set_results::ci_ptr(THD *thd, enum_var_type type)
|
||||
{
|
||||
|
@ -2561,6 +2576,13 @@ end:
|
|||
|
||||
int set_var_collation_client::check(THD *thd)
|
||||
{
|
||||
/* Currently, UCS-2 cannot be used as a client character set */
|
||||
if (character_set_client->mbminlen > 1)
|
||||
{
|
||||
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client",
|
||||
character_set_client->csname);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -613,6 +613,7 @@ public:
|
|||
sys_var_character_set(name_arg) {}
|
||||
void set_default(THD *thd, enum_var_type type);
|
||||
CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
|
||||
bool check(THD *thd, set_var *var);
|
||||
};
|
||||
|
||||
class sys_var_character_set_results :public sys_var_character_set
|
||||
|
|
Loading…
Add table
Reference in a new issue