Details
-
Bug
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
12.2.2
-
None
-
None
-
Docker: mariadb:12.2.2
Server version: 12.2.2-MariaDB-ubu2404
Source revision: d26a6f44c1f2119377e79a9540886c6d8c01472f
Description
Hi, I found a logic bug in MariaDB 12.2.2.
These two queries are equivalent, yet they yield different execution results.
How to repeat:
-- create table
|
DROP TABLE IF EXISTS t0; |
CREATE TABLE t0 ( c0 float DEFAULT NULL ); |
INSERT INTO t0 VALUES (1657020000); |
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 ( c0 mediumtext COMMENT 'asdf', c1 varchar(500) DEFAULT NULL ); |
INSERT INTO t1 VALUES ('-1254578240','664505778'); |
|
|
|
|
-- query1, result:{1657020032, -1254578240}
|
SELECT COALESCE(t1.c0, t1.c0) AS c1 FROM t0 AS t1 UNION SELECT COALESCE(t2.c0, t2.c0) AS c1 FROM t1 AS t2; |
|
|
-- query 2, expected result:{1657020032, -1254578240}, actual result:{1657020000, -1254578240}
|
SELECT c1 FROM ( |
SELECT c0 AS c1 FROM t0 |
INTERSECT ALL |
SELECT c0 AS c1 FROM t0 |
) AS t_bug |
UNION
|
SELECT c0 FROM t1; |