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
a961b77c
Commit
a961b77c
authored
Apr 28, 2008
by
iggy@amd64.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge amd64.(none):/src/rel_clean_up/my50-rel_clean_up
into amd64.(none):/src/rel_clean_up/my51-rel_clean_up
parents
a975c7ef
3d0f5666
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+7
-0
mysql-test/t/type_decimal.test
mysql-test/t/type_decimal.test
+8
-0
sql/my_decimal.h
sql/my_decimal.h
+11
-2
No files found.
mysql-test/r/type_decimal.result
View file @
a961b77c
...
...
@@ -946,4 +946,11 @@ SELECT ROUND(20061108085411.000002);
ROUND(20061108085411.000002)
20061108085411
DROP TABLE t1, t2, t3, t4, t5, t6;
create table t1(`c` decimal(9,2));
insert into t1 values (300),(201.11);
select max(case 1 when 1 then c else null end) from t1 group by c;
max(case 1 when 1 then c else null end)
201.11
300.00
drop table t1;
End of 5.0 tests
mysql-test/t/type_decimal.test
View file @
a961b77c
...
...
@@ -521,4 +521,12 @@ SELECT ROUND(20061108085411.000002);
DROP
TABLE
t1
,
t2
,
t3
,
t4
,
t5
,
t6
;
#
# Bug#36023: Incorrect handling of zero length caused an assertion to fail.
#
create
table
t1
(
`c`
decimal
(
9
,
2
));
insert
into
t1
values
(
300
),(
201.11
);
select
max
(
case
1
when
1
then
c
else
null
end
)
from
t1
group
by
c
;
drop
table
t1
;
--
echo
End
of
5.0
tests
sql/my_decimal.h
View file @
a961b77c
...
...
@@ -169,14 +169,23 @@ inline int check_result_and_overflow(uint mask, int result, my_decimal *val)
inline
uint
my_decimal_length_to_precision
(
uint
length
,
uint
scale
,
bool
unsigned_flag
)
{
return
(
uint
)
(
length
-
(
scale
>
0
?
1
:
0
)
-
(
unsigned_flag
?
0
:
1
));
/* Precision can't be negative thus ignore unsigned_flag when length is 0. */
DBUG_ASSERT
(
length
||
!
scale
);
return
(
uint
)
(
length
-
(
scale
>
0
?
1
:
0
)
-
(
unsigned_flag
||
!
length
?
0
:
1
));
}
inline
uint32
my_decimal_precision_to_length
(
uint
precision
,
uint8
scale
,
bool
unsigned_flag
)
{
/*
When precision is 0 it means that original length was also 0. Thus
unsigned_flag is ignored in this case.
*/
DBUG_ASSERT
(
precision
||
!
scale
);
set_if_smaller
(
precision
,
DECIMAL_MAX_PRECISION
);
return
(
uint32
)(
precision
+
(
scale
>
0
?
1
:
0
)
+
(
unsigned_flag
?
0
:
1
));
return
(
uint32
)(
precision
+
(
scale
>
0
?
1
:
0
)
+
(
unsigned_flag
||
!
precision
?
0
:
1
));
}
inline
...
...
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