MySQL 8.0.29
Source Code Documentation
handler.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2021, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify it under
4the terms of the GNU General Public License, version 2.0, as published by the
5Free Software Foundation.
6
7This program is also distributed with certain software (including but not
8limited to OpenSSL) that is licensed under separate terms, as designated in a
9particular file or component or in included license documentation. The authors
10of MySQL hereby grant you an additional permission to link the program and
11your derivative works with the separately licensed software that they have
12included with MySQL.
13
14This program is distributed in the hope that it will be useful, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
17for more details.
18
19You should have received a copy of the GNU General Public License along with
20this program; if not, write to the Free Software Foundation, Inc.,
2151 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23/** @file storage/temptable/include/temptable/handler.h
24TempTable public handler API declaration. */
25
26/** @page PAGE_TEMPTABLE TempTable storage engine
27The TempTable storage engine is designed to be used by the Optimizer for
28creating temporary tables internally when dealing with complex queries.
29
30@subpage PAGE_TEMPTABLE_GLOSSARY
31
32@subpage PAGE_TEMPTABLE_ROW_FORMAT
33
34@page PAGE_TEMPTABLE_GLOSSARY Glossary
35
36Following is a list of the terms used in the TempTable storage engine source
37code.
38
39This is to avoid confusion because in the surrounding code (outside of
40storage/temptable) different terms are used to designate the one thing and in
41some cases a given term can designate different things.
42
43For example some surrounding code reads `key->records_per_key(j)` where
44the first "key" (`key->...`) designates an index and the second "key"
45(`..._key(j)`) designates distinct indexed cells.
46
47Below are the terms used in TempTable source code with some explanations.
48
49@section TABLE Table
50
51A table consists of rows and columns.
52
53id | color_name | hex_code
54-- | ---------- | --------
55 1 | Red | FF0000
56 2 | Orange | FF8800
57 3 | Yellow | FFFF00
58 4 | Green | 00FF00
59 5 | Cyan | 00FFFF
60 6 | Blue | 0000FF
61 7 | Pink | FF00FF
62
63@section ROW Row
64
65A row is a horizonal slice from the table.
66
67id | color_name | hex_code
68----- | ---------- | --------
69 1 | Red | FF0000
70 2 | Orange | FF8800
71 @b 3 | @b Yellow | @b FFFF00
72 4 | Green | 00FF00
73 5 | Cyan | 00FFFF
74 6 | Blue | 0000FF
75 7 | Pink | FF00FF
76
77Also called "record" elsewhere.
78
79@section COLUMN Column
80
81A column is a vertical slice from the table. It has a name - "hex_code" in the
82example.
83
84id | color_name | @b hex_code
85-- | ---------- | --------
86 1 | Red | @b FF0000
87 2 | Orange | @b FF8800
88 3 | Yellow | @b FFFF00
89 4 | Green | @b 00FF00
90 5 | Cyan | @b 00FFFF
91 6 | Blue | @b 0000FF
92 7 | Pink | @b FF00FF
93
94Also called "field" elsewhere.
95
96@section CELL Cell
97
98A cell is where a row intersects with a column.
99
100id | color_name | @b hex_code
101---- | ---------- | --------
102 1 | Red | @b FF0000
103 2 | Orange | @b FF8800
104@b 3 | @b Yellow | @b @e FFFF00
105 4 | Green | @b 00FF00
106 5 | Cyan | @b 00FFFF
107 6 | Blue | @b 0000FF
108 7 | Pink | @b FF00FF
109
110Also called "field" elsewhere.
111
112@section INDEX Index
113
114An index is a complex structure covering one or more columns.
115Also called "key" elsewhere.
116
117@section INDEXED_COLUMN Indexed column
118
119A column that is covered by an index.
120
121@section INDEXED_CELL Indexed cell
122
123An indexed cell is a cell that is covered by an index. An intersection between
124a row and an indexed column.
125Also called "key", "field", "subkey", "key part", "key segment" elsewhere.
126*/
127
128#ifndef TEMPTABLE_HANDLER_H
129#define TEMPTABLE_HANDLER_H
130
131#include "sql/handler.h"
132#include "sql/table.h"
135
136namespace temptable {
137
138/** Forward declarations. */
139class Block;
140
141/** Temptable engine handler. */
142class Handler : public ::handler {
143 public:
144 /** Constructor. */
145 Handler(
146 /** [in] Handlerton, saved in `ht` in this class for later usage. */
147 handlerton *hton,
148 /** [in] Table data that is shared between handlers, saved in
149 * `table_share` in this class for later usage. */
151
152 /** Destructor. */
153 ~Handler() override = default;
154
155 /** Create an in-memory table.
156 * @return 0 on success or HA_ERR_* error code */
157 int create(
158 /** [in] Name of the new table. The engine does not try to parse it, so it
159 * can be anything as long as it is unique wrt other created tables and as
160 * long as the same name is given to the `open()` method. */
161 const char *table_name,
162 /** [in] New table structure (columns and indexes). Some of the members in
163 * `mysql_table->s` are remembered for later usage. */
164 TABLE *mysql_table,
165 /** [in] Unused. */
167 /** [in] Unused. */
168 dd::Table *) override;
169
170 /** Delete a table.
171 * @return 0 on success or HA_ERR_* error code */
172 int delete_table(
173 /** [in] Name of the table to delete. */
174 const char *table_name,
175 /** [in] Unused. */
176 const dd::Table *) override;
177
178 /** Open an existing table. A reference to the opened table is kept
179 * internally. Only one table can be opened at a time and the read&write
180 * methods operate on it.
181 * @return 0 on success or HA_ERR_* error code */
182 int open(
183 /** [in] Name of the table to open. */
184 const char *table_name,
185 /** [in] Unused. */
186 int,
187 /** [in] Unused. */
188 uint,
189 /** [in] Unused. */
190 const dd::Table *) override;
191
192 /** Close the opened table.
193 * @return 0 on success or HA_ERR_* error code */
194 int close() override;
195
196 /** Begin a table scan. The cursor is positioned _before_ the first row in
197 * insertion order and subsequent iterations with `rnd_next()` will return
198 * the rows in insertion order. `position()` must not be called immediately
199 * after `rnd_init()` without a call to `rnd_next()` after `rnd_init()`.
200 * @return 0 on success or HA_ERR_* error code */
201 int rnd_init(
202 /** [in] Unused. */
203 bool) override;
204
205 /** Advance the cursor to the next row in insertion order and retrieve it.
206 * If no more rows remain in the table, then `HA_ERR_END_OF_FILE` is returned.
207 * This method can then be called multiple times and it will keep returning
208 * `HA_ERR_END_OF_FILE`. If a new row is inserted after this method has
209 * returned `HA_ERR_END_OF_FILE` and this method is called again then it will
210 * fetch the newly inserted row.
211 * @return 0 on success or HA_ERR_* error code */
212 int rnd_next(
213 /** [out] Output where the retrieved row is written to. */
214 uchar *mysql_row) override;
215
216 /** Fetch the record pointed by `position`.
217 * @return 0 on success or HA_ERR_* error code */
218 int rnd_pos(
219 /** [out] Output where the retrieved row is written to. */
220 uchar *mysql_row,
221 /** [in] Position pointing to a row. Must be retrieved from
222 * `handler::ref` after a call to `position()`. */
223 uchar *position) override;
224
225 /** End a table scan. The table scan cursor is invalidated.
226 * @return 0 on success or HA_ERR_* error code */
227 int rnd_end() override;
228
229 /** Set the index to be used by subsequent `index_*()` calls.
230 * @return 0 on success or HA_ERR_* error code */
231 int index_init(
232 /** [in] index number (0-based). */
233 uint index_no,
234 /** [in] Unused. */
235 bool) override;
236
237 /** Read a row from the currently opened table using the index set with
238 * `index_init()`.
239 * @return 0 on success or HA_ERR_* error code */
240 int index_read(
241 /** [out] Output where the retrieved row is written to. */
242 uchar *mysql_row,
243 /** [in] Concatenated cells that are to be searched for. For example if
244 * the table has columns `c1=INT, c2=INT, c3=VARCHAR(16)` and an index
245 * on `(c1, c3)` and we are searching for `WHERE c1=5 AND c3='foo'`,
246 * then this will contain 5 and 'foo' concatenated. It may also contain
247 * a prefix of the indexed columns. */
248 const uchar *mysql_search_cells,
249 /** [in] The length of `mysql_search_cells` in bytes. */
250 uint mysql_search_cells_len_bytes,
251 /** [in] Flag denoting how to search for the row. */
252 ha_rkey_function find_flag) override;
253
254 /** Advance the index cursor and read the row at that position. Iteration is
255 * started by `index_first()` or `index_read()`.
256 * @return 0 on success or HA_ERR_* error code */
257 int index_next(
258 /** [out] Output where the retrieved row is written to. */
259 uchar *mysql_row) override;
260
261 /** Advance the index cursor and read the row at that position if its indexed
262 * cells are the same as in the current row.
263 * @return 0 on success or HA_ERR_* error code */
264 int index_next_same(
265 /** [out] Output where the retrieved row is written to. */
266 uchar *mysql_row,
267 /** [in] Unused. */
268 const uchar *,
269 /** [in] Unused. */
270 uint) override;
271
272 /** A condition used by `index_next_conditional()` to control whether to fetch
273 * the next row or not. */
274 enum class NextCondition {
275 /** No condition - fetch the next row unconditionally. */
276 NO,
277 /** Fetch the next row only if it is the same as the current one. */
279 };
280
281 /** Advance the index cursor and read the row at that position, conditionally
282 * - depending on the specified condition.
283 * @return 0 on success or HA_ERR_* error code */
285 /** [out] Output where the retrieved row is written to. */
286 uchar *mysql_row,
287 /** [in] Condition which dictates whether to fetch the next row or not. */
288 NextCondition condition);
289
290 /** Read the last row that matches `mysql_search_cells` (in index order).
291 @return 0 on success or HA_ERR_* error code */
292 int index_read_last(
293 /** [out] Output where the retrieved row is written to. */
294 uchar *mysql_row,
295 /** [in] Concatenated cells that are to be searched for.
296 * @see `index_read()`. */
297 const uchar *mysql_search_cells,
298 /** [in] The length of `mysql_search_cells` in bytes. */
299 uint mysql_search_cells_len_bytes) override;
300
301 /** Step to the previous row in index order.
302 @return 0 on success or HA_ERR_* error code */
303 int index_prev(
304 /** [out] Output where the retrieved row is written to. */
305 uchar *mysql_row) override;
306
307 /** End an index scan.
308 * @return 0 on success or HA_ERR_* error code */
309 int index_end() override;
310
311 /** Store position to current row inside the handler. */
312 void position(
313 /** [in] Unused. */
314 const uchar *) override;
315
316 /** Insert a new row to the currently opened table.
317 * @return 0 on success or HA_ERR_* error code */
318 int write_row(
319 /** [in] Row to insert. */
320 uchar *mysql_row) override;
321
322 /** Update a row.
323 * @return 0 on success or HA_ERR_* error code */
324 int update_row(
325 /** [in] Original row to find and update. */
326 const uchar *mysql_row_old,
327 /** [in] New row to put into the place of the old one. */
328 uchar *mysql_row_new) override;
329
330 /** Delete the row where the handler is currently positioned. This row must
331 * be equal to `mysql_row` and the handler must be positioned.
332 * @return 0 on success or HA_ERR_* error code */
333 int delete_row(
334 /** [in] Copy of the row to be deleted. */
335 const uchar *mysql_row) override;
336
337 /** Delete all rows in the table.
338 * @return 0 on success or HA_ERR_* error code */
339 int truncate(
340 /** [in] Unused. */
341 dd::Table *) override;
342
343 /** Delete all rows in the table.
344 * @return 0 on success or HA_ERR_* error code */
345 int delete_all_rows() override;
346
347 /** Refresh table stats.
348 * @return 0 on success or HA_ERR_* error code. */
349 int info(
350 /** [in] Which stats to refresh. */
351 uint flag) override;
352
353 /** Get the limit on the memory usage. */
354 longlong get_memory_buffer_size() const override;
355
356 /** Get the name of the storage engine.
357 * @return name */
358 const char *table_type() const override;
359
360 /** Get the table flags.
361 * @return table flags */
362 Table_flags table_flags() const override;
363
364 /** Get the flags for a given index.
365 * @return index flags */
366 ulong index_flags(
367 /** [in] Index number (0-based). */
368 uint index_no,
369 /** [in] Unused. */
370 uint,
371 /** [in] Unused. */
372 bool) const override;
373
374 /** Get the default index algorithm.
375 * @return index type */
377
378 /** Check whether an index algorithm is supported.
379 * @return true if supported */
381 /** [in] Algorithm to check if supported. */
382 ha_key_alg algorithm) const override;
383
384 /** Get the maximum supported index length in bytes.
385 * @return max length */
386 uint max_supported_key_length() const override;
387
388 /** Get the maximum supported indexed columns length.
389 * @return max length */
391 HA_CREATE_INFO *create_info) const override;
392
393#if 0
394 /* This is disabled in order to mimic ha_heap's implementation which relies on
395 * the method from the parent class which adds a magic +10. */
396
397 /** Get an upper bound of how many rows will be retrieved by a table scan.
398 * The number returned by this method is precisely the number of rows in the
399 * table.
400 * @return number of rows in the table */
402#endif
403
404 /** Not implemented. */
406
407 /** Scan time. The unit of the return value is "disk access". E.g. if the
408 * operation would require the disk to be accessed 5 times, then 5.0 would
409 * be returned.
410 * @deprecated This function is deprecated and will be removed in a future
411 * version. Use handler::table_scan_cost() instead.
412 * @return estimate based on the number of rows */
413 double scan_time() override;
414
415 /** Read time. The unit of the return value is "disk access". E.g. if the
416 * operation would require the disk to be accessed 5 times, then 5.0 would
417 * be returned.
418 * @deprecated This function is deprecated and will be removed in a future
419 * version. Use handler::read_cost() instead.
420 * @return estimate based on the number of rows */
421 double read_time(
422 /** [in] Unused. */
423 uint,
424 /** [in] Unused. */
425 uint,
426 /** [in] Total number of rows to be read. */
427 ha_rows rows) override;
428
429 /** Disable indexes.
430 * @return 0 on success or HA_ERR_* error code */
431 int disable_indexes(
432 /** [in] Mode. Only HA_KEY_SWITCH_ALL (disable all) is supported. */
433 uint mode) override;
434
435 /** Enable indexes. This is only supported if the currently opened table is
436 * empty.
437 * @return 0 on success or HA_ERR_* error code */
438 int enable_indexes(
439 /** [in] Mode. Only HA_KEY_SWITCH_ALL (enable all) is supported. */
440 uint mode) override;
441
442 /* Not implemented methods. */
443
444 /** Not implemented.
445 @return 0 */
446 int external_lock(THD *, int) override;
447
448 /** Not implemented. */
449 void unlock_row() override;
450
451 /** Not implemented.
452 @return nullptr */
453 handler *clone(const char *, MEM_ROOT *) override;
454
455 /** Not implemented.
456 @return 0 */
457 int index_first(uchar *) override;
458
459 /** Not implemented.
460 @return 0 */
461 int index_last(uchar *) override;
462
463 /** Not implemented.
464 @return 0 */
465 int analyze(THD *, HA_CHECK_OPT *) override;
466
467 /** Not implemented.
468 @return 0 */
469 int optimize(THD *, HA_CHECK_OPT *) override;
470
471 /** Not implemented.
472 @return 0 */
473 int check(THD *, HA_CHECK_OPT *) override;
474
475 /** Not implemented.
476 @return 0 */
477 int start_stmt(THD *, thr_lock_type) override;
478
479 /** Not implemented.
480 @return 0 */
481 int reset() override;
482
483 /** Not implemented.
484 @return 0 */
485 int records(ha_rows *) override;
486
487 /** Not implemented. */
488 void update_create_info(HA_CREATE_INFO *) override;
489
490 /** Not implemented.
491 @return 0 */
492 int rename_table(const char *, const char *, const dd::Table *,
493 dd::Table *) override;
494
495 /** Not implemented. */
496 void init_table_handle_for_HANDLER() override;
497
498 /** Not implemented.
499 @return false */
500 bool get_error_message(int, String *) override;
501
502 /** Not implemented.
503 @return false */
504 bool primary_key_is_clustered() const override;
505
506 /** Not implemented.
507 @return 0 */
508 int cmp_ref(const uchar *, const uchar *) const override;
509
510 /** Not implemented.
511 @return false */
513
514 private:
516
517 /** Checks if field has a fixed size.
518 * @return true if field has fixed size, false otherwise */
520 /** [in] Field descriptor. */
521 const Field &mysql_field) const;
522
523 /** Currently opened table, or `nullptr` if none is opened. */
525
526 /** Pointer to the non-owned shared-block of memory to be re-used by all
527 * `Allocator` instances or copies made by `Table`. */
529
530 /** Iterator used by `rnd_init()`, `rnd_next()` and `rnd_end()` methods.
531 * It points to the row that was retrieved by the last read call (e.g.
532 * `rnd_next()`). */
534
535 /** Flag that denotes whether `m_rnd_iterator` is positioned. `rnd_init()`
536 * "unpositions" the iterator, so that `rnd_next()` knows to start from
537 * the first row when the iterator is not positioned. */
539
540 /** Cursor used by `index_*()` methods.
541 * It points to the current record that will be retrieved by the next
542 * read call (e.g. `index_next()`). */
544
545 /** Number of cells to compare in `index_next()` after `index_read()` has
546 * positioned `m_index_cursor`. If we have an index on two columns, e.g.
547 * (c1, c2) and rows:
548 * (5, 6), (5, 7)
549 * and `index_read()` is requested to fetch the row where c1=5 then we
550 * will fetch the first row and position the index cursor on (5, 6).
551 * A subsequent call to `index_next()` must go to the next row if it
552 * is the same as the current, but only comparing the first cell.
553 * So in order to be able to treat (5, 6) equal to (5, 7) during
554 * `index_next()` (because the `index_read()` call only specified the first
555 * cell) we remember the number of cells to compare in this variable. */
557
558 /** Number of deleted rows by this handler object. */
560};
561
563 assert(m_opened_table != nullptr);
564 assert(handler::table != nullptr);
566}
567
568inline bool Handler::is_field_type_fixed_size(const Field &mysql_field) const {
569 switch (mysql_field.type()) {
570 case MYSQL_TYPE_BLOB:
572 case MYSQL_TYPE_JSON:
577 return false;
578 default:
579 return true;
580 }
581}
582
585
586} /* namespace temptable */
587
588#endif /* TEMPTABLE_HANDLER_H */
Definition: field.h:573
virtual enum_field_types type() const =0
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:945
Definition: table.h:46
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4157
TABLE_SHARE * table_share
Definition: handler.h:4164
ulonglong Table_flags
Definition: handler.h:4161
TABLE * table
Definition: handler.h:4165
virtual ha_rows estimate_rows_upper_bound()
Return upper bound of current number of records in the table (max.
Definition: handler.h:5050
Memory-block abstraction whose purpose is to serve as a building block for custom memory-allocator im...
Definition: block.h:162
A cursor for iterating over an Index.
Definition: cursor.h:40
Temptable engine handler.
Definition: handler.h:142
int check(THD *, HA_CHECK_OPT *) override
Not implemented.
Definition: handler.cc:974
int enable_indexes(uint mode) override
Enable indexes.
Definition: handler.cc:917
~Handler() override=default
Destructor.
int create(const char *table_name, TABLE *mysql_table, HA_CREATE_INFO *, dd::Table *) override
Create an in-memory table.
Definition: handler.cc:105
int open(const char *table_name, int, uint, const dd::Table *) override
Open an existing table.
Definition: handler.cc:183
int index_prev(uchar *mysql_row) override
Step to the previous row in index order.
Definition: handler.cc:575
uint max_supported_key_length() const override
Get the maximum supported index length in bytes.
Definition: handler.cc:834
Block * m_shared_block
Pointer to the non-owned shared-block of memory to be re-used by all Allocator instances or copies ma...
Definition: handler.h:528
int index_first(uchar *) override
Not implemented.
Definition: handler.cc:950
size_t m_index_read_number_of_cells
Number of cells to compare in index_next() after index_read() has positioned m_index_cursor.
Definition: handler.h:556
int analyze(THD *, HA_CHECK_OPT *) override
Not implemented.
Definition: handler.cc:962
ulong index_flags(uint index_no, uint, bool) const override
Get the flags for a given index.
Definition: handler.cc:788
int write_row(uchar *mysql_row) override
Insert a new row to the currently opened table.
Definition: handler.cc:643
bool check_if_incompatible_data(HA_CREATE_INFO *, uint) override
Not implemented.
Definition: handler.cc:1032
int index_end() override
End an index scan.
Definition: handler.cc:609
int index_init(uint index_no, bool) override
Set the index to be used by subsequent index_*() calls.
Definition: handler.cc:337
bool primary_key_is_clustered() const override
Not implemented.
Definition: handler.cc:1021
NextCondition
A condition used by index_next_conditional() to control whether to fetch the next row or not.
Definition: handler.h:274
@ NO
No condition - fetch the next row unconditionally.
@ ONLY_IF_SAME
Fetch the next row only if it is the same as the current one.
int rnd_pos(uchar *mysql_row, uchar *position) override
Fetch the record pointed by position.
Definition: handler.cc:302
void update_create_info(HA_CREATE_INFO *) override
Not implemented.
Definition: handler.cc:998
int rnd_init(bool) override
Begin a table scan.
Definition: handler.cc:233
Storage::Iterator m_rnd_iterator
Iterator used by rnd_init(), rnd_next() and rnd_end() methods.
Definition: handler.h:533
int index_next_same(uchar *mysql_row, const uchar *, uint) override
Advance the index cursor and read the row at that position if its indexed cells are the same as in th...
Definition: handler.cc:479
int rename_table(const char *, const char *, const dd::Table *, dd::Table *) override
Not implemented.
Definition: handler.cc:1003
int index_read_last(uchar *mysql_row, const uchar *mysql_search_cells, uint mysql_search_cells_len_bytes) override
Read the last row that matches mysql_search_cells (in index order).
Definition: handler.cc:562
Table * m_opened_table
Currently opened table, or nullptr if none is opened.
Definition: handler.h:524
void position(const uchar *) override
Store position to current row inside the handler.
Definition: handler.cc:625
int delete_row(const uchar *mysql_row) override
Delete the row where the handler is currently positioned.
Definition: handler.cc:678
handler * clone(const char *, MEM_ROOT *) override
Not implemented.
Definition: handler.cc:944
double scan_time() override
Scan time.
Definition: handler.cc:876
int records(ha_rows *) override
Not implemented.
Definition: handler.cc:992
int delete_table(const char *table_name, const dd::Table *) override
Delete a table.
Definition: handler.cc:150
int external_lock(THD *, int) override
Not implemented.
Definition: handler.cc:936
int reset() override
Not implemented.
Definition: handler.cc:986
int disable_indexes(uint mode) override
Disable indexes.
Definition: handler.cc:898
const char * table_type() const override
Get the name of the storage engine.
Definition: handler.cc:763
Result index_next_conditional(uchar *mysql_row, NextCondition condition)
Advance the index cursor and read the row at that position, conditionally.
Definition: handler.cc:492
THR_LOCK_DATA ** store_lock(THD *, THR_LOCK_DATA **, thr_lock_type) override
Not implemented.
Definition: handler.cc:871
int start_stmt(THD *, thr_lock_type) override
Not implemented.
Definition: handler.cc:980
int close() override
Close the opened table.
Definition: handler.cc:213
double read_time(uint, uint, ha_rows rows) override
Read time.
Definition: handler.cc:887
int optimize(THD *, HA_CHECK_OPT *) override
Not implemented.
Definition: handler.cc:968
void opened_table_validate()
Definition: handler.h:562
uint max_supported_key_part_length(HA_CREATE_INFO *create_info) const override
Get the maximum supported indexed columns length.
Definition: handler.cc:844
bool is_index_algorithm_supported(ha_key_alg algorithm) const override
Check whether an index algorithm is supported.
Definition: handler.cc:829
longlong get_memory_buffer_size() const override
Get the limit on the memory usage.
Definition: handler.cc:754
void unlock_row() override
Not implemented.
Definition: handler.cc:942
size_t m_deleted_rows
Number of deleted rows by this handler object.
Definition: handler.h:559
Cursor m_index_cursor
Cursor used by index_*() methods.
Definition: handler.h:543
int truncate(dd::Table *) override
Delete all rows in the table.
Definition: handler.cc:706
bool is_field_type_fixed_size(const Field &mysql_field) const
Checks if field has a fixed size.
Definition: handler.h:568
int cmp_ref(const uchar *, const uchar *) const override
Not implemented.
Definition: handler.cc:1026
int index_last(uchar *) override
Not implemented.
Definition: handler.cc:956
bool m_rnd_iterator_is_positioned
Flag that denotes whether m_rnd_iterator is positioned.
Definition: handler.h:538
Table_flags table_flags() const override
Get the table flags.
Definition: handler.cc:768
int index_next(uchar *mysql_row) override
Advance the index cursor and read the row at that position.
Definition: handler.cc:467
int info(uint flag) override
Refresh table stats.
Definition: handler.cc:730
bool get_error_message(int, String *) override
Not implemented.
Definition: handler.cc:1015
int rnd_next(uchar *mysql_row) override
Advance the cursor to the next row in insertion order and retrieve it.
Definition: handler.cc:247
Handler(handlerton *hton, TABLE_SHARE *table_share)
Constructor.
Definition: handler.cc:68
int rnd_end() override
End a table scan.
Definition: handler.cc:323
void init_table_handle_for_HANDLER() override
Not implemented.
Definition: handler.cc:1010
ha_key_alg get_default_index_algorithm() const override
Get the default index algorithm.
Definition: handler.cc:824
int update_row(const uchar *mysql_row_old, uchar *mysql_row_new) override
Update a row.
Definition: handler.cc:655
int index_read(uchar *mysql_row, const uchar *mysql_search_cells, uint mysql_search_cells_len_bytes, ha_rkey_function find_flag) override
Read a row from the currently opened table using the index set with index_init().
Definition: handler.cc:357
int delete_all_rows() override
Delete all rows in the table.
Definition: handler.cc:725
Iterator over a Storage object.
Definition: storage.h:50
Definition: table.h:46
const TABLE_SHARE * mysql_table_share() const
Definition: table.h:174
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:72
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:86
@ MYSQL_TYPE_BLOB
Definition: field_types.h:87
@ MYSQL_TYPE_JSON
Definition: field_types.h:80
@ MYSQL_TYPE_TINY_BLOB
Definition: field_types.h:84
@ MYSQL_TYPE_GEOMETRY
Definition: field_types.h:90
@ MYSQL_TYPE_MEDIUM_BLOB
Definition: field_types.h:85
static int flag
Definition: hp_test1.cc:39
ha_key_alg
Definition: my_base.h:96
ha_rkey_function
Definition: my_base.h:77
my_off_t ha_rows
Definition: my_base.h:1139
unsigned char uchar
Definition: my_inttypes.h:51
long long int longlong
Definition: my_inttypes.h:54
const char * table_name
Definition: rules_table_service.cc:55
mode
Definition: file_handle.h:59
Definition: allocator.h:44
void kv_store_shards_debug_dump()
Small helper function which debug-prints the miscelaneous statistics which key-value store has collec...
Definition: handler.cc:52
Result
Definition: result.h:33
void shared_block_pool_release(THD *thd)
Small helper function which releases the slot (and memory occupied by the Block) in shared-block pool...
Definition: handler.cc:57
TempTable Table declarations.
TempTable Storage.
Definition: handler.h:3375
Definition: handler.h:2790
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
This structure is shared between different table objects.
Definition: table.h:688
Definition: table.h:1394
TABLE_SHARE * s
Definition: table.h:1395
Definition: thr_lock.h:123
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2416
thr_lock_type
Definition: thr_lock.h:50
unsigned int uint
Definition: uca-dump.cc:29