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
65d0d45a
Commit
65d0d45a
authored
Jan 31, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some USE_MB have been removed.
parent
f845e66b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
31 deletions
+10
-31
sql/item_strfunc.cc
sql/item_strfunc.cc
+10
-31
No files found.
sql/item_strfunc.cc
View file @
65d0d45a
...
...
@@ -805,13 +805,8 @@ String *Item_func_insert::val_str(String *str)
if
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
args
[
2
]
->
null_value
||
args
[
3
]
->
null_value
)
goto
null
;
/* purecov: inspected */
#ifdef USE_MB
if
(
use_mb
(
res
->
charset
())
&&
!
args
[
0
]
->
binary
())
{
start
=
res
->
charpos
(
start
);
length
=
res
->
charpos
(
length
,
start
);
}
#endif
start
=
res
->
charpos
(
start
);
length
=
res
->
charpos
(
length
,
start
);
if
(
start
>
res
->
length
()
+
1
)
return
res
;
// Wrong param; skip insert
if
(
length
>
res
->
length
()
-
start
)
...
...
@@ -878,10 +873,7 @@ String *Item_func_left::val_str(String *str)
return
0
;
if
(
length
<=
0
)
return
&
empty_string
;
#ifdef USE_MB
if
(
use_mb
(
res
->
charset
())
&&
!
binary
())
length
=
res
->
charpos
(
length
);
#endif
length
=
res
->
charpos
(
length
);
if
(
res
->
length
()
>
(
ulong
)
length
)
{
// Safe even if const arg
if
(
!
res
->
alloced_length
())
...
...
@@ -927,19 +919,11 @@ String *Item_func_right::val_str(String *str)
return
&
empty_string
;
/* purecov: inspected */
if
(
res
->
length
()
<=
(
uint
)
length
)
return
res
;
/* purecov: inspected */
#ifdef USE_MB
if
(
use_mb
(
res
->
charset
())
&&
!
binary
())
{
uint
start
=
res
->
numchars
()
-
(
uint
)
length
;
if
(
start
<=
0
)
return
res
;
start
=
res
->
charpos
(
start
);
tmp_value
.
set
(
*
res
,
start
,
res
->
length
()
-
start
);
}
else
#endif
{
tmp_value
.
set
(
*
res
,(
res
->
length
()
-
(
uint
)
length
),(
uint
)
length
);
}
uint
start
=
res
->
numchars
()
-
(
uint
)
length
;
if
(
start
<=
0
)
return
res
;
start
=
res
->
charpos
(
start
);
tmp_value
.
set
(
*
res
,
start
,
res
->
length
()
-
start
);
return
&
tmp_value
;
}
...
...
@@ -960,13 +944,8 @@ String *Item_func_substr::val_str(String *str)
if
((
null_value
=
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
(
arg_count
==
3
&&
args
[
2
]
->
null_value
))))
return
0
;
/* purecov: inspected */
#ifdef USE_MB
if
(
use_mb
(
res
->
charset
())
&&
!
binary
())
{
start
=
res
->
charpos
(
start
);
length
=
res
->
charpos
(
length
,
start
);
}
#endif
start
=
res
->
charpos
(
start
);
length
=
res
->
charpos
(
length
,
start
);
if
(
start
<
0
||
(
uint
)
start
+
1
>
res
->
length
()
||
length
<=
0
)
return
&
empty_string
;
...
...
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