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
76e0a076
Commit
76e0a076
authored
Jun 14, 2007
by
holyfoot/hf@hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into mysql.com:/d2/hf/mrg/mysql-5.1-opt
parents
2372767b
20ad5150
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+9
-0
mysql-test/t/type_decimal.test
mysql-test/t/type_decimal.test
+14
-0
sql/item_func.cc
sql/item_func.cc
+7
-1
No files found.
mysql-test/r/type_decimal.result
View file @
76e0a076
...
...
@@ -790,3 +790,12 @@ Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00'
drop table t1;
CREATE TABLE t1 (
qty decimal(16,6) default NULL,
dps tinyint(3) unsigned default NULL
);
INSERT INTO t1 VALUES (1.1325,3);
SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
ROUND(qty,3) dps ROUND(qty,dps)
1.133 3 1.133
DROP TABLE t1;
mysql-test/t/type_decimal.test
View file @
76e0a076
...
...
@@ -394,3 +394,17 @@ create table t1 as
from
(
select
1
as
s
,
't'
as
t
union
select
null
,
null
)
as
sub1
;
select
group_concat
(
t
)
from
t1
group
by
week
(
date
)
/
10
;
drop
table
t1
;
#
# Bug#28980: ROUND(<dec expr>, <int col>) returned double values
#
CREATE
TABLE
t1
(
qty
decimal
(
16
,
6
)
default
NULL
,
dps
tinyint
(
3
)
unsigned
default
NULL
);
INSERT
INTO
t1
VALUES
(
1.1325
,
3
);
SELECT
ROUND
(
qty
,
3
),
dps
,
ROUND
(
qty
,
dps
)
FROM
t1
;
DROP
TABLE
t1
;
sql/item_func.cc
View file @
76e0a076
...
...
@@ -1954,6 +1954,12 @@ void Item_func_round::fix_length_and_dec()
{
max_length
=
args
[
0
]
->
max_length
;
decimals
=
args
[
0
]
->
decimals
;
if
(
args
[
0
]
->
result_type
()
==
DECIMAL_RESULT
)
{
max_length
++
;
hybrid_type
=
DECIMAL_RESULT
;
}
else
hybrid_type
=
REAL_RESULT
;
return
;
}
...
...
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