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
ca948e33
Commit
ca948e33
authored
Oct 07, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant
parent
dbeffabc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
1 deletion
+69
-1
mysql-test/r/ctype_gbk.result
mysql-test/r/ctype_gbk.result
+18
-0
mysql-test/r/ctype_latin1.result
mysql-test/r/ctype_latin1.result
+18
-0
mysql-test/t/ctype_gbk.test
mysql-test/t/ctype_gbk.test
+14
-0
mysql-test/t/ctype_latin1.test
mysql-test/t/ctype_latin1.test
+16
-0
sql/item.cc
sql/item.cc
+3
-1
No files found.
mysql-test/r/ctype_gbk.result
View file @
ca948e33
...
...
@@ -4944,5 +4944,23 @@ E05B
DROP TABLE t1;
# Start of ctype_E05C.inc
#
# MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant
#
SET NAMES latin1;
CREATE TABLE t1 (a TEXT CHARACTER SET gbk);
INSERT INTO t1 VALUES (0xEE5D);
SELECT a<>0xEE5D AS a FROM t1;
a
0
CREATE VIEW v1 AS SELECT a<>0xEE5D AS a FROM t1;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`a` <> 0xee5d) AS `a` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
a
0
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.0 tests
#
mysql-test/r/ctype_latin1.result
View file @
ca948e33
...
...
@@ -7922,5 +7922,23 @@ SELECT _latin1 0x7E, _latin1 X'7E', _latin1 B'01111110';
_latin1 0x7E _latin1 X'7E' _latin1 B'01111110'
~ ~ ~
#
# MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant
#
SET NAMES latin1;
CREATE TABLE t1 (a TEXT CHARACTER SET latin1);
INSERT INTO t1 VALUES (0xC0);
SELECT a<>0xEE5D AS a FROM t1;
a
1
CREATE VIEW v1 AS SELECT a<>0xC0 AS a FROM t1;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (`t1`.`a` <> 0xc0) AS `a` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
a
0
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.0 tests
#
mysql-test/t/ctype_gbk.test
View file @
ca948e33
...
...
@@ -199,6 +199,20 @@ let $ctype_unescape_combinations=selected;
SET
NAMES
gbk
;
--
source
include
/
ctype_E05C
.
inc
--
echo
#
--
echo
# MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant
--
echo
#
SET
NAMES
latin1
;
CREATE
TABLE
t1
(
a
TEXT
CHARACTER
SET
gbk
);
INSERT
INTO
t1
VALUES
(
0xEE5D
);
SELECT
a
<>
0xEE5D
AS
a
FROM
t1
;
CREATE
VIEW
v1
AS
SELECT
a
<>
0xEE5D
AS
a
FROM
t1
;
SHOW
CREATE
VIEW
v1
;
SELECT
*
FROM
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.0 tests
...
...
mysql-test/t/ctype_latin1.test
View file @
ca948e33
...
...
@@ -245,6 +245,22 @@ DROP TABLE t1;
--
echo
#
SELECT
_latin1
0x7E
,
_latin1
X
'7E'
,
_latin1
B
'01111110'
;
--
echo
#
--
echo
# MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant
--
echo
#
SET
NAMES
latin1
;
CREATE
TABLE
t1
(
a
TEXT
CHARACTER
SET
latin1
);
INSERT
INTO
t1
VALUES
(
0xC0
);
SELECT
a
<>
0xEE5D
AS
a
FROM
t1
;
CREATE
VIEW
v1
AS
SELECT
a
<>
0xC0
AS
a
FROM
t1
;
SHOW
CREATE
VIEW
v1
;
SELECT
*
FROM
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.0 tests
--
echo
#
sql/item.cc
View file @
ca948e33
...
...
@@ -2162,6 +2162,9 @@ bool agg_item_collations_for_comparison(DTCollation &c, const char *fname,
bool
agg_item_set_converter
(
DTCollation
&
coll
,
const
char
*
fname
,
Item
**
args
,
uint
nargs
,
uint
flags
,
int
item_sep
)
{
THD
*
thd
=
current_thd
;
if
(
thd
->
lex
->
is_ps_or_view_context_analysis
())
return
false
;
Item
**
arg
,
*
safe_args
[
2
]
=
{
NULL
,
NULL
};
/*
...
...
@@ -2177,7 +2180,6 @@ bool agg_item_set_converter(DTCollation &coll, const char *fname,
safe_args
[
1
]
=
args
[
item_sep
];
}
THD
*
thd
=
current_thd
;
bool
res
=
FALSE
;
uint
i
;
...
...
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