You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
5.9 KiB

  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. COPYING CONDITIONS NOTICE:
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of version 2 of the GNU General Public License as
  8. published by the Free Software Foundation, and provided that the
  9. following conditions are met:
  10. * Redistributions of source code must retain this COPYING
  11. CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
  12. DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
  13. PATENT MARKING NOTICE (below), and the PATENT RIGHTS
  14. GRANT (below).
  15. * Redistributions in binary form must reproduce this COPYING
  16. CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
  17. DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
  18. PATENT MARKING NOTICE (below), and the PATENT RIGHTS
  19. GRANT (below) in the documentation and/or other materials
  20. provided with the distribution.
  21. You should have received a copy of the GNU General Public License
  22. along with this program; if not, write to the Free Software
  23. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  24. 02110-1301, USA.
  25. COPYRIGHT NOTICE:
  26. TokuDB, Tokutek Fractal Tree Indexing Library.
  27. Copyright (C) 2007-2013 Tokutek, Inc.
  28. DISCLAIMER:
  29. This program is distributed in the hope that it will be useful, but
  30. WITHOUT ANY WARRANTY; without even the implied warranty of
  31. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  32. General Public License for more details.
  33. UNIVERSITY PATENT NOTICE:
  34. The technology is licensed by the Massachusetts Institute of
  35. Technology, Rutgers State University of New Jersey, and the Research
  36. Foundation of State University of New York at Stony Brook under
  37. United States of America Serial No. 11/760379 and to the patents
  38. and/or patent applications resulting from it.
  39. PATENT MARKING NOTICE:
  40. This software is covered by US Patent No. 8,185,551.
  41. This software is covered by US Patent No. 8,489,638.
  42. PATENT RIGHTS GRANT:
  43. "THIS IMPLEMENTATION" means the copyrightable works distributed by
  44. Tokutek as part of the Fractal Tree project.
  45. "PATENT CLAIMS" means the claims of patents that are owned or
  46. licensable by Tokutek, both currently or in the future; and that in
  47. the absence of this license would be infringed by THIS
  48. IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
  49. "PATENT CHALLENGE" shall mean a challenge to the validity,
  50. patentability, enforceability and/or non-infringement of any of the
  51. PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
  52. Tokutek hereby grants to you, for the term and geographical scope of
  53. the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
  54. irrevocable (except as stated in this section) patent license to
  55. make, have made, use, offer to sell, sell, import, transfer, and
  56. otherwise run, modify, and propagate the contents of THIS
  57. IMPLEMENTATION, where such license applies only to the PATENT
  58. CLAIMS. This grant does not include claims that would be infringed
  59. only as a consequence of further modifications of THIS
  60. IMPLEMENTATION. If you or your agent or licensee institute or order
  61. or agree to the institution of patent litigation against any entity
  62. (including a cross-claim or counterclaim in a lawsuit) alleging that
  63. THIS IMPLEMENTATION constitutes direct or contributory patent
  64. infringement, or inducement of patent infringement, then any rights
  65. granted to you under this License shall terminate as of the date
  66. such litigation is filed. If you or your agent or exclusive
  67. licensee institute or order or agree to the institution of a PATENT
  68. CHALLENGE, then Tokutek may terminate any rights granted to you
  69. under this License.
  70. */
  71. #ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
  72. #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
  73. /****************************************************************************
  74. * DS-MRR implementation, essentially copied from InnoDB/MyISAM/Maria
  75. ***************************************************************************/
  76. /**
  77. * Multi Range Read interface, DS-MRR calls
  78. */
  79. int ha_tokudb::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
  80. uint n_ranges, uint mode,
  81. HANDLER_BUFFER *buf)
  82. {
  83. return ds_mrr.dsmrr_init(this, seq, seq_init_param, n_ranges, mode, buf);
  84. }
  85. int ha_tokudb::multi_range_read_next(range_id_t *range_info)
  86. {
  87. return ds_mrr.dsmrr_next(range_info);
  88. }
  89. ha_rows ha_tokudb::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
  90. void *seq_init_param,
  91. uint n_ranges, uint *bufsz,
  92. uint *flags,
  93. COST_VECT *cost)
  94. {
  95. /* See comments in ha_myisam::multi_range_read_info_const */
  96. ds_mrr.init(this, table);
  97. ha_rows res= ds_mrr.dsmrr_info_const(keyno, seq, seq_init_param, n_ranges,
  98. bufsz, flags, cost);
  99. return res;
  100. }
  101. ha_rows ha_tokudb::multi_range_read_info(uint keyno, uint n_ranges, uint keys,
  102. uint key_parts, uint *bufsz,
  103. uint *flags, COST_VECT *cost)
  104. {
  105. ds_mrr.init(this, table);
  106. ha_rows res= ds_mrr.dsmrr_info(keyno, n_ranges, keys, key_parts, bufsz,
  107. flags, cost);
  108. return res;
  109. }
  110. int ha_tokudb::multi_range_read_explain_info(uint mrr_mode, char *str, size_t size)
  111. {
  112. return ds_mrr.dsmrr_explain_info(mrr_mode, str, size);
  113. }