Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
11.4.0
-
None
Description
A discrepancy occurs when comparing the output of the COMPRESS function in MariaDB. In the original table t0, querying with COMPRESS(c0) > c1 returns a result as expected. However, after storing COMPRESS(c0) in a derived table t1, applying the equivalent condition on t1 yields no results, even though the data and conditions are identical.
Reproduce Steps:
-- Step 1: Create table t0 and insert data
|
CREATE TABLE t0 (c0 DATETIME, c1 VARCHAR(16), c2 VARCHAR(9)); |
INSERT INTO t0 (c0, c1, c2) VALUES ('2003-01-18 19:04:14', 'o4oFjkHVT8LcDfnY', 'djXhVwU7m'); |
|
-- Step 2: Query in the original table
|
MariaDB [test]> SELECT c2 FROM t0 WHERE ((COMPRESS(c0)) > c1); |
|
+-----------+ |
| c2 |
|
+-----------+ |
| djXhVwU7m |
|
+-----------+ |
1 row in set, 1 warning (0.012 sec) |
|
-- Step 3: Create derived table t1 with COMPRESS result
|
CREATE TABLE t1 AS (SELECT (COMPRESS(c0)) AS c0, c1 AS c1, c2 AS c2 FROM t0); |
|
-- Step 4: Apply equivalent comparison in derived table t1
|
MariaDB [test]> SELECT c2 FROM t1 WHERE ((c0) > c1); |
0 rows in set (0.007 sec) |
|
Expected Result:
Both queries should return consistent results.