diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2011-04-30 04:59:05 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2011-04-30 04:59:05 +0400 |
commit | 3098c21b8f8e01448e36620a28e4b4314e82077a (patch) | |
tree | affe5757ecef44b12d6bdbf906d24c63c4376291 /sql/opt_range.cc | |
parent | 2721e912ba45f42f3ddf7c8366f6abbeef060833 (diff) | |
parent | 81c6f73ff26c5f384c44e6c576a8024cd4910077 (diff) | |
download | mariadb-git-3098c21b8f8e01448e36620a28e4b4314e82077a.tar.gz |
Merge MWL#90 into 5.3-main
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 8d0d1c03ee5..39abdaf20b2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -341,8 +341,9 @@ public: SEL_ARG(Field *field, uint8 part, uchar *min_value, uchar *max_value, uint8 min_flag, uint8 max_flag, uint8 maybe_flag); SEL_ARG(enum Type type_arg) - :min_flag(0),elements(1),use_count(1),left(0),right(0),next_key_part(0), - color(BLACK), type(type_arg) + :min_flag(0), max_part_no(0) /* first key part means 1. 0 mean 'no parts'*/, + elements(1),use_count(1),left(0),right(0), + next_key_part(0), color(BLACK), type(type_arg) {} inline bool is_same(SEL_ARG *arg) { @@ -2909,7 +2910,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, quick=0; needed_reg.clear_all(); quick_keys.clear_all(); - if (keys_to_use.is_clear_all()) + DBUG_ASSERT(!head->is_filled_at_execution()); + if (keys_to_use.is_clear_all() || head->is_filled_at_execution()) DBUG_RETURN(0); records= head->file->stats.records; if (!records) @@ -4317,7 +4319,7 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records) return 1; */ JOIN *join= param->thd->lex->select_lex.join; - if (!join || join->tables == 1) + if (!join || join->table_count == 1) { /* No join, assume reading is done in one 'sweep' */ result= busy_blocks*(DISK_SEEK_BASE_COST + @@ -11268,7 +11270,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree) /* Perform few 'cheap' tests whether this access method is applicable. */ if (!join) DBUG_RETURN(NULL); /* This is not a select statement. */ - if ((join->tables != 1) || /* The query must reference one table. */ + if ((join->table_count != 1) || /* The query must reference one table. */ ((!join->group_list) && /* Neither GROUP BY nor a DISTINCT query. */ (!join->select_distinct)) || (join->select_lex->olap == ROLLUP_TYPE)) /* Check (B3) for ROLLUP */ |