List:Internals« Previous MessageNext Message »
From:Guilhem Bichot Date:January 12 2010 9:06am
Subject:suspicious arguments to one print_plan() call in the optimizer
View as plain text  
Hello,

The print_plan() function (sql_test.cc) has this form:
print_plan(JOIN* join, uint idx, double record_count, double read_time,
            double current_read_time, const char *info)

but one call to it, located at the start of
best_extension_by_limited_search() in MySQL 5.1, is:

   DBUG_EXECUTE("opt", print_plan(join, idx, read_time, record_count, idx,
                                  "SOFAR:"););

This looks weird, because it seems to have swapped variables (local 
variable "record_count" is used for print_plan()'s parameter 
"read_time", and vice-versa). Another weirdness: it uses local variable 
"idx" (=join->const_tables in this case) for print_plan()'s parameter 
"current_read_time".
I wonder if this is really a correct call.

-- 
Mr. Guilhem Bichot <guilhem@stripped>
Sun Microsystems / MySQL, Lead Software Engineer
Bordeaux, France
www.sun.com / www.mysql.com
Thread
suspicious arguments to one print_plan() call in the optimizerGuilhem Bichot12 Jan
  • Re: suspicious arguments to one print_plan() call in the optimizerTimour Katchaounov12 Jan
    • Re: suspicious arguments to one print_plan() call in the optimizerSergey Petrunya15 Jan
      • Re: suspicious arguments to one print_plan() call in the optimizerGuilhem Bichot15 Jan