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/*======
5This file is part of TokuDB
6
7
8Copyright (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 * DS-MRR implementation, essentially copied from InnoDB/MyISAM/Maria
28 ***************************************************************************/
29
30/**
31 * Multi Range Read interface, DS-MRR calls
32 */
33int ha_tokudb::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
34 uint n_ranges, uint mode,
35 HANDLER_BUFFER *buf)
36{
37 return ds_mrr.dsmrr_init(this, seq, seq_init_param, n_ranges, mode, buf);
38}
39
40int ha_tokudb::multi_range_read_next(range_id_t *range_info)
41{
42 return ds_mrr.dsmrr_next(range_info);
43}
44
45ha_rows ha_tokudb::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
46 void *seq_init_param,
47 uint n_ranges, uint *bufsz,
48 uint *flags,
49 COST_VECT *cost)
50{
51 /* See comments in ha_myisam::multi_range_read_info_const */
52 ds_mrr.init(this, table);
53 ha_rows res= ds_mrr.dsmrr_info_const(keyno, seq, seq_init_param, n_ranges,
54 bufsz, flags, cost);
55 return res;
56}
57
58ha_rows ha_tokudb::multi_range_read_info(uint keyno, uint n_ranges, uint keys,
59 uint key_parts, uint *bufsz,
60 uint *flags, COST_VECT *cost)
61{
62 ds_mrr.init(this, table);
63 ha_rows res= ds_mrr.dsmrr_info(keyno, n_ranges, keys, key_parts, bufsz,
64 flags, cost);
65 return res;
66}
67
68int ha_tokudb::multi_range_read_explain_info(uint mrr_mode, char *str, size_t size)
69{
70 return ds_mrr.dsmrr_explain_info(mrr_mode, str, size);
71}
72