diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 19:11:36 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 19:11:36 +0200 |
commit | c498250888ec126fddda2867d1239b2a7734482f (patch) | |
tree | e308174c977c0981d8e36f6f9b791b1b266d0cb0 /sql/sql_prepare.cc | |
parent | 09a1f0075a8d5752dd7b2940a20d86a040af1741 (diff) | |
parent | 1418439d3823fe059b41092af72ab32d5e7cd7ab (diff) | |
download | mariadb-git-bb-10.6-georg.tar.gz |
Merge 10.5 into 10.6mariadb-10.5.7bb-10.6-georg10.6-vatu
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 57d6b27fcbb..ec76d1f3ff0 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2015, Oracle and/or its affiliates. - Copyright (c) 2008, 2019, MariaDB + Copyright (c) 2008, 2020, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -122,7 +122,10 @@ When one supplies long data for a placeholder: #include "sql_handler.h" #include "transaction.h" // trans_rollback_implicit #include "mysql/psi/mysql_ps.h" // MYSQL_EXECUTE_PS +#ifdef WITH_WSREP #include "wsrep_mysqld.h" +#include "wsrep_trans_observer.h" +#endif /* WITH_WSREP */ /* Constants defining bits in parameter type flags. Flags are read from high byte of short value */ static const uint PARAMETER_FLAG_UNSIGNED = 128U << 8; @@ -4607,6 +4610,23 @@ reexecute: thd->m_reprepare_observer= NULL; +#ifdef WITH_WSREP + if (!(sql_command_flags[lex->sql_command] & CF_PS_ARRAY_BINDING_OPTIMIZED) && + WSREP(thd)) + { + if (wsrep_after_statement(thd)) + { + /* + Re-execution success is unlikely after an error from + wsrep_after_statement(), so retrun error immediately. + */ + thd->get_stmt_da()->reset_diagnostics_area(); + wsrep_override_error(thd, thd->wsrep_cs().current_error(), + thd->wsrep_cs().current_error_status()); + } + } + else +#endif /* WITH_WSREP */ if (unlikely(error) && (sql_command_flags[lex->sql_command] & CF_REEXECUTION_FRAGILE) && !thd->is_fatal_error && !thd->killed && |