mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
IB: removed alloc from row_ins_set_tuple_col_8()
This commit is contained in:
@@ -202,6 +202,8 @@ struct ins_node_t{
|
||||
trx_id_t trx_id; /*!< trx id or the last trx which executed the
|
||||
node */
|
||||
byte* trx_id_buf;/* buffer for the trx id sys field in row */
|
||||
byte vers_start_buf[8]; /* Buffers for System Versioning */
|
||||
byte vers_end_buf[8]; /* system fields. */
|
||||
mem_heap_t* entry_sys_heap;
|
||||
/* memory heap used as auxiliary storage;
|
||||
entry_list and sys fields are stored here;
|
||||
@@ -233,13 +235,12 @@ void row_ins_set_tuple_col_8(
|
||||
dtuple_t* tuple,
|
||||
int col,
|
||||
ib_uint64_t data,
|
||||
mem_heap_t* heap)
|
||||
byte* buf)
|
||||
{
|
||||
static const ulint fsize = sizeof(data);
|
||||
dfield_t* dfield = dtuple_get_nth_field(tuple, col);
|
||||
ut_ad(dfield->type.len == fsize);
|
||||
if (dfield->len == UNIV_SQL_NULL) {
|
||||
byte* buf = reinterpret_cast<byte*>(mem_heap_alloc(heap, fsize));
|
||||
dfield_set_data(dfield, buf, fsize);
|
||||
}
|
||||
ut_ad(dfield->len == dfield->type.len && dfield->data);
|
||||
@@ -251,12 +252,11 @@ void row_ins_set_tuple_col_8(
|
||||
dtuple_t* tuple,
|
||||
int col,
|
||||
timeval& data,
|
||||
mem_heap_t* heap)
|
||||
byte* buf)
|
||||
{
|
||||
dfield_t* dfield = dtuple_get_nth_field(tuple, col);
|
||||
ut_ad(dfield->type.len == 8);
|
||||
if (dfield->len == UNIV_SQL_NULL) {
|
||||
byte* buf = reinterpret_cast<byte*>(mem_heap_alloc(heap, 8));
|
||||
dfield_set_data(dfield, buf, 8);
|
||||
}
|
||||
ut_ad(dfield->len == dfield->type.len && dfield->data);
|
||||
@@ -264,21 +264,4 @@ void row_ins_set_tuple_col_8(
|
||||
mach_write_to_4(reinterpret_cast<byte*>(dfield->data) + 4, (ulint) data.tv_usec);
|
||||
}
|
||||
|
||||
UNIV_INLINE
|
||||
void row_ins_set_tuple_col_1(
|
||||
dtuple_t* tuple,
|
||||
int col,
|
||||
byte data,
|
||||
mem_heap_t* heap)
|
||||
{
|
||||
dfield_t* dfield = dtuple_get_nth_field(tuple, col);
|
||||
ut_ad(dfield->type.len == 1);
|
||||
if (dfield->len == UNIV_SQL_NULL) {
|
||||
byte* buf = reinterpret_cast<byte*>(mem_heap_alloc(heap, 1));
|
||||
dfield_set_data(dfield, buf, 1);
|
||||
}
|
||||
ut_ad(dfield->len == dfield->type.len && dfield->data);
|
||||
*(byte*)(dfield->data) = data;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1504,14 +1504,14 @@ row_insert_for_mysql(
|
||||
ut_ad(t->mysql_col_len == 8);
|
||||
|
||||
if (ins_mode == ROW_INS_HISTORICAL) {
|
||||
row_ins_set_tuple_col_8(node->row, table->vers_end, trx->id, node->entry_sys_heap);
|
||||
row_ins_set_tuple_col_8(node->row, table->vers_end, trx->id, node->vers_end_buf);
|
||||
}
|
||||
else /* ROW_INS_VERSIONED */ {
|
||||
row_ins_set_tuple_col_8(node->row, table->vers_end, IB_UINT64_MAX, node->entry_sys_heap);
|
||||
row_ins_set_tuple_col_8(node->row, table->vers_end, IB_UINT64_MAX, node->vers_end_buf);
|
||||
int8store(&mysql_rec[t->mysql_col_offset], IB_UINT64_MAX);
|
||||
t = &prebuilt->mysql_template[table->vers_start];
|
||||
ut_ad(t->mysql_col_len == 8);
|
||||
row_ins_set_tuple_col_8(node->row, table->vers_start, trx->id, node->entry_sys_heap);
|
||||
row_ins_set_tuple_col_8(node->row, table->vers_start, trx->id, node->vers_start_buf);
|
||||
int8store(&mysql_rec[t->mysql_col_offset], trx->id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user