diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-08-06 19:57:06 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-08-06 19:57:06 +0200 |
commit | a7f39aacd573bfa299a930ee8275ba3066efc33a (patch) | |
tree | 9d440e20d7809dcccff7eea0c7b93d79c1d2edf6 /storage/xtradb/row/row0ins.cc | |
parent | 098a9c602d702950b112a251580057f128634f22 (diff) | |
parent | 415fe3f175c55cca80477572d7e05bdfda4e3c23 (diff) | |
download | mariadb-git-a7f39aacd573bfa299a930ee8275ba3066efc33a.tar.gz |
xtradb-5.6.19-67.0
Diffstat (limited to 'storage/xtradb/row/row0ins.cc')
-rw-r--r-- | storage/xtradb/row/row0ins.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc index f8ca40fac12..c3c94a01c09 100644 --- a/storage/xtradb/row/row0ins.cc +++ b/storage/xtradb/row/row0ins.cc @@ -151,35 +151,37 @@ row_ins_alloc_sys_fields( ut_ad(row && table && heap); ut_ad(dtuple_get_n_fields(row) == dict_table_get_n_cols(table)); - /* 1. Allocate buffer for row id */ + /* allocate buffer to hold the needed system created hidden columns. */ + uint len = DATA_ROW_ID_LEN + DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN; + ptr = static_cast<byte*>(mem_heap_zalloc(heap, len)); + /* 1. Populate row-id */ col = dict_table_get_sys_col(table, DATA_ROW_ID); dfield = dtuple_get_nth_field(row, dict_col_get_no(col)); - ptr = static_cast<byte*>(mem_heap_zalloc(heap, DATA_ROW_ID_LEN)); - dfield_set_data(dfield, ptr, DATA_ROW_ID_LEN); node->row_id_buf = ptr; - /* 3. Allocate buffer for trx id */ + ptr += DATA_ROW_ID_LEN; + /* 2. Populate trx id */ col = dict_table_get_sys_col(table, DATA_TRX_ID); dfield = dtuple_get_nth_field(row, dict_col_get_no(col)); - ptr = static_cast<byte*>(mem_heap_zalloc(heap, DATA_TRX_ID_LEN)); dfield_set_data(dfield, ptr, DATA_TRX_ID_LEN); node->trx_id_buf = ptr; - /* 4. Allocate buffer for roll ptr */ + ptr += DATA_TRX_ID_LEN; + + /* 3. Populate roll ptr */ col = dict_table_get_sys_col(table, DATA_ROLL_PTR); dfield = dtuple_get_nth_field(row, dict_col_get_no(col)); - ptr = static_cast<byte*>(mem_heap_zalloc(heap, DATA_ROLL_PTR_LEN)); dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN); } |