summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2000-10-09 00:00:24 +0200
committerunknown <serg@serg.mysql.com>2000-10-09 00:00:24 +0200
commit48695081377ca07e44601484a41f66264d35ed0b (patch)
treec553188635e89125d3712fd5e01bb89dc39fdde1
parent4af074054be434b73e3b449ca1babc982c4df5fb (diff)
downloadmariadb-git-48695081377ca07e44601484a41f66264d35ed0b.tar.gz
Oops - forgot to add files to bk
sql/opt_ft.cc: Change mode to -rw-rw-r-- sql/opt_ft.h: Change mode to -rw-rw-r--
-rw-r--r--sql/opt_ft.cc36
-rw-r--r--sql/opt_ft.h49
2 files changed, 85 insertions, 0 deletions
diff --git a/sql/opt_ft.cc b/sql/opt_ft.cc
new file mode 100644
index 00000000000..b35b3230a39
--- /dev/null
+++ b/sql/opt_ft.cc
@@ -0,0 +1,36 @@
+/* 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(TABLE *table, JOIN_TAB *tab)
+{
+ if (tab->type == JT_FT)
+ return new FT_SELECT(table, &tab->ref);
+ else
+ return get_quick_select_for_ref(table, &tab->ref);
+}
+
diff --git a/sql/opt_ft.h b/sql/opt_ft.h
new file mode 100644
index 00000000000..1c95a7cfea7
--- /dev/null
+++ b/sql/opt_ft.h
@@ -0,0 +1,49 @@
+/* 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(TABLE *table, TABLE_REF *tref) :
+ QUICK_SELECT (table,tref->key,1), ref(tref) {}
+
+ int init()
+ {
+#if 0
+ if (cp_buffer_from_ref(ref)) // as ft-key doesn't use store_key's
+ return -1;
+#endif
+ return error=file->ft_init(ref->key,
+ ref->key_buff,
+ ref->key_length);
+ }
+ int get_next() { return error=file->ft_read(record); }
+};
+
+QUICK_SELECT *get_ft_or_quick_select_for_ref(TABLE *table, JOIN_TAB *tab);
+
+#endif