mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
fix compilation with gcc-10
../sql/sql_class.cc: In constructor ‘start_new_trans::start_new_trans(THD*)’: ../include/m_string.h:61:49: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct Ha_data’; use assignment or value-initialization instead [-Werror=class-memaccess] 61 | # define bzero(A,B) memset((A),0,(B)) | ^ ../sql/sql_class.cc:5805:3: note: in expansion of macro ‘bzero’ 5805 | bzero(thd->ha_data, sizeof(thd->ha_data)); | ^~~~~ In file included from ../sql/sql_class.cc:33: ../sql/sql_class.h:2003:8: note: ‘struct Ha_data’ declared here 2003 | struct Ha_data | ^~~~~~~
This commit is contained in:
parent
55c7536a02
commit
24ed08c3c4
2 changed files with 10 additions and 1 deletions
|
@ -5802,7 +5802,8 @@ start_new_trans::start_new_trans(THD *thd)
|
|||
mdl_savepoint= thd->mdl_context.mdl_savepoint();
|
||||
memcpy(old_ha_data, thd->ha_data, sizeof(old_ha_data));
|
||||
thd->reset_n_backup_open_tables_state(&open_tables_state_backup);
|
||||
bzero(thd->ha_data, sizeof(thd->ha_data));
|
||||
for (auto &data : thd->ha_data)
|
||||
data.reset();
|
||||
old_transaction= thd->transaction;
|
||||
thd->transaction= &new_transaction;
|
||||
new_transaction.on= 1;
|
||||
|
|
|
@ -2024,6 +2024,14 @@ struct Ha_data
|
|||
*/
|
||||
plugin_ref lock;
|
||||
Ha_data() :ha_ptr(NULL) {}
|
||||
|
||||
void reset()
|
||||
{
|
||||
ha_ptr= nullptr;
|
||||
for (auto &info : ha_info)
|
||||
info.reset();
|
||||
lock= nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue