Bug #119814 drop index can lead to incorrect results

Submitted: 31 Jan 4:11 Modified: 31 Jan 20:58
Reporter: fan liu Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0.44 OS:Any
Assigned to: CPU Architecture:Any

[31 Jan 4:11] fan liu
Description:
The same query returned different results after I drop the index.

DROP DATABASE IF EXISTS test;  
CREATE DATABASE  test;  
USE test;  
CREATE TABLE t0(c0 DECIMAL UNIQUE KEY)  ENGINE =MEMORY;  
CREATE TABLE t1(c0 VARCHAR(500))  ENGINE = InnoDB;  
INSERT INTO t0(c0) VALUES(843390797); 
INSERT INTO t0(c0) VALUES(0);  
REPLACE INTO t1(c0) VALUES('0z'); 
SELECT t0.c0, t1.c0  FROM t0 NATURAL JOIN t1;

c0|c0|
--+--+

DROP INDEX c0 on t0;
SELECT t0.c0, t1.c0  FROM t0 NATURAL JOIN t1;

c0|c0|
--+--+
 0|0z|

How to repeat:
DROP DATABASE IF EXISTS test;  
CREATE DATABASE  test;  
USE test;  
CREATE TABLE t0(c0 DECIMAL UNIQUE KEY)  ENGINE =MEMORY;  
CREATE TABLE t1(c0 VARCHAR(500))  ENGINE = InnoDB;  
INSERT INTO t0(c0) VALUES(843390797); 
INSERT INTO t0(c0) VALUES(0);  
REPLACE INTO t1(c0) VALUES('0z'); 
SELECT t0.c0, t1.c0  FROM t0 NATURAL JOIN t1;
drop index c0 on t0;
SELECT t0.c0, t1.c0  FROM t0 NATURAL JOIN t1;
[31 Jan 20:58] Roy Lyseng
Thank you for the bug report.
Verified as described.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.