|
static size_t | CalculateColumnStorageSize (const Column &column, bool skip_blob_null_check) |
| Calculate how many bytes the data in the column uses. More...
|
|
size_t | ComputeRowSizeUpperBound (const TableCollection &tables) |
| Similar to ComputeRowSizeUpperBoundSansBlobs, but will calculate blob size as well. More...
|
|
size_t | ComputeRowSizeUpperBoundSansBlobs (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...
|
|
static bool | ShouldGetRowIdFor (const TABLE &table, table_map tables_to_get_rowid_for) |
|
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) |
|
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.
Enumerator |
---|
kNotNull | The row is not a NULL-complemented one.
|
kNullWithoutData | The row is NULL-complemented. No column values are stored in the buffer.
|
kNullWithData | The row is NULL-complemented.
The actual non-NULL values that were in the record buffer at the time StoreFromTableBuffers() was called, will however be available in the buffer.
|
static size_t pack_rows::CalculateColumnStorageSize |
( |
const Column & |
column, |
|
|
bool |
skip_blob_null_check |
|
) |
| |
|
static |
Calculate how many bytes the data in the column uses.
We don't bother calculating the exact size for all types, since we consider reserving some extra bytes in buffers harmless. In particular, as long as the column is not of type BLOB, TEXT, JSON or GEOMETRY, we return an upper bound of the storage size. In the case of said types, we return the actual storage size; we do not want to return 4 gigabytes for a BLOB column if it only contains 10 bytes of data.
- Parameters
-
column | the column to calculate size for |
skip_blob_null_check | If true, disregard the NULL status of blob columns, presuming the table buffer has valid data for the blob; count that. |
size_t pack_rows::ComputeRowSizeUpperBoundSansBlobs |
( |
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:
- Space for a NULL flag per nullable column.
- Space for a NULL flag per nullable table (tables on the inner side of an outer join). 3) Size of the buffer returned by pack() on all columns marked in the
read_set_internal
. We do not necessarily have valid data in the table buffers, so we do not try to calculate size for blobs.
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.
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.
- Return values
-
true | if error, false otherwise |