1 /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
3 #ident "$Id$"
4 /*======
5 This file is part of TokuDB
6 
7 
8 Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
9 
10     TokuDBis is free software: you can redistribute it and/or modify
11     it under the terms of the GNU General Public License, version 2,
12     as published by the Free Software Foundation.
13 
14     TokuDB is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17     GNU General Public License for more details.
18 
19     You should have received a copy of the GNU General Public License
20     along with TokuDB.  If not, see <http://www.gnu.org/licenses/>.
21 
22 ======= */
23 
24 #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
25 
26 /****************************************************************************
27  * MRR implementation: use DS-MRR, essentially copied from MyISAM
28  ***************************************************************************/
29 
multi_range_read_init(RANGE_SEQ_IF * seq,void * seq_init_param,uint n_ranges,uint mode,HANDLER_BUFFER * buf)30 int ha_tokudb::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
31                                      uint n_ranges, uint mode,
32                                      HANDLER_BUFFER *buf)
33 {
34   ds_mrr.init(this, table);
35   return ds_mrr.dsmrr_init(this, seq, seq_init_param, n_ranges, mode, buf);
36 }
37 
multi_range_read_next(char ** range_info)38 int ha_tokudb::multi_range_read_next(char **range_info)
39 {
40   return ds_mrr.dsmrr_next(range_info);
41 }
42 
multi_range_read_info_const(uint keyno,RANGE_SEQ_IF * seq,void * seq_init_param,uint n_ranges,uint * bufsz,uint * flags,Cost_estimate * cost)43 ha_rows ha_tokudb::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
44                                                void *seq_init_param,
45                                                uint n_ranges, uint *bufsz,
46                                                uint *flags, Cost_estimate *cost)
47 {
48   /*
49     This call is here because there is no location where this->table would
50     already be known.
51     TODO: consider moving it into some per-query initialization call.
52   */
53   ds_mrr.init(this, table);
54   return ds_mrr.dsmrr_info_const(keyno, seq, seq_init_param, n_ranges, bufsz,
55                                  flags, cost);
56 }
57 
multi_range_read_info(uint keyno,uint n_ranges,uint keys,uint * bufsz,uint * flags,Cost_estimate * cost)58 ha_rows ha_tokudb::multi_range_read_info(uint keyno, uint n_ranges, uint keys,
59                                          uint *bufsz, uint *flags,
60                                          Cost_estimate *cost)
61 {
62   ds_mrr.init(this, table);
63   return ds_mrr.dsmrr_info(keyno, n_ranges, keys, bufsz, flags, cost);
64 }
65 
66