From 48695081377ca07e44601484a41f66264d35ed0b Mon Sep 17 00:00:00 2001
From: unknown <serg@serg.mysql.com>
Date: Mon, 9 Oct 2000 00:00:24 +0200
Subject: [PATCH] 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--
---
 sql/opt_ft.cc | 36 ++++++++++++++++++++++++++++++++++++
 sql/opt_ft.h  | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 sql/opt_ft.cc
 create mode 100644 sql/opt_ft.h

diff --git a/sql/opt_ft.cc b/sql/opt_ft.cc
new file mode 100644
index 0000000000..b35b3230a3
--- /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 0000000000..1c95a7cfea
--- /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
-- 
2.30.9