diff options
author | Daniele Sciascia <daniele.sciascia@galeracluster.com> | 2022-02-01 14:26:24 +0100 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2022-03-18 08:30:26 +0200 |
commit | c63eab2c68bd83c7b1f5fec9fc9bb0d7238b9b34 (patch) | |
tree | 142fdfbb69aabd350f1306baeba4ac0816268806 /sql/sql_prepare.cc | |
parent | 39ed4005536dc1c76053c564a3a1404eebb199a5 (diff) | |
download | mariadb-git-c63eab2c68bd83c7b1f5fec9fc9bb0d7238b9b34.tar.gz |
MDEV-28055: Galera ps-protocol fixes
* Fix test galera.MW-44 to make it work with --ps-protocol
* Skip test galera.MW-328C under --ps-protocol This test
relies on wsrep_retry_autocommit, which has no effect
under ps-protocol.
* Return WSREP related errors on COM_STMT_PREPARE commands
Change wsrep_command_no_result() to allow sending back errors
when a statement is prepared. For example, to handle deadlock
error due to BF aborted transaction during prepare.
* Add sync waiting before statement prepare
When a statement is prepared, tables used in the statement may be
opened and checked for existence. Because of that, some tests (for
example galera_create_table_as_select) that CREATE a table in one node
and then SELECT from the same table in another node may result in errors
due to non existing table.
To make tests behave similarly under normal and PS protocol, we add a
call to sync wait before preparing statements that would sync wait
during normal execution.
Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index c674cc78719..c6e993b8f6c 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2394,6 +2394,10 @@ static bool check_prepared_statement(Prepared_statement *stmt) goto error; } +#ifdef WITH_WSREP + if (wsrep_sync_wait(thd, sql_command)) + goto error; +#endif switch (sql_command) { case SQLCOM_REPLACE: case SQLCOM_INSERT: |