MySQL 8.3.0
Source Code Documentation
ha_innopart.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2014, 2023, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is also distributed with certain software (including but not
10limited to OpenSSL) that is licensed under separate terms, as designated in a
11particular file or component or in included license documentation. The authors
12of MySQL hereby grant you an additional permission to link the program and
13your derivative works with the separately licensed software that they have
14included with MySQL.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc.,
2351 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
25*****************************************************************************/
26
27/* The InnoDB Partition handler: the interface between MySQL and InnoDB. */
28
29#ifndef ha_innopart_h
30#define ha_innopart_h
31
32#include <stddef.h>
33#include <sys/types.h>
34
35#include "ha_innodb.h"
36#include "my_compiler.h"
37#include "my_inttypes.h"
39#include "row0mysql.h"
40#include "ut0bitset.h"
41
42/* Forward declarations */
44class partition_info;
45
46/* Error Text */
47static constexpr auto PARTITION_IN_SHARED_TABLESPACE =
48 "InnoDB : A partitioned table"
49 " is not allowed in a shared tablespace.";
50
51/** HA_DUPLICATE_POS and HA_READ_BEFORE_WRITE_REMOVAL is not
52set from ha_innobase, but cannot yet be supported in ha_innopart.
53Full text and geometry is not yet supported. */
57
59
60/** InnoDB partition specific Handler_share. */
62 private:
63 /** Array of all included table definitions (one per partition). */
65
66 /** Instead of INNOBASE_SHARE::idx_trans_tbl. Maps MySQL index number
67 to InnoDB index per partition. */
69
70 /** Total number of partitions. */
72
73 /** Number of indexes. */
75
76 /** Reference count. */
78
79 /** Pointer back to owning TABLE_SHARE. */
81
82 public:
83 Ha_innopart_share(TABLE_SHARE *table_share);
84
85 ~Ha_innopart_share() override;
86
87 /** Set innodb table for given partition.
88 @param[in] part_id Partition number.
89 @param[in] table Table. */
90 inline void set_table_part(uint part_id, dict_table_t *table) {
91 ut_ad(m_table_parts != nullptr);
92 ut_ad(part_id < m_tot_parts);
93 m_table_parts[part_id] = table;
94 }
95 /** Get table reference for given partition.
96 @param[in] part_id Partition number
97 @return InnoDB table reference. */
98 inline dict_table_t **get_table_part_ref(uint part_id) {
99 return (&m_table_parts[part_id]);
100 }
101
102 /** Return innodb table for given partition.
103 @param[in] part_id Partition number.
104 @return InnoDB table. */
105 inline dict_table_t *get_table_part(uint part_id) const {
106 ut_ad(m_table_parts != nullptr);
107 ut_ad(part_id < m_tot_parts);
108 return (m_table_parts[part_id]);
109 }
110
111 /** Return innodb index for given partition and key number.
112 @param[in] part_id Partition number.
113 @param[in] keynr Key number.
114 @return InnoDB index. */
115 dict_index_t *get_index(uint part_id, uint keynr);
116
117 /** Get MySQL key number corresponding to InnoDB index.
118 Calculates the key number used inside MySQL for an Innobase index. We will
119 first check the "index translation table" for a match of the index to get
120 the index number. If there does not exist an "index translation table",
121 or not able to find the index in the translation table, then we will fall back
122 to the traditional way of looping through dict_index_t list to find a
123 match. In this case, we have to take into account if we generated a
124 default clustered index for the table
125 @param[in] part_id Partition the index belongs to.
126 @param[in] index Index to return MySQL key number for.
127 @return the key number used inside MySQL or UINT_MAX if key is not
128 found. */
129 uint get_mysql_key(uint part_id, const dict_index_t *index);
130
131 /** Return whether share has opened InnoDB tables for partitions. */
132 bool has_table_parts() const { return (m_table_parts != nullptr); }
133
134 /** Increment share and InnoDB tables reference counters. */
136
137 /** Open InnoDB tables for partitions and return them as array.
138 @param[in,out] thd Thread context
139 @param[in] table MySQL table definition
140 @param[in] dd_table Global DD table object
141 @param[in] part_info Partition info (partition names to use)
142 @param[in] table_name Table name (db/table_name)
143 @return Array on InnoDB tables on success else nullptr. */
144 static dict_table_t **open_table_parts(THD *thd, const TABLE *table,
145 const dd::Table *dd_table,
146 partition_info *part_info,
147 const char *table_name);
148
149 /** Initialize the share with table and indexes per partition.
150 @param[in] part_info Partition info (partition names to use).
151 @param[in] table_parts Array of InnoDB tables for partitions.
152 @return false on success else true. */
154 dict_table_t **table_parts);
155
156 /** Close the table partitions.
157 If all instances are closed, also release the resources.*/
158 void close_table_parts();
159
160 /** Close InnoDB tables for partitions.
161 @param[in] table_parts Array of InnoDB tables for partitions.
162 @param[in] tot_parts Number of partitions. */
163 static void close_table_parts(dict_table_t **table_parts, uint tot_parts);
164
165 /** @return the TABLE SHARE object */
166 const TABLE_SHARE *get_table_share() const { return (m_table_share); }
167
168 /** Get the number of partitions
169 @return number of partitions */
170 uint get_num_parts() const {
171 ut_ad(m_tot_parts != 0);
172 return (m_tot_parts);
173 }
174
175 /** Set up the virtual column template for partition table, and points
176 all m_table_parts[]->vc_templ to it.
177 @param[in] table MySQL TABLE object
178 @param[in] ib_table InnoDB dict_table_t
179 @param[in] name Table name (db/table_name) */
180 void set_v_templ(TABLE *table, dict_table_t *ib_table, const char *name);
181
182 private:
183 /** Disable default constructor. */
184 Ha_innopart_share() = default;
185
186 /** Open one partition
187 @param[in,out] client Data dictionary client
188 @param[in] thd Thread THD
189 @param[in] table MySQL table definition
190 @param[in] dd_part dd::Partition
191 @param[in] part_name Table name of this partition
192 @param[out] part_dict_table InnoDB table for partition
193 @retval false On success
194 @retval true On failure */
196 THD *thd, const TABLE *table,
197 const dd::Partition *dd_part,
198 const char *part_name,
199 dict_table_t **part_dict_table);
200};
201
202/** Get explicit specified tablespace for one (sub)partition, checking
203from lowest level
204@param[in] tablespace table-level tablespace if specified
205@param[in] part Partition to check
206@param[in] sub_part Sub-partition to check, if no, just NULL
207@return Tablespace name, if nullptr or [0] = '\0' then nothing specified */
208const char *partition_get_tablespace(const char *tablespace,
209 const partition_element *part,
210 const partition_element *sub_part);
211
212/** The class defining a partitioning aware handle to an InnoDB table.
213Based on ha_innobase and extended with
214- Partition_helper for re-using common partitioning functionality
215- Partition_handler for providing partitioning specific api calls.
216Generic partitioning functions are implemented in Partition_helper.
217Lower level storage functions are implemented in ha_innobase.
218Partition_handler is inherited for implementing the handler level interface
219for partitioning specific functions, like truncate_partition.
220InnoDB specific functions related to partitioning is implemented here. */
222 public Partition_helper,
223 public Partition_handler {
224 public:
225 ha_innopart(handlerton *hton, TABLE_SHARE *table_arg);
226
227 ~ha_innopart() override = default;
228
229 /** Clone this handler, used when needing more than one cursor
230 to the same table.
231 @param[in] name Table name.
232 @param[in] mem_root mem_root to allocate from.
233 @retval Pointer to clone or NULL if error. */
234 handler *clone(const char *name, MEM_ROOT *mem_root) override;
235
236 /** \defgroup ONLINE_ALTER_TABLE_INTERFACE On-line ALTER TABLE interface
237 @see handler0alter.cc
238 @{ */
239
240 /** Check if InnoDB supports a particular alter table in-place.
241 @param[in] altered_table TABLE object for new version of table.
242 @param[in,out] ha_alter_info Structure describing changes to be done
243 by ALTER TABLE and holding data used during in-place alter.
244 @retval HA_ALTER_INPLACE_NOT_SUPPORTED Not supported
245 @retval HA_ALTER_INPLACE_NO_LOCK Supported
246 @retval HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE Supported, but
247 requires lock during main phase and exclusive lock during prepare
248 phase.
249 @retval HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE Supported, prepare
250 phase requires exclusive lock. */
252 TABLE *altered_table, Alter_inplace_info *ha_alter_info) override;
253
254 /** Prepare in-place ALTER for table.
255 Allows InnoDB to update internal structures with concurrent
256 writes blocked (provided that check_if_supported_inplace_alter()
257 did not return HA_ALTER_INPLACE_NO_LOCK).
258 This will be invoked before inplace_alter_table().
259 @param[in] altered_table TABLE object for new version of table.
260 @param[in,out] ha_alter_info Structure describing changes to be done
261 by ALTER TABLE and holding data used during in-place alter.
262 @param[in] old_table_def dd::Table object describing old
263 version of the table.
264 @param[in,out] new_table_def dd::Table object for the new version
265 of the table. Can be adjusted by this call. Changes to the table
266 definition will be persisted in the data-dictionary at statement
267 commit time.
268 @retval true Failure.
269 @retval false Success. */
270 bool prepare_inplace_alter_table(TABLE *altered_table,
271 Alter_inplace_info *ha_alter_info,
272 const dd::Table *old_table_def,
273 dd::Table *new_table_def) override;
274
275 /** Alter the table structure in-place.
276 Alter the table structure in-place with operations
277 specified using HA_ALTER_FLAGS and Alter_inplace_information.
278 The level of concurrency allowed during this operation depends
279 on the return value from check_if_supported_inplace_alter().
280 @param[in] altered_table TABLE object for new version of table.
281 @param[in,out] ha_alter_info Structure describing changes to be done
282 by ALTER TABLE and holding data used during in-place alter.
283 @param[in] old_table_def dd::Table object describing old
284 version of the table.
285 @param[in,out] new_table_def dd::Table object for the new version
286 of the table. Can be adjusted by this call. Changes to the table
287 definition will be persisted in the data-dictionary at statement
288 commit time.
289 @retval true Failure.
290 @retval false Success. */
291 bool inplace_alter_table(TABLE *altered_table,
292 Alter_inplace_info *ha_alter_info,
293 const dd::Table *old_table_def,
294 dd::Table *new_table_def) override;
295
296 /** Commit or rollback.
297 Commit or rollback the changes made during
298 prepare_inplace_alter_table() and inplace_alter_table() inside
299 the storage engine. Note that the allowed level of concurrency
300 during this operation will be the same as for
301 inplace_alter_table() and thus might be higher than during
302 prepare_inplace_alter_table(). (E.g concurrent writes were
303 blocked during prepare, but might not be during commit).
304 @param[in] altered_table TABLE object for new version of table.
305 @param[in,out] ha_alter_info Structure describing changes to be done
306 by ALTER TABLE and holding data used during
307 in-place alter.
308 @param[in] commit true => Commit, false => Rollback.
309 @param[in] old_table_def dd::Table object describing old
310 version of the table.
311 @param[in,out] new_table_def dd::Table object for the new version
312 of the table. Can be adjusted by this call. Changes to the table
313 definition will be persisted in the data-dictionary at statement
314 commit time.
315 @retval true Failure.
316 @retval false Success. */
317 bool commit_inplace_alter_table(TABLE *altered_table,
318 Alter_inplace_info *ha_alter_info,
319 bool commit, const dd::Table *old_table_def,
320 dd::Table *new_table_def) override;
321 /** @} */
322
323 /** Allows InnoDB to update internal structures with concurrent
324 writes blocked (given that check_if_supported_inplace_alter()
325 did not return HA_ALTER_INPLACE_NO_LOCK).
326 This is for 'ALTER TABLE ... PARTITION' and a corresponding function
327 to inplace_alter_table().
328 This will be invoked before inplace_alter_partition().
329
330 @param[in,out] altered_table TABLE object for new version of table
331 @param[in,out] ha_alter_info Structure describing changes to be done
332 by ALTER TABLE and holding data used during
333 in-place alter.
334 @param[in] old_dd_tab Table definition before the ALTER
335 @param[in,out] new_dd_tab Table definition after the ALTER
336 @retval true Failure
337 @retval false Success */
338 bool prepare_inplace_alter_partition(TABLE *altered_table,
339 Alter_inplace_info *ha_alter_info,
340 const dd::Table *old_dd_tab,
341 dd::Table *new_dd_tab);
342
343 /** Alter the table structure in-place with operations
344 specified using HA_ALTER_FLAGS and Alter_inplace_information.
345 This is for 'ALTER TABLE ... PARTITION' and a corresponding function
346 to inplace_alter_table().
347 The level of concurrency allowed during this operation depends
348 on the return value from check_if_supported_inplace_alter().
349
350 @param[in,out] ha_alter_info Structure describing changes to be done
351 by ALTER TABLE and holding data used
352 during in-place alter.
353 @retval true Failure
354 @retval false Success */
355 bool inplace_alter_partition(Alter_inplace_info *ha_alter_info);
356
357 /** Prepare to commit or roll back ALTER TABLE...ALGORITHM=INPLACE.
358 This is for 'ALTER TABLE ... PARTITION' and a corresponding function
359 to commit_inplace_alter_table().
360 @param[in,out] altered_table TABLE object for new version of table.
361 @param[in,out] ha_alter_info ALGORITHM=INPLACE metadata
362 @param[in] commit true=Commit, false=Rollback.
363 @param[in] old_dd_tab old table
364 @param[in,out] new_dd_tab new table
365 @retval true on failure (my_error() will have been called)
366 @retval false on success */
367 bool commit_inplace_alter_partition(TABLE *altered_table,
368 Alter_inplace_info *ha_alter_info,
369 bool commit, const dd::Table *old_dd_tab,
370 dd::Table *new_dd_tab);
371
372 // TODO: should we implement init_table_handle_for_HANDLER() ?
373 // (or is sql_stat_start handled correctly anyway?)
374 /** Optimize table.
375 This is mapped to "ALTER TABLE tablename ENGINE=InnoDB", which rebuilds
376 the table in MySQL.
377 @param[in] thd Connection thread handle.
378 @param[in] check_opt Currently ignored.
379 @return 0 for success else error code. */
380 int optimize(THD *thd, HA_CHECK_OPT *check_opt) override;
381
382 /** Set DD discard attribute for tablespace.
383 @param[in] table_def dd table
384 @param[in] discard True if this table is discarded
385 @return 0 or error number. */
386 int set_dd_discard_attribute(dd::Table *table_def, bool discard);
387
388 int discard_or_import_tablespace(bool discard, dd::Table *table_def) override;
389
390 /** Compare key and rowid.
391 Helper function for sorting records in the priority queue.
392 a/b points to table->record[0] rows which must have the
393 key fields set. The bytes before a and b store the rowid.
394 This is used for comparing/sorting rows first according to
395 KEY and if same KEY, by rowid (ref).
396
397 @param[in] key_info Null terminated array of index
398 information.
399 @param[in] a Pointer to record+ref in first record.
400 @param[in] b Pointer to record+ref in second record.
401 @return Return value is SIGN(first_rec - second_rec)
402 @retval 0 Keys are equal.
403 @retval -1 second_rec is greater than first_rec.
404 @retval +1 first_rec is greater than second_rec. */
405 static int key_and_rowid_cmp(KEY **key_info, uchar *a, uchar *b);
406
407 int extra(enum ha_extra_function operation) override;
408
409 void print_error(int error, myf errflag) override;
410
411 bool is_ignorable_error(int error) override;
412
413 int start_stmt(THD *thd, thr_lock_type lock_type) override;
414
415 ha_rows records_in_range(uint inx, key_range *min_key,
416 key_range *max_key) override;
417
419
421
422 void update_create_info(HA_CREATE_INFO *create_info) override;
423
424 int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info,
425 dd::Table *table_def) override;
426
427 /** Drop a table.
428 @param[in] name table name
429 @param[in,out] dd_table data dictionary table
430 @return error number
431 @retval 0 on success */
432 int delete_table(const char *name, const dd::Table *dd_table) override;
433
434 /** Rename a table.
435 @param[in] from table name before rename
436 @param[in] to table name after rename
437 @param[in] from_table data dictionary table before rename
438 @param[in,out] to_table data dictionary table after rename
439 @return error number
440 @retval 0 on success */
441 int rename_table(const char *from, const char *to,
442 const dd::Table *from_table, dd::Table *to_table) override;
443
444 int check(THD *thd, HA_CHECK_OPT *check_opt) override;
445
446 /** Repair a partitioned table.
447 Only repairs records in wrong partitions (moves them to the correct
448 partition or deletes them if not in any partition).
449 @param[in] thd MySQL THD object/thread handle.
450 @param[in] repair_opt Repair options.
451 @return 0 or error code. */
452 int repair(THD *thd, HA_CHECK_OPT *repair_opt) override;
453
454 /** Get the current auto_increment value.
455 @param[in] offset Table auto-inc offset.
456 @param[in] increment Table auto-inc increment.
457 @param[in] nb_desired_values Number of required values.
458 @param[out] first_value The auto increment value.
459 @param[out] nb_reserved_values Number of reserved values. */
460 void get_auto_increment(ulonglong offset, ulonglong increment,
461 ulonglong nb_desired_values, ulonglong *first_value,
462 ulonglong *nb_reserved_values) override;
463
464 /* Get partition row type
465 @param[in] partition_table partition table
466 @param[in] part_id Id of partition for which row type to be retrieved
467 @return Partition row type. */
468 enum row_type get_partition_row_type(const dd::Table *partition_table,
469 uint part_id) override;
470
471 int cmp_ref(const uchar *ref1, const uchar *ref2) const override;
472
473 int read_range_first(const key_range *start_key, const key_range *end_key,
474 bool eq_range_arg, bool sorted) override {
475 return (Partition_helper::ph_read_range_first(start_key, end_key,
476 eq_range_arg, sorted));
477 }
478
479 void position(const uchar *record) override {
481 }
482
483 /* TODO: Implement these! */
485 uint table_changes
486 [[maybe_unused]]) override {
487 ut_d(ut_error);
488 ut_o(return (COMPATIBLE_DATA_NO));
489 }
490
491 int delete_all_rows() override { return (handler::delete_all_rows()); }
492
493 int disable_indexes(uint mode [[maybe_unused]]) override {
494 return (HA_ERR_WRONG_COMMAND);
495 }
496
497 int enable_indexes(uint mode [[maybe_unused]]) override {
498 return (HA_ERR_WRONG_COMMAND);
499 }
500
501 int ft_init() override {
502 ut_d(ut_error);
503 ut_o(return (HA_ERR_WRONG_COMMAND));
504 }
505
506 FT_INFO *ft_init_ext(uint flags [[maybe_unused]], uint inx [[maybe_unused]],
507 String *key [[maybe_unused]]) override {
508 ut_d(ut_error);
509 ut_o(return (nullptr));
510 }
511
512 FT_INFO *ft_init_ext_with_hints(uint inx [[maybe_unused]],
513 String *key [[maybe_unused]],
514 Ft_hints *hints [[maybe_unused]]) override {
515 ut_d(ut_error);
516 ut_o(return (nullptr));
517 }
518
519 int ft_read(uchar *buf [[maybe_unused]]) override {
520 ut_d(ut_error);
521 ut_o(return (HA_ERR_WRONG_COMMAND));
522 }
523
524 bool get_foreign_dup_key(char *child_table_name [[maybe_unused]],
525 uint child_table_name_len [[maybe_unused]],
526 char *child_key_name [[maybe_unused]],
527 uint child_key_name_len [[maybe_unused]]) override {
528 ut_d(ut_error);
529 ut_o(return (false));
530 }
531
532 int read_range_next() override {
534 }
535
536 uint32_t calculate_key_hash_value(Field **field_array) override {
538 }
539
540 Table_flags table_flags() const override {
542 }
543
544 void release_auto_increment() override {
546 }
547
548 /** Implementing Partition_handler interface @see partition_handler.h
549 @{ */
550
551 /** See Partition_handler. */
553 ha_checksum *check_sum,
554 uint part_id) override {
556 part_id);
557 }
558
559 uint alter_flags(uint flags [[maybe_unused]]) const override {
561 }
562
564 return (static_cast<Partition_handler *>(this));
565 }
566
567 void set_part_info(partition_info *part_info, bool early) override {
568 Partition_helper::set_part_info_low(part_info, early);
569 }
570
571 void initialize_partitioning(partition_info *part_info, bool early) {
572 Partition_helper::set_part_info_low(part_info, early);
573 }
574
575 handler *get_handler() override { return (static_cast<handler *>(this)); }
576 /** @} */
577
578 /** Get number of threads that would be spawned for parallel read.
579 @param[out] scan_ctx A scan context created by this method
580 that has to be used in
581 parallel_scan
582 @param[out] num_threads Number of threads to be spawned
583 @param[in] use_reserved_threads true if reserved threads are to be used
584 if we exhaust the max cap of number of
585 parallel read threads that can be
586 spawned at a time
587 @param[in] max_desired_threads Maximum number of desired read threads;
588 passing 0 has no effect, it is ignored;
589 upper-limited by the current value of
590 innodb_parallel_read_threads.
591 @return error code
592 @return 0 on success */
593 int parallel_scan_init(void *&scan_ctx, size_t *num_threads,
594 bool use_reserved_threads,
595 size_t max_desired_threads) override;
596
598
599 /** Start parallel read of data.
600 @param[in] scan_ctx Scan context created by parallel_scan_init
601 @param[in] thread_ctxs context for each of the spawned threads
602 @param[in] init_fn callback called by each parallel load
603 thread at the beginning of the parallel load.
604 @param[in] load_fn callback called by each parallel load
605 thread when processing of rows is required.
606 @param[in] end_fn callback called by each parallel load
607 thread when processing of rows has ended.
608 @return error code
609 @return 0 on success */
610 int parallel_scan(void *scan_ctx, void **thread_ctxs, Reader::Init_fn init_fn,
611 Reader::Load_fn load_fn, Reader::End_fn end_fn) override;
612 /** Run the parallel read of data.
613 @param[in] parallel_scan_ctx a scan context created by
614 parallel_scan_init
615 */
616 void parallel_scan_end(void *parallel_scan_ctx) override;
617
618 private:
619 /** Pointer to Ha_innopart_share on the TABLE_SHARE. */
621
623 /** saved m_prebuilt->ins_node */
625
626 /** saved m_prebuilt->upd_node */
628
629 /** saved m_prebuilt->blob_heap */
631
632 /** saved m_prebuilt->trx_id (which in turn reflects table->def_trx_id) */
634
635 /** saved m_prebuilt->row_read_type */
637
638 /** save m_prebuilt->new_rec_lock[] values */
640 };
641 /* Per partition information storing last values of m_prebuilt when we've last
642 finished using given partition, so we can restore it when we return to it.
643 Synchronized with m_prebuilt when changing partitions:
644 set_partition(part_id) copies to m_prebuilt from m_parts[part_id]
645 update_partition(part_id) copies to m_parts[part_id] from m_prebuilt
646
647 NOTE: these are not the only fields synchronized with m_prebuilt.
648 */
650
651 /** byte array for sql_stat_start bitset */
652 byte *m_bitset;
653
654 /** sql_stat_start per partition. */
656
657 /** persistent cursors per partition. */
659
660 /** persistent cluster cursors per partition. */
662
663 /** map from part_id to offset in above two arrays. */
664 uint16_t *m_pcur_map;
665
666 /** Original m_prebuilt->pcur. */
668
669 /** Original m_prebuilt->clust_pcur. */
671
672 /** New partitions during ADD/REORG/... PARTITION. */
674
675 /** Can reuse the template for the previous partition. */
677
678 /** Clear used ins_nodes and upd_nodes. */
679 void clear_ins_upd_nodes();
680
681 /** Clear the blob heaps for all partitions */
682 void clear_blob_heaps();
683
684 /** Reset state of file to after 'open'. This function is called
685 after every statement for all tables used by that statement. */
686 int reset() override;
687
688 /** Changes the active index of a handle.
689 @param[in] part_id Use this partition.
690 @param[in] keynr Use this index; MAX_KEY means always clustered index,
691 even if it was internally generated by InnoDB.
692 @return 0 or error number. */
693 int change_active_index(uint part_id, uint keynr);
694
695 /** Move to next partition and set its index.
696 @return 0 for success else error number. */
698
699 /** Internally called for initializing auto increment value.
700 Should never be called, but defined to catch such errors.
701 @return 0 on success else error code. */
703
704 /** Get the index for the current partition
705 @param[in] keynr MySQL index number.
706 @return InnoDB index or NULL. */
707 dict_index_t *innobase_get_index(uint keynr) override;
708
709 /** Get the index for a handle.
710 Does not change active index.
711 @param[in] keynr Use this index; MAX_KEY means always clustered index,
712 even if it was internally generated by InnoDB.
713 @param[in] part_id From this partition.
714 @return NULL or index instance. */
715 dict_index_t *innopart_get_index(uint part_id, uint keynr);
716
717 /** Change active partition.
718 Copies needed info into m_prebuilt from the partition specific memory.
719 @param[in] part_id Partition to set as active. */
720 void set_partition(uint part_id);
721
722 /** Update active partition.
723 Copies needed info from m_prebuilt into the partition specific memory.
724 @param[in] part_id Partition to set as active. */
725 void update_partition(uint part_id);
726
727 /** TRUNCATE an InnoDB partitioned table.
728 @param[in] name table name
729 @param[in] form table definition
730 @param[in,out] table_def dd::Table describing table to be
731 truncated. Can be adjusted by SE, the changes will be saved into
732 the data-dictionary at statement commit time.
733 @return error number
734 @retval 0 on success */
735 int truncate_impl(const char *name, TABLE *form, dd::Table *table_def);
736
737 /** @defgroup PARTITION_HANDLER_HELPERS Helpers needed by Partition_helper
738 @see partition_handler.h
739 @{ */
740
741 /** Set the autoinc column max value.
742 This should only be called once from ha_innobase::open().
743 Therefore there's no need for a covering lock.
744 @param[in] no_lock If locking should be skipped. Not used!
745 @return 0 for success or error code. */
746 int initialize_auto_increment(bool no_lock) override;
747
748 /** Save currently highest auto increment value.
749 @param[in] nr Auto increment value to save. */
750 void save_auto_increment(ulonglong nr) override;
751
752 /** Setup the ordered record buffer and the priority queue.
753 @param[in] used_parts Number of used partitions in query.
754 @return false for success, else true. */
755 int init_record_priority_queue_for_parts(uint used_parts) override;
756
757 /** Destroy the ordered record buffer and the priority queue. */
759
760 /** Create the Altered_partitoins object
761 @param[in] ha_alter_info thd DDL operation
762 @retval true On failure
763 @retval false On success */
765
766 /** write row to new partition.
767 @param[in] new_part New partition to write to.
768 @return 0 for success else error code. */
769 int write_row_in_new_part(uint new_part) override;
770
771 /** Write a row in specific partition.
772 Stores a row in an InnoDB database, to the table specified in this
773 handle.
774 @param[in] part_id Partition to write to.
775 @param[in] record A row in MySQL format.
776 @return error code. */
777 int write_row_in_part(uint part_id, uchar *record) override;
778
779 /** Update a row in partition.
780 Updates a row given as a parameter to a new value.
781 @param[in] part_id Partition to update row in.
782 @param[in] old_row Old row in MySQL format.
783 @param[in] new_row New row in MySQL format.
784 @return 0 or error number. */
785 int update_row_in_part(uint part_id, const uchar *old_row,
786 uchar *new_row) override;
787
788 /** Deletes a row in partition.
789 @param[in] part_id Partition to delete from.
790 @param[in] record Row to delete in MySQL format.
791 @return 0 or error number. */
792 int delete_row_in_part(uint part_id, const uchar *record) override;
793
794 /** Return first record in index from a partition.
795 @param[in] part Partition to read from.
796 @param[out] record First record in index in the partition.
797 @return error number or 0. */
798 int index_first_in_part(uint part, uchar *record) override;
799
800 /** Return last record in index from a partition.
801 @param[in] part Partition to read from.
802 @param[out] record Last record in index in the partition.
803 @return error number or 0. */
804 int index_last_in_part(uint part, uchar *record) override;
805
806 /** Return previous record in index from a partition.
807 @param[in] part Partition to read from.
808 @param[out] record Last record in index in the partition.
809 @return error number or 0. */
810 int index_prev_in_part(uint part, uchar *record) override;
811
812 /** Return next record in index from a partition.
813 @param[in] part Partition to read from.
814 @param[out] record Last record in index in the partition.
815 @return error number or 0. */
816 int index_next_in_part(uint part, uchar *record) override;
817
818 /** Return next same record in index from a partition.
819 This routine is used to read the next record, but only if the key is
820 the same as supplied in the call.
821 @param[in] part Partition to read from.
822 @param[out] record Last record in index in the partition.
823 @param[in] key Key to match.
824 @param[in] length Length of key.
825 @return error number or 0. */
826 int index_next_same_in_part(uint part, uchar *record, const uchar *key,
827 uint length) override;
828
829 /** Start index scan and return first record from a partition.
830 This routine starts an index scan using a start key. The calling
831 function will check the end key on its own.
832 @param[in] part Partition to read from.
833 @param[out] record First matching record in index in the partition.
834 @param[in] key Key to match.
835 @param[in] keypart_map Which part of the key to use.
836 @param[in] find_flag Key condition/direction to use.
837 @return error number or 0. */
838 int index_read_map_in_part(uint part, uchar *record, const uchar *key,
839 key_part_map keypart_map,
840 enum ha_rkey_function find_flag) override;
841
842 /** Return last matching record in index from a partition.
843 @param[in] part Partition to read from.
844 @param[out] record Last matching record in index in the partition.
845 @param[in] key Key to match.
846 @param[in] keypart_map Which part of the key to use.
847 @return error number or 0. */
848 int index_read_last_map_in_part(uint part, uchar *record, const uchar *key,
849 key_part_map keypart_map) override;
850
851 /** Start index scan and return first record from a partition.
852 This routine starts an index scan using a start and end key.
853 @param[in] part Partition to read from.
854 @param[in,out] record First matching record in index in the
855 partition, if NULL use table->record[0] as return buffer.
856 @param[in] start_key Start key to match.
857 @param[in] end_key End key to match.
858 @param[in] sorted Return rows in sorted order.
859 @return error number or 0. */
860 int read_range_first_in_part(uint part, uchar *record,
861 const key_range *start_key,
862 const key_range *end_key, bool sorted) override;
863
864 /** Return next record in index range scan from a partition.
865 @param[in] part Partition to read from.
866 @param[in,out] record First matching record in index in the partition,
867 if NULL use table->record[0] as return buffer.
868 @return error number or 0. */
869 int read_range_next_in_part(uint part, uchar *record) override;
870
871 /** Start index scan and return first record from a partition.
872 This routine starts an index scan using a start key. The calling
873 function will check the end key on its own.
874 @param[in] part Partition to read from.
875 @param[out] record First matching record in index in the partition.
876 @param[in] index Index to read from.
877 @param[in] key Key to match.
878 @param[in] keypart_map Which part of the key to use.
879 @param[in] find_flag Key condition/direction to use.
880 @return error number or 0. */
881 int index_read_idx_map_in_part(uint part, uchar *record, uint index,
882 const uchar *key, key_part_map keypart_map,
883 enum ha_rkey_function find_flag) override;
884
885 /** Initialize sampling.
886 @param[out] scan_ctx A scan context created by this method that has to be
887 used in sample_next
888 @param[in] sampling_percentage percentage of records that need to be
889 sampled
890 @param[in] sampling_seed random seed that the random generator will
891 use
892 @param[in] sampling_method sampling method to be used; currently only
893 SYSTEM sampling is supported
894 @param[in] tablesample true if the sampling is for tablesample
895 @return 0 for success, else one of the HA_xxx values in case of error. */
896 int sample_init(void *&scan_ctx, double sampling_percentage,
897 int sampling_seed, enum_sampling_method sampling_method,
898 const bool tablesample) override;
899
900 /** Get the next record for sampling.
901 @param[in] scan_ctx Scan context of the sampling
902 @param[in] buf buffer to place the read record
903 @return 0 for success, else one of the HA_xxx values in case of error. */
904 int sample_next(void *scan_ctx, uchar *buf) override;
905
906 /** End sampling.
907 @param[in] scan_ctx Scan context of the sampling
908 @return 0 for success, else one of the HA_xxx values in case of error. */
909 int sample_end(void *scan_ctx) override;
910
911 /** Initialize random read/scan of a specific partition.
912 @param[in] part_id Partition to initialize.
913 @param[in] scan True for scan else random access.
914 @return error number or 0. */
915 int rnd_init_in_part(uint part_id, bool scan) override;
916
917 /** Get next row during scan of a specific partition.
918 Also used to read the FIRST row in a table scan.
919 @param[in] part_id Partition to read from.
920 @param[out] buf Next row.
921 @return error number or 0. */
922 int rnd_next_in_part(uint part_id, uchar *buf) override;
923
924 /** End random read/scan of a specific partition.
925 @param[in] part_id Partition to end random read/scan.
926 @param[in] scan True for scan else random access.
927 @return error number or 0. */
928 int rnd_end_in_part(uint part_id, bool scan) override;
929
930 /** Return position for cursor in last used partition.
931 Stores a reference to the current row to 'ref' field of the handle. Note
932 that in the case where we have generated the clustered index for the
933 table, the function parameter is illogical: we MUST ASSUME that 'record'
934 is the current 'position' of the handle, because if row ref is actually
935 the row id internally generated in InnoDB, then 'record' does not contain
936 it. We just guess that the row id must be for the record where the handle
937 was positioned the last time.
938 @param[out] ref_arg Pointer to buffer where to write the position.
939 @param[in] record Record to position for. */
940 void position_in_last_part(uchar *ref_arg, const uchar *record) override;
941
942 /** Read row using position using given record to find.
943 This works as position()+rnd_pos() functions, but does some
944 extra work,calculating m_last_part - the partition to where
945 the 'record' should go.
946 Only useful when position is based on primary key
947 (HA_PRIMARY_KEY_REQUIRED_FOR_POSITION).
948 @param[in] record Current record in MySQL Row Format.
949 @return 0 for success else error code. */
950 int rnd_pos_by_record(uchar *record) override;
951
952 /** Copy a cached MySQL row.
953 If requested, also avoids overwriting non-read columns.
954 @param[out] buf Row in MySQL format.
955 @param[in] cached_row Which row to copy. */
956 void copy_cached_row(uchar *buf, const uchar *cached_row) override;
957 /** @} */
958
959 /** @defgroup PRIVATE_HANDLER InnoDB Partitioning Private Handler
960 Functions specific for native InnoDB partitioning.
961 @see handler.h
962 @{ */
963
964 /** Open an InnoDB table.
965 @param[in] name table name
966 @param[in] mode access mode
967 @param[in] test_if_locked test if the file to be opened is locked
968 @param[in] table_def dd::Table describing table to be opened
969 @retval 1 if error
970 @retval 0 if success */
971 int open(const char *name, int mode, uint test_if_locked,
972 const dd::Table *table_def) override;
973
974 int close() override;
975
976 double scan_time() override;
977
978 /** Was the last returned row semi consistent read.
979 In an UPDATE or DELETE, if the row under the cursor was locked by
980 another transaction, and the engine used an optimistic read of the last
981 committed row value under the cursor, then the engine returns 1 from
982 this function. MySQL must NOT try to update this optimistic value. If
983 the optimistic value does not match the WHERE condition, MySQL can
984 decide to skip over this row. This can be used to avoid unnecessary
985 lock waits.
986
987 If this method returns true, it will also signal the storage
988 engine that the next read will be a locking re-read of the row.
989 @see handler.h and row0mysql.h
990 @return true if last read was semi consistent else false. */
991 bool was_semi_consistent_read() override;
992
993 /** Try semi consistent read.
994 Tell the engine whether it should avoid unnecessary lock waits.
995 If yes, in an UPDATE or DELETE, if the row under the cursor was locked
996 by another transaction, the engine may try an optimistic read of
997 the last committed row value under the cursor.
998 @see handler.h and row0mysql.h
999 @param[in] yes Should semi-consistent read be used. */
1000 void try_semi_consistent_read(bool yes) override;
1001
1002 /** Removes a lock on a row.
1003 Removes a new lock set on a row, if it was not read optimistically.
1004 This can be called after a row has been read in the processing of
1005 an UPDATE or a DELETE query. @see ha_innobase::unlock_row(). */
1006 void unlock_row() override;
1007
1008 int index_init(uint index, bool sorted) override;
1009
1010 int index_end() override;
1011
1012 int rnd_init(bool scan) override {
1013 return (Partition_helper::ph_rnd_init(scan));
1014 }
1015
1016 int rnd_end() override { return (Partition_helper::ph_rnd_end()); }
1017
1018 int external_lock(THD *thd, int lock_type) override;
1019
1021 thr_lock_type lock_type) override;
1022
1023 int write_row(uchar *record) override {
1024 bool entered = false;
1025 auto trx = m_prebuilt->trx;
1026
1027 /* Enter innodb to order Auto INC partition lock after Innodb. No need to
1028 enter if there are tickets left. Currently we cannot handle re-enter
1029 without exit if no more tickets left.
1030
1031 1. We avoid consuming the last ticket as there could be another enter
1032 call from innobase.
1033
1034 2. If we enter innodb here, there is at least one more ticket left as
1035 the minimum value for "innodb_concurrency_tickets" is 1 */
1036
1037 if (!trx->declared_to_be_inside_innodb) {
1038 auto err = srv_concurrency_enter();
1039 if (err != 0) {
1040 return (err);
1041 }
1042 entered = true;
1043 }
1044
1046
1047 if (entered) {
1049 }
1050
1051 return (err);
1052 }
1053
1054 int update_row(const uchar *old_record, uchar *new_record) override {
1055 return (Partition_helper::ph_update_row(old_record, new_record));
1056 }
1057
1058 int delete_row(const uchar *record) override {
1060 }
1061 /** @} */
1062
1063 /** Delete all rows in the requested partitions.
1064 Done by deleting the partitions and recreate them again.
1065 @param[in,out] dd_table dd::Table object for partitioned table
1066 which partitions need to be truncated. Can be adjusted by this call.
1067 Changes to the table definition will be persisted in the data-dictionary
1068 at statement commit time.
1069 @return 0 or error number. */
1070 int truncate_partition_low(dd::Table *dd_table) override;
1071
1072 /** Exchange partition.
1073 Low-level primitive which implementation is provided here.
1074 @param[in] part_id The id of the partition to be exchanged
1075 @param[in] part_table partitioned table to be exchanged
1076 @param[in] swap_table table to be exchanged
1077 @return error number
1078 @retval 0 on success */
1079 int exchange_partition_low(uint part_id, dd::Table *part_table,
1080 dd::Table *swap_table) override;
1081
1082 /** Access methods to protected areas in handler to avoid adding
1083 friend class Partition_helper in class handler.
1084 @see partition_handler.h
1085 @{ */
1086
1087 THD *get_thd() const override { return ha_thd(); }
1088
1089 TABLE *get_table() const override { return table; }
1090
1091 bool get_eq_range() const override { return eq_range; }
1092
1093 void set_eq_range(bool eq_range_arg) override { eq_range = eq_range_arg; }
1094
1095 void set_range_key_part(KEY_PART_INFO *key_part) override {
1096 range_key_part = key_part;
1097 }
1098 /** @} */
1099
1100 /** Fill in data_dir_path and tablespace name from internal data
1101 dictionary.
1102 @param[in,out] part_elem Partition element to fill.
1103 @param[in] ib_table InnoDB table to copy from.
1104 @param[in] display_tablespace Display tablespace name if
1105 set. */
1106 void update_part_elem(partition_element *part_elem, dict_table_t *ib_table,
1107 bool display_tablespace);
1108
1109 protected:
1110 /** Protected handler:: functions specific for native InnoDB partitioning.
1111 @see handler.h
1112 @{ */
1113
1114 int rnd_next(uchar *record) override {
1116 }
1117
1118 int rnd_pos(uchar *record, uchar *pos) override;
1119
1120 int records(ha_rows *num_rows) override;
1121
1122 int records_from_index(ha_rows *num_rows, uint) override {
1123 /* Force use of cluster index until we implement sec index parallel scan. */
1124 return ha_innopart::records(num_rows);
1125 }
1126
1127 int index_next(uchar *record) override {
1129 }
1130
1131 int index_next_same(uchar *record, const uchar *, uint keylen) override {
1133 }
1134
1135 int index_prev(uchar *record) override {
1137 }
1138
1139 int index_first(uchar *record) override {
1141 }
1142
1143 int index_last(uchar *record) override {
1145 }
1146
1148 key_part_map keypart_map) override {
1149 return (Partition_helper::ph_index_read_last_map(record, key, keypart_map));
1150 }
1151
1152 int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map,
1153 enum ha_rkey_function find_flag) override {
1154 return (
1155 Partition_helper::ph_index_read_map(buf, key, keypart_map, find_flag));
1156 }
1157
1158 int index_read_idx_map(uchar *buf, uint index, const uchar *key,
1159 key_part_map keypart_map,
1160 enum ha_rkey_function find_flag) override {
1162 keypart_map, find_flag));
1163 }
1164 /** @} */
1165
1166 /** Updates and return statistics.
1167 Returns statistics information of the table to the MySQL interpreter,
1168 in various fields of the handle object.
1169 @param[in] flag Flags for what to update and return.
1170 @param[in] is_analyze True if called from "::analyze()".
1171 @return HA_ERR_* error code or 0. */
1172 int info_low(uint flag, bool is_analyze) override;
1173
1174 bool can_reuse_mysql_template() const override {
1176 }
1177};
1178#endif /* ha_innopart_h */
Class describing changes to be done by ALTER TABLE.
Definition: handler.h:3328
Helper class for encapsulating new/altered partitions during ADD(HASH/KEY)/COALESCE/REORGANIZE PARTIT...
Definition: handler0alter.cc:8048
A simple bitset wrapper class, whose size can be specified after the object has been defined.
Definition: ut0bitset.h:38
Definition: field.h:574
Wrapper for struct ft_hints.
Definition: handler.h:4100
InnoDB partition specific Handler_share.
Definition: ha_innopart.h:61
dict_table_t * get_table_part(uint part_id) const
Return innodb table for given partition.
Definition: ha_innopart.h:105
uint m_index_count
Number of indexes.
Definition: ha_innopart.h:74
uint get_num_parts() const
Get the number of partitions.
Definition: ha_innopart.h:170
uint m_ref_count
Reference count.
Definition: ha_innopart.h:77
void close_table_parts()
Close the table partitions.
Definition: ha_innopart.cc:449
~Ha_innopart_share() override
Definition: ha_innopart.cc:96
void increment_ref_counts()
Increment share and InnoDB tables reference counters.
Definition: ha_innopart.cc:232
dict_table_t ** m_table_parts
Array of all included table definitions (one per partition).
Definition: ha_innopart.h:64
uint m_tot_parts
Total number of partitions.
Definition: ha_innopart.h:71
void set_table_part(uint part_id, dict_table_t *table)
Set innodb table for given partition.
Definition: ha_innopart.h:90
Ha_innopart_share()=default
Disable default constructor.
const TABLE_SHARE * get_table_share() const
Definition: ha_innopart.h:166
dict_index_t * get_index(uint part_id, uint keynr)
Return innodb index for given partition and key number.
Definition: ha_innopart.cc:495
static dict_table_t ** open_table_parts(THD *thd, const TABLE *table, const dd::Table *dd_table, partition_info *part_info, const char *table_name)
Open InnoDB tables for partitions and return them as array.
Definition: ha_innopart.cc:262
bool set_table_parts_and_indexes(partition_info *part_info, dict_table_t **table_parts)
Initialize the share with table and indexes per partition.
Definition: ha_innopart.cc:313
static bool open_one_table_part(dd::cache::Dictionary_client *client, THD *thd, const TABLE *table, const dd::Partition *dd_part, const char *part_name, dict_table_t **part_dict_table)
Open one partition.
Definition: ha_innopart.cc:129
bool has_table_parts() const
Return whether share has opened InnoDB tables for partitions.
Definition: ha_innopart.h:132
dict_index_t ** m_index_mapping
Instead of INNOBASE_SHARE::idx_trans_tbl.
Definition: ha_innopart.h:68
uint get_mysql_key(uint part_id, const dict_index_t *index)
Get MySQL key number corresponding to InnoDB index.
Definition: ha_innopart.cc:524
void set_v_templ(TABLE *table, dict_table_t *ib_table, const char *name)
Set up the virtual column template for partition table, and points all m_table_parts[]->vc_templ to i...
Definition: ha_innopart.cc:207
TABLE_SHARE * m_table_share
Pointer back to owning TABLE_SHARE.
Definition: ha_innopart.h:80
dict_table_t ** get_table_part_ref(uint part_id)
Get table reference for given partition.
Definition: ha_innopart.h:98
Definition: key.h:56
Definition: key.h:112
Traverse an index in the leaf page block list order and send records to adapter.
Definition: row0pread-adapter.h:42
handler::Load_init_cbk Init_fn
Definition: row0pread-adapter.h:54
handler::Load_end_cbk End_fn
Definition: row0pread-adapter.h:52
handler::Load_cbk Load_fn
Definition: row0pread-adapter.h:50
Class for partitioning specific operations.
Definition: partition_handler.h:193
Partition_helper is a helper class that implements most generic partitioning functionality such as: t...
Definition: partition_handler.h:389
int ph_index_first(uchar *buf)
Start an index scan from leftmost record and return first record.
Definition: partition_handler.cc:1906
int ph_index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag)
Read one record in an index scan and start an index scan.
Definition: partition_handler.cc:1831
int ph_index_prev(uchar *buf)
Read next record when performing index scan backwards.
Definition: partition_handler.cc:2127
int ph_update_row(const uchar *old_data, uchar *new_data)
Update an existing row in the partitioned table.
Definition: partition_handler.cc:558
int ph_write_row(uchar *buf)
INSERT/UPDATE/DELETE functions.
Definition: partition_handler.cc:453
int ph_rnd_init(bool scan)
MODULE full table scan.
Definition: partition_handler.cc:1429
int ph_index_next_same(uchar *buf, uint keylen)
Read next same record.
Definition: partition_handler.cc:2105
int ph_index_last(uchar *buf)
Start an index scan from rightmost record and return first record.
Definition: partition_handler.cc:1929
int ph_rnd_next(uchar *buf)
Read next row during full table scan (scan in random row order).
Definition: partition_handler.cc:1537
int ph_read_range_next()
Read next record in read of a range with start and end key.
Definition: partition_handler.cc:2190
virtual void set_part_info_low(partition_info *part_info, bool early)
Set partition info.
Definition: partition_handler.cc:369
static uint32 ph_calculate_key_hash_value(Field **field_array)
Calculate key hash value from an null terminated array of fields.
Definition: partition_handler.cc:803
void ph_position(const uchar *record)
Save position of current row.
Definition: partition_handler.cc:1605
int ph_rnd_end()
End of a table scan.
Definition: partition_handler.cc:1490
int ph_index_read_idx_map(uchar *buf, uint index, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag)
Read index by key and keymap.
Definition: partition_handler.cc:2013
int ph_index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map)
Read last using key.
Definition: partition_handler.cc:1981
void ph_release_auto_increment()
Release unused auto increment values.
Definition: partition_handler.cc:767
int ph_index_next(uchar *buf)
Read next record in a forward index scan.
Definition: partition_handler.cc:2074
int ph_read_range_first(const key_range *start_key, const key_range *end_key, bool eq_range_arg, bool sorted)
Start a read of one range with start and end key.
Definition: partition_handler.cc:2154
int ph_delete_row(const uchar *buf)
Delete an existing row in the partitioned table.
Definition: partition_handler.cc:644
virtual void get_dynamic_partition_info_low(ha_statistics *stat_info, ha_checksum *check_sum, uint part_id)
Functions matching Partition_handler API.
Definition: partition_handler.cc:2860
Partition specific Handler_share.
Definition: partition_handler.h:103
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_lexer_thd.h:35
Definition: partition.h:50
Definition: table.h:46
Definition: dictionary_client.h:148
The class defining a handle to an InnoDB table.
Definition: ha_innodb.h:86
Table_flags table_flags() const override
Get the table flags to use for the statement.
Definition: ha_innodb.cc:6658
void srv_concurrency_exit()
Leave Innodb, if no more tickets are left.
Definition: ha_innodb.cc:2967
row_prebuilt_t * m_prebuilt
Save CPU time with prebuilt/cached data structures.
Definition: ha_innodb.h:691
int srv_concurrency_enter()
Enter InnoDB engine after checking max allowed threads.
Definition: ha_innodb.cc:2960
int info(uint) override
Returns statistics information of the table to the MySQL interpreter, in various fields of the handle...
Definition: ha_innodb.cc:17838
The class defining a partitioning aware handle to an InnoDB table.
Definition: ha_innopart.h:223
bool inplace_alter_partition(Alter_inplace_info *ha_alter_info)
Alter the table structure in-place with operations specified using HA_ALTER_FLAGS and Alter_inplace_i...
Definition: handler0alter.cc:10739
void update_part_elem(partition_element *part_elem, dict_table_t *ib_table, bool display_tablespace)
Fill in data_dir_path and tablespace name from internal data dictionary.
Definition: ha_innopart.cc:2228
void set_range_key_part(KEY_PART_INFO *key_part) override
Definition: ha_innopart.h:1095
int rnd_next(uchar *record) override
Protected handler:: functions specific for native InnoDB partitioning.
Definition: ha_innopart.h:1114
Sql_stat_start_parts m_sql_stat_start_parts
sql_stat_start per partition.
Definition: ha_innopart.h:655
Altered_partitions * m_new_partitions
New partitions during ADD/REORG/... PARTITION.
Definition: ha_innopart.h:673
~ha_innopart() override=default
FT_INFO * ft_init_ext(uint flags, uint inx, String *key) override
Initialize FT index scan.
Definition: ha_innopart.h:506
bool m_reuse_mysql_template
Can reuse the template for the previous partition.
Definition: ha_innopart.h:676
bool can_reuse_mysql_template() const override
Can reuse the template.
Definition: ha_innopart.h:1174
void parallel_scan_end(void *parallel_scan_ctx) override
Run the parallel read of data.
Definition: handler0alter.cc:10096
int check(THD *thd, HA_CHECK_OPT *check_opt) override
Checks a partitioned table.
Definition: ha_innopart.cc:3849
int discard_or_import_tablespace(bool discard, dd::Table *table_def) override
Discards or imports an InnoDB tablespace.
Definition: ha_innopart.cc:2825
int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) override
Positions an index cursor to the index specified in the handle ('active_index').
Definition: ha_innopart.h:1152
int records(ha_rows *num_rows) override
Total number of rows in all used partitions.
Definition: ha_innopart.cc:3178
btr_pcur_t * m_clust_pcur
Original m_prebuilt->clust_pcur.
Definition: ha_innopart.h:670
int index_next_same(uchar *record, const uchar *, uint keylen) override
Reads the next row matching to the key value given as the parameter.
Definition: ha_innopart.h:1131
uint32_t calculate_key_hash_value(Field **field_array) override
Definition: ha_innopart.h:536
int enable_indexes(uint mode) override
Enable indexes.
Definition: ha_innopart.h:497
int innobase_initialize_autoinc()
Internally called for initializing auto increment value.
Definition: ha_innopart.cc:618
void get_dynamic_partition_info(ha_statistics *stat_info, ha_checksum *check_sum, uint part_id) override
Implementing Partition_handler interface.
Definition: ha_innopart.h:552
enum row_type get_partition_row_type(const dd::Table *partition_table, uint part_id) override
Get partition row type from SE.
Definition: ha_innopart.cc:2943
int index_last(uchar *record) override
Positions a cursor on the last record in an index and reads the corresponding row to buf.
Definition: ha_innopart.h:1143
int rename_table(const char *from, const char *to, const dd::Table *from_table, dd::Table *to_table) override
Rename a table.
Definition: ha_innopart.cc:2685
handler * get_handler() override
Return the table handler.
Definition: ha_innopart.h:575
btr_pcur_t * m_pcur_parts
persistent cursors per partition.
Definition: ha_innopart.h:658
void clear_blob_heaps()
Clear the blob heaps for all partitions.
Definition: ha_innopart.cc:4127
int index_read_last_map(uchar *record, const uchar *key, key_part_map keypart_map) override
The following functions works like index_read, but it find the last row with the current key value or...
Definition: ha_innopart.h:1147
ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) override
Estimates the number of index records in a range.
Definition: ha_innopart.cc:3261
static int key_and_rowid_cmp(KEY **key_info, uchar *a, uchar *b)
Compare key and rowid.
Definition: ha_innopart.cc:2882
uint alter_flags(uint flags) const override
Alter flags.
Definition: ha_innopart.h:559
handler * clone(const char *name, MEM_ROOT *mem_root) override
Clone this handler, used when needing more than one cursor to the same table.
Definition: ha_innopart.cc:1151
int delete_table(const char *name, const dd::Table *dd_table) override
Drop a table.
Definition: ha_innopart.cc:2618
bool commit_inplace_alter_partition(TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit, const dd::Table *old_dd_tab, dd::Table *new_dd_tab)
Prepare to commit or roll back ALTER TABLE...ALGORITHM=INPLACE.
Definition: handler0alter.cc:10787
byte * m_bitset
byte array for sql_stat_start bitset
Definition: ha_innopart.h:652
ha_rows estimate_rows_upper_bound() override
Gives an UPPER BOUND to the number of rows in a table.
Definition: ha_innopart.cc:3380
void set_part_info(partition_info *part_info, bool early) override
Set the partition info object to be used by the handler.
Definition: ha_innopart.h:567
ha_innopart(handlerton *hton, TABLE_SHARE *table_arg)
Construct ha_innopart handler.
Definition: ha_innopart.cc:596
int change_active_index(uint part_id, uint keynr)
Changes the active index of a handle.
Definition: ha_innopart.cc:1717
TABLE * get_table() const override
Definition: ha_innopart.h:1089
int index_next(uchar *record) override
Reads the next row from a cursor, which must have previously been positioned using index_read.
Definition: ha_innopart.h:1127
bool get_foreign_dup_key(char *child_table_name, uint child_table_name_len, char *child_key_name, uint child_key_name_len) override
Retrieves the names of the table and the key for which there was a duplicate entry in the case of HA_...
Definition: ha_innopart.h:524
void update_partition(uint part_id)
Update active partition.
Definition: ha_innopart.cc:1317
int read_range_next() override
Read next row between two endpoints.
Definition: ha_innopart.h:532
void set_eq_range(bool eq_range_arg) override
Definition: ha_innopart.h:1093
int disable_indexes(uint mode) override
Disable indexes.
Definition: ha_innopart.h:493
int records_from_index(ha_rows *num_rows, uint) override
Number of rows in table counted using the secondary index chosen by optimizer.
Definition: ha_innopart.h:1122
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes) override
Part of old, deprecated in-place ALTER API.
Definition: ha_innopart.h:484
void release_auto_increment() override
Do cleanup for auto increment calculation.
Definition: ha_innopart.h:544
Partition_handler * get_partition_handler() override
Definition: ha_innopart.h:563
int info_low(uint flag, bool is_analyze) override
Updates and return statistics.
Definition: ha_innopart.cc:3473
uint16_t * m_pcur_map
map from part_id to offset in above two arrays.
Definition: ha_innopart.h:664
Table_flags table_flags() const override
Get the table flags to use for the statement.
Definition: ha_innopart.h:540
int index_prev(uchar *record) override
Reads the previous row from a cursor, which must have previously been positioned using index_read.
Definition: ha_innopart.h:1135
btr_pcur_t * m_pcur
Original m_prebuilt->pcur.
Definition: ha_innopart.h:667
THD * get_thd() const override
Access methods to protected areas in handler to avoid adding friend class Partition_helper in class h...
Definition: ha_innopart.h:1087
ut::unique_ptr< saved_prebuilt_t[]> m_parts
Definition: ha_innopart.h:649
void clear_ins_upd_nodes()
Clear used ins_nodes and upd_nodes.
Definition: ha_innopart.cc:1168
int start_stmt(THD *thd, thr_lock_type lock_type) override
Start statement.
Definition: ha_innopart.cc:3947
int read_range_first(const key_range *start_key, const key_range *end_key, bool eq_range_arg, bool sorted) override
Read first row between two ranges.
Definition: ha_innopart.h:473
FT_INFO * ft_init_ext_with_hints(uint inx, String *key, Ft_hints *hints) override
Initialize FT index scan.
Definition: ha_innopart.h:512
dict_index_t * innopart_get_index(uint part_id, uint keynr)
Get the index for a handle.
Definition: ha_innopart.cc:1671
void initialize_partitioning(partition_info *part_info, bool early)
Definition: ha_innopart.h:571
int cmp_ref(const uchar *ref1, const uchar *ref2) const override
Compares two 'refs'.
Definition: ha_innopart.cc:4112
int index_read_idx_map(uchar *buf, uint index, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) override
Positions an index cursor to the index specified in argument.
Definition: ha_innopart.h:1158
void set_partition(uint part_id)
Change active partition.
Definition: ha_innopart.cc:1268
void position(const uchar *record) override
Store a reference to the current row to 'ref' field of the handle.
Definition: ha_innopart.h:479
int optimize(THD *thd, HA_CHECK_OPT *check_opt) override
Optimize table.
Definition: ha_innopart.cc:3837
int parallel_scan(void *scan_ctx, void **thread_ctxs, Reader::Init_fn init_fn, Reader::Load_fn load_fn, Reader::End_fn end_fn) override
Start parallel read of data.
Definition: handler0alter.cc:10085
dict_index_t * innobase_get_index(uint keynr) override
Get the index for the current partition.
Definition: ha_innopart.cc:1656
int truncate_partition_low(dd::Table *dd_table) override
Delete all rows in the requested partitions.
Definition: ha_innopart.cc:3073
void print_error(int error, myf errflag) override
Print error information.
Definition: ha_innopart.cc:1634
btr_pcur_t * m_clust_pcur_parts
persistent cluster cursors per partition.
Definition: ha_innopart.h:661
int ft_init() override
Initialize FT index scan.
Definition: ha_innopart.h:501
int parallel_scan_init(void *&scan_ctx, size_t *num_threads, bool use_reserved_threads, size_t max_desired_threads) override
Get number of threads that would be spawned for parallel read.
Definition: handler0alter.cc:10009
int exchange_partition_low(uint part_id, dd::Table *part_table, dd::Table *swap_table) override
Exchange partition.
Definition: handler0alter.cc:10892
int reset() override
Reset state of file to after 'open'.
Definition: ha_innopart.cc:4149
int ft_read(uchar *buf) override
Fetch next result from the FT result set.
Definition: ha_innopart.h:519
uint alter_table_flags(uint flags)
int extra(enum ha_extra_function operation) override
Extra hints from MySQL.
Definition: ha_innopart.cc:2897
int delete_all_rows() override
Delete all rows from the table.
Definition: ha_innopart.h:491
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info, dd::Table *table_def) override
Creates a new table to an InnoDB database.
Definition: ha_innopart.cc:2401
Ha_innopart_share * m_part_share
Pointer to Ha_innopart_share on the TABLE_SHARE.
Definition: ha_innopart.h:620
bool is_ignorable_error(int error) override
Can error be ignored.
Definition: ha_innopart.cc:1644
int truncate_impl(const char *name, TABLE *form, dd::Table *table_def)
TRUNCATE an InnoDB partitioned table.
Definition: ha_innopart.cc:2980
int next_partition_index()
Move to next partition and set its index.
bool prepare_inplace_alter_partition(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_dd_tab, dd::Table *new_dd_tab)
Allows InnoDB to update internal structures with concurrent writes blocked (given that check_if_suppo...
Definition: handler0alter.cc:10708
void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values) override
Get the current auto_increment value.
Definition: ha_innopart.cc:4088
int set_dd_discard_attribute(dd::Table *table_def, bool discard)
Set DD discard attribute for tablespace.
Definition: ha_innopart.cc:2770
int rnd_pos(uchar *record, uchar *pos) override
Get a row from a position.
Definition: ha_innopart.cc:2165
int repair(THD *thd, HA_CHECK_OPT *repair_opt) override
Repair a partitioned table.
Definition: ha_innopart.cc:3894
bool get_eq_range() const override
Definition: ha_innopart.h:1091
void update_create_info(HA_CREATE_INFO *create_info) override
Update create_info.
Definition: ha_innopart.cc:2281
int index_first(uchar *record) override
Positions a cursor on the first record in an index and reads the corresponding row to buf.
Definition: ha_innopart.h:1139
Definition: handler.h:4011
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4548
KEY_PART_INFO * range_key_part
Definition: handler.h:4607
bool eq_range
Definition: handler.h:4608
ulonglong Table_flags
Definition: handler.h:4552
THD * ha_thd() const
Definition: handler.cc:2729
TABLE * table
Definition: handler.h:4556
virtual int delete_all_rows()
Delete all rows in a table.
Definition: handler.h:6902
Definition: partition_element.h:107
Definition: partition_info.h:208
A table definition from the master.
Definition: rpl_utility.h:247
static MEM_ROOT mem_root
Definition: client_plugin.cc:113
bool commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit, const dd::Table *old_table_def, dd::Table *new_table_def) override
Commit or rollback.
Definition: handler0alter.cc:10498
bool prepare_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_table_def, dd::Table *new_table_def) override
Prepare in-place ALTER for table.
Definition: handler0alter.cc:10295
bool inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_table_def, dd::Table *new_table_def) override
Alter the table structure in-place.
Definition: handler0alter.cc:10432
enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info *ha_alter_info) override
Check if InnoDB supports a particular alter table in-place.
Definition: handler0alter.cc:10112
int rnd_next_in_part(uint part_id, uchar *buf) override
Get next row during scan of a specific partition.
Definition: ha_innopart.cc:2136
int update_row_in_part(uint part_id, const uchar *old_row, uchar *new_row) override
Update a row in partition.
Definition: ha_innopart.cc:1446
int rnd_end_in_part(uint part_id, bool scan) override
End random read/scan of a specific partition.
Definition: ha_innopart.cc:2129
void destroy_record_priority_queue_for_parts() override
Destroy the ordered record buffer and the priority queue.
Definition: ha_innopart.cc:1607
void copy_cached_row(uchar *buf, const uchar *cached_row) override
Copy a cached MySQL row.
Definition: ha_innopart.cc:112
int index_last_in_part(uint part, uchar *record) override
Return last record in index from a partition.
Definition: ha_innopart.cc:1841
void position_in_last_part(uchar *ref_arg, const uchar *record) override
Return position for cursor in last used partition.
Definition: ha_innopart.cc:2205
void save_auto_increment(ulonglong nr) override
Save currently highest auto increment value.
Definition: ha_innopart.cc:1360
int sample_init(void *&scan_ctx, double sampling_percentage, int sampling_seed, enum_sampling_method sampling_method, const bool tablesample) override
Initialize sampling.
Definition: ha_innopart.cc:2003
int write_row_in_part(uint part_id, uchar *record) override
Write a row in specific partition.
Definition: ha_innopart.cc:1419
int init_record_priority_queue_for_parts(uint used_parts) override
Setup the ordered record buffer and the priority queue.
Definition: ha_innopart.cc:1548
int index_read_map_in_part(uint part, uchar *record, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) override
Start index scan and return first record from a partition.
Definition: ha_innopart.cc:1877
int sample_next(void *scan_ctx, uchar *buf) override
Get the next record for sampling.
Definition: ha_innopart.cc:2083
int initialize_auto_increment(bool no_lock) override
Set the autoinc column max value.
Definition: ha_innopart.cc:623
int write_row_in_new_part(uint new_part) override
write row to new partition.
Definition: handler0alter.cc:10676
int index_next_same_in_part(uint part, uchar *record, const uchar *key, uint length) override
Return next same record in index from a partition.
Definition: ha_innopart.cc:1827
int index_first_in_part(uint part, uchar *record) override
Return first record in index from a partition.
Definition: ha_innopart.cc:1788
int read_range_next_in_part(uint part, uchar *record) override
Return next record in index range scan from a partition.
Definition: ha_innopart.cc:1969
int delete_row_in_part(uint part_id, const uchar *record) override
Deletes a row in partition.
Definition: ha_innopart.cc:1461
int sample_end(void *scan_ctx) override
End sampling.
Definition: ha_innopart.cc:2100
int rnd_pos_by_record(uchar *record) override
Read row using position using given record to find.
Definition: ha_innopart.cc:4165
bool prepare_for_copy_partitions(Alter_inplace_info *ha_alter_info)
Create the Altered_partitoins object.
Definition: handler0alter.cc:10647
int index_read_idx_map_in_part(uint part, uchar *record, uint index, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) override
Start index scan and return first record from a partition.
Definition: ha_innopart.cc:1899
int rnd_init_in_part(uint part_id, bool scan) override
Initialize random read/scan of a specific partition.
Definition: ha_innopart.cc:2111
int read_range_first_in_part(uint part, uchar *record, const key_range *start_key, const key_range *end_key, bool sorted) override
Start index scan and return first record from a partition.
Definition: ha_innopart.cc:1928
int index_prev_in_part(uint part, uchar *record) override
Return previous record in index from a partition.
Definition: ha_innopart.cc:1854
int index_next_in_part(uint part, uchar *record) override
Return next record in index from a partition.
Definition: ha_innopart.cc:1803
int index_read_last_map_in_part(uint part, uchar *record, const uchar *key, key_part_map keypart_map) override
Return last matching record in index from a partition.
Definition: ha_innopart.cc:1918
int close() override
Closes a handle to an InnoDB table.
Definition: ha_innopart.cc:1218
int rnd_init(bool scan) override
Initialize a table scan.
Definition: ha_innopart.h:1012
double scan_time() override
Time estimate for full table scan.
Definition: ha_innopart.cc:3426
int index_end() override
End index cursor.
Definition: ha_innopart.cc:1525
bool was_semi_consistent_read() override
Was the last returned row semi consistent read.
Definition: ha_innopart.cc:1383
int write_row(uchar *record) override
Stores a row in an InnoDB database, to the table specified in this handle.
Definition: ha_innopart.h:1023
int open(const char *name, int mode, uint test_if_locked, const dd::Table *table_def) override
Open an InnoDB table.
Definition: ha_innopart.cc:780
void unlock_row() override
Removes a lock on a row.
Definition: ha_innopart.cc:1406
int index_init(uint index, bool sorted) override
Initializes a handle to use an index.
Definition: ha_innopart.cc:1477
void try_semi_consistent_read(bool yes) override
Try semi consistent read.
Definition: ha_innopart.cc:1394
int update_row(const uchar *old_record, uchar *new_record) override
Updates a row given as a parameter to a new value.
Definition: ha_innopart.h:1054
THR_LOCK_DATA ** store_lock(THD *thd, THR_LOCK_DATA **to, thr_lock_type lock_type) override
Function to store lock for all partitions in native partitioned table.
Definition: ha_innopart.cc:3973
int rnd_end() override
Ends a table scan.
Definition: ha_innopart.h:1016
int external_lock(THD *thd, int lock_type) override
Lock/prepare to lock table.
Definition: ha_innopart.cc:4003
int delete_row(const uchar *record) override
Deletes a row given as the parameter.
Definition: ha_innopart.h:1058
Bitset Sql_stat_start_parts
Definition: ha_innopart.h:58
const handler::Table_flags HA_INNOPART_DISABLED_TABLE_FLAGS
HA_DUPLICATE_POS and HA_READ_BEFORE_WRITE_REMOVAL is not set from ha_innobase, but cannot yet be supp...
Definition: ha_innopart.h:54
static constexpr auto PARTITION_IN_SHARED_TABLESPACE
Definition: ha_innopart.h:47
const char * partition_get_tablespace(const char *tablespace, const partition_element *part, const partition_element *sub_part)
Get explicit specified tablespace for one (sub)partition, checking from lowest level.
Definition: ha_innopart.cc:565
static int flags[50]
Definition: hp_test1.cc:39
static int flag
Definition: hp_test1.cc:39
ha_rkey_function
Definition: my_base.h:77
ulong key_part_map
Definition: my_base.h:1007
my_off_t ha_rows
Definition: my_base.h:1140
ha_extra_function
Definition: my_base.h:184
#define HA_ERR_WRONG_COMMAND
Command not supported.
Definition: my_base.h:840
std::uint32_t ha_checksum
Definition: my_checksum.h:105
Header for compiler-dependent features.
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:93
unsigned long long int ulonglong
Definition: my_inttypes.h:55
unsigned char uchar
Definition: my_inttypes.h:51
static int record
Definition: mysqltest.cc:194
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
Definition: buf0block_hint.cc:29
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:926
const char * table_name
Definition: rules_table_service.cc:55
mode
Definition: file_handle.h:59
std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > > unique_ptr
The following is a common type that is returned by all the ut::make_unique (non-aligned) specializati...
Definition: ut0new.h:2437
#define HA_INPLACE_CHANGE_PARTITION
Definition: partition_handler.h:76
#define HA_PARTITION_FUNCTION_SUPPORTED
bits in Partition_handler::alter_flags():
Definition: partition_handler.h:75
required string key
Definition: replication_asynchronous_connection_failover.proto:59
Interface between Innobase row operations and MySQL.
#define COMPATIBLE_DATA_NO
Definition: handler.h:828
#define HA_READ_BEFORE_WRITE_REMOVAL
The handler supports read before write removal optimization.
Definition: handler.h:418
#define HA_CAN_REPAIR
Definition: handler.h:376
enum_alter_inplace_result
Return values for check_if_supported_inplace_alter().
Definition: handler.h:199
#define HA_CAN_GEOMETRY
Definition: handler.h:235
#define HA_CAN_FULLTEXT
Definition: handler.h:312
row_type
Definition: handler.h:683
#define HA_DUPLICATE_POS
Definition: handler.h:258
#define HA_CAN_FULLTEXT_EXT
Definition: handler.h:423
enum_sampling_method
Definition: handler.h:713
static bool commit(THD *thd)
Commit the current statement and transaction.
Definition: sql_cmd_srs.cc:151
case opt name
Definition: sslopt-case.h:32
Definition: ft_global.h:71
Definition: handler.h:3766
Struct to hold information about the table that should be created.
Definition: handler.h:3177
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:698
Definition: table.h:1403
Definition: thr_lock.h:123
Definition: btr0pcur.h:98
Data structure for an index.
Definition: dict0mem.h:1045
Data structure for a database table.
Definition: dict0mem.h:1908
Definition: ha_innopart.h:622
ins_node_t * m_ins_node
saved m_prebuilt->ins_node
Definition: ha_innopart.h:624
mem_heap_t * m_blob_heap
saved m_prebuilt->blob_heap
Definition: ha_innopart.h:630
decltype(row_prebuilt_t::new_rec_lock) m_new_rec_lock
save m_prebuilt->new_rec_lock[] values
Definition: ha_innopart.h:639
ulint m_row_read_type
saved m_prebuilt->row_read_type
Definition: ha_innopart.h:636
upd_node_t * m_upd_node
saved m_prebuilt->upd_node
Definition: ha_innopart.h:627
trx_id_t m_trx_id
saved m_prebuilt->trx_id (which in turn reflects table->def_trx_id)
Definition: ha_innopart.h:633
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2718
Definition: row0ins.h:161
Definition: my_base.h:1124
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:301
std::bitset< LOCK_COUNT > new_rec_lock
normally false; if session is using READ COMMITTED or READ UNCOMMITTED isolation level,...
Definition: row0mysql.h:761
trx_t * trx
current transaction handle
Definition: row0mysql.h:522
Definition: row0upd.h:700
thr_lock_type
Definition: thr_lock.h:50
ib_id_t trx_id_t
Transaction identifier (DB_TRX_ID, DATA_TRX_ID)
Definition: trx0types.h:137
unsigned long int ulint
Definition: univ.i:405
Utilities for bitset operations.
#define ut_error
Abort execution.
Definition: ut0dbg.h:100
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:104
#define ut_o(EXPR)
Opposite of ut_d().
Definition: ut0dbg.h:108
#define ut_d(EXPR)
Debug statement.
Definition: ut0dbg.h:106