diff options
author | Monty <monty@mariadb.org> | 2015-11-06 13:02:19 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-11-10 13:46:57 +0200 |
commit | e3868ee07273b1ea2c495d92891fd7d1ed1eea9e (patch) | |
tree | 63e0bc0ba9c05cf3fb098b83cbb6782df47a8897 /sql/sql_insert.cc | |
parent | 93d1e5ce0b841bedbc071da85995f15611ed3d34 (diff) | |
download | mariadb-git-e3868ee07273b1ea2c495d92891fd7d1ed1eea9e.tar.gz |
Don't store vcol bitmaps in TABLE if table doesn't have virtual fields.
(Makes TABLE a bit smaller)
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 8d36a763b90..574e0892872 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2470,6 +2470,9 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) if (share->vfields) { + if (!(copy->def_vcol_set= (MY_BITMAP*) alloc_root(client_thd->mem_root, + sizeof(MY_BITMAP)))) + goto error; copy->vfield= vfield; for (field= copy->field; *field; field++) { @@ -2502,13 +2505,17 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) copy->def_read_set.bitmap= (my_bitmap_map*) bitmap; copy->def_write_set.bitmap= ((my_bitmap_map*) (bitmap + share->column_bitmap_size)); - copy->def_vcol_set.bitmap= ((my_bitmap_map*) - (bitmap + 2*share->column_bitmap_size)); + if (share->vfields) + { + my_bitmap_init(copy->def_vcol_set, + (my_bitmap_map*) (bitmap + 2*share->column_bitmap_size), + share->fields, FALSE); + copy->vcol_set= copy->def_vcol_set; + } copy->tmp_set.bitmap= 0; // To catch errors - bzero((char*) bitmap, share->column_bitmap_size*3); + bzero((char*) bitmap, share->column_bitmap_size + (share->vfields ? 3 : 2)); copy->read_set= ©->def_read_set; copy->write_set= ©->def_write_set; - copy->vcol_set= ©->def_vcol_set; DBUG_RETURN(copy); |