mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge remote-tracking branch 'origin/10.1' into 10.2
This commit is contained in:
@ -1015,6 +1015,24 @@ SELECT -9223372036854775808 MOD -9223372036854775808;
|
|||||||
-9223372036854775808 MOD -9223372036854775808
|
-9223372036854775808 MOD -9223372036854775808
|
||||||
0
|
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
|
# 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);
|
CREATE TABLE t44 (d1 decimal(38,0) DEFAULT NULL);
|
||||||
|
@ -715,6 +715,18 @@ SELECT 9223372036854775808 MOD -9223372036854775808;
|
|||||||
SELECT -9223372036854775808 MOD 9223372036854775808;
|
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 #
|
||||||
--echo # MDEV-22503 MDB limits DECIMAL column precision to 16 doing CTAS with floor/ceil over DECIMAL(X,Y) where X > 16
|
--echo # MDEV-22503 MDB limits DECIMAL column precision to 16 doing CTAS with floor/ceil over DECIMAL(X,Y) where X > 16
|
||||||
|
@ -2512,6 +2512,8 @@ bool Item_func_round::fix_length_and_dec()
|
|||||||
|
|
||||||
precision-= decimals_delta - length_increase;
|
precision-= decimals_delta - length_increase;
|
||||||
decimals= MY_MIN(decimals_to_set, DECIMAL_MAX_SCALE);
|
decimals= MY_MIN(decimals_to_set, DECIMAL_MAX_SCALE);
|
||||||
|
if (!precision)
|
||||||
|
precision= 1; // DECIMAL(0,0) -> DECIMAL(1,0)
|
||||||
max_length= my_decimal_precision_to_length_no_truncation(precision,
|
max_length= my_decimal_precision_to_length_no_truncation(precision,
|
||||||
decimals,
|
decimals,
|
||||||
unsigned_flag);
|
unsigned_flag);
|
||||||
|
Reference in New Issue
Block a user