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 <boost/dynamic_bitset.hpp> 00025 #include <vector> 00026 00027 namespace drizzled 00028 { 00029 00030 namespace optimizer 00031 { 00032 00050 class QuickRorIntersectSelect : public QuickSelectInterface 00051 { 00052 public: 00053 00054 QuickRorIntersectSelect(Session *session, 00055 Table *table, 00056 bool retrieve_full_rows, 00057 memory::Root *parent_alloc); 00058 00059 ~QuickRorIntersectSelect(); 00060 00070 int init(); 00071 00080 int reset(void); 00081 00101 int get_next(); 00102 00103 bool reverse_sorted() const 00104 { 00105 return false; 00106 } 00107 00108 bool unique_key_range() const 00109 { 00110 return false; 00111 } 00112 00113 int get_type() const 00114 { 00115 return QS_TYPE_ROR_INTERSECT; 00116 } 00117 00118 void add_keys_and_lengths(std::string *key_names, std::string *used_lengths); 00119 void add_info_string(std::string *str); 00120 bool is_keys_used(const boost::dynamic_bitset<>& fields); 00121 00132 int init_ror_merged_scan(bool reuse_handler); 00133 00148 bool push_quick_back(QuickRangeSelect *quick_sel_range); 00149 00154 std::vector<QuickRangeSelect *> quick_selects; 00155 00160 QuickRangeSelect *cpk_quick; 00161 00162 memory::Root alloc; 00163 Session *session; 00164 bool need_to_fetch_row; 00166 bool scans_inited; 00167 }; 00168 00169 } /* namespace optimizer */ 00170 00171 } /* namespace drizzled */ 00172