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
e072a647
Commit
e072a647
authored
Nov 17, 2014
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6865 Merge Bug#18935421 RPAD DIES WITH CERTAIN PADSTR INTPUTS..
parent
e7c356f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
mysql-test/r/ctype_utf16.result
mysql-test/r/ctype_utf16.result
+9
-0
mysql-test/t/ctype_utf16.test
mysql-test/t/ctype_utf16.test
+6
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+25
-0
No files found.
mysql-test/r/ctype_utf16.result
View file @
e072a647
...
...
@@ -1198,5 +1198,14 @@ a 512
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
#
# MDEV-6865 Merge Bug#18935421 RPAD DIES WITH CERTAIN PADSTR INTPUTS..
#
DO RPAD(_utf16 0x0061 COLLATE utf16_unicode_ci, 10000, 0x0061DE989999);
Warnings:
Warning 1300 Invalid utf16 character string: 'DE9899'
DO LPAD(_utf16 0x0061 COLLATE utf16_unicode_ci, 10000, 0x0061DE989999);
Warnings:
Warning 1300 Invalid utf16 character string: 'DE9899'
#
# End of 5.5 tests
#
mysql-test/t/ctype_utf16.test
View file @
e072a647
...
...
@@ -786,6 +786,12 @@ SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1;
## TODO: add tests for all engines
#
--
echo
#
--
echo
# MDEV-6865 Merge Bug#18935421 RPAD DIES WITH CERTAIN PADSTR INTPUTS..
--
echo
#
DO
RPAD
(
_utf16
0x0061
COLLATE
utf16_unicode_ci
,
10000
,
0x0061DE989999
);
DO
LPAD
(
_utf16
0x0061
COLLATE
utf16_unicode_ci
,
10000
,
0x0061DE989999
);
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
sql/item_strfunc.cc
View file @
e072a647
...
...
@@ -2721,6 +2721,19 @@ String *Item_func_rpad::val_str(String *str)
res
->
set_charset
(
&
my_charset_bin
);
rpad
->
set_charset
(
&
my_charset_bin
);
}
#if MARIADB_VERSION_ID < 1000000
/*
Well-formedness is handled on a higher level in 10.0,
no needs to check it here again.
*/
else
{
// This will chop off any trailing illegal characters from rpad.
String
*
well_formed_pad
=
args
[
2
]
->
check_well_formed_result
(
rpad
,
false
);
if
(
!
well_formed_pad
)
goto
err
;
}
#endif
if
(
count
<=
(
res_char_length
=
res
->
numchars
()))
{
// String to pad is big enough
...
...
@@ -2826,6 +2839,18 @@ String *Item_func_lpad::val_str(String *str)
res
->
set_charset
(
&
my_charset_bin
);
pad
->
set_charset
(
&
my_charset_bin
);
}
#if MARIADB_VERSION_ID < 1000000
/*
Well-formedness is handled on a higher level in 10.0,
no needs to check it here again.
*/
else
{
// This will chop off any trailing illegal characters from pad.
String
*
well_formed_pad
=
args
[
2
]
->
check_well_formed_result
(
pad
,
false
);
if
(
!
well_formed_pad
)
goto
err
;
}
#endif
res_char_length
=
res
->
numchars
();
...
...
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