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
02e35ef5
Commit
02e35ef5
authored
Nov 15, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
parent
ea1739f9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
0 deletions
+75
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+15
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+21
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+12
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+12
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+14
-0
sql/item_strfunc.h
sql/item_strfunc.h
+1
-0
No files found.
mysql-test/r/ctype_utf8.result
View file @
02e35ef5
...
@@ -10113,5 +10113,20 @@ DROP FUNCTION iswellformed;
...
@@ -10113,5 +10113,20 @@ DROP FUNCTION iswellformed;
DROP TABLE allbytes;
DROP TABLE allbytes;
# End of ctype_backslash.inc
# End of ctype_backslash.inc
#
#
# MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
#
SET NAMES utf8;
SELECT CHAR(0xDF USING latin1);
CHAR(0xDF USING latin1)
ß
CREATE OR REPLACE VIEW v1 AS SELECT CHAR(0xDF USING latin1) AS c;
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 char(0xdf using latin1) AS `c` utf8 utf8_general_ci
SELECT * FROM v1;
c
ß
DROP VIEW v1;
#
# End of 10.0 tests
# End of 10.0 tests
#
#
mysql-test/r/func_str.result
View file @
02e35ef5
...
@@ -4530,3 +4530,24 @@ latin2_general_ci
...
@@ -4530,3 +4530,24 @@ latin2_general_ci
#
#
# End of 5.6 tests
# End of 5.6 tests
#
#
#
# Start of 10.0 tests
#
#
# MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
#
EXPLAIN EXTENDED SELECT CHAR(0xDF USING latin1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf using latin1) AS `CHAR(0xDF USING latin1)`
EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF USING ``binary``)`
EXPLAIN EXTENDED SELECT CHAR(0xDF);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF)`
mysql-test/t/ctype_utf8.test
View file @
02e35ef5
...
@@ -1868,6 +1868,18 @@ SELECT _utf8 0x7E, _utf8 X'7E', _utf8 B'01111110';
...
@@ -1868,6 +1868,18 @@ SELECT _utf8 0x7E, _utf8 X'7E', _utf8 B'01111110';
let
$ctype_unescape_combinations
=
selected
;
let
$ctype_unescape_combinations
=
selected
;
--
source
include
/
ctype_unescape
.
inc
--
source
include
/
ctype_unescape
.
inc
--
echo
#
--
echo
# MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
--
echo
#
SET
NAMES
utf8
;
SELECT
CHAR
(
0xDF
USING
latin1
);
CREATE
OR
REPLACE
VIEW
v1
AS
SELECT
CHAR
(
0xDF
USING
latin1
)
AS
c
;
SHOW
CREATE
VIEW
v1
;
SELECT
*
FROM
v1
;
DROP
VIEW
v1
;
--
echo
#
--
echo
#
--
echo
# End of 10.0 tests
--
echo
# End of 10.0 tests
--
echo
#
--
echo
#
mysql-test/t/func_str.test
View file @
02e35ef5
...
@@ -1742,3 +1742,15 @@ EXECUTE stmt;
...
@@ -1742,3 +1742,15 @@ EXECUTE stmt;
--
echo
#
--
echo
#
--
echo
# End of 5.6 tests
--
echo
# End of 5.6 tests
--
echo
#
--
echo
#
--
echo
#
--
echo
# Start of 10.0 tests
--
echo
#
--
echo
#
--
echo
# MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
--
echo
#
EXPLAIN
EXTENDED
SELECT
CHAR
(
0xDF
USING
latin1
);
EXPLAIN
EXTENDED
SELECT
CHAR
(
0xDF
USING
`binary`
);
EXPLAIN
EXTENDED
SELECT
CHAR
(
0xDF
);
sql/item_strfunc.cc
View file @
02e35ef5
...
@@ -2905,6 +2905,20 @@ String *Item_func_make_set::val_str(String *str)
...
@@ -2905,6 +2905,20 @@ String *Item_func_make_set::val_str(String *str)
}
}
void
Item_func_char
::
print
(
String
*
str
,
enum_query_type
query_type
)
{
str
->
append
(
Item_func_char
::
func_name
());
str
->
append
(
'('
);
print_args
(
str
,
0
,
query_type
);
if
(
collation
.
collation
!=
&
my_charset_bin
)
{
str
->
append
(
C_STRING_WITH_LEN
(
" using "
));
str
->
append
(
collation
.
collation
->
csname
);
}
str
->
append
(
')'
);
}
String
*
Item_func_char
::
val_str
(
String
*
str
)
String
*
Item_func_char
::
val_str
(
String
*
str
)
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
...
...
sql/item_strfunc.h
View file @
02e35ef5
...
@@ -702,6 +702,7 @@ class Item_func_char :public Item_str_func
...
@@ -702,6 +702,7 @@ class Item_func_char :public Item_str_func
max_length
=
arg_count
*
4
;
max_length
=
arg_count
*
4
;
}
}
const
char
*
func_name
()
const
{
return
"char"
;
}
const
char
*
func_name
()
const
{
return
"char"
;
}
void
print
(
String
*
str
,
enum_query_type
query_type
);
};
};
...
...
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