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