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
45b90d45
Commit
45b90d45
authored
Mar 05, 2005
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.8915
parents
c2482083
d3ee99ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
16 deletions
+48
-16
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+8
-2
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+2
-0
sql/item_func.cc
sql/item_func.cc
+38
-14
No files found.
mysql-test/r/type_newdecimal.result
View file @
45b90d45
...
...
@@ -733,6 +733,9 @@ abs(9999999999999999999999)
select abs(-9999999999999999999999);
abs(-9999999999999999999999)
9999999999999999999999
select ceiling(999999999999999999);
ceiling(999999999999999999)
999999999999999999
select ceiling(99999999999999999999);
ceiling(99999999999999999999)
99999999999999999999
...
...
@@ -741,13 +744,16 @@ ceiling(9.9999999999999999999)
10
select ceiling(-9.9999999999999999999);
ceiling(-9.9999999999999999999)
-10
-9
select floor(999999999999999999);
floor(999999999999999999)
999999999999999999
select floor(9999999999999999999999);
floor(9999999999999999999999)
9999999999999999999999
select floor(9.999999999999999999999);
floor(9.999999999999999999999)
10
9
select floor(-9.999999999999999999999);
floor(-9.999999999999999999999)
-10
...
...
mysql-test/t/type_newdecimal.test
View file @
45b90d45
...
...
@@ -601,6 +601,7 @@ select abs(9999999999999999999999);
select
abs
(
-
9999999999999999999999
);
#-- should return 9999999999999999999999
#
select
ceiling
(
999999999999999999
);
select
ceiling
(
99999999999999999999
);
#-- should return 99999999999999999999
#
...
...
@@ -610,6 +611,7 @@ select ceiling(9.9999999999999999999);
select
ceiling
(
-
9.9999999999999999999
);
#-- should return 9
#
select
floor
(
999999999999999999
);
select
floor
(
9999999999999999999999
);
#-- should return 9999999999999999999999
#
...
...
sql/item_func.cc
View file @
45b90d45
...
...
@@ -1629,13 +1629,25 @@ void Item_func_int_val::find_num_type()
longlong
Item_func_ceiling
::
int_op
()
{
/*
the volatile's for BUG #3051 to calm optimizer down (because of gcc's
bug)
*/
volatile
double
value
=
args
[
0
]
->
val_real
();
null_value
=
args
[
0
]
->
null_value
;
return
(
longlong
)
ceil
(
value
);
longlong
result
;
switch
(
args
[
0
]
->
result_type
())
{
case
INT_RESULT
:
result
=
args
[
0
]
->
val_int
();
null_value
=
args
[
0
]
->
null_value
;
break
;
case
DECIMAL_RESULT
:
{
my_decimal
dec_buf
,
*
dec
;
if
((
dec
=
Item_func_ceiling
::
decimal_op
(
&
dec_buf
)))
my_decimal2int
(
E_DEC_FATAL_ERROR
,
dec
,
unsigned_flag
,
&
result
);
else
result
=
0
;
break
;
}
default:
result
=
(
longlong
)
Item_func_ceiling
::
real_op
();
};
return
result
;
}
...
...
@@ -1664,13 +1676,25 @@ my_decimal *Item_func_ceiling::decimal_op(my_decimal *decimal_value)
longlong
Item_func_floor
::
int_op
()
{
/*
the volatile's for BUG #3051 to calm optimizer down (because of gcc's
bug)
*/
volatile
double
value
=
args
[
0
]
->
val_real
();
null_value
=
args
[
0
]
->
null_value
;
return
(
longlong
)
floor
(
value
);
longlong
result
;
switch
(
args
[
0
]
->
result_type
())
{
case
INT_RESULT
:
result
=
args
[
0
]
->
val_int
();
null_value
=
args
[
0
]
->
null_value
;
break
;
case
DECIMAL_RESULT
:
{
my_decimal
dec_buf
,
*
dec
;
if
((
dec
=
Item_func_floor
::
decimal_op
(
&
dec_buf
)))
my_decimal2int
(
E_DEC_FATAL_ERROR
,
dec
,
unsigned_flag
,
&
result
);
else
result
=
0
;
break
;
}
default:
result
=
(
longlong
)
Item_func_floor
::
real_op
();
};
return
result
;
}
...
...
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