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
c1d25e32
Commit
c1d25e32
authored
Sep 11, 2004
by
gluh@gluh.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #5513: FIND_IN_SET fails if set ends with a comma
parent
74336d59
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
mysql-test/r/func_set.result
mysql-test/r/func_set.result
+3
-0
mysql-test/t/func_set.test
mysql-test/t/func_set.test
+5
-0
sql/item_func.cc
sql/item_func.cc
+3
-2
No files found.
mysql-test/r/func_set.result
View file @
c1d25e32
...
...
@@ -64,3 +64,6 @@ find_in_set('a',binary 'A,B,C')
select find_in_set(binary 'a', 'A,B,C');
find_in_set(binary 'a', 'A,B,C')
0
select find_in_set('1','3,1,');
find_in_set('1','3,1,')
2
mysql-test/t/func_set.test
View file @
c1d25e32
...
...
@@ -47,3 +47,8 @@ select find_in_set(binary 'a',binary 'A,B,C');
select
find_in_set
(
'a'
,
binary
'A,B,C'
);
select
find_in_set
(
binary
'a'
,
'A,B,C'
);
#
# Bug5513:FIND_IN_SET fails if set ends with a comma
#
select
find_in_set
(
'1'
,
'3,1,'
);
sql/item_func.cc
View file @
c1d25e32
...
...
@@ -1455,10 +1455,11 @@ longlong Item_func_find_in_set::val_int()
{
const
char
*
substr_end
=
str_end
+
symbol_len
;
bool
is_last_item
=
(
substr_end
==
real_end
);
if
(
wc
==
(
my_wc_t
)
separator
||
is_last_item
)
bool
is_separator
=
(
wc
==
(
my_wc_t
)
separator
);
if
(
is_separator
||
is_last_item
)
{
position
++
;
if
(
is_last_item
)
if
(
is_last_item
&&
!
is_separator
)
str_end
=
substr_end
;
if
(
!
my_strnncoll
(
cs
,
(
const
uchar
*
)
str_begin
,
str_end
-
str_begin
,
...
...
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