Debugging: add dbug_print_join_prefix() to use in best_access_path
A call to dbug_print_join_prefix(join_positions, idx, s) returns a const char* ponter to string with current join prefix, including the table being added to it.
This commit is contained in:
parent
42eb64e64d
commit
d67c88946f
@ -7550,6 +7550,30 @@ double adjust_quick_cost(double quick_cost, ha_rows records)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DBUG_OFF
|
||||||
|
|
||||||
|
char dbug_join_prefix_buf[256];
|
||||||
|
|
||||||
|
const char* dbug_print_join_prefix(const POSITION *join_positions,
|
||||||
|
uint idx,
|
||||||
|
JOIN_TAB *s)
|
||||||
|
{
|
||||||
|
char *buf= dbug_join_prefix_buf;
|
||||||
|
String str(buf, sizeof(dbug_join_prefix_buf), &my_charset_bin);
|
||||||
|
str.length(0);
|
||||||
|
for (uint i=0; i!=idx; i++)
|
||||||
|
{
|
||||||
|
str.append(join_positions[i].table->table->alias);
|
||||||
|
str.append(',');
|
||||||
|
}
|
||||||
|
str.append(s->table->alias);
|
||||||
|
if (str.c_ptr_safe() == buf)
|
||||||
|
return buf;
|
||||||
|
else
|
||||||
|
return "Couldn't fit into buffer";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Find the best access path for an extension of a partial execution
|
Find the best access path for an extension of a partial execution
|
||||||
plan and add this path to the plan.
|
plan and add this path to the plan.
|
||||||
@ -7573,6 +7597,14 @@ double adjust_quick_cost(double quick_cost, ha_rows records)
|
|||||||
@param pos OUT Table access plan
|
@param pos OUT Table access plan
|
||||||
@param loose_scan_pos OUT Table plan that uses loosescan, or set cost to
|
@param loose_scan_pos OUT Table plan that uses loosescan, or set cost to
|
||||||
DBL_MAX if not possible.
|
DBL_MAX if not possible.
|
||||||
|
@detail
|
||||||
|
Use this to print the current join prefix:
|
||||||
|
|
||||||
|
dbug_print_join_prefix(join_positions, idx, s)
|
||||||
|
|
||||||
|
Use this as breakpoint condition to stop at join prefix "t1,t2,t3":
|
||||||
|
|
||||||
|
$_streq(dbug_print_join_prefix(join_positions, idx, s), "t1,t2,t3")
|
||||||
|
|
||||||
@return
|
@return
|
||||||
None
|
None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user