[MDEV-13848] Wrong result (missing rows) with materialization=off, semijoin=off Created: 2017-09-19  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: not-11.0-sel


 Description   

--source include/have_innodb.inc
 
CREATE TABLE t1 (entityKey INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3);
 
CREATE TABLE t2 (entityKey INT, xhtmltext TEXT, FULLTEXT(xhtmltext)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,"silver"),(2,"gold"),(3,"gold");
 
SET optimizer_switch='materialization=off,semijoin=off';
 
SELECT t1.entityKey FROM t1 
WHERE t1.entityKey IN (
  SELECT t2.entityKey FROM t2 
  WHERE MATCH (t2.xhtmltext) AGAINST ('gold')
) 
ORDER BY t1.entityKey DESC;
 
# Cleanup
DROP TABLE t1, t2;

Actual result

+-----------+
| entityKey |
+-----------+
|         3 |
+-----------+
1 row in set (0.07 sec)

Expected result

+-----------+
| entityKey |
+-----------+
|         3 |
|         2 |
+-----------+
2 rows in set (0.09 sec)



 Comments   
Comment by Alice Sherepa [ 2022-12-02 ]

repetable on 10.3 (4e9206736c403206915c09db)-10.10, correct result on bb-11.0

Generated at Thu Feb 08 08:08:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.