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
f7cf6099
Commit
f7cf6099
authored
May 14, 2020
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/10.2' into 10.3
parents
ef65c39a
4dc690dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
mysql-test/main/func_math.result
mysql-test/main/func_math.result
+18
-0
mysql-test/main/func_math.test
mysql-test/main/func_math.test
+12
-0
sql/item_func.cc
sql/item_func.cc
+2
-0
No files found.
mysql-test/main/func_math.result
View file @
f7cf6099
...
...
@@ -1015,6 +1015,24 @@ SELECT -9223372036854775808 MOD -9223372036854775808;
-9223372036854775808 MOD -9223372036854775808
0
#
# MDEV-22502 MDB crashes in CREATE TABLE AS SELECT when the precision of returning type = 0
#
CREATE TABLE t1 (d decimal(5,5));
INSERT INTO t1 VALUES (0.55555);
SELECT TRUNCATE(d,0) FROM t1;
TRUNCATE(d,0)
0
CREATE TABLE t2 AS SELECT TRUNCATE(d,0) FROM t1;
SELECT * FROM t2;
TRUNCATE(d,0)
0
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`TRUNCATE(d,0)` decimal(1,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
#
# MDEV-22503 MDB limits DECIMAL column precision to 16 doing CTAS with floor/ceil over DECIMAL(X,Y) where X > 16
#
CREATE TABLE t44 (d1 decimal(38,0) DEFAULT NULL);
...
...
mysql-test/main/func_math.test
View file @
f7cf6099
...
...
@@ -715,6 +715,18 @@ SELECT 9223372036854775808 MOD -9223372036854775808;
SELECT
-
9223372036854775808
MOD
9223372036854775808
;
SELECT
-
9223372036854775808
MOD
-
9223372036854775808
;
--
echo
#
--
echo
# MDEV-22502 MDB crashes in CREATE TABLE AS SELECT when the precision of returning type = 0
--
echo
#
CREATE
TABLE
t1
(
d
decimal
(
5
,
5
));
INSERT
INTO
t1
VALUES
(
0.55555
);
SELECT
TRUNCATE
(
d
,
0
)
FROM
t1
;
CREATE
TABLE
t2
AS
SELECT
TRUNCATE
(
d
,
0
)
FROM
t1
;
SELECT
*
FROM
t2
;
SHOW
CREATE
TABLE
t2
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# MDEV-22503 MDB limits DECIMAL column precision to 16 doing CTAS with floor/ceil over DECIMAL(X,Y) where X > 16
...
...
sql/item_func.cc
View file @
f7cf6099
...
...
@@ -2433,6 +2433,8 @@ void Item_func_round::fix_length_and_dec_decimal(uint decimals_to_set)
set_handler
(
&
type_handler_newdecimal
);
unsigned_flag
=
args
[
0
]
->
unsigned_flag
;
decimals
=
decimals_to_set
;
if
(
!
precision
)
precision
=
1
;
// DECIMAL(0,0) -> DECIMAL(1,0)
max_length
=
my_decimal_precision_to_length_no_truncation
(
precision
,
decimals
,
unsigned_flag
);
...
...
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