#At file:///home/mysql_src/bzrrepos_new/mysql-next-mr-opt-backporting-wl4800/ based on revid:guilhem.bichot@stripped
3251 Guilhem Bichot 2011-01-13
less code duplication
modified:
sql/opt_range.cc
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc 2011-01-12 21:17:26 +0000
+++ b/sql/opt_range.cc 2011-01-13 13:12:27 +0000
@@ -10110,23 +10110,16 @@ get_best_group_min_max(PARAM *param, SEL
/* Perform few 'cheap' tests whether this access method is applicable. */
if (!join)
+ cause= "no_join";
+ else if (join->tables != 1) /* The query must reference one table. */
+ cause= "not_single_table";
+ else if (join->select_lex->olap == ROLLUP_TYPE) /* Check (B3) for ROLLUP */
+ cause= "rollup";
+ else if (table->s->keys == 0) /* There are no indexes to use. */
+ cause= "no_index";
+ if (cause != NULL)
{
- trace_group.add("chosen", false).add_alnum("cause", "no_join");
- DBUG_RETURN(NULL);
- }
- if (join->tables != 1) /* The query must reference one table. */
- {
- trace_group.add("chosen", false).add_alnum("cause", "not_single_table");
- DBUG_RETURN(NULL);
- }
- if (join->select_lex->olap == ROLLUP_TYPE) /* Check (B3) for ROLLUP */
- {
- trace_group.add("chosen", false).add_alnum("cause", "rollup");
- DBUG_RETURN(NULL);
- }
- if (table->s->keys == 0) /* There are no indexes to use. */
- {
- trace_group.add("chosen", false).add_alnum("cause", "no_index");
+ trace_group.add("chosen", false).add_alnum("cause", cause);
DBUG_RETURN(NULL);
}
Attachment: [text/bzr-bundle] bzr/guilhem.bichot@oracle.com-20110113131227-g8mw2sqirtd48bt2.bundle
| Thread |
|---|
| • bzr commit into mysql-next-mr-bugfixing branch (guilhem.bichot:3251) | Guilhem Bichot | 13 Jan |