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
a75ac82c
Commit
a75ac82c
authored
Dec 14, 2015
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9147: Character set is ignored in Dynamic Column for saved string
Fixed moving charset from definition to the value.
parent
98c9fbfa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
mysql-test/r/dyncol.result
mysql-test/r/dyncol.result
+15
-5
mysql-test/t/dyncol.test
mysql-test/t/dyncol.test
+7
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+2
-0
No files found.
mysql-test/r/dyncol.result
View file @
a75ac82c
...
...
@@ -6,16 +6,16 @@ hex(COLUMN_CREATE(1, NULL AS char character set utf8))
000000
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8));
hex(COLUMN_CREATE(1, "afaf" AS char character set utf8))
000100010003
08
61666166
000100010003
21
61666166
select hex(COLUMN_CREATE(1, 1212 AS char character set utf8));
hex(COLUMN_CREATE(1, 1212 AS char character set utf8))
000100010003
08
31323132
000100010003
21
31323132
select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8));
hex(COLUMN_CREATE(1, 12.12 AS char character set utf8))
000100010003
08
31322E3132
000100010003
21
31322E3132
select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8));
hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8))
000100010003
08
3939393939393939393939393939393939393939393939393939393939
000100010003
21
3939393939393939393939393939393939393939393939393939393939
select hex(COLUMN_CREATE(1, NULL AS unsigned int));
hex(COLUMN_CREATE(1, NULL AS unsigned int))
000000
...
...
@@ -144,7 +144,7 @@ hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
6, "2011-04-05" AS date,
7, "- 0:45:49.000001" AS time,
8, "2011-04-05 0:45:49.000001" AS datetime))
01080001000300020029000300380004004A0005008C000600AE000700C7000800F500
08
61666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000
01080001000300020029000300380004004A0005008C000600AE000700C7000800F500
21
61666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000
explain extended
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
2, 1212 AS unsigned int,
...
...
@@ -1848,5 +1848,15 @@ select column_json(column_create('float', 1.23456789012345E+10 as double));
column_json(column_create('float', 1.23456789012345E+10 as double))
{"float":12345678901.2345}
#
# MDEV-9147: Character set is ignored in Dynamic Column for saved string
#
SET NAMES utf8;
SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET latin1), 1 AS CHAR CHARACTER SET utf8) AS a;
a
¢
SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET utf8), 1 AS CHAR CHARACTER SET utf8) AS a;
a
¢
#
# end of 10.0 tests
#
mysql-test/t/dyncol.test
View file @
a75ac82c
...
...
@@ -901,6 +901,13 @@ select column_get(column_create('float', 1.23456789012345E+100 as double), 'floa
select
column_json
(
column_create
(
'float'
,
1.23456789012345E+100
as
double
));
select
column_json
(
column_create
(
'float'
,
1.23456789012345E+10
as
double
));
--
echo
#
--
echo
# MDEV-9147: Character set is ignored in Dynamic Column for saved string
--
echo
#
SET
NAMES
utf8
;
SELECT
COLUMN_GET
(
COLUMN_CREATE
(
1
,
0xC2A2
AS
CHAR
CHARACTER
SET
latin1
),
1
AS
CHAR
CHARACTER
SET
utf8
)
AS
a
;
SELECT
COLUMN_GET
(
COLUMN_CREATE
(
1
,
0xC2A2
AS
CHAR
CHARACTER
SET
utf8
),
1
AS
CHAR
CHARACTER
SET
utf8
)
AS
a
;
--
echo
#
--
echo
# end of 10.0 tests
--
echo
#
sql/item_strfunc.cc
View file @
a75ac82c
...
...
@@ -4448,6 +4448,8 @@ bool Item_func_dyncol_create::prepare_arguments(bool force_names_arg)
case
DYN_COL_DYNCOL
:
case
DYN_COL_STRING
:
res
=
args
[
valpos
]
->
val_str
(
&
tmp
);
if
(
res
&&
defs
[
i
].
cs
)
res
->
set_charset
(
defs
[
i
].
cs
);
if
(
res
&&
(
vals
[
i
].
x
.
string
.
value
.
str
=
sql_strmake
(
res
->
ptr
(),
res
->
length
())))
{
...
...
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