From 5619f2938406e737e199bf66e10eedab5621c117 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 10 Oct 2024 16:11:37 +0300 Subject: [PATCH] Replace 0.001 with symbolic name COST_EPS optimize_straight_join and best_extension_by_limited_search() use 0.001 to make choice between plans with identical cost deterministic. Use COST_EPS instead of 0.001, like it's done in newer versions. --- sql/sql_select.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cc3d0a8d1bd..7f16598840e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9662,7 +9662,7 @@ optimize_straight_join(JOIN *join, table_map remaining_tables) memcpy((uchar*) join->best_positions, (uchar*) join->positions, sizeof(POSITION)*idx); join->join_record_count= record_count; - join->best_read= read_time - 0.001; + join->best_read= read_time - COST_EPS; } @@ -11093,7 +11093,7 @@ best_extension_by_limited_search(JOIN *join, memcpy((uchar*) join->best_positions, (uchar*) join->positions, sizeof(POSITION) * (idx + 1)); join->join_record_count= partial_join_cardinality; - join->best_read= current_read_time - 0.001; + join->best_read= current_read_time - COST_EPS; } DBUG_EXECUTE("opt", print_plan(join, idx+1, current_record_count,