MySQL 8.0.39
Source Code Documentation
|
Classes | |
struct | Column |
A class that represents a field, which also holds a cached value of the field's data type. More... | |
struct | Table |
This struct is primarily used for holding the extracted columns in a hash join or BKA join, or the input columns in a streaming aggregation operation. More... | |
class | TableCollection |
A structure that contains a list of input tables for a hash join operation, BKA join operation or a streaming aggregation operation, and some pre-computed properties for the tables. More... | |
Enumerations | |
enum class | NullRowFlag { kNotNull , kNullWithoutData , kNullWithData } |
Possible values of the NULL-row flag stored by StoreFromTableBuffers(). More... | |
Functions | |
static size_t | CalculateColumnStorageSize (const Column &column) |
size_t | ComputeRowSizeUpperBound (const TableCollection &tables) |
Count up how many bytes a single row from the given tables will occupy, in "packed" format. More... | |
bool | StoreFromTableBuffers (const TableCollection &tables, String *buffer) |
Take the data marked for reading in "tables" and store it in the provided buffer. More... | |
const uchar * | LoadIntoTableBuffers (const TableCollection &tables, const uchar *ptr) |
Take the data in "ptr" and put it back to the tables' record buffers. More... | |
void | RequestRowId (const Prealloced_array< pack_rows::Table, 4 > &tables, table_map tables_to_get_rowid_for) |
For each of the given tables, request that the row ID is filled in (the equivalent of calling file->position()) if needed. More... | |
void | PrepareForRequestRowId (const Prealloced_array< Table, 4 > &tables, table_map tables_to_get_rowid_for) |
bool | ShouldCopyRowId (const TABLE *table) |
ALWAYS_INLINE uchar * | StoreFromTableBuffersRaw (const TableCollection &tables, uchar *dptr) |
|
strong |
Possible values of the NULL-row flag stored by StoreFromTableBuffers().
It tells whether or not a row is a NULL-complemented row in which all column values (including non-nullable columns) are NULL. Additionally, in case it is a NULL-complemented row, the flag contains information about whether the buffer contains the actual non-NULL values that were available in the record buffer at the time the row was stored, or if no column values are stored for the NULL-complemented row. Usually, no values are stored for NULL-complemented rows, but it may be necessary in order to avoid corrupting the internal cache of EQRefIterator. See Table::store_contents_of_null_rows.
|
static |
size_t pack_rows::ComputeRowSizeUpperBound | ( | const TableCollection & | tables | ) |
Count up how many bytes a single row from the given tables will occupy, in "packed" format.
Note that this is an upper bound, so the length after calling Field::pack may very well be shorter than the size returned by this function.
The value returned from this function will sum up 1) The row-id if that is to be kept. 2) Size of the NULL flags. This includes:
Note that if any of the tables has a BLOB/TEXT column, this function looks at the data stored in the record buffers. This means that the function can not be called before reading any rows if tables.has_blob_column is true.
const uchar * pack_rows::LoadIntoTableBuffers | ( | const TableCollection & | tables, |
const uchar * | ptr | ||
) |
Take the data in "ptr" and put it back to the tables' record buffers.
The tables must be exactly the same as when the row was created. That is, it must contain the same tables in the same order, and the read set of each table must be identical when storing and restoring the row. If that's not the case, you will end up with undefined and unpredictable behavior.
Returns a pointer to where we ended reading.
void pack_rows::PrepareForRequestRowId | ( | const Prealloced_array< Table, 4 > & | tables, |
table_map | tables_to_get_rowid_for | ||
) |
void pack_rows::RequestRowId | ( | const Prealloced_array< pack_rows::Table, 4 > & | tables, |
table_map | tables_to_get_rowid_for | ||
) |
For each of the given tables, request that the row ID is filled in (the equivalent of calling file->position()) if needed.
tables | All tables involved in the operation. |
tables_to_get_rowid_for | A bitmap of which tables to actually get row IDs for. (A table needs to be in both sets to be processed.) |
|
inline |
bool pack_rows::StoreFromTableBuffers | ( | const TableCollection & | tables, |
String * | buffer | ||
) |
Take the data marked for reading in "tables" and store it in the provided buffer.
What data to store is determined by the read set of each table. Note that any existing data in "buffer" will be overwritten.
The output buffer will contain the following data for each table in "tables":
1) NULL-row flag if the table is nullable. 2) NULL flags for each nullable column. 3) The actual data from the columns. 4) The row ID for each row. This is only stored if the optimizer requested row IDs when creating the TableCollection.
true | if error, false otherwise |
ALWAYS_INLINE uchar * pack_rows::StoreFromTableBuffersRaw | ( | const TableCollection & | tables, |
uchar * | dptr | ||
) |