1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-4805 For functions in the plugin code that disable replication on the

slave threads, we now check for this condition early on in the function block.
This commit is contained in:
Gagan Goel
2021-08-04 20:18:38 +00:00
parent ef89ef4155
commit 0c06aa1bd9
3 changed files with 77 additions and 71 deletions

View File

@ -2215,6 +2215,9 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
#endif
THD* thd = current_thd;
if (thd->slave_thread && !get_replication_slave(thd))
return 0;
char* query = thd->query();
if (!query)
@ -2313,9 +2316,6 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
if ( schemaSyncOnly && isCreate)
return rc;
if (thd->slave_thread && !get_replication_slave(thd))
return rc;
//@bug 5660. Error out REAL DDL/DML on slave node.
// When the statement gets here, it's NOT SSO or RESTRICT
if (ci.isSlaveNode)
@ -2529,6 +2529,10 @@ int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_i
cout << "ha_mcs_impl_delete_table: " << db << name << endl;
#endif
THD* thd = current_thd;
if (thd->slave_thread && !get_replication_slave(thd))
return 0;
char* query = thd->query();
if (!query)
@ -2548,9 +2552,6 @@ int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_i
return 0;
}
if (thd->slave_thread && !get_replication_slave(thd))
return 0;
//@bug 5660. Error out REAL DDL/DML on slave node.
// When the statement gets here, it's NOT SSO or RESTRICT
if (ci.isSlaveNode)
@ -2588,6 +2589,10 @@ int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_i
int ha_mcs_impl_rename_table_(const char* from, const char* to, cal_connection_info& ci)
{
THD* thd = current_thd;
if (thd->slave_thread && !get_replication_slave(thd))
return 0;
string emsg;
string tblFrom (from+2);
@ -2602,9 +2607,6 @@ int ha_mcs_impl_rename_table_(const char* from, const char* to, cal_connection_i
string stmt;
if (thd->slave_thread && !get_replication_slave(thd))
return 0;
// This is a temporary table rename, we don't use the temporary table name
// so this is a NULL op
if (tblFrom.compare(0, 4, "#sql") == 0)