Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a YEAR(2)); |
INSERT INTO t1 VALUES (0); |
SELECT a,NULLIF(a,2000),NULLIF(2001,a) FROM t1; |
returns
+------+----------------+----------------+
|
| a | NULLIF(a,2000) | NULLIF(2001,a) |
|
+------+----------------+----------------+
|
| 00 | NULL | 1 |
|
+------+----------------+----------------+
|
This is Ok that YEAR=00 is compared as equal to 2000, but the return value for NULLIF(2001,a) does not look Ok. The expected values is 2001, not 1.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Summary | NULLIF return unexpected result with a YEAR field | NULLIF returns unexpected result with a YEAR field |
Description |
{code:sq} DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a YEAR(2)); INSERT INTO t1 VALUES (0); SELECT a,NULLIF(a,2000),NULLIF(2001,a) FROM t1; {code} returns {noformat} +------+----------------+----------------+ | a | NULLIF(a,2000) | NULLIF(2001,a) | +------+----------------+----------------+ | 00 | NULL | 1 | +------+----------------+----------------+ {noformat} This is Ok that YEAR=00 is compared as equal to 2000, but the return value for NULLIF(2001,a) does not look Ok. The expected values is 2001, not 1. |
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a YEAR(2)); INSERT INTO t1 VALUES (0); SELECT a,NULLIF(a,2000),NULLIF(2001,a) FROM t1; {code} returns {noformat} +------+----------------+----------------+ | a | NULLIF(a,2000) | NULLIF(2001,a) | +------+----------------+----------------+ | 00 | NULL | 1 | +------+----------------+----------------+ {noformat} This is Ok that YEAR=00 is compared as equal to 2000, but the return value for NULLIF(2001,a) does not look Ok. The expected values is 2001, not 1. |
Component/s | OTHER [ 10125 ] | |
Fix Version/s | 10.1.2 [ 15801 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Component/s | Temporal Types [ 11000 ] | |
Component/s | OTHER [ 10125 ] |
Workflow | MariaDB v2 [ 58630 ] | MariaDB v3 [ 65527 ] |
Workflow | MariaDB v3 [ 65527 ] | MariaDB v4 [ 148495 ] |