00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- 00002 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 00003 * 00004 * Copyright (C) 2008-2009 Sun Microsystems, Inc. 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; version 2 of the License. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00020 #pragma once 00021 00022 #include <drizzled/optimizer/range.h> 00023 00024 #include <vector> 00025 00026 namespace drizzled { 00027 namespace optimizer { 00028 00041 class QuickRorUnionSelect : public QuickSelectInterface 00042 { 00043 public: 00044 QuickRorUnionSelect(Session *session, Table *table); 00045 ~QuickRorUnionSelect(); 00046 00056 int init(); 00057 00067 int reset(void); 00068 00083 int get_next(); 00084 00085 bool reverse_sorted() const 00086 { 00087 return false; 00088 } 00089 00090 bool unique_key_range() const 00091 { 00092 return false; 00093 } 00094 00095 int get_type() const 00096 { 00097 return QS_TYPE_ROR_UNION; 00098 } 00099 00100 void add_keys_and_lengths(std::string *key_names, std::string *used_lengths); 00101 void add_info_string(std::string *str); 00102 bool is_keys_used(const boost::dynamic_bitset<>& fields); 00103 00104 void push_quick_back(QuickSelectInterface *quick_sel_range); 00105 00106 std::vector<QuickSelectInterface *> quick_selects; 00109 std::priority_queue<QuickSelectInterface *, std::vector<QuickSelectInterface *>, compare_functor > *queue; 00110 memory::Root alloc; 00112 Session *session; 00113 unsigned char *cur_rowid; 00114 unsigned char *prev_rowid; 00115 bool have_prev_rowid; 00116 uint32_t rowid_length; 00117 private: 00118 bool scans_inited; 00119 }; 00120 00121 } /* namespace optimizer */ 00122 00123 } /* namespace drizzled */ 00124