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
bb805867
Commit
bb805867
authored
Dec 09, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More use of new string->number conversion routines
parent
8fda0532
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
19 deletions
+7
-19
sql/field.cc
sql/field.cc
+6
-18
sql/item.cc
sql/item.cc
+1
-1
No files found.
sql/field.cc
View file @
bb805867
...
...
@@ -4786,16 +4786,10 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
if
(
length
<
6
)
// Can't be more than 99999 enums
{
/* This is for reading numbers with LOAD DATA INFILE */
char
buff
[
7
],
*
end
;
const
char
*
conv
=
from
;
if
(
from
[
length
])
{
strmake
(
buff
,
from
,
length
);
conv
=
buff
;
}
char
*
end
;
my_errno
=
0
;
tmp
=
(
uint
)
strtoul
(
conv
,
&
end
,
10
);
if
(
my_errno
||
end
!=
conv
+
length
||
tmp
>
typelib
->
count
)
tmp
=
(
uint
)
my_strntoul
(
cs
,
from
,
length
,
&
end
,
10
);
if
(
my_errno
||
end
!=
from
+
length
||
tmp
>
typelib
->
count
)
{
tmp
=
0
;
current_thd
->
cuted_fields
++
;
...
...
@@ -4990,16 +4984,10 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
if
(
!
tmp
&&
length
&&
length
<
22
)
{
/* This is for reading numbers with LOAD DATA INFILE */
char
buff
[
22
],
*
end
;
const
char
*
conv
=
from
;
if
(
from
[
length
])
{
strmake
(
buff
,
from
,
length
);
conv
=
buff
;
}
char
*
end
;
my_errno
=
0
;
tmp
=
strtoull
(
conv
,
&
end
,
10
);
if
(
my_errno
||
end
!=
conv
+
length
||
tmp
=
my_strntoull
(
cs
,
from
,
length
,
&
end
,
10
);
if
(
my_errno
||
end
!=
from
+
length
||
tmp
>
(
ulonglong
)
(((
longlong
)
1
<<
typelib
->
count
)
-
(
longlong
)
1
))
{
tmp
=
0
;
...
...
sql/item.cc
View file @
bb805867
...
...
@@ -395,7 +395,7 @@ longlong Item_param::val_int()
{
switch
(
item_result_type
)
{
case
STRING_RESULT
:
return
strtoll
(
str_value
.
ptr
(),(
char
**
)
0
,
10
);
return
my_strntoll
(
str_value
.
charset
(),
str_value
.
ptr
(),
str_value
.
length
(),(
char
**
)
0
,
10
);
case
REAL_RESULT
:
return
(
longlong
)
(
real_value
+
(
real_value
>
0
?
0.5
:
-
0.5
));
default:
...
...
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