MXS-2188: Update target table in prepare_table

Passing the target table and create to the prepare_table function allows
the converter to update the internal variables.
This commit is contained in:
Markus Mäkelä
2018-11-27 12:35:39 +02:00
parent 2eee524eef
commit 2dc6718d47
4 changed files with 17 additions and 8 deletions

View File

@ -353,15 +353,17 @@ bool AvroConverter::open_table(const STableMapEvent& map, const STableCreateEven
return rval;
}
bool AvroConverter::prepare_table(std::string database, std::string table)
bool AvroConverter::prepare_table(const STableMapEvent& map, const STableCreateEvent& create)
{
bool rval = false;
auto it = m_open_tables.find(database + "." + table);
auto it = m_open_tables.find(map->database + "." + map->table);
if (it != m_open_tables.end())
{
m_writer_iface = it->second->avro_writer_iface;
m_avro_file = &it->second->avro_file;
m_map = map;
m_create = create;
rval = true;
}