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
e5a0524f
Commit
e5a0524f
authored
Sep 14, 2004
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0
into gw.mysql.r18.ru:/usr/home/ram/work/4.0.b5498
parents
7478cc04
2488b827
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+6
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+7
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+3
-3
No files found.
mysql-test/r/func_str.result
View file @
e5a0524f
...
...
@@ -282,3 +282,9 @@ NULL NULL 1 1 n
two 'two' 0 0 'two'
four 'four' 0 0 'four'
drop table t1;
select trim(trailing 'foo' from 'foo');
trim(trailing 'foo' from 'foo')
select trim(leading 'foo' from 'foo');
trim(leading 'foo' from 'foo')
mysql-test/t/func_str.test
View file @
e5a0524f
...
...
@@ -172,3 +172,10 @@ create table t1(a char(4));
insert
into
t1
values
(
'one'
),(
NULL
),(
'two'
),(
'four'
);
select
a
,
quote
(
a
),
isnull
(
quote
(
a
)),
quote
(
a
)
is
null
,
ifnull
(
quote
(
a
),
'n'
)
from
t1
;
drop
table
t1
;
#
# Bug #5498: TRIM fails with LEADING or TRAILING if remstr = str
#
select
trim
(
trailing
'foo'
from
'foo'
);
select
trim
(
leading
'foo'
from
'foo'
);
sql/item_strfunc.cc
View file @
e5a0524f
...
...
@@ -1135,7 +1135,7 @@ String *Item_func_ltrim::val_str(String *str)
{
const
char
*
r_ptr
=
remove_str
->
ptr
();
end
-=
remove_length
;
while
(
ptr
<
end
&&
!
memcmp
(
ptr
,
r_ptr
,
remove_length
))
while
(
ptr
<
=
end
&&
!
memcmp
(
ptr
,
r_ptr
,
remove_length
))
ptr
+=
remove_length
;
end
+=
remove_length
;
}
...
...
@@ -1206,8 +1206,8 @@ String *Item_func_rtrim::val_str(String *str)
else
#endif
/* USE_MB */
{
while
(
ptr
+
remove_length
<
end
&&
!
memcmp
(
end
-
remove_length
,
r_ptr
,
remove_length
))
while
(
ptr
+
remove_length
<
=
end
&&
!
memcmp
(
end
-
remove_length
,
r_ptr
,
remove_length
))
end
-=
remove_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