Commit c286021a authored by unknown's avatar unknown

ORDER BY works with FULLTEXT keys

parent 47d38f68
......@@ -45,7 +45,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
sql_map.h sql_string.h unireg.h \
field.h handler.h ha_isammrg.h ha_isam.h ha_myisammrg.h\
ha_heap.h ha_myisam.h ha_berkeley.h\
opt_range.h \
opt_range.h opt_ft.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h\
lex.h lex_symbol.h sql_acl.h sql_crypt.h md5.h \
log_event.h mini_client.h sql_repl.h
......@@ -62,7 +62,7 @@ mysqld_SOURCES = sql_lex.cc \
sql_update.cc sql_delete.cc \
procedure.cc item_uniq.cc sql_test.cc \
log.cc init.cc derror.cc sql_acl.cc unireg.cc \
time.cc opt_range.cc opt_sum.cc \
time.cc opt_range.cc opt_sum.cc opt_ft.cc \
records.cc filesort.cc handler.cc \
ha_isam.cc ha_isammrg.cc ha_heap.cc \
ha_myisam.cc ha_myisammrg.cc ha_berkeley.cc \
......
......@@ -336,6 +336,10 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->extra(HA_EXTRA_CACHE); /* Quicker reads */
}
if (quick_select)
error=select->quick->init();
if (!error)
for (;;)
{
if (quick_select)
......
......@@ -73,12 +73,12 @@ class QUICK_SELECT {
QUICK_SELECT(TABLE *table,uint index_arg,bool no_alloc=0);
~QUICK_SELECT();
void reset(void) { next=0; it.rewind(); }
int get_next();
virtual int init() { return 0; }
virtual int get_next();
int cmp_next(QUICK_RANGE *range);
bool unique_key_range();
};
class SQL_SELECT :public Sql_alloc {
public:
QUICK_SELECT *quick; // If quick-select used
......
......@@ -23,6 +23,7 @@
#include "mysql_priv.h"
#include "sql_select.h"
#include "opt_ft.h"
#include <m_ctype.h>
#include <hash.h>
#include <ft_global.h>
......@@ -4357,7 +4358,7 @@ join_ft_read_first(JOIN_TAB *tab)
#if 0
if (cp_buffer_from_ref(&tab->ref)) // as ft-key doesn't use store_key's
return -1;
return -1; // see also FT_SELECT::init()
#endif
if ((error=table->file->ft_init(tab->ref.key,
tab->ref.key_buff,
......@@ -5052,13 +5053,13 @@ create_sort_index(JOIN_TAB *tab,ORDER *order,ha_rows select_limit)
}
}
else
if (tab->type != JT_FT) /* Beware! SerG */
// if (tab->type != JT_FT) /* Beware! SerG */
{
/*
We have a ref on a const; Change this to a range that filesort
can use.
*/
if (!(select->quick=get_quick_select_for_ref(table, &tab->ref)))
if (!(select->quick=get_ft_or_quick_select_for_ref(table, tab)))
goto err;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment