summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2020-11-03 10:44:26 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-02-25 07:47:51 +0200
commit27d66d644cf2ebe9201e0362f2050036cce2908a (patch)
tree8b1dc6ca683c0c0c5cb04d01de7043276f2bcff5 /sql/wsrep_mysqld.cc
parent74281fe1fb0faf444aec3744b90995156f9f58f9 (diff)
downloadmariadb-git-27d66d644cf2ebe9201e0362f2050036cce2908a.tar.gz
MENT-411 : Implement wsrep_replicate_aria
Introduced two new wsrep_mode options * REPLICATE_MYISAM * REPLICATE_ARIA Depracated wsrep_replicate_myisam parameter and we use wsrep_mode = REPLICATE_MYISAM instead. This required small refactoring of wsrep_check_mode_after_open_table so that both MyISAM and Aria are handled on required DML cases. Similarly, added Aria to wsrep_should_replicate_ddl to handle DDL for Aria tables using TOI. Added test cases and improved MyISAM testing. Changed use of wsrep_replicate_myisam to wsrep_mode = REPLICATE_MYISAM
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index ea1582c5a44..21131b6b671 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1216,7 +1216,7 @@ static const char* wsrep_warning_name(const enum wsrep_warning_type type)
return "WSREP_REQUIRE_PRIMARY_KEY"; break;
case WSREP_REQUIRE_INNODB:
return "WSREP_REQUIRE_INNODB"; break;
- default: assert(0);
+ default: assert(0); return " "; break; // for compiler
}
}
/**
@@ -1373,7 +1373,8 @@ bool wsrep_check_mode_after_open_table (THD *thd,
return true;
const legacy_db_type db_type= hton->db_type;
- bool replicate= (wsrep_replicate_myisam && db_type == DB_TYPE_MYISAM);
+ bool replicate= ((db_type == DB_TYPE_MYISAM && wsrep_check_mode(WSREP_MODE_REPLICATE_MYISAM)) ||
+ (db_type == DB_TYPE_ARIA && wsrep_check_mode(WSREP_MODE_REPLICATE_ARIA)));
TABLE *tbl= tables->table;
if (replicate)
@@ -1383,7 +1384,7 @@ bool wsrep_check_mode_after_open_table (THD *thd,
Following code will kick-start the TOI but this has to be done only once
per statement.
Note: kick-start will take-care of creating isolation key for all tables
- involved in the list (provided all of them are MYISAM tables). */
+ involved in the list (provided all of them are MYISAM or Aria tables). */
if (!is_stat_table(&tables->db, &tables->alias))
{
if (tbl->s->primary_key == MAX_KEY &&
@@ -2183,14 +2184,17 @@ bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton)
return true;
break;
case DB_TYPE_MYISAM:
- if (wsrep_replicate_myisam)
+ if (wsrep_check_mode(WSREP_MODE_REPLICATE_MYISAM))
return true;
else
WSREP_DEBUG("wsrep OSU failed for %s", wsrep_thd_query(thd));
break;
case DB_TYPE_ARIA:
- /* if (wsrep_replicate_aria) */
- /* fallthrough */
+ if (wsrep_check_mode(WSREP_MODE_REPLICATE_ARIA))
+ return true;
+ else
+ WSREP_DEBUG("wsrep OSU failed for %s", wsrep_thd_query(thd));
+ break;
default:
WSREP_DEBUG("wsrep OSU failed for %s", wsrep_thd_query(thd));
break;