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