Bug #119360 Result inconsistency due to sorting in temporary tables

Submitted: 11 Nov 2025 8:42 Modified: 8 Feb 13:59
Reporter: Go Yakult Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0.41 OS:Any
Assigned to: CPU Architecture:Any

[11 Nov 2025 8:42] Go Yakult
Description:
Using FORCE INDEX caused incorrect results.

SELECT DISTINCT t0.c9 AS ref0, t0.c5 AS ref1 FROM t0 force index(i3) GROUP BY t0.c9, t0.c5 order by 1, 2;

SELECT DISTINCT t0.c9 AS ref0, t0.c5 AS ref1 FROM t0 GROUP BY t0.c9, t0.c5 order by 1, 2;

How to repeat:
source test2.sql

SELECT DISTINCT t0.c9 AS ref0, t0.c5 AS ref1 FROM t0 force index(i3) GROUP BY t0.c9, t0.c5 order by 1, 2;

SELECT DISTINCT t0.c9 AS ref0, t0.c5 AS ref1 FROM t0 GROUP BY t0.c9, t0.c5 order by 1, 2;
[8 Feb 13:59] 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.039 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.