MySQL 26.7.0
Source Code Documentation
mysql_bulk_data.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 2026, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24
25#pragma once
26
29
30namespace Bulk_data_convert {
31
33 (THD * thd, const TABLE *table, const Rows_text &text_rows,
34 size_t &next_index, char *buffer, size_t &buffer_length,
35 const CHARSET_INFO *charset, const Row_meta &metadata,
36 Rows_mysql &sql_rows,
37 Bulk_load_error_location_details &error_details));
38
40 (char *buffer, size_t buffer_length, const Row_meta &metadata,
41 size_t start_index, size_t &consumed_length,
42 Rows_mysql &sql_rows));
43
45 (const Row_meta &metadata, const Rows_mysql &sql_keys,
46 size_t key_offset, Rows_mysql &sql_rows, size_t sql_index));
47
48DEFINE_METHOD(bool, is_killed, (THD * thd));
49
51 (const Column_mysql &key1, const Column_mysql &key2,
52 const Column_meta &col_meta));
53
55 (THD * thd, const TABLE *table, bool have_key,
56 std::vector<Row_meta> &row_meta_all));
57
59 (THD * thd, const TABLE *table, Table_meta &table_meta));
60
61} // namespace Bulk_data_convert
62
63namespace Bulk_data_load {
64
66 void *, begin,
67 (THD * thd, const TABLE *table, size_t data_size, size_t memory,
68 size_t num_threads,
69 const std::vector<Bulk_load::Source_table_data> &source_table_data));
70
71/* Load data to an index. */
72DEFINE_METHOD(void *, begin,
73 (THD * thd, const TABLE *table, size_t nth_key, size_t data_size,
74 size_t memory, size_t num_threads));
75
77 (THD * thd, void *ctx, const TABLE *table,
78 const Rows_mysql &sql_rows, size_t thread,
79 Bulk_load::Stat_callbacks &wait_cbks));
80
82 (THD * thd, void *load_ctx, const TABLE *table,
83 Blob_context &blob_ctx, unsigned char *blobref, size_t thread));
84
86 (THD * thd, void *load_ctx, const TABLE *table,
87 Blob_context blob_ctx, unsigned char *blobref, size_t thread,
88 const unsigned char *data, size_t data_len));
89
91 (THD * thd, void *load_ctx, const TABLE *table,
92 Blob_context blob_ctx, unsigned char *blobref, size_t thread));
93
94DEFINE_METHOD(bool, end,
95 (THD * thd, void *ctx, const TABLE *table, bool error));
96
97DEFINE_METHOD(bool, is_table_supported, (THD * thd, const TABLE *table));
98
99DEFINE_METHOD(size_t, get_se_memory_size, (THD * thd, const TABLE *table));
100
102 (void *ctx, const TABLE *duplicate_table, size_t thread,
103 Bulk_load::Stat_callbacks &wait_cbks));
104
107 (void *ctx, const TABLE *duplicate_table,
108 const std::vector<Bulk_load::Source_table_data> &source_table_data));
109
110} // namespace Bulk_data_load
Services for bulk data conversion and load to SE.
Implements the row and column memory management for parse and load operations.
Definition: bulk_data_service.h:325
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Specifies macros to define Components.
static uint16 key1[1001]
Definition: hp_test2.cc:50
Definition: bulk_data_service.cc:53
int mysql_format_from_raw(char *buffer, size_t buffer_length, const Row_meta &metadata, size_t start_index, size_t &consumed_length, Rows_mysql &sql_rows) noexcept
Definition: bulk_data_service.cc:1892
bool get_table_metadata(THD *thd, const TABLE *table, Table_meta &table_meta) noexcept
Definition: bulk_data_service.cc:2591
int mysql_format(THD *thd, const TABLE *table, const Rows_text &text_rows, size_t &next_index, char *buffer, size_t &buffer_length, const CHARSET_INFO *charset, const Row_meta &metadata, Rows_mysql &sql_rows, Bulk_load_error_location_details &error_details) noexcept
Definition: bulk_data_service.cc:1923
bool get_row_metadata_all(THD *thd, const TABLE *table, bool have_key, std::vector< Row_meta > &row_meta_all) noexcept
Definition: bulk_data_service.cc:2612
int compare_keys(const Column_mysql &key1, const Column_mysql &key2, const Column_meta &col_meta) noexcept
Definition: bulk_data_service.cc:1982
int mysql_format_using_key(const Row_meta &metadata, const Rows_mysql &sql_keys, size_t key_offset, Rows_mysql &sql_rows, size_t sql_index) noexcept
Definition: bulk_data_service.cc:1870
bool is_killed(THD *thd) noexcept
Definition: bulk_data_service.cc:1975
Definition: bulk_data_service.cc:2657
void * Blob_context
Definition: bulk_data_service.cc:2659
void * begin(THD *thd, const TABLE *table, size_t keynr, size_t data_size, size_t memory, size_t num_threads) noexcept
Definition: bulk_data_service.cc:2663
bool copy_existing_data(void *ctx, const TABLE *duplicate_table, size_t thread, Bulk_load::Stat_callbacks &wait_cbks) noexcept
Definition: bulk_data_service.cc:2794
bool open_blob(THD *thd, void *load_ctx, const TABLE *table, Blob_context &blob_ctx, unsigned char *blobref, size_t thread) noexcept
Definition: bulk_data_service.cc:2680
size_t get_se_memory_size(THD *thd, const TABLE *table) noexcept
Definition: bulk_data_service.cc:2788
bool set_source_table_data(void *ctx, const TABLE *duplicate_table, const std::vector< Bulk_load::Source_table_data > &source_table_data) noexcept
Definition: bulk_data_service.cc:2803
bool end(THD *thd, void *ctx, const TABLE *table, bool error) noexcept
Definition: bulk_data_service.cc:2704
bool load(THD *thd, void *ctx, const TABLE *table, const Rows_mysql &sql_rows, size_t thread, Bulk_load::Stat_callbacks &wait_cbks) noexcept
Definition: bulk_data_service.cc:2672
bool write_blob(THD *thd, void *load_ctx, const TABLE *table, Blob_context blob_ctx, unsigned char *blobref, size_t thread, const unsigned char *data, size_t data_len) noexcept
Definition: bulk_data_service.cc:2690
bool close_blob(THD *thd, void *load_ctx, const TABLE *table, Blob_context blob_ctx, unsigned char *blobref, size_t thread) noexcept
Definition: bulk_data_service.cc:2698
bool is_table_supported(THD *thd, const TABLE *table) noexcept
Definition: bulk_data_service.cc:2808
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
const std::string charset("charset")
Definition: aligned_atomic.h:44
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
#define DEFINE_METHOD(retval, name, args)
A macro to ensure method implementation has required properties, that is it does not throw exceptions...
Definition: service_implementation.h:79
Callbacks for collecting time statistics.
Definition: bulk_data_service.h:931
Definition: bulk_data_service.h:58
Definition: m_ctype.h:421
Column metadata information.
Definition: bulk_data_service.h:469
Definition: bulk_data_service.h:210
Row metadata.
Definition: bulk_data_service.h:761
Definition: table.h:1456
Table metadata.
Definition: bulk_data_service.h:743