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
4155d093
Commit
4155d093
authored
Jun 10, 2016
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8402 Bug #77473 Truncated data with subquery & UTF8
parent
df144880
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
4 deletions
+119
-4
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+39
-0
mysql-test/r/ctype_utf8mb4.result
mysql-test/r/ctype_utf8mb4.result
+34
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+23
-0
mysql-test/t/ctype_utf8mb4.test
mysql-test/t/ctype_utf8mb4.test
+20
-0
sql/field.h
sql/field.h
+3
-4
No files found.
mysql-test/r/ctype_utf8.result
View file @
4155d093
...
...
@@ -5830,5 +5830,44 @@ OCTET_LENGTH(a) a
255 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
DROP TABLE t1;
#
# MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
#
#
SET NAMES utf8;
SELECT length(rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2)) AS data;
data
131072
SELECT length(data) AS len FROM (
SELECT rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2) AS data
) AS sub;
len
131072
SELECT length(rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2)) AS data;
data
131070
SELECT length(data) AS len FROM (
SELECT rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2) AS data
) AS sub;
len
131070
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36766) AS data) AS sub;
len
73532
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36767) AS data) AS sub;
len
73534
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36778) AS data) AS sub;
len
73556
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub;
len
131070
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub;
len
131072
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub;
len
131074
#
# End of 5.5 tests
#
mysql-test/r/ctype_utf8mb4.result
View file @
4155d093
...
...
@@ -2622,6 +2622,40 @@ OCTET_LENGTH(a) a
252 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎
DROP TABLE t1;
#
# MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
#
#
SET NAMES utf8mb4;
SELECT length(repeat(_utf8mb4 0xE29883, 21844)) AS data;
data
65532
SELECT length(data) AS len
FROM ( SELECT repeat(_utf8mb4 0xE29883, 21844) AS data ) AS sub;
len
65532
SELECT length(repeat(_utf8mb4 0xE29883, 21846)) AS data;
data
65538
SELECT length(data) AS len
FROM ( SELECT repeat(_utf8mb4 0xE29883, 21846) AS data ) AS sub;
len
65538
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21844) AS data ) AS sub;
len
65532
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21845) AS data ) AS sub;
len
65535
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21846) AS data ) AS sub;
len
65538
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65535) AS data ) AS sub;
len
196605
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub;
len
196608
#
# End of 5.5 tests
#
#
...
...
mysql-test/t/ctype_utf8.test
View file @
4155d093
...
...
@@ -1658,6 +1658,29 @@ ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8;
SELECT
OCTET_LENGTH
(
a
),
a
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
--
echo
#
--
echo
#
SET
NAMES
utf8
;
SELECT
length
(
rpad
(
_utf8
0xD0B1
,
65536
,
_utf8
0xD0B2
))
AS
data
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
rpad
(
_utf8
0xD0B1
,
65536
,
_utf8
0xD0B2
)
AS
data
)
AS
sub
;
SELECT
length
(
rpad
(
_utf8
0xD0B1
,
65535
,
_utf8
0xD0B2
))
AS
data
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
rpad
(
_utf8
0xD0B1
,
65535
,
_utf8
0xD0B2
)
AS
data
)
AS
sub
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'ä'
,
36766
)
AS
data
)
AS
sub
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'ä'
,
36767
)
AS
data
)
AS
sub
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'ä'
,
36778
)
AS
data
)
AS
sub
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'ä'
,
65535
)
AS
data
)
AS
sub
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'ä'
,
65536
)
AS
data
)
AS
sub
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'ä'
,
65537
)
AS
data
)
AS
sub
;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
mysql-test/t/ctype_utf8mb4.test
View file @
4155d093
...
...
@@ -1838,6 +1838,26 @@ SELECT OCTET_LENGTH(a),a FROM t1;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
--
echo
#
--
echo
#
SET
NAMES
utf8mb4
;
SELECT
length
(
repeat
(
_utf8mb4
0xE29883
,
21844
))
AS
data
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
repeat
(
_utf8mb4
0xE29883
,
21844
)
AS
data
)
AS
sub
;
SELECT
length
(
repeat
(
_utf8mb4
0xE29883
,
21846
))
AS
data
;
SELECT
length
(
data
)
AS
len
FROM
(
SELECT
repeat
(
_utf8mb4
0xE29883
,
21846
)
AS
data
)
AS
sub
;
SELECT
LENGTH
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'☃'
,
21844
)
AS
data
)
AS
sub
;
SELECT
LENGTH
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'☃'
,
21845
)
AS
data
)
AS
sub
;
SELECT
LENGTH
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'☃'
,
21846
)
AS
data
)
AS
sub
;
SELECT
LENGTH
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'☃'
,
65535
)
AS
data
)
AS
sub
;
SELECT
LENGTH
(
data
)
AS
len
FROM
(
SELECT
REPEAT
(
'☃'
,
65536
)
AS
data
)
AS
sub
;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
...
...
sql/field.h
View file @
4155d093
...
...
@@ -1854,10 +1854,9 @@ class Field_blob :public Field_longstr {
packlength
=
4
;
if
(
set_packlength
)
{
uint32
l_char_length
=
len_arg
/
cs
->
mbmaxlen
;
packlength
=
l_char_length
<=
255
?
1
:
l_char_length
<=
65535
?
2
:
l_char_length
<=
16777215
?
3
:
4
;
packlength
=
len_arg
<=
255
?
1
:
len_arg
<=
65535
?
2
:
len_arg
<=
16777215
?
3
:
4
;
}
}
Field_blob
(
uint32
packlength_arg
)
...
...
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