diff options
author | Michael Widenius <monty@askmonty.org> | 2010-11-25 12:10:02 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-11-25 12:10:02 +0200 |
commit | babdbbbfd2d24b7a953ea3978bf076202995faa9 (patch) | |
tree | 24a67e6f8eebc05b4d987fe28f07ca3d3b30607a /sql/sql_select.cc | |
parent | bf5140fb7b6d3080a25ba3f92b65f24dc75223df (diff) | |
parent | 1a6373e8e2f0c8c5ca6b8ef5076dcb2948eeb41a (diff) | |
download | mariadb-git-babdbbbfd2d24b7a953ea3978bf076202995faa9.tar.gz |
Automatic merge with base
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 65c76c0792f..972f4f7610f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1703,11 +1703,14 @@ JOIN::reinit() /* Reset effect of possible no_rows_in_result() */ List_iterator_fast<Item> it(fields_list); Item *item; - no_rows_in_result_called= 0; while ((item= it++)) item->restore_to_before_no_rows_in_result(); - } + } + + if (!(select_options & SELECT_DESCRIBE)) + init_ftfuncs(thd, select_lex, test(order)); + DBUG_RETURN(0); } @@ -2494,6 +2497,13 @@ mysql_select(THD *thd, Item ***rref_pointer_array, { DBUG_RETURN(TRUE); } + /* + Original join tabs might be overwritten at first + subselect execution. So we need to restore them. + */ + Item_subselect *subselect= select_lex->master_unit()->item; + if (subselect && subselect->is_uncacheable() && join->reinit()) + DBUG_RETURN(TRUE); } else { @@ -13498,6 +13508,8 @@ static bool list_contains_unique_index(TABLE *table, bool (*find_func) (Field *, void *), void *data) { + if (table->pos_in_table_list->outer_join) + return 0; for (uint keynr= 0; keynr < table->s->keys; keynr++) { if (keynr == table->s->primary_key || @@ -13511,7 +13523,7 @@ list_contains_unique_index(TABLE *table, key_part < key_part_end; key_part++) { - if (key_part->field->maybe_null() || + if (key_part->field->real_maybe_null() || !find_func(key_part->field, data)) break; } |