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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3f32bf62
Commit
3f32bf62
authored
Jun 24, 2016
by
Alexander Barkov
Committed by
Sergei Golubchik
Jun 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests for "MDEV-7563 Support CHECK constraint".
Testing non-ASCII string literals.
parent
11debf69
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
158 additions
and
29 deletions
+158
-29
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+76
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+54
-0
sql/set_var.cc
sql/set_var.cc
+2
-4
sql/slave.cc
sql/slave.cc
+2
-5
sql/sql_acl.cc
sql/sql_acl.cc
+0
-2
sql/sql_class.h
sql/sql_class.h
+16
-0
sql/sql_connect.cc
sql/sql_connect.cc
+5
-10
sql/sql_parse.cc
sql/sql_parse.cc
+2
-4
sql/table.cc
sql/table.cc
+1
-4
No files found.
mysql-test/r/ctype_utf8.result
View file @
3f32bf62
...
...
@@ -10459,5 +10459,81 @@ HEX(a)
613F
DROP TABLE t1;
#
# MDEV-10134 Add full support for DEFAULT
#
SET NAMES latin1;
CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß'));
SET NAMES utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT CONCAT('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (DEFAULT);
SELECT HEX(a),a FROM t1;
HEX(a) a
C39F ß
SET NAMES latin1;
ALTER TABLE t1 ADD b VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß');
SET NAMES utf8;
ALTER TABLE t1 ADD c VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT CONCAT('ß'),
`b` varchar(30) DEFAULT CONCAT('ß'),
`c` varchar(30) DEFAULT CONCAT('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DELETE FROM t1;
INSERT INTO t1 VALUES();
SELECT * FROM t1;
a b c
ß ß ß
SET NAMES latin1;
DELETE FROM t1;
INSERT INTO t1 VALUES();
SET NAMES utf8;
SELECT * FROM t1;
a b c
ß ß ß
DROP TABLE t1;
SET NAMES latin1;
CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 DEFAULT CONCAT('ß'));
SET NAMES utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (DEFAULT);
SELECT HEX(a), a FROM t1;
HEX(a) a
C383C5B8 ß
DROP TABLE t1;
SET NAMES utf8;
CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß'));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT CONCAT('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (DEFAULT);
SELECT HEX(a) FROM t1;
HEX(a)
DF
DROP TABLE t1;
SET NAMES utf8;
CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 DEFAULT CONCAT('ß'));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (DEFAULT);
SELECT HEX(a) FROM t1;
HEX(a)
C39F
DROP TABLE t1;
#
# End of 10.2 tests
#
mysql-test/t/ctype_utf8.test
View file @
3f32bf62
...
...
@@ -1982,6 +1982,60 @@ LOAD XML INFILE '../../std_data/loaddata/mdev9874.xml' INTO TABLE t1 CHARACTER S
SELECT
HEX
(
a
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-10134 Add full support for DEFAULT
--
echo
#
# This test uses some magic codes:
# _latin1 0xC39F is "A WITH TILDE + Y WITH DIAERESIS"
# _utf8 0xC39F is "SHARP S"
# "A WITH TILDE + Y WITH DIAERESIS" in DEFAULT.
SET
NAMES
latin1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
30
)
CHARACTER
SET
latin1
DEFAULT
CONCAT
(
'ß'
));
SET
NAMES
utf8
;
SHOW
CREATE
TABLE
t1
;
INSERT
INTO
t1
VALUES
(
DEFAULT
);
SELECT
HEX
(
a
),
a
FROM
t1
;
SET
NAMES
latin1
;
ALTER
TABLE
t1
ADD
b
VARCHAR
(
30
)
CHARACTER
SET
latin1
DEFAULT
CONCAT
(
'ß'
);
SET
NAMES
utf8
;
ALTER
TABLE
t1
ADD
c
VARCHAR
(
30
)
CHARACTER
SET
latin1
DEFAULT
CONCAT
(
'ß'
);
SHOW
CREATE
TABLE
t1
;
# Testing that DEFAULT is independent on the current "SET NAMES".
DELETE
FROM
t1
;
INSERT
INTO
t1
VALUES
();
SELECT
*
FROM
t1
;
SET
NAMES
latin1
;
DELETE
FROM
t1
;
INSERT
INTO
t1
VALUES
();
SET
NAMES
utf8
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
SET
NAMES
latin1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
30
)
CHARACTER
SET
utf8
DEFAULT
CONCAT
(
'ß'
));
SET
NAMES
utf8
;
SHOW
CREATE
TABLE
t1
;
INSERT
INTO
t1
VALUES
(
DEFAULT
);
SELECT
HEX
(
a
),
a
FROM
t1
;
DROP
TABLE
t1
;
# "SHARP S" in DEFAULT
SET
NAMES
utf8
;
CREATE
TABLE
t1
(
a
VARCHAR
(
30
)
CHARACTER
SET
latin1
DEFAULT
CONCAT
(
'ß'
));
SHOW
CREATE
TABLE
t1
;
INSERT
INTO
t1
VALUES
(
DEFAULT
);
SELECT
HEX
(
a
)
FROM
t1
;
DROP
TABLE
t1
;
SET
NAMES
utf8
;
CREATE
TABLE
t1
(
a
VARCHAR
(
30
)
CHARACTER
SET
utf8
DEFAULT
CONCAT
(
'ß'
));
SHOW
CREATE
TABLE
t1
;
INSERT
INTO
t1
VALUES
(
DEFAULT
);
SELECT
HEX
(
a
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
sql/set_var.cc
View file @
3f32bf62
...
...
@@ -966,10 +966,8 @@ int set_var_collation_client::check(THD *thd)
int
set_var_collation_client
::
update
(
THD
*
thd
)
{
thd
->
variables
.
character_set_client
=
character_set_client
;
thd
->
variables
.
character_set_results
=
character_set_results
;
thd
->
variables
.
collation_connection
=
collation_connection
;
thd
->
update_charset
();
thd
->
update_charset
(
character_set_client
,
collation_connection
,
character_set_results
);
thd
->
protocol_text
.
init
(
thd
);
thd
->
protocol_binary
.
init
(
thd
);
return
0
;
...
...
sql/slave.cc
View file @
3f32bf62
...
...
@@ -3024,13 +3024,10 @@ void set_slave_thread_default_charset(THD* thd, rpl_group_info *rgi)
{
DBUG_ENTER
(
"set_slave_thread_default_charset"
);
thd
->
variables
.
character_set_client
=
global_system_variables
.
character_set_client
;
thd
->
variables
.
collation_connection
=
global_system_variables
.
collation_connection
;
thd
->
variables
.
collation_server
=
global_system_variables
.
collation_server
;
thd
->
update_charset
();
thd
->
update_charset
(
global_system_variables
.
character_set_client
,
global_system_variables
.
collation_connection
);
thd
->
system_thread_info
.
rpl_sql_info
->
cached_charset_invalidate
();
DBUG_VOID_RETURN
;
...
...
sql/sql_acl.cc
View file @
3f32bf62
...
...
@@ -11774,7 +11774,6 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
{
if
(
thd_init_client_charset
(
thd
,
uint2korr
(
next_field
)))
DBUG_RETURN
(
1
);
thd
->
update_charset
();
next_field
+=
2
;
}
...
...
@@ -11940,7 +11939,6 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
DBUG_PRINT
(
"info"
,
(
"client_character_set: %d"
,
(
uint
)
net
->
read_pos
[
8
]));
if
(
thd_init_client_charset
(
thd
,
(
uint
)
net
->
read_pos
[
8
]))
return
packet_error
;
thd
->
update_charset
();
end
=
(
char
*
)
net
->
read_pos
+
32
;
}
else
...
...
sql/sql_class.h
View file @
3f32bf62
...
...
@@ -3417,6 +3417,22 @@ class THD :public Statement,
inline
CHARSET_INFO
*
charset
()
{
return
variables
.
character_set_client
;
}
void
update_charset
();
void
update_charset
(
CHARSET_INFO
*
character_set_client
,
CHARSET_INFO
*
collation_connection
)
{
variables
.
character_set_client
=
character_set_client
;
variables
.
collation_connection
=
collation_connection
;
update_charset
();
}
void
update_charset
(
CHARSET_INFO
*
character_set_client
,
CHARSET_INFO
*
collation_connection
,
CHARSET_INFO
*
character_set_results
)
{
variables
.
character_set_client
=
character_set_client
;
variables
.
collation_connection
=
collation_connection
;
variables
.
character_set_results
=
character_set_results
;
update_charset
();
}
inline
Query_arena
*
activate_stmt_arena_if_needed
(
Query_arena
*
backup
)
{
...
...
sql/sql_connect.cc
View file @
3f32bf62
...
...
@@ -799,12 +799,9 @@ bool thd_init_client_charset(THD *thd, uint cs_number)
if
(
!
opt_character_set_client_handshake
||
!
(
cs
=
get_charset
(
cs_number
,
MYF
(
0
))))
{
thd
->
variables
.
character_set_client
=
global_system_variables
.
character_set_client
;
thd
->
variables
.
collation_connection
=
global_system_variables
.
collation_connection
;
thd
->
variables
.
character_set_results
=
global_system_variables
.
character_set_results
;
thd
->
update_charset
(
global_system_variables
.
character_set_client
,
global_system_variables
.
collation_connection
,
global_system_variables
.
character_set_results
);
}
else
{
...
...
@@ -815,9 +812,7 @@ bool thd_init_client_charset(THD *thd, uint cs_number)
cs
->
csname
);
return
true
;
}
thd
->
variables
.
character_set_results
=
thd
->
variables
.
collation_connection
=
thd
->
variables
.
character_set_client
=
cs
;
thd
->
update_charset
(
cs
,
cs
,
cs
);
}
return
false
;
}
...
...
sql/sql_parse.cc
View file @
3f32bf62
...
...
@@ -1710,10 +1710,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
decrease_user_connections
(
thd
->
user_connect
);
thd
->
user_connect
=
save_user_connect
;
thd
->
reset_db
(
save_db
,
save_db_length
);
thd
->
variables
.
character_set_client
=
save_character_set_client
;
thd
->
variables
.
collation_connection
=
save_collation_connection
;
thd
->
variables
.
character_set_results
=
save_character_set_results
;
thd
->
update_charset
();
thd
->
update_charset
(
save_character_set_client
,
save_collation_connection
,
save_character_set_results
);
thd
->
failed_com_change_user
++
;
my_sleep
(
1000000
);
}
...
...
sql/table.cc
View file @
3f32bf62
...
...
@@ -126,10 +126,7 @@ Default_object_creation_ctx::create_backup_ctx(THD *thd) const
void
Default_object_creation_ctx
::
change_env
(
THD
*
thd
)
const
{
thd
->
variables
.
character_set_client
=
m_client_cs
;
thd
->
variables
.
collation_connection
=
m_connection_cl
;
thd
->
update_charset
();
thd
->
update_charset
(
m_client_cs
,
m_connection_cl
);
}
/**************************************************************************
...
...
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