Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
12.3.3
-
None
-
Not for Release Notes
Description
Summary
MariaDB 12.3.3 returns different results for two semantically equivalent
inner joins when STRAIGHT_JOIN is used.
This may be related to MDEV-36249.
How to reproduce
DROP DATABASE IF EXISTS mariadb_srs_reduced; |
CREATE DATABASE mariadb_srs_reduced CHARACTER SET utf8mb4; |
USE mariadb_srs_reduced; |
|
|
CREATE TABLE t0 ( |
c0 REAL SIGNED NOT NULL |
) ENGINE=MyISAM;
|
|
|
CREATE OR REPLACE TABLE t1 ( |
c0 CHAR(100) UNIQUE PRIMARY KEY |
) ENGINE=InnoDB;
|
|
|
INSERT INTO t1 VALUES ('E|'); |
INSERT INTO t0 VALUES (-1120782647); |
|
|
SELECT t1.c0 |
FROM t1 |
INNER JOIN t0 ON TRUE |
WHERE t0.c0 IN (t1.c0, (t0.c0 ^ '')); |
|
|
SELECT ALL t1.c0 |
FROM t1 |
STRAIGHT_JOIN t0 ON TRUE |
WHERE t0.c0 IN (t1.c0, (t0.c0 ^ '')); |
Actual result
The INNER JOIN query returns 1 row:
E|
|
The STRAIGHT_JOIN query returns 0 rows.
Observed cardinalities:
INNER JOIN: 1
|
STRAIGHT_JOIN: 0
|
The result is stable across repeated executions.
Expected result
Both queries should return the same result.
STRAIGHT_JOIN can constrain the join order, but changing the join order of
these inner joins must not change the result of the query.
Additional information
The predicate contains a mixed REAL/CHAR IN expression and a bitwise XOR
expression:
t0.c0 IN (t1.c0, (t0.c0 ^ '')) |
Possibly related to MDEV-36249.
Attachments
Issue Links
- duplicates
-
MDEV-36249 Equivalent straight-join queries return different results
-
- Confirmed
-