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
52fb60da
Commit
52fb60da
authored
Mar 09, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B26281-5.0-opt
parents
e68df7a1
c7de22a1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+12
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+8
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+5
-5
No files found.
mysql-test/r/func_str.result
View file @
52fb60da
...
...
@@ -1960,4 +1960,16 @@ NULL
SELECT UNHEX('G') IS NULL;
UNHEX('G') IS NULL
1
SELECT INSERT('abc', 3, 3, '1234');
INSERT('abc', 3, 3, '1234')
ab1234
SELECT INSERT('abc', 4, 3, '1234');
INSERT('abc', 4, 3, '1234')
abc1234
SELECT INSERT('abc', 5, 3, '1234');
INSERT('abc', 5, 3, '1234')
abc
SELECT INSERT('abc', 6, 3, '1234');
INSERT('abc', 6, 3, '1234')
abc
End of 5.0 tests
mysql-test/t/func_str.test
View file @
52fb60da
...
...
@@ -1008,7 +1008,6 @@ select repeat('a', cast(2 as unsigned int));
select
rpad
(
'abc'
,
cast
(
5
as
unsigned
integer
),
'x'
);
select
lpad
(
'abc'
,
cast
(
5
as
unsigned
integer
),
'x'
);
#
# Bug #25197 :repeat function returns null when using table field directly as count
#
...
...
@@ -1036,4 +1035,12 @@ DROP TABLE t1;
SELECT
UNHEX
(
'G'
);
SELECT
UNHEX
(
'G'
)
IS
NULL
;
#
# Bug #26281: INSERT() function mishandles NUL on boundary condition
#
SELECT
INSERT
(
'abc'
,
3
,
3
,
'1234'
);
SELECT
INSERT
(
'abc'
,
4
,
3
,
'1234'
);
SELECT
INSERT
(
'abc'
,
5
,
3
,
'1234'
);
SELECT
INSERT
(
'abc'
,
6
,
3
,
'1234'
);
--
echo
End
of
5.0
tests
sql/item_strfunc.cc
View file @
52fb60da
...
...
@@ -967,18 +967,18 @@ String *Item_func_insert::val_str(String *str)
args
[
3
]
->
null_value
)
goto
null
;
/* purecov: inspected */
if
((
start
<
0
)
||
(
start
>
res
->
length
()
+
1
))
if
((
start
<
0
)
||
(
start
>
res
->
length
()))
return
res
;
// Wrong param; skip insert
if
((
length
<
0
)
||
(
length
>
res
->
length
()
+
1
))
length
=
res
->
length
()
+
1
;
if
((
length
<
0
)
||
(
length
>
res
->
length
()))
length
=
res
->
length
();
/* start and length are now sufficiently valid to pass to charpos function */
start
=
res
->
charpos
((
int
)
start
);
length
=
res
->
charpos
((
int
)
length
,
(
uint32
)
start
);
/* Re-testing with corrected params */
if
(
start
>
res
->
length
()
+
1
)
return
res
;
// Wrong param; skip insert
if
(
start
>
res
->
length
())
return
res
;
/* purecov: inspected */
// Wrong param; skip insert
if
(
length
>
res
->
length
()
-
start
)
length
=
res
->
length
()
-
start
;
...
...
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