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.
> 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,
> 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
> I wonder if this is really a correct call.