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