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
cba6ff75
Commit
cba6ff75
authored
Mar 04, 2004
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed Bug #3051 "FLOOR returns invalid"
parent
c00ef445
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+6
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+8
-0
sql/item_func.cc
sql/item_func.cc
+2
-1
No files found.
mysql-test/r/func_math.result
View file @
cba6ff75
...
@@ -32,3 +32,9 @@ ASIN(0.8+0.2)
...
@@ -32,3 +32,9 @@ ASIN(0.8+0.2)
1.570796
1.570796
ASIN(1.2-0.2)
ASIN(1.2-0.2)
1.570796
1.570796
floor(log(4)/log(2))
2
floor(log(8)/log(2))
3
floor(log(16)/log(2))
4
mysql-test/t/func_math.test
View file @
cba6ff75
...
@@ -24,3 +24,11 @@ SELECT ACOS(0.2*5.0);
...
@@ -24,3 +24,11 @@ SELECT ACOS(0.2*5.0);
SELECT
ACOS
(
0.5
*
2.0
);
SELECT
ACOS
(
0.5
*
2.0
);
SELECT
ASIN
(
0.8
+
0.2
);
SELECT
ASIN
(
0.8
+
0.2
);
SELECT
ASIN
(
1.2
-
0.2
);
SELECT
ASIN
(
1.2
-
0.2
);
#
# Bug #3051 FLOOR returns invalid
#
select
floor
(
log
(
4
)
/
log
(
2
));
select
floor
(
log
(
8
)
/
log
(
2
));
select
floor
(
log
(
16
)
/
log
(
2
));
sql/item_func.cc
View file @
cba6ff75
...
@@ -572,7 +572,8 @@ longlong Item_func_ceiling::val_int()
...
@@ -572,7 +572,8 @@ longlong Item_func_ceiling::val_int()
longlong
Item_func_floor
::
val_int
()
longlong
Item_func_floor
::
val_int
()
{
{
double
value
=
args
[
0
]
->
val
();
// the volatile's for BUG #3051 to calm optimizer down (because of gcc's bug)
volatile
double
value
=
args
[
0
]
->
val
();
null_value
=
args
[
0
]
->
null_value
;
null_value
=
args
[
0
]
->
null_value
;
return
(
longlong
)
floor
(
value
);
return
(
longlong
)
floor
(
value
);
}
}
...
...
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