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
1786a388
Commit
1786a388
authored
Aug 24, 2004
by
gluh@gluh.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #4340: find_in_set is case insensitive even on binary operators(2nd version)
parent
7bfc78f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
5 deletions
+36
-5
mysql-test/r/func_set.result
mysql-test/r/func_set.result
+9
-0
mysql-test/t/func_set.test
mysql-test/t/func_set.test
+8
-0
sql/item_func.cc
sql/item_func.cc
+19
-5
No files found.
mysql-test/r/func_set.result
View file @
1786a388
...
...
@@ -28,3 +28,12 @@ find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc")
select interval(null, 1, 10, 100);
interval(null, 1, 10, 100)
-1
select find_in_set(binary 'a',binary 'A,B,C');
find_in_set(binary 'a',binary 'A,B,C')
0
select find_in_set('a',binary 'A,B,C');
find_in_set('a',binary 'A,B,C')
0
select find_in_set(binary 'a', 'A,B,C');
find_in_set(binary 'a', 'A,B,C')
0
mysql-test/t/func_set.test
View file @
1786a388
...
...
@@ -16,3 +16,11 @@ select elt(2,1),field(NULL,"a","b","c");
select
find_in_set
(
""
,
"a,b,c"
),
find_in_set
(
""
,
"a,b,c,"
),
find_in_set
(
""
,
",a,b,c"
);
select
find_in_set
(
"abc"
,
"abc"
),
find_in_set
(
"ab"
,
"abc"
),
find_in_set
(
"abcd"
,
"abc"
);
select
interval
(
null
,
1
,
10
,
100
);
#
# Bug4340: find_in_set is case insensitive even on binary operators
#
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'
);
sql/item_func.cc
View file @
1786a388
...
...
@@ -1071,6 +1071,7 @@ static const char separator=',';
longlong
Item_func_find_in_set
::
val_int
()
{
bool
binary_cmp
=
args
[
0
]
->
binary
||
args
[
1
]
->
binary
;
if
(
enum_value
)
{
ulonglong
tmp
=
(
ulonglong
)
args
[
1
]
->
val_int
();
...
...
@@ -1103,12 +1104,25 @@ longlong Item_func_find_in_set::val_int()
do
{
const
char
*
pos
=
f_pos
;
while
(
pos
!=
f_end
)
if
(
binary_cmp
)
{
if
(
toupper
(
*
str
)
!=
toupper
(
*
pos
))
goto
not_found
;
str
++
;
pos
++
;
while
(
pos
!=
f_end
)
{
if
(
*
str
!=
*
pos
)
goto
not_found
;
str
++
;
pos
++
;
}
}
else
{
while
(
pos
!=
f_end
)
{
if
(
toupper
(
*
str
)
!=
toupper
(
*
pos
))
goto
not_found
;
str
++
;
pos
++
;
}
}
if
(
str
==
real_end
||
str
[
0
]
==
separator
)
return
(
longlong
)
position
;
...
...
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