Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
-
None
Description
CREATE OR REPLACE TABLE t1 (a date); |
CREATE OR REPLACE TABLE t2 AS SELECT FLOOR(a), CEIL(a),ROUND(a),TRUNCATE(a,0) FROM t1; |
+---------------+--------------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+---------------+--------------+------+-----+---------+-------+
|
| FLOOR(a) | bigint(12) | YES | | NULL | |
|
| CEIL(a) | bigint(12) | YES | | NULL | |
|
| ROUND(a) | double(17,0) | YES | | NULL | |
|
| TRUNCATE(a,0) | double(17,0) | YES | | NULL | |
|
+---------------+--------------+------+-----+---------+-------+
|
A date value has 8 digits in numeric format: YYYYMMDD.
- INT(9) should be enough for ROUND() with a negative argument (to be checked in a separate MDEV)
- INT(8) should be enough for ROUND() with a non-negative argument
- INT(8) should be enough for all other functions
Attachments
Issue Links
- relates to
-
MDEV-23032 FLOOR()/CEIL() incorrectly calculate the precision of a DECIMAL(M,D) column.
-
- Closed
-
-
MDEV-23388 Assertion `args[0]->decimals == 0' failed in Item_func_round::fix_arg_int
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
{code:sql}
CREATE OR REPLACE TABLE t1 (a date); CREATE OR REPLACE TABLE t2 AS SELECT FLOOR(a), CEIL(a),ROUND(a),TRUNCATE(a,0) FROM t1; {code} {noformat} +---------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+-------+ | FLOOR(a) | bigint(12) | YES | | NULL | | | CEIL(a) | bigint(12) | YES | | NULL | | | ROUND(a) | double(17,0) | YES | | NULL | | | TRUNCATE(a,0) | double(17,0) | YES | | NULL | | +---------------+--------------+------+-----+---------+-------+ {noformat} A date value has 8 digits in numeric format: YYYYMMDD. - INT(9) should be enough for ROUND() with a negative argument - INT(8) should be enough for ROUND() with a non-negative argument - INT(8) should be enough for all other functions |
{code:sql}
CREATE OR REPLACE TABLE t1 (a date); CREATE OR REPLACE TABLE t2 AS SELECT FLOOR(a), CEIL(a),ROUND(a),TRUNCATE(a,0) FROM t1; {code} {noformat} +---------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+-------+ | FLOOR(a) | bigint(12) | YES | | NULL | | | CEIL(a) | bigint(12) | YES | | NULL | | | ROUND(a) | double(17,0) | YES | | NULL | | | TRUNCATE(a,0) | double(17,0) | YES | | NULL | | +---------------+--------------+------+-----+---------+-------+ {noformat} A date value has 8 digits in numeric format: YYYYMMDD. - INT(9) should be enough for ROUND() with a negative argument (to be checked in a separate MDEV) - INT(8) should be enough for ROUND() with a non-negative argument - INT(8) should be enough for all other functions |
Status | Open [ 1 ] | In Progress [ 3 ] |
issue.field.resolutiondate | 2020-07-31 14:08:20.0 | 2020-07-31 14:08:20.057 |
Fix Version/s | 10.4.14 [ 24305 ] | |
Fix Version/s | 10.5.5 [ 24423 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Link |
This issue relates to |
Link |
This issue relates to |
Workflow | MariaDB v3 [ 111848 ] | MariaDB v4 [ 158175 ] |