mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Code cleanup:
we don't need opt_range.h and opt_range.cc files at all.
This commit is contained in:
parent
8eb590a71e
commit
c4728c276a
6 changed files with 17 additions and 84 deletions
|
@ -46,7 +46,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
|
||||||
item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
|
item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
|
||||||
item_geofunc.cc item_uniq.cc item_subselect.cc item_row.cc\
|
item_geofunc.cc item_uniq.cc item_subselect.cc item_row.cc\
|
||||||
key.cc lock.cc log.cc log_event.cc sql_state.c \
|
key.cc lock.cc log.cc log_event.cc sql_state.c \
|
||||||
protocol.cc net_serv.cc opt_ft.cc opt_range.cc \
|
protocol.cc net_serv.cc opt_range.cc \
|
||||||
opt_sum.cc procedure.cc records.cc sql_acl.cc \
|
opt_sum.cc procedure.cc records.cc sql_acl.cc \
|
||||||
sql_load.cc sql_olap.cc \
|
sql_load.cc sql_olap.cc \
|
||||||
sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
|
sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
|
||||||
|
|
|
@ -52,7 +52,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
|
||||||
field.h handler.h \
|
field.h handler.h \
|
||||||
ha_isammrg.h ha_isam.h ha_myisammrg.h\
|
ha_isammrg.h ha_isam.h ha_myisammrg.h\
|
||||||
ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \
|
ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \
|
||||||
opt_range.h opt_ft.h protocol.h \
|
opt_range.h protocol.h \
|
||||||
sql_select.h structs.h table.h sql_udf.h hash_filo.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 \
|
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
|
||||||
log_event.h sql_repl.h slave.h \
|
log_event.h sql_repl.h slave.h \
|
||||||
|
@ -75,7 +75,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
|
||||||
procedure.cc item_uniq.cc sql_test.cc \
|
procedure.cc item_uniq.cc sql_test.cc \
|
||||||
log.cc log_event.cc init.cc derror.cc sql_acl.cc \
|
log.cc log_event.cc init.cc derror.cc sql_acl.cc \
|
||||||
unireg.cc des_key_file.cc \
|
unireg.cc des_key_file.cc \
|
||||||
time.cc opt_range.cc opt_sum.cc opt_ft.cc \
|
time.cc opt_range.cc opt_sum.cc \
|
||||||
records.cc filesort.cc handler.cc \
|
records.cc filesort.cc handler.cc \
|
||||||
ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
|
ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
|
||||||
ha_berkeley.cc ha_innodb.cc \
|
ha_berkeley.cc ha_innodb.cc \
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#pragma implementation // gcc: Class implementation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "sql_select.h"
|
|
||||||
#include "opt_ft.h"
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
** Create a FT or QUICK RANGE based on a key
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
QUICK_SELECT *get_ft_or_quick_select_for_ref(THD *thd, TABLE *table,
|
|
||||||
JOIN_TAB *tab)
|
|
||||||
{
|
|
||||||
if (tab->type == JT_FT)
|
|
||||||
return new FT_SELECT(thd, table, &tab->ref);
|
|
||||||
return get_quick_select_for_ref(thd, table, &tab->ref);
|
|
||||||
}
|
|
||||||
|
|
41
sql/opt_ft.h
41
sql/opt_ft.h
|
@ -1,41 +0,0 @@
|
||||||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
||||||
|
|
||||||
|
|
||||||
/* classes to use when handling where clause */
|
|
||||||
|
|
||||||
#ifndef _opt_ft_h
|
|
||||||
#define _opt_ft_h
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#pragma interface /* gcc class implementation */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class FT_SELECT: public QUICK_SELECT {
|
|
||||||
public:
|
|
||||||
TABLE_REF *ref;
|
|
||||||
|
|
||||||
FT_SELECT(THD *thd, TABLE *table, TABLE_REF *tref) :
|
|
||||||
QUICK_SELECT (thd, table, tref->key, 1), ref(tref) { init(); }
|
|
||||||
|
|
||||||
int init() { return error=file->ft_init(); }
|
|
||||||
int get_next() { return error=file->ft_read(record); }
|
|
||||||
};
|
|
||||||
|
|
||||||
QUICK_SELECT *get_ft_or_quick_select_for_ref(THD *thd, TABLE *table,
|
|
||||||
JOIN_TAB *tab);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -134,6 +134,17 @@ class SQL_SELECT :public Sql_alloc {
|
||||||
ha_rows limit, bool force_quick_range=0);
|
ha_rows limit, bool force_quick_range=0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class FT_SELECT: public QUICK_SELECT {
|
||||||
|
public:
|
||||||
|
FT_SELECT(THD *thd, TABLE *table, uint key):
|
||||||
|
QUICK_SELECT (thd, table, key, 1) { init(); }
|
||||||
|
|
||||||
|
int init() { return error= file->ft_init(); }
|
||||||
|
int get_next() { return error= file->ft_read(record); }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
|
QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
|
||||||
struct st_table_ref *ref);
|
struct st_table_ref *ref);
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
#include "sql_select.h"
|
#include "sql_select.h"
|
||||||
|
|
||||||
#include "opt_ft.h"
|
|
||||||
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
#include <ft_global.h>
|
#include <ft_global.h>
|
||||||
|
@ -7203,8 +7201,9 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
|
||||||
For impossible ranges (like when doing a lookup on NULL on a NOT NULL
|
For impossible ranges (like when doing a lookup on NULL on a NOT NULL
|
||||||
field, quick will contain an empty record set.
|
field, quick will contain an empty record set.
|
||||||
*/
|
*/
|
||||||
if (!(select->quick=get_ft_or_quick_select_for_ref(tab->join->thd,
|
if (!(select->quick= tab->type == JT_FT ?
|
||||||
table, tab)))
|
new FT_SELECT(thd, table, tab->ref.key) :
|
||||||
|
get_quick_select_for_ref(thd, table, &tab->ref)))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue