Bug #113047 MTR test main.derived_limit fails with small cost differences
Submitted: 10 Nov 2023 15:17 Modified: 17 Jan 13:52
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S2 (Serious)
Version:8.0.35 OS:Any
Assigned to: CPU Architecture:Any

[10 Nov 2023 15:17] Laurynas Biveinis
Description:
$ mtr main.derived_limit --retry-failure=0
...
[ 50%] main.derived_limit                        [ fail ]
        Test ended at 2023-11-10 17:14:52

CURRENT_TEST: main.derived_limit
--- /Users/laurynas/vilniusdb/mysql-8.0.35/mysql-test/r/derived_limit.result	2023-10-26 09:13:43
+++ /Users/laurynas/vilniusdb/mysql-8.0.35/_build-debug/mysql-test/var/log/derived_limit.reject	2023-11-10 18:14:52
@@ -400,7 +400,7 @@
 SELECT * FROM cte;
 EXPLAIN
 -> Table scan on cte  (cost=3.87..5.56 rows=3)
-    -> Materialize recursive CTE cte  (cost=3.03..3.03 rows=3)
+    -> Materialize recursive CTE cte  (cost=3.02..3.02 rows=3)
         -> Limit table size: 5 row(s)
             -> Rows fetched before execution  (cost=0..0 rows=1)
         -> Limit table size: 5 row(s), repeat until convergence
...
(more differences similar to the first one)

How to repeat:
See above
[13 Nov 2023 9:43] MySQL Verification Team
Hello Laurynas,

Thank you for the report and feedback!
I quickly tried using https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.35-macos13-arm64.tar but not seeing any issues on MacOS(Ventura 13.5.1) and even on OL7(generic binary tarball build) but not observed any issues which is seen in your report. Is there anything I'm missing here? Thank you.

--
./mtr main.derived_limit --retry-failure=0
Logging: ./mtr  main.derived_limit --retry-failure=0
MySQL Version 8.0.35
Checking supported features
Using 'all' suites
Collecting tests
Checking leftover processes
Removing old var directory
Creating var directory '/Users/umshastr/Downloads/mysql-8.0.35/mysql-test/var'
Installing system database
Using parallel: 1

==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
[ 50%] main.derived_limit                        [ pass ]     11
[100%] shutdown_report                           [ pass ]       
------------------------------------------------------------------------------
The servers were restarted 0 times
The servers were reinitialized 0 times
Spent 0.011 of 4 seconds executing testcases

Completed: All 2 tests were successful.

regards,
Umesh
[15 Nov 2023 20:03] Laurynas Biveinis
A workaround is adding -ffp-contract=off to compilation flags
[16 Nov 2023 10:16] MySQL Verification Team
Thank you, Laurynas.
Verified as described.

Sincerely,
Umesh
[21 Dec 2023 16:14] Jon Stephens
Fixed in MySQL 8.0.36 and 8.4.0.

Changes in test code only, no changelog entry needed.

Closed.
[17 Jan 13:52] Laurynas Biveinis
commit dfeb55e55a8b4136f3142a11b23c98074409fe29
Author: Tor Didriksen <tor.didriksen@oracle.com>
Date:   Fri Nov 17 12:44:27 2023 +0100

    Bug#36017210 MTR test main.derived_limit fails with small cost differences
    
    Elide cost numbers, which were 3.02 rather than 3.03 for Xcode 15.0.1
    
    Change-Id: I72aac3823bec4c07a05561b0aa2c7d6d7f13b9ea
    (cherry picked from commit 40ad3de93b2443f10d77f169270ea376ac6da234)