1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

MDEV-13549 Fix for test galera.galera_var_max_ws_rows

This patch re-enables test galera.galera_var_max_ws_rows.
The test did not work because there were two distinct places where
the server was incrementing member THD::wsrep_affected_rows before
enforcing wsrep_max_ws_rows. Essentially, the test would fail because
every inserted row was counted twice.
The patch removes the extra code.
This commit is contained in:
Daniele Sciascia
2018-03-09 10:20:19 +01:00
parent 8ef727b3d0
commit 9ee39d2b9b
2 changed files with 0 additions and 34 deletions

View File

@@ -5769,8 +5769,6 @@ static int write_locked_table_maps(THD *thd)
typedef bool Log_func(THD*, TABLE*, bool, const uchar*, const uchar*);
static int check_wsrep_max_ws_rows();
static int binlog_log_row(TABLE* table,
const uchar *before_record,
const uchar *after_record,
@@ -5824,13 +5822,6 @@ static int binlog_log_row(TABLE* table,
bool const has_trans= thd->lex->sql_command == SQLCOM_CREATE_TABLE ||
table->file->has_transactions();
error= (*log_func)(thd, table, has_trans, before_record, after_record);
/*
Now that the record has been logged, increment wsrep_affected_rows and
also check whether its within the allowable limits (wsrep_max_ws_rows).
*/
if (error == 0)
error= check_wsrep_max_ws_rows();
}
}
return error ? HA_ERR_RBR_LOGGING_FAILED : 0;
@@ -5941,30 +5932,6 @@ int handler::ha_reset()
}
static int check_wsrep_max_ws_rows()
{
#ifdef WITH_WSREP
if (wsrep_max_ws_rows)
{
THD *thd= current_thd;
if (!WSREP(thd))
return 0;
thd->wsrep_affected_rows++;
if (thd->wsrep_exec_mode != REPL_RECV &&
thd->wsrep_affected_rows > wsrep_max_ws_rows)
{
trans_rollback_stmt(thd) || trans_rollback(thd);
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
return ER_ERROR_DURING_COMMIT;
}
}
#endif /* WITH_WSREP */
return 0;
}
int handler::ha_write_row(uchar *buf)
{
int error;