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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
2bce5e57
Commit
2bce5e57
authored
Jan 31, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql_string.cc:
Use of new CHARSET_INFO function sql/sql_string.cc: Use of new CHARSET_INFO function
parent
a6438797
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
60 deletions
+4
-60
sql/sql_string.cc
sql/sql_string.cc
+4
-60
No files found.
sql/sql_string.cc
View file @
2bce5e57
...
...
@@ -573,66 +573,10 @@ void String::qs_append(const char &c)
int
sortcmp
(
const
String
*
x
,
const
String
*
y
)
{
const
char
*
s
=
x
->
ptr
();
const
char
*
t
=
y
->
ptr
();
uint32
x_len
=
x
->
length
(),
y_len
=
y
->
length
(),
len
=
min
(
x_len
,
y_len
);
if
(
use_strnxfrm
(
x
->
str_charset
))
{
#ifndef CMP_ENDSPACE
while
(
x_len
&&
my_isspace
(
x
->
str_charset
,
s
[
x_len
-
1
]))
x_len
--
;
while
(
y_len
&&
my_isspace
(
x
->
str_charset
,
t
[
y_len
-
1
]))
y_len
--
;
#endif
return
my_strnncoll
(
x
->
str_charset
,
(
unsigned
char
*
)
s
,
x_len
,(
unsigned
char
*
)
t
,
y_len
);
}
else
{
x_len
-=
len
;
// For easy end space test
y_len
-=
len
;
if
(
x
->
str_charset
->
sort_order
)
{
while
(
len
--
)
{
if
(
x
->
str_charset
->
sort_order
[(
uchar
)
*
s
++
]
!=
x
->
str_charset
->
sort_order
[(
uchar
)
*
t
++
])
return
((
int
)
x
->
str_charset
->
sort_order
[(
uchar
)
s
[
-
1
]]
-
(
int
)
x
->
str_charset
->
sort_order
[(
uchar
)
t
[
-
1
]]);
}
}
else
{
while
(
len
--
)
{
if
(
*
s
++
!=
*
t
++
)
return
((
int
)
s
[
-
1
]
-
(
int
)
t
[
-
1
]);
}
}
#ifndef CMP_ENDSPACE
/* Don't compare end space in strings */
{
if
(
y_len
)
{
const
char
*
end
=
t
+
y_len
;
for
(;
t
!=
end
;
t
++
)
if
(
!
my_isspace
(
x
->
str_charset
,
*
t
))
return
-
1
;
}
else
{
const
char
*
end
=
s
+
x_len
;
for
(;
s
!=
end
;
s
++
)
if
(
!
my_isspace
(
x
->
str_charset
,
*
s
))
return
1
;
}
return
0
;
}
#else
return
(
int
)
(
x_len
-
y_len
);
#endif
/* CMP_ENDSPACE */
}
CHARSET_INFO
*
cs
=
x
->
str_charset
;
return
cs
->
strnncollsp
(
cs
,
(
unsigned
char
*
)
x
->
ptr
(),
x
->
length
(),
(
unsigned
char
*
)
y
->
ptr
(),
y
->
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