64 std::ostream &
print(std::ostream &out)
const;
68 std::ostream &out)
const {
69 out <<
"[Bulk_load_error_location_details: filename=" <<
filename
81 return obj.
print(out);
96 m_data_len = std::numeric_limits<size_t>::max();
102 assert(
m_data_len != std::numeric_limits<size_t>::max() ||
104 return m_data_len == std::numeric_limits<size_t>::max();
142 std::ostream &
print(std::ostream &out)
const;
169 sout << std::setfill(
'0') << std::setw(2) << std::hex
178 out <<
"[Column_text: this=" <<
static_cast<const void *
>(
this)
179 <<
", m_data_ptr=" <<
static_cast<const void *
>(
m_data_ptr)
190 return obj.
print(out);
244 sout << std::setfill(
'0') << std::setw(2) << std::hex
259template <
typename Column_type>
276 template <
typename F>
284 template <
typename F>
290 if (!cbk(
m_columns[row_offset + index], last_col)) {
323 Column_type &
get_column(
size_t row_offset,
size_t col_index) {
325 assert(row_offset + col_index <
m_columns.size());
326 return m_columns[row_offset + col_index];
333 Column_type &
get_col(
size_t row_index,
size_t col_index) {
346 const Column_type &
read_column(
size_t row_offset,
size_t col_index)
const {
348 assert(row_offset + col_index <
m_columns.size());
349 return m_columns[row_offset + col_index];
358 if (n_rows > std::numeric_limits<uint32_t>::max() ||
479 std::ostream &
print(std::ostream &out)
const;
527 return "typed_array";
545 return "medium_blob";
590 return obj.
print(out);
682 m_error =
"JSON document has more nesting levels than supported";
685 m_error =
"Invalid JSON value is encountered";
688 const char *message [[maybe_unused]])
const {
690 m_error +=
" (Internal Error)";
725 size_t &next_index,
char *
buffer,
size_t &buffer_length,
740 size_t start_index,
size_t &consumed_length,
792 size_t num_threads));
831 Blob_context blob_ctx,
unsigned char *blobref,
size_t thread,
832 const
unsigned char *data,
size_t data_len));
constexpr size_t BLOB_REF_SIZE
The blob reference size.
Definition: bulk_data_service.h:52
void * Blob_context
Definition: bulk_data_service.h:49
std::ostream & operator<<(std::ostream &out, const Bulk_load_error_location_details &obj)
Overloading the global output operator to print objects of type Bulk_load_error_location_details.
Definition: bulk_data_service.h:79
Definition: bulk_data_service.h:656
const char * c_str() const
Definition: bulk_data_service.h:665
void KeyTooBig() const override
Called when a JSON object contains a member with a name that is longer than supported by the JSON bin...
Definition: bulk_data_service.h:673
std::string get_error() const
Definition: bulk_data_service.h:667
std::string m_error
Definition: bulk_data_service.h:670
void InternalError(const char *message) const override
Called when an internal error occurs.
Definition: bulk_data_service.h:687
void ValueTooBig() const override
Called when a JSON document is too big to be stored in the JSON binary format.
Definition: bulk_data_service.h:677
void TooDeep() const override
Called when a JSON document has more nesting levels than supported.
Definition: bulk_data_service.h:681
void InvalidJson() const override
Called when an invalid JSON value is encountered.
Definition: bulk_data_service.h:684
bool CheckStack() const override
Check if the stack is about to be exhausted, and report the error.
Definition: bulk_data_service.h:693
Error handler for the functions that serialize a JSON value in the JSON binary storage format.
Definition: json_error_handler.h:49
Implements the row and column memory management for parse and load operations.
Definition: bulk_data_service.h:260
bool set_num_rows(size_t n_rows)
Set the number of rows.
Definition: bulk_data_service.h:356
std::vector< Column_type > m_columns
All the columns.
Definition: bulk_data_service.h:387
size_t get_next_row_offset(size_t &offset) const
Get next row offset from current row offset.
Definition: bulk_data_service.h:314
Column_type & get_col(size_t col_offset)
Get column using the column offset.
Definition: bulk_data_service.h:340
bool process_columns(size_t row_index, F &&cbk)
Process all columns, invoking callback for each.
Definition: bulk_data_service.h:277
bool process_columns_by_offset(size_t row_offset, F &&cbk)
Definition: bulk_data_service.h:285
size_t get_num_cols() const
Definition: bulk_data_service.h:270
void reset()
Definition: bulk_data_service.h:297
size_t m_num_rows
Number of rows.
Definition: bulk_data_service.h:390
size_t get_row_offset(size_t row_index) const
Get current row offset to access columns.
Definition: bulk_data_service.h:306
size_t get_num_rows() const
Definition: bulk_data_service.h:267
const Column_type & read_column(size_t row_offset, size_t col_index) const
Get constant column for reading using row offset and column index.
Definition: bulk_data_service.h:346
Column_type & get_col(size_t row_index, size_t col_index)
Get column using row index and column index.
Definition: bulk_data_service.h:333
Row_bunch(size_t n_cols)
Create a new row bunch.
Definition: bulk_data_service.h:264
static const size_t S_MAX_TOTAL_COLS
Limit allocation up to 600M columns.
Definition: bulk_data_service.h:383
size_t m_num_columns
Number of columns in each row.
Definition: bulk_data_service.h:393
Column_type & get_column(size_t row_offset, size_t col_index)
Get column using row offset and column index.
Definition: bulk_data_service.h:323
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
This file contains the field type.
enum_field_types
Column types for MySQL Note: Keep include/mysql/components/services/bits/stored_program_bits....
Definition: field_types.h:55
@ MYSQL_TYPE_BOOL
Currently just a placeholder.
Definition: field_types.h:79
@ MYSQL_TYPE_TIME2
Internal to MySQL.
Definition: field_types.h:75
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:71
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:64
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:86
@ MYSQL_TYPE_VAR_STRING
Definition: field_types.h:88
@ MYSQL_TYPE_BLOB
Definition: field_types.h:87
@ MYSQL_TYPE_TINY
Definition: field_types.h:57
@ MYSQL_TYPE_TIME
Definition: field_types.h:67
@ MYSQL_TYPE_SET
Definition: field_types.h:83
@ MYSQL_TYPE_NEWDATE
Internal to MySQL.
Definition: field_types.h:70
@ MYSQL_TYPE_VECTOR
Definition: field_types.h:77
@ MYSQL_TYPE_JSON
Definition: field_types.h:80
@ MYSQL_TYPE_STRING
Definition: field_types.h:89
@ MYSQL_TYPE_NULL
Definition: field_types.h:62
@ MYSQL_TYPE_ENUM
Definition: field_types.h:82
@ MYSQL_TYPE_TINY_BLOB
Definition: field_types.h:84
@ MYSQL_TYPE_LONG
Definition: field_types.h:59
@ MYSQL_TYPE_BIT
Definition: field_types.h:72
@ MYSQL_TYPE_INVALID
Definition: field_types.h:78
@ MYSQL_TYPE_GEOMETRY
Definition: field_types.h:90
@ MYSQL_TYPE_NEWDECIMAL
Definition: field_types.h:81
@ MYSQL_TYPE_DECIMAL
Definition: field_types.h:56
@ MYSQL_TYPE_TYPED_ARRAY
Used for replication only.
Definition: field_types.h:76
@ MYSQL_TYPE_DOUBLE
Definition: field_types.h:61
@ MYSQL_TYPE_MEDIUM_BLOB
Definition: field_types.h:85
@ MYSQL_TYPE_DATETIME2
Internal to MySQL.
Definition: field_types.h:74
@ MYSQL_TYPE_SHORT
Definition: field_types.h:58
@ MYSQL_TYPE_DATE
Definition: field_types.h:66
@ MYSQL_TYPE_FLOAT
Definition: field_types.h:60
@ MYSQL_TYPE_TIMESTAMP
Definition: field_types.h:63
@ MYSQL_TYPE_INT24
Definition: field_types.h:65
@ MYSQL_TYPE_DATETIME
Definition: field_types.h:68
@ MYSQL_TYPE_TIMESTAMP2
Definition: field_types.h:73
@ MYSQL_TYPE_YEAR
Definition: field_types.h:69
static uint16 key1[1001]
Definition: hp_test2.cc:50
void error(const char *format,...)
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:1710
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:1739
bool get_row_metadata(THD *, const TABLE *table, bool have_key, Row_meta &metadata) noexcept
Definition: bulk_data_service.cc:1964
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:1689
bool is_killed(THD *thd) noexcept
Definition: bulk_data_service.cc:1791
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:2147
size_t get_se_memory_size(THD *thd, const TABLE *table) noexcept
Definition: bulk_data_service.cc:2255
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:2157
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:2165
bool is_table_supported(THD *thd, const TABLE *table) noexcept
Definition: bulk_data_service.cc:2259
Definition: bulk_data_service.h:653
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
const std::string charset("charset")
bool load(THD *, const dd::String_type &fname, dd::String_type *buf)
Read an sdi file from disk and store in a buffer.
Definition: sdi_file.cc:308
Definition: aligned_atomic.h:44
const char * begin(const char *const c)
Definition: base64.h:44
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2872
#define DECLARE_METHOD(retval, name, args)
Declares a method as a part of the Service definition.
Definition: service.h:103
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
Callbacks for collecting time statistics.
Definition: bulk_data_service.h:698
std::function< void()> m_fn_begin
Definition: bulk_data_service.h:700
std::function< void()> m_fn_end
Definition: bulk_data_service.h:702
Definition: bulk_data_service.h:54
std::string filename
Definition: bulk_data_service.h:55
std::string m_table_name
Definition: bulk_data_service.h:61
size_t m_bytes
Definition: bulk_data_service.h:62
size_t row_number
Definition: bulk_data_service.h:56
std::string column_input_data
Definition: bulk_data_service.h:59
std::string column_name
Definition: bulk_data_service.h:57
std::string m_error_mesg
Definition: bulk_data_service.h:60
std::ostream & print(std::ostream &out) const
Definition: bulk_data_service.h:67
std::string column_type
Definition: bulk_data_service.h:58
Definition: m_ctype.h:421
Definition: bulk_data_service.h:193
uint64_t m_int_data
Column data in integer format.
Definition: bulk_data_service.h:207
std::string to_string() const
Definition: bulk_data_service.h:220
bool m_is_null
If column is NULL.
Definition: bulk_data_service.h:201
char * m_data_ptr
Column data.
Definition: bulk_data_service.h:204
int16_t m_type
Column Data Type.
Definition: bulk_data_service.h:195
uint16_t m_data_len
Column data length.
Definition: bulk_data_service.h:198
void init()
Definition: bulk_data_service.h:209
Definition: bulk_data_service.h:84
bool is_null() const
Check if the column is null, by checking special value for length.
Definition: bulk_data_service.h:101
bool is_ext_relaxed() const
Check if the column data is stored externally.
Definition: bulk_data_service.h:121
bool m_is_ext
If true, the column data is stored externally.
Definition: bulk_data_service.h:148
void set_null()
Mark the column to be null, by setting length to a special value.
Definition: bulk_data_service.h:94
std::ostream & print(std::ostream &out) const
Print this object into the given output stream.
Definition: bulk_data_service.h:177
const char * m_data_ptr
Column data.
Definition: bulk_data_service.h:86
void init()
Initialize the members.
Definition: bulk_data_service.h:133
void set_ext()
Mark that the column data has been stored externally.
Definition: bulk_data_service.h:127
bool is_ext() const
Check if the column data is stored externally.
Definition: bulk_data_service.h:112
size_t m_data_len
Column data length.
Definition: bulk_data_service.h:89
std::string to_string() const
Definition: bulk_data_service.h:151