Commit 9ee39d2b authored by Daniele Sciascia's avatar Daniele Sciascia

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.
parent 8ef727b3
......@@ -47,7 +47,6 @@ lp1376747 : MDEV-13549 Galera test failures
galera_toi_ddl_nonconflicting : MDEV-13549 Galera test failures
galera_parallel_simple : MDEV-13549 Galera test failures
galera_admin : MDEV-13549 Galera test failures
galera_var_max_ws_rows : MDEV-13549 Galera test failures 10.1
MW-286 : MDEV-13549 Galera test failures 10.1
galera_as_master: MDEV-13549 Galera test failures 10.1
galera_pc_ignore_sb : MDEV-13549 Galera test failures 10.1
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment