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.
A query that should have returned an empty set actually returned 1.
I executed this query in DBMSs such as TiDB, and the result returned was an empty set.
Expected results:
Empty set
|
Actual Results:
+---+
|
| 1 |
|
+---+
|
| 1 |
|
+---+
|
1 row in set (0.00 sec)
|
How to repeat:
-- create table
|
DROP TABLE IF EXISTS `t0`; |
DROP TABLE IF EXISTS `t1`; |
CREATE TABLE t0 (c0 DECIMAL(10,0) UNSIGNED NOT NULL, c1 TINYTEXT); |
INSERT INTO t0 VALUES (1, '0.7387026232049367'); |
CREATE TABLE t1 ( c0 DECIMAL(10,0) UNSIGNED); |
INSERT INTO t1 VALUES(0); |
 |
-- query, expect:Empty set, actual:{1}
|
SELECT
|
1
|
FROM `t1` AS ref_0 |
INNER JOIN `t0` AS ref_1 |
ON TRUE |
WHERE ref_1.c1 >= JSON_UNQUOTE( |
JSON_EXTRACT(
|
JSON_OBJECT(
|
'k', |
JSON_SET(
|
JSON_OBJECT('k', ref_0.c0), |
'$.k', |
ref_0.c0
|
)
|
),
|
'$.k' |
)
|
)
|
ORDER BY c1 ASC; |