List:Internals« Previous MessageNext Message »
From:Timour Katchaounov Date:January 12 2010 7:18pm
Subject:Re: suspicious arguments to one print_plan() call in the optimizer
View as plain text  
Guilhem

Looks inexplicable to me too. Running bzr gannotate sql_select.cc
tells us that this line is by Sergey Petrunia, so it is worth
asking him. His on the CC.

Timour

> 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.
> 
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