summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc1
-rw-r--r--sql/item_func.h1
-rw-r--r--sql/sql_select.cc6
-rw-r--r--sql/table.h1
4 files changed, 7 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index e7e8964b07a..ec9244e783e 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2056,6 +2056,7 @@ bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist)
}
const_item_cache=0;
table=((Item_field *)fields.head())->field->table;
+ table->fulltext_searched=1;
return 0;
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 4a8f808de57..c0924ba0289 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -880,6 +880,7 @@ public:
ft_close_search(ft_handler);
if(join_key)
table->file->ft_handler=0;
+ table->fulltext_searched=0;
}
}
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 1ee0d84e182..673923765ad 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -885,7 +885,8 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
s->dependent=(table_map) 0;
s->key_dependent=(table_map) 0;
if ((table->system || table->file->records <= 1) && ! s->dependent &&
- !(table->file->option_flag() & HA_NOT_EXACT_COUNT))
+ !(table->file->option_flag() & HA_NOT_EXACT_COUNT) &&
+ !table->fulltext_searched)
{
s->type=JT_SYSTEM;
const_table_map|=table->map;
@@ -983,7 +984,8 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
} while (keyuse->table == table && keyuse->key == key);
if (eq_part == PREV_BITS(uint,table->key_info[key].key_parts) &&
- (table->key_info[key].flags & HA_NOSAME))
+ (table->key_info[key].flags & HA_NOSAME) &&
+ !table->fulltext_searched)
{
if (const_ref == eq_part)
{ // Found everything for ref.
diff --git a/sql/table.h b/sql/table.h
index b627a158556..ae785b8a402 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -95,6 +95,7 @@ struct st_table {
my_bool db_low_byte_first; /* Portable row format */
my_bool locked_by_flush;
my_bool locked_by_name;
+ my_bool fulltext_searched;
my_bool crashed;
my_bool is_view;
Field *next_number_field, /* Set if next_number is activated */