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
a70809c0
Commit
a70809c0
authored
Aug 17, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13555 Assertion `!item->null_value' failed in Type_handler::Item_send_str
parent
ff3cf749
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+14
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+12
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+4
-2
No files found.
mysql-test/r/func_str.result
View file @
a70809c0
...
...
@@ -4887,5 +4887,19 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select octet_length('a') AS `LENGTH('a')`,octet_length('a') AS `LENGTHB('a')`
#
# MDEV-13555 Assertion `!item->null_value' failed in Type_handler::Item_send_str
#
CREATE TABLE t1 (c VARCHAR(8));
INSERT INTO t1 VALUES (NULL),('bar');
SELECT LPAD( c, 0, '?' ) FROM t1;
LPAD( c, 0, '?' )
NULL
SELECT RPAD( c, 0, '?' ) FROM t1;
RPAD( c, 0, '?' )
NULL
DROP TABLE t1;
#
# End of 10.3 tests
#
mysql-test/t/func_str.test
View file @
a70809c0
...
...
@@ -1889,6 +1889,18 @@ DROP TABLE t1;
SELECT
LENGTHB
(
'a'
),
LENGTHB
(
_utf8
0xC39F
),
LENGTHB
(
123
),
LENGTH
(
null
);
EXPLAIN
EXTENDED
SELECT
LENGTH
(
'a'
),
LENGTHB
(
'a'
);
--
echo
#
--
echo
# MDEV-13555 Assertion `!item->null_value' failed in Type_handler::Item_send_str
--
echo
#
CREATE
TABLE
t1
(
c
VARCHAR
(
8
));
INSERT
INTO
t1
VALUES
(
NULL
),(
'bar'
);
SELECT
LPAD
(
c
,
0
,
'?'
)
FROM
t1
;
SELECT
RPAD
(
c
,
0
,
'?'
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.3 tests
--
echo
#
sql/item_strfunc.cc
View file @
a70809c0
...
...
@@ -3267,10 +3267,11 @@ String *Item_func_rpad::val_str(String *str)
((
count
<
0
)
&&
!
args
[
1
]
->
unsigned_flag
))
goto
err
;
null_value
=
0
;
if
(
count
==
0
)
return
make_empty_result
();
null_value
=
0
;
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Set here so that rest of code sees out-of-bound value as such. */
if
((
ulonglong
)
count
>
INT_MAX32
)
...
...
@@ -3358,10 +3359,11 @@ String *Item_func_lpad::val_str(String *str)
((
count
<
0
)
&&
!
args
[
1
]
->
unsigned_flag
))
goto
err
;
null_value
=
0
;
if
(
count
==
0
)
return
make_empty_result
();
null_value
=
0
;
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Set here so that rest of code sees out-of-bound value as such. */
if
((
ulonglong
)
count
>
INT_MAX32
)
...
...
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