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
54520d97
Commit
54520d97
authored
Aug 24, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
automerged
parents
8f254c1b
510cacbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
21 deletions
+34
-21
sql/item_func.cc
sql/item_func.cc
+34
-21
No files found.
sql/item_func.cc
View file @
54520d97
...
@@ -1435,30 +1435,43 @@ longlong Item_func_find_in_set::val_int()
...
@@ -1435,30 +1435,43 @@ longlong Item_func_find_in_set::val_int()
int
diff
;
int
diff
;
if
((
diff
=
buffer
->
length
()
-
find
->
length
())
>=
0
)
if
((
diff
=
buffer
->
length
()
-
find
->
length
())
>=
0
)
{
{
const
char
*
f_pos
=
find
->
ptr
();
my_wc_t
wc
;
const
char
*
f_end
=
f_pos
+
find
->
length
();
CHARSET_INFO
*
cs
=
cmp_collation
.
collation
;
const
char
*
str
=
buffer
->
ptr
();
const
char
*
str_begin
=
buffer
->
ptr
();
const
char
*
end
=
str
+
diff
+
1
;
const
char
*
str_end
=
buffer
->
ptr
();
const
char
*
real_end
=
str
+
buffer
->
length
();
const
char
*
real_end
=
str_end
+
buffer
->
length
();
uint
position
=
1
;
const
uchar
*
find_str
=
(
const
uchar
*
)
find
->
ptr
();
do
uint
find_str_len
=
find
->
length
();
int
position
=
0
;
while
(
1
)
{
{
const
char
*
pos
=
f_pos
;
int
symbol_len
;
while
(
pos
!=
f_end
)
if
((
symbol_len
=
cs
->
cset
->
mb_wc
(
cs
,
&
wc
,
(
uchar
*
)
str_end
,
(
uchar
*
)
real_end
))
>
0
)
{
{
if
(
my_toupper
(
cmp_collation
.
collation
,
*
str
)
!=
const
char
*
substr_end
=
str_end
+
symbol_len
;
my_toupper
(
cmp_collation
.
collation
,
*
pos
))
bool
is_last_item
=
(
substr_end
==
real_end
);
goto
not_found
;
if
(
wc
==
(
my_wc_t
)
separator
||
is_last_item
)
str
++
;
{
pos
++
;
position
++
;
if
(
is_last_item
)
str_end
=
substr_end
;
if
(
!
my_strnncoll
(
cs
,
(
const
uchar
*
)
str_begin
,
str_end
-
str_begin
,
find_str
,
find_str_len
))
return
(
longlong
)
position
;
else
str_begin
=
substr_end
;
}
str_end
=
substr_end
;
}
}
if
(
str
==
real_end
||
str
[
0
]
==
separator
)
else
if
(
str_end
-
str_begin
==
0
&&
return
(
longlong
)
position
;
find_str_len
==
0
&&
not_found:
wc
==
(
my_wc_t
)
separator
)
while
(
str
<
end
&&
str
[
0
]
!=
separator
)
return
(
longlong
)
++
position
;
str
++
;
else
position
++
;
return
(
longlong
)
0
;
}
while
(
++
str
<=
end
);
}
}
}
return
0
;
return
0
;
}
}
...
...
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