53struct Merge_file_sort;
 
   56struct Parallel_cursor;
 
  238    if (locker != 
nullptr) {
 
  240      (locker, 0, __FILE__, __LINE__);
 
  248    if (locker != 
nullptr) {
 
  280    const char *
path) 
noexcept;
 
  327    ut_ad(rhs.m_next_value > 0);
 
  396    explicit FTS(
size_t n_parser_threads) noexcept
 
  455          TABLE *eval_table, 
size_t max_buffer_size,
 
  456          size_t max_threads) 
noexcept;
 
  473    m_err.compare_exchange_strong(expected, 
err);
 
  488    if (
m_err.compare_exchange_strong(expected, 
err)) {
 
  514      size_t n_threads) 
const noexcept;
 
  532  [[nodiscard]] 
THD *
thd() noexcept;
 
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:247
 
Class used to report ALTER TABLE progress via performance_schema.
Definition: ut0stage.h:81
 
We use Flush_observer to track flushing of non-redo logged pages in bulk create index(btr0load....
Definition: buf0flu.h:258
 
Definition: conf_to_src.cc:76
 
A row of result or a row of metadata A row is a collection of Column values or Column metadata.
Definition: protocol_local_v2.h:92
 
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
 
Build indexes on a table by reading a clustered index, creating a temporary file containing index ent...
Definition: ddl0impl-loader.h:44
 
Captures ownership and manages lifetime of an already opened OS file descriptor.
Definition: ddl0ddl.h:200
 
Unique_os_file_descriptor(os_fd_t fd)
Main constructor capturing an already opened OS file descriptor.
Definition: ddl0ddl.h:206
 
os_fd_t get() const
Returns the managed OS file descriptor for use with OS functions that operate on file.
Definition: ddl0ddl.h:214
 
os_fd_t m_fd
Definition: ddl0ddl.h:255
 
void swap(Unique_os_file_descriptor &other)
Swaps the underlying managed file descriptors between two instances of Unique_os_file_descriptor.
Definition: ddl0ddl.h:228
 
Unique_os_file_descriptor(Unique_os_file_descriptor &&other)
Definition: ddl0ddl.h:208
 
bool is_open() const
Definition: ddl0ddl.h:218
 
Unique_os_file_descriptor()=default
Default constructor, does not hold any file, does not close any on destruction.
 
Unique_os_file_descriptor & operator=(Unique_os_file_descriptor &&other)
Definition: ddl0ddl.h:220
 
void close()
Closes the managed file.
Definition: ddl0ddl.h:232
 
~Unique_os_file_descriptor()
Definition: ddl0ddl.h:210
 
A utility class which, if inherited from, prevents the descendant class from being copied,...
Definition: ut0class_life_cycle.h:41
 
#define PSI_FILE_CALL(M)
Definition: psi_file.h:36
 
dberr_t
Definition: db0err.h:39
 
@ DB_SUCCESS
Definition: db0err.h:43
 
@ DB_END_OF_INDEX
Definition: db0err.h:221
 
Full text search header file.
 
uint64_t doc_id_t
Document id type.
Definition: fts0fts.h:76
 
struct PSI_file_locker PSI_file_locker
Definition: psi_file_bits.h:62
 
@ PSI_FILE_CLOSE
File close, as in close().
Definition: psi_file_bits.h:75
 
unsigned char byte
Blob class.
Definition: common.h:151
 
The transaction lock system global types.
 
lock_mode
Definition: lock0types.h:54
 
unsigned long long int ulonglong
Definition: my_inttypes.h:56
 
static char * path
Definition: mysqldump.cc:150
 
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
 
The general architecture is that the work is done in two phases, roughly the read and write phase.
Definition: btr0load.cc:42
 
ulong fts_parser_threads
Variable specifying the number of FTS parser threads to use.
Definition: ddl0fts.cc:49
 
void drop_indexes(trx_t *trx, dict_table_t *table, bool locked) noexcept
Drop those indexes which were created before an error occurred.
Definition: ddl0ddl.cc:474
 
dberr_t lock_table(trx_t *trx, dict_table_t *table, enum lock_mode mode) noexcept
Sets an exclusive lock on a table, for the duration of creating indexes.
Definition: ddl0ddl.cc:306
 
dberr_t drop_table(trx_t *trx, dict_table_t *table) noexcept
Drop a table.
Definition: ddl0ddl.cc:297
 
byte mrec_t
Merge record in Aligned_buffer.
Definition: ddl0ddl.h:78
 
long fill_factor
Innodb B-tree index fill factor for bulk load.
Definition: btr0load.cc:44
 
constexpr size_t IO_BLOCK_SIZE
Minimum IO buffer size.
Definition: ddl0ddl.h:65
 
Unique_os_file_descriptor file_create_low(const char *path) noexcept
Create temporary merge files in the given parameter path, and if UNIV_PFS_IO defined,...
Definition: ddl0ddl.cc:135
 
dict_index_t * create_index(trx_t *trx, dict_table_t *table, const Index_defn *index_def, const dict_add_v_col_t *add_v) noexcept
Create the index and load in to the dictionary.
Definition: ddl0ddl.cc:190
 
byte[UNIV_PAGE_SIZE_MAX] mrec_buf_t
Secondary buffer for I/O operations of merge records.
Definition: ddl0ddl.h:72
 
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
 
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:924
 
ValueType max(X &&first)
Definition: gtid.h:103
 
Definition: gcs_xcom_synode.h:64
 
mode
Definition: file_handle.h:61
 
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
 
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2880
 
void delete_(T *ptr) noexcept
Releases storage which has been dynamically allocated through any of the ut::new*() variants.
Definition: ut0new.h:811
 
The interface to the operating system file io.
 
static constexpr os_fd_t OS_FD_CLOSED
Definition: os0file.h:117
 
int os_fd_t
Raw file handle.
Definition: os0file.h:115
 
static void swap(String &a, String &b) noexcept
Definition: sql_string.h:650
 
State data storage for get_thread_file_name_locker_v1_t.
Definition: psi_file_bits.h:146
 
Definition: completion_hash.h:35
 
For loading indexes.
Definition: ddl0impl-builder.h:48
 
Document ID sequence.
Definition: ddl0ddl.h:364
 
virtual doc_id_t generated_count() const noexcept=0
 
virtual ~Sequence() noexcept
Destructor.
Definition: ddl0ctx.cc:134
 
virtual void increment() noexcept=0
Advance the document ID.
 
virtual bool is_generated() const noexcept=0
 
virtual doc_id_t fetch(const dtuple_t *dtuple=nullptr) noexcept=0
Get the next document ID.
 
virtual doc_id_t current() noexcept=0
Get the current document ID.
 
doc_id_t m_doc_id
Current document ID.
Definition: ddl0ddl.h:391
 
virtual doc_id_t max_doc_id() const noexcept=0
 
Full text search context information and state.
Definition: ddl0ddl.h:362
 
~FTS() noexcept
Destructor.
Definition: ddl0ddl.h:400
 
ddl::FTS * m_ptr
FTS instance.
Definition: ddl0ddl.h:412
 
FTS(size_t n_parser_threads) noexcept
Constructor.
Definition: ddl0ddl.h:396
 
const size_t m_n_parser_threads
Maximum number of FTS parser and sort threads to use.
Definition: ddl0ddl.h:406
 
Sequence * m_doc_id
Document ID sequence generator.
Definition: ddl0ddl.h:409
 
dict_index_t * m_index
FTS index.
Definition: ddl0ddl.h:403
 
DDL context/configuration.
Definition: ddl0ddl.h:360
 
size_t m_err_key_number
Index where the error occurred.
Definition: ddl0ddl.h:618
 
~Context() noexcept
Destructor.
Definition: ddl0ctx.cc:126
 
const dict_index_t * index() const noexcept
Definition: ddl0ctx.cc:145
 
bool m_need_observer
true if need flush observer.
Definition: ddl0ddl.h:685
 
void set_error(dberr_t err) noexcept
Set the error code, when it's not specific to an index.
Definition: ddl0ddl.h:466
 
const dtuple_t * m_add_cols
Default value for added columns or null.
Definition: ddl0ddl.h:649
 
dict_table_t * old_table() noexcept
Definition: ddl0ddl.h:505
 
bool is_interrupted() noexcept
Definition: ddl0ctx.cc:528
 
size_t allocate(size_t n) const
Request number of bytes for a buffer.
 
const ulint * m_col_map
Mapping of old column numbers to new ones, or nullptr if none were added.
Definition: ddl0ddl.h:653
 
dberr_t cleanup(dberr_t err) noexcept
Clean up the data structures at the end of the DDL.
Definition: ddl0ctx.cc:305
 
Context(trx_t *trx, dict_table_t *old_table, dict_table_t *new_table, bool online, dict_index_t **indexes, const ulint *key_numbers, size_t n_indexes, TABLE *table, const dtuple_t *add_cols, const ulint *col_map, size_t add_autoinc, ddl::Sequence &sequence, bool skip_pk_sort, Alter_stage *stage, const dict_add_v_col_t *add_v, TABLE *eval_table, size_t max_buffer_size, size_t max_threads) noexcept
Build indexes on a table by reading a clustered index, creating a temporary file containing index ent...
Definition: ddl0ctx.cc:46
 
mem_heap_t * m_dtuple_heap
Heap for copies of m_add_cols.
Definition: ddl0ddl.h:705
 
bool set_error(dberr_t err, size_t id) noexcept
Set the error code and index number where the error occurred.
Definition: ddl0ddl.h:480
 
dtuple_t * create_add_cols() noexcept
Copy the added columns dtuples so that we don't use the same column data buffer for the added column ...
Definition: ddl0ctx.cc:530
 
bool m_skip_pk_sort
Skip the sorting phase if true.
Definition: ddl0ddl.h:676
 
size_t merge_io_buffer_size(size_t n_buffers) const noexcept
Calculate the io buffer size per file for the sort phase.
Definition: ddl0ctx.cc:201
 
Scan_buffer_size scan_buffer_size(size_t n_threads) const noexcept
Calculate the sort and buffer size per thread.
Definition: ddl0ctx.cc:149
 
void note_max_trx_id(dict_index_t *index) noexcept
Track the highest TxID that modified this index when the scan was completed.
Definition: ddl0ctx.cc:479
 
std::vector< size_t, ut::allocator< size_t > > m_nonnull
Non null columns.
Definition: ddl0ddl.h:679
 
TABLE * m_table
MySQL table for reporting errors/warnings.
Definition: ddl0ddl.h:646
 
dict_table_t * m_old_table
Source table, read rows from this table.
Definition: ddl0ddl.h:627
 
std::vector< size_t, ut::allocator< size_t > > Key_numbers
Definition: ddl0ddl.h:611
 
dict_table_t * new_table() noexcept
Definition: ddl0ddl.h:508
 
void setup_nonnull() noexcept
Init the non-null column constraints checks (if required).
Definition: ddl0ctx.cc:392
 
const dict_add_v_col_t * m_add_v
New virtual columns added along with indexes.
Definition: ddl0ddl.h:669
 
const size_t m_max_buffer_size
Maximum number of bytes to use.
Definition: ddl0ddl.h:694
 
dict_table_t * m_new_table
Table where indexes are created; identical to old_table unless creating a PRIMARY KEY.
Definition: ddl0ddl.h:631
 
void update_fts_doc_id() noexcept
Update the FTS document ID.
 
trx_t * m_trx
Transaction covering the index build.
Definition: ddl0ddl.h:621
 
size_t m_n_allocated
Number of bytes used.
Definition: ddl0ddl.h:691
 
std::atomic< dberr_t > m_err
Common error code for all index builders running in parallel.
Definition: ddl0ddl.h:615
 
Cursor * cursor() noexcept
Definition: ddl0ddl.h:541
 
size_t m_n_uniq
Number of unique columns in the key.
Definition: ddl0ddl.h:682
 
ib_mutex_t m_autoinc_mutex
For parallel access to the autoincrement generator.
Definition: ddl0ddl.h:702
 
bool has_virtual_columns() const noexcept
Definition: ddl0ctx.cc:224
 
bool has_fts_indexes() const noexcept
Definition: ddl0ctx.cc:436
 
dberr_t check_state_of_online_build_log() noexcept
Check the state of the online build log for the index.
Definition: ddl0ctx.cc:466
 
dberr_t setup_fts_build() noexcept
Setup the FTS index build data structures.
Definition: ddl0ctx.cc:449
 
FTS m_fts
The FTS builder.
Definition: ddl0ddl.h:624
 
dberr_t setup_pk_sort(Cursor *cursor) noexcept
Setup the primary key sort.
Definition: ddl0ctx.cc:499
 
dberr_t handle_autoinc(const dtuple_t *row, mem_heap_t *heap) noexcept
Handle auto increment.
Definition: ddl0ctx.cc:239
 
std::pair< size_t, size_t > Scan_buffer_size
Scan sort and IO buffer size.
Definition: ddl0ddl.h:416
 
Key_numbers m_key_numbers
MySQL key numbers.
Definition: ddl0ddl.h:643
 
size_t m_add_autoinc
Number of added AUTO_INCREMENT columns, or ULINT_UNDEFINED if none added.
Definition: ddl0ddl.h:657
 
Flush_observer * flush_observer() noexcept
Definition: ddl0ctx.cc:136
 
bool m_online
True if creating index online.
Definition: ddl0ddl.h:637
 
Indexes m_indexes
Indexes to be created.
Definition: ddl0ddl.h:640
 
size_t load_io_buffer_size(size_t n_buffers) const noexcept
Calculate the io buffer size per file for the load phase.
Definition: ddl0ctx.cc:216
 
dberr_t get_error() const noexcept
Definition: ddl0ddl.h:462
 
std::vector< dict_index_t *, ut::allocator< dict_index_t * > > Indexes
Definition: ddl0ddl.h:612
 
dberr_t read_init(Cursor *cursor) noexcept
Initialize the context for a cluster index scan.
Definition: ddl0ctx.cc:507
 
ddl::Sequence & m_sequence
Autoinc sequence.
Definition: ddl0ddl.h:660
 
friend struct Btree_cursor
Definition: ddl0ddl.h:713
 
Cursor * m_cursor
Cursor for reading the cluster index.
Definition: ddl0ddl.h:688
 
Alter_stage * m_stage
Performance schema accounting object, used by ALTER TABLE.
Definition: ddl0ddl.h:666
 
const size_t m_max_threads
Maximum number of threads to use.
Definition: ddl0ddl.h:699
 
dberr_t build() noexcept
Build the indexes.
Definition: ddl0ctx.cc:516
 
bool check_null_constraints(const dtuple_t *row) const noexcept
Check if the nonnull columns satisfy the constraint.
Definition: ddl0ctx.cc:422
 
dberr_t fts_create(dict_index_t *index) noexcept
Initialize the FTS build infrastructure.
Definition: ddl0ctx.cc:291
 
TABLE * m_eval_table
MySQL table used to evaluate virtual column value, see innobase_get_computed_value().
Definition: ddl0ddl.h:673
 
THD * thd() noexcept
Definition: ddl0ctx.cc:140
 
doc_id_t next_doc_id() noexcept
Get the next Doc ID and increment the current value.
 
Cursor for reading the data.
Definition: ddl0impl-cursor.h:41
 
Structure for reporting duplicate records.
Definition: ddl0ddl.h:132
 
dict_index_t * m_index
Index being sorted.
Definition: ddl0ddl.h:181
 
size_t m_n_dup
Number of duplicates.
Definition: ddl0ddl.h:191
 
void save_duplicate(const dfield_t *entry)
Save the duplicate tuple information.
Definition: ddl0ddl.h:175
 
Dup(dict_index_t *index, TABLE *table, const ulint *col_map, size_t n_dup)
Constructor.
Definition: ddl0ddl.h:142
 
const dfield_t * m_entry
The duplicate tuple of index m_index.
Definition: ddl0ddl.h:195
 
const ulint * m_col_map
Mapping of column numbers in table to the rebuilt table (index->table), or NULL if not rebuilding tab...
Definition: ddl0ddl.h:188
 
TABLE * m_table
MySQL table object.
Definition: ddl0ddl.h:184
 
bool empty() const noexcept
Definition: ddl0ddl.h:171
 
void report() noexcept
Report a duplicate key, saved in m_entry member.
Definition: ddl0ddl.cc:92
 
Full text search index builder.
Definition: ddl0fts.h:67
 
Definition of an index being created.
Definition: ddl0ddl.h:99
 
const char * m_name
Index name.
Definition: ddl0ddl.h:101
 
bool m_srid_is_valid
true if we want to check SRID while inserting to index
Definition: ddl0ddl.h:125
 
bool m_is_ngram
true if it's ngram parser
Definition: ddl0ddl.h:122
 
size_t m_ind_type
0, DICT_UNIQUE, or DICT_CLUSTERED
Definition: ddl0ddl.h:107
 
size_t m_key_number
MySQL key number, or ULINT_UNDEFINED if none.
Definition: ddl0ddl.h:110
 
Index_field * m_fields
Field definitions.
Definition: ddl0ddl.h:116
 
uint32_t m_srid
SRID obtained from dd column.
Definition: ddl0ddl.h:128
 
size_t m_n_fields
Number of fields in index.
Definition: ddl0ddl.h:113
 
st_mysql_ftparser * m_parser
Fulltext parser plugin.
Definition: ddl0ddl.h:119
 
bool m_rebuild
Whether the table is rebuilt.
Definition: ddl0ddl.h:104
 
Index field definition.
Definition: ddl0ddl.h:81
 
bool m_is_ascending
true=ASC, false=DESC
Definition: ddl0ddl.h:95
 
size_t m_col_no
Column offset.
Definition: ddl0ddl.h:83
 
size_t m_prefix_len
Column prefix length, or 0 if indexing the whole column.
Definition: ddl0ddl.h:86
 
bool m_is_v_col
Whether this is a virtual column.
Definition: ddl0ddl.h:89
 
bool m_is_multi_value
Whether it has multi-value.
Definition: ddl0ddl.h:92
 
Definition: ddl0impl-builder.h:458
 
Merge the blocks in the file.
Definition: ddl0impl-merge.h:45
 
Cursor used for parallel reads.
Definition: ddl0par-scan.cc:45
 
Physical row context.
Definition: ddl0impl.h:121
 
Generate the next autoinc based on a snapshot of the session auto_increment_increment and auto_increm...
Definition: ddl0ddl.h:306
 
ulonglong last() const noexcept
Definition: ddl0ddl.h:337
 
bool m_eof
true if no more values left in the sequence
Definition: ddl0ddl.h:356
 
ulong m_increment
Value of auto_increment_increment.
Definition: ddl0ddl.h:347
 
const ulonglong m_max_value
Maximum column value if adding an AUTOINC column else 0.
Definition: ddl0ddl.h:344
 
ddl::Sequence & operator=(const ddl::Sequence &rhs) noexcept
Assignment operator to copy the sequence values.
Definition: ddl0ddl.h:326
 
ulong m_offset
Value of auto_increment_offset.
Definition: ddl0ddl.h:350
 
ulonglong operator++(int) noexcept
Postfix increment.
Definition: ddl0ctx.cc:565
 
Sequence(THD *thd, ulonglong start_value, ulonglong max_value) noexcept
Constructor.
Definition: ddl0ctx.cc:543
 
ulonglong m_next_value
Next value in the sequence.
Definition: ddl0ddl.h:353
 
~Sequence()=default
Destructor.
 
bool eof() const noexcept
Check if the autoinc "sequence" is exhausted.
Definition: ddl0ddl.h:322
 
Structure for an SQL data field.
Definition: data0data.h:617
 
Data structure for newly added virtual column in a table.
Definition: dict0mem.h:830
 
Data structure for an index.
Definition: dict0mem.h:1041
 
Data structure for a database table.
Definition: dict0mem.h:1922
 
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:696
 
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
 
Definition: plugin_ftparser.h:216
 
Definition: trx0trx.h:675
 
long long sequence(UDF_INIT *initid, UDF_ARGS *args, unsigned char *, unsigned char *)
Definition: udf_example.cc:568
 
unsigned long int ulint
Definition: univ.i:406
 
constexpr size_t UNIV_PAGE_SIZE_MAX
Maximum page size InnoDB currently supports.
Definition: univ.i:323
 
constexpr ulint ULINT_UNDEFINED
The 'undefined' value for a ulint.
Definition: univ.i:420
 
Utilities related to class lifecycle.
 
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105
 
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:93
 
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:510
 
int n
Definition: xcom_base.cc:509