1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Replication improvements

This patch fixes:

MCOL-3557 - Row Based Replication events to ColumnStore tables will no
longer cause MariaDB to crash, it will error instead.

MCOL-3556 - Remove the Columnstore.xml variable to turn on ColumnStore
tables applying replication events and instead make it a system variable
that can be set in my.cnf called "columnstore_replication_slave". This
allows it to be set per-UM.
This commit is contained in:
Andrew Hutchings
2019-10-11 16:54:41 +01:00
parent 8476c81255
commit 20c1949152
7 changed files with 98 additions and 35 deletions

View File

@ -159,7 +159,17 @@ int ProcessCommandStatement(THD* thd, string& dmlStatement, cal_connection_info&
//@Bug 2721 and 2722. Log the statement before issuing commit/rollback
if ( dmlStatement == "LOGGING" )
{
VendorDMLStatement cmdStmt(idb_mysql_query_str(thd), DML_COMMAND, sessionID);
char* query_char = idb_mysql_query_str(thd);
std::string query_str;
if (!query_char)
{
query_str = "<Replication event>";
}
else
{
query_str = query_char;
}
VendorDMLStatement cmdStmt(query_str, DML_COMMAND, sessionID);
cmdStmt.set_Logging( false );
pDMLPackage = CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt);
pDMLPackage->set_Logging( false );
@ -250,7 +260,18 @@ int doProcessInsertValues ( TABLE* table, uint32_t size, cal_connection_info& ci
int rc = 0;
VendorDMLStatement dmlStmts(idb_mysql_query_str(thd), DML_INSERT, table->s->table_name.str,
char* query_char = idb_mysql_query_str(thd);
std::string query_str;
if (!query_char)
{
query_str = "<Replication event>";
}
else
{
query_str = query_char;
}
VendorDMLStatement dmlStmts(query_str, DML_INSERT, table->s->table_name.str,
table->s->db.str, size, ci.colNameList.size(), ci.colNameList,
ci.tableValuesMap, ci.nullValuesBitset, sessionID);
@ -2009,7 +2030,7 @@ int ha_mcs_impl_commit_ (handlerton* hton, THD* thd, bool all, cal_connection_in
{
int rc = 0;
if (thd->slave_thread && !ci.replicationEnabled)
if (thd->slave_thread && !get_replication_slave(thd))
return 0;
std::string command("COMMIT");