summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2021-02-10 09:53:37 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-02-22 13:51:58 +0200
commit208233be5af55072d7ef80c37ddbc664bc51f342 (patch)
tree3fc67a6c1fa63faa271729168fc3016cf20bf50f /sql/sql_base.cc
parent420f8e24ab73ef00b323aaa9423f365fb38e9306 (diff)
downloadmariadb-git-bb-10.6-MDEV-24830.tar.gz
MDEV-24830 : Write a warning to error log if Galera replicates InnoDB table with no primary keybb-10.6-MDEV-24830
Two new features for Galera * Write a warning to error log if Galera replicates table with storage engine not supported by Galera (at the moment only InnoDB is supported ** Warning is pushed to client also ** MyISAM is allowed if wsrep_replicate_myisam=ON * Write a warning to error log if Galera replicates table with no primary key ** Warning is pushed to client also ** MyISAM is allowed if wsrep_relicate_myisam=ON * In both cases apply flood control if > 10 same warning is writen to error log (requires log_warnings > 1), flood control will suppress warnings for 300 seconds
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc37
1 files changed, 6 insertions, 31 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 623c0eff5b9..bfbf688c932 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4431,13 +4431,16 @@ restart:
tbl->reginfo.lock_type= tables->lock_type;
}
#ifdef WITH_WSREP
- /*
+ /*
At this point we have SE associated with table so we can check wsrep_mode
rules at this point.
*/
- if (WSREP(thd) &&
+ if (WSREP(thd) &&
wsrep_thd_is_local(thd) &&
- !wsrep_check_mode_after_open_table(thd, tbl->file->ht->db_type))
+ tbl &&
+ tables == *start &&
+ !wsrep_check_mode_after_open_table(thd,
+ tbl->file->ht, tables))
{
error= TRUE;
goto error;
@@ -4445,35 +4448,7 @@ restart:
#endif
}
-#ifdef WITH_WSREP
- if (WSREP(thd) &&
- wsrep_replicate_myisam &&
- (*start) &&
- (*start)->table &&
- (*start)->table->file->ht == myisam_hton &&
- wsrep_thd_is_local(thd) &&
- !is_stat_table(&(*start)->db, &(*start)->alias) &&
- thd->get_command() != COM_STMT_PREPARE &&
- ((thd->lex->sql_command == SQLCOM_INSERT ||
- thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
- thd->lex->sql_command == SQLCOM_REPLACE ||
- thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
- thd->lex->sql_command == SQLCOM_UPDATE ||
- thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
- thd->lex->sql_command == SQLCOM_LOAD ||
- thd->lex->sql_command == SQLCOM_DELETE)))
- {
- wsrep_before_rollback(thd, true);
- wsrep_after_rollback(thd, true);
- wsrep_after_statement(thd);
- WSREP_TO_ISOLATION_BEGIN(NULL, NULL, (*start));
- }
-#endif /* WITH_WSREP */
-
error:
-#ifdef WITH_WSREP
-wsrep_error_label:
-#endif
THD_STAGE_INFO(thd, stage_after_opening_tables);
thd_proc_info(thd, 0);