Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d05c05a8
Commit
d05c05a8
authored
Oct 24, 2007
by
ramil/ram@ramil.myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/ram/work/mysql-5.1-maint
into mysql.com:/home/ram/work/b31615/b31615.5.1
parents
d3293988
c380020a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
1 deletion
+58
-1
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+8
-0
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+12
-0
sql/set_var.cc
sql/set_var.cc
+24
-1
sql/set_var.h
sql/set_var.h
+14
-0
No files found.
mysql-test/r/ctype_ucs.result
View file @
d05c05a8
...
@@ -811,6 +811,14 @@ quote(name)
...
@@ -811,6 +811,14 @@ quote(name)
????????
????????
????????????????
????????????????
drop table bug20536;
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
End of 4.1 tests
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
...
...
mysql-test/t/ctype_ucs.test
View file @
d05c05a8
...
@@ -547,6 +547,18 @@ select quote(name) from bug20536;
...
@@ -547,6 +547,18 @@ select quote(name) from bug20536;
drop
table
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
--
echo
End
of
4.1
tests
#
#
...
...
sql/set_var.cc
View file @
d05c05a8
...
@@ -164,7 +164,8 @@ static sys_var_character_set_sv sys_character_set_server(&vars, "character_set_s
...
@@ -164,7 +164,8 @@ static sys_var_character_set_sv sys_character_set_server(&vars, "character_set_s
sys_var_const_str
sys_charset_system
(
&
vars
,
"character_set_system"
,
sys_var_const_str
sys_charset_system
(
&
vars
,
"character_set_system"
,
(
char
*
)
my_charset_utf8_general_ci
.
name
);
(
char
*
)
my_charset_utf8_general_ci
.
name
);
static
sys_var_character_set_database
sys_character_set_database
(
&
vars
,
"character_set_database"
);
static
sys_var_character_set_database
sys_character_set_database
(
&
vars
,
"character_set_database"
);
static
sys_var_character_set_sv
sys_character_set_client
(
&
vars
,
"character_set_client"
,
static
sys_var_character_set_client
sys_character_set_client
(
&
vars
,
"character_set_client"
,
&
SV
::
character_set_client
,
&
SV
::
character_set_client
,
&
default_charset_info
);
&
default_charset_info
);
static
sys_var_character_set_sv
sys_character_set_connection
(
&
vars
,
"character_set_connection"
,
static
sys_var_character_set_sv
sys_character_set_connection
(
&
vars
,
"character_set_connection"
,
...
@@ -1861,6 +1862,21 @@ CHARSET_INFO **sys_var_character_set_sv::ci_ptr(THD *thd, enum_var_type type)
...
@@ -1861,6 +1862,21 @@ CHARSET_INFO **sys_var_character_set_sv::ci_ptr(THD *thd, enum_var_type type)
}
}
bool
sys_var_character_set_client
::
check
(
THD
*
thd
,
set_var
*
var
)
{
if
(
sys_var_character_set_sv
::
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_database
::
ci_ptr
(
THD
*
thd
,
CHARSET_INFO
**
sys_var_character_set_database
::
ci_ptr
(
THD
*
thd
,
enum_var_type
type
)
enum_var_type
type
)
{
{
...
@@ -2290,6 +2306,13 @@ uchar *sys_var_log_output::value_ptr(THD *thd, enum_var_type type,
...
@@ -2290,6 +2306,13 @@ uchar *sys_var_log_output::value_ptr(THD *thd, enum_var_type type,
int
set_var_collation_client
::
check
(
THD
*
thd
)
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
;
return
0
;
}
}
...
...
sql/set_var.h
View file @
d05c05a8
...
@@ -667,6 +667,20 @@ public:
...
@@ -667,6 +667,20 @@ public:
};
};
class
sys_var_character_set_client
:
public
sys_var_character_set_sv
{
public:
sys_var_character_set_client
(
sys_var_chain
*
chain
,
const
char
*
name_arg
,
CHARSET_INFO
*
SV
::*
offset_arg
,
CHARSET_INFO
**
global_default_arg
,
bool
is_nullable
=
0
)
:
sys_var_character_set_sv
(
chain
,
name_arg
,
offset_arg
,
global_default_arg
,
is_nullable
)
{
}
bool
check
(
THD
*
thd
,
set_var
*
var
);
};
class
sys_var_character_set_database
:
public
sys_var_character_set
class
sys_var_character_set_database
:
public
sys_var_character_set
{
{
public:
public:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment