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
d54359ff
Commit
d54359ff
authored
Nov 29, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addition to fix for bug #12956: cast make differ rounding.
- use rint() in some other val_int() methods as well.
parent
6cc4218f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
sql/field.cc
sql/field.cc
+2
-2
sql/item.h
sql/item.h
+2
-2
No files found.
sql/field.cc
View file @
d54359ff
...
...
@@ -3953,7 +3953,7 @@ longlong Field_float::val_int(void)
else
#endif
memcpy_fixed
((
byte
*
)
&
j
,
ptr
,
sizeof
(
j
));
return
(
(
longlong
)
j
);
return
(
longlong
)
rint
(
j
);
}
...
...
@@ -4241,7 +4241,7 @@ longlong Field_double::val_int(void)
else
#endif
doubleget
(
j
,
ptr
);
return
(
(
longlong
)
j
);
return
(
longlong
)
rint
(
j
);
}
...
...
sql/item.h
View file @
d54359ff
...
...
@@ -159,7 +159,7 @@ struct Hybrid_type_traits
{
val
->
real
/=
ulonglong2double
(
u
);
}
virtual
longlong
val_int
(
Hybrid_type
*
val
,
bool
unsigned_flag
)
const
{
return
(
longlong
)
val
->
real
;
}
{
return
(
longlong
)
rint
(
val
->
real
)
;
}
virtual
double
val_real
(
Hybrid_type
*
val
)
const
{
return
val
->
real
;
}
virtual
my_decimal
*
val_decimal
(
Hybrid_type
*
val
,
my_decimal
*
buf
)
const
;
virtual
String
*
val_str
(
Hybrid_type
*
val
,
String
*
buf
,
uint8
decimals
)
const
;
...
...
@@ -1341,7 +1341,7 @@ class Item_float :public Item_num
{
return
LONGLONG_MAX
;
}
return
(
longlong
)
(
value
+
(
value
>
0
?
0.5
:
-
0.5
)
);
return
(
longlong
)
rint
(
value
);
}
String
*
val_str
(
String
*
);
my_decimal
*
val_decimal
(
my_decimal
*
);
...
...
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