~drizzle-trunk/drizzle/development

1273.13.1 by Brian Aker
First pass through data dictionary.
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2009 Sun Microsystems
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
1273.13.65 by Brian Aker
Lint fixes.
21
#ifndef PLUGIN_FUNCTION_ENGINE_CURSOR_H
22
#define PLUGIN_FUNCTION_ENGINE_CURSOR_H
1273.13.1 by Brian Aker
First pass through data dictionary.
23
24
#include <drizzled/cursor.h>
25
1273.13.55 by Brian Aker
Naming fixes.
26
#include <plugin/function_engine/function.h>
1551 by Brian Aker
This fixes the issue with filesort() possibly crashing on a Function based
27
#include <drizzled/base.h>
1273.13.1 by Brian Aker
First pass through data dictionary.
28
1273.14.5 by Monty Taylor
Merged trunk.
29
class FunctionCursor: public drizzled::Cursor
1273.13.1 by Brian Aker
First pass through data dictionary.
30
{
1273.13.32 by Brian Aker
Big ole patch. This covers moving information_schema to old_* table names
31
  drizzled::plugin::TableFunction *tool;
32
  drizzled::plugin::TableFunction::Generator *generator;
1273.13.1 by Brian Aker
First pass through data dictionary.
33
  size_t record_id;
34
  std::vector<unsigned char *> row_cache;
1273.13.60 by Brian Aker
Merge with trunk.
35
  drizzled::ha_rows estimate_of_rows;
36
  drizzled::ha_rows rows_returned;
1273.13.1 by Brian Aker
First pass through data dictionary.
37
1552.1.2 by Brian Aker
This 1) fixes issue of reset() 2) uses a better cache design to decrease
38
  void wipeCache();
39
1273.13.1 by Brian Aker
First pass through data dictionary.
40
public:
1273.14.5 by Monty Taylor
Merged trunk.
41
  FunctionCursor(drizzled::plugin::StorageEngine &engine,
42
                 drizzled::TableShare &table_arg);
1273.13.18 by Brian Aker
Update code, first pass through cleaner method for recursing through
43
  ~FunctionCursor() {}
1273.13.1 by Brian Aker
First pass through data dictionary.
44
45
  int open(const char *name, int mode, uint32_t test_if_locked);
46
47
  int close(void);
48
1552.1.2 by Brian Aker
This 1) fixes issue of reset() 2) uses a better cache design to decrease
49
  int reset()
50
  {
51
    return extra(drizzled::HA_EXTRA_RESET_STATE);
52
  }
53
1491.1.10 by Jay Pipes
ha_rnd_init -> startTableScan, rnd_init -> doStartTableScan, ha_rnd_end -> endTableScan, rnd_end -> doEndTableScan
54
  int doStartTableScan(bool scan);
1273.13.1 by Brian Aker
First pass through data dictionary.
55
56
  /* get the next row and copy it into buf */
57
  int rnd_next(unsigned char *buf);
58
59
  /* locate row pointed to by pos, copy it into buf */
60
  int rnd_pos(unsigned char *buf, unsigned char *pos);
61
1491.1.10 by Jay Pipes
ha_rnd_init -> startTableScan, rnd_init -> doStartTableScan, ha_rnd_end -> endTableScan, rnd_end -> doEndTableScan
62
  int doEndTableScan();
1273.13.1 by Brian Aker
First pass through data dictionary.
63
1551 by Brian Aker
This fixes the issue with filesort() possibly crashing on a Function based
64
  int extra(enum drizzled::ha_extra_function);
65
1273.13.1 by Brian Aker
First pass through data dictionary.
66
  /* record position of a record for reordering */
67
  void position(const unsigned char *record);
68
69
  int info(uint32_t flag);
1273.13.60 by Brian Aker
Merge with trunk.
70
71
  /**
72
   * @return an upper bound estimate for the number of rows in the table
73
   */
74
  drizzled::ha_rows estimate_rows_upper_bound()
75
  {
76
    return estimate_of_rows;
77
  }
1377.7.2 by Stewart Smith
make get_auto_increment pure virtual and force engines not supporting auto_increment to be explicit about it
78
79
  void get_auto_increment(uint64_t, uint64_t,
80
                          uint64_t,
81
                          uint64_t *,
82
                          uint64_t *)
83
  {}
1273.13.1 by Brian Aker
First pass through data dictionary.
84
};
85
1273.13.65 by Brian Aker
Lint fixes.
86
#endif /* PLUGIN_FUNCTION_ENGINE_CURSOR_H */