mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Bug#44664: valgrind warning for COMMIT_AND_CHAIN and ROLLBACK_AND_CHAIN
The problem is that the internal variable used to specify a transaction with consistent read was being used outside the processing context of a START TRANSACTION WITH CONSISTENT SNAPSHOT statement. The practical consequence was that a consistent snapshot specification could leak to unrelated transactions on the same session. The solution is to ensure a consistent snapshot clause is only relied upon for the START TRANSACTION statement. This is already fixed in a similar way on 6.0.
This commit is contained in:
@@ -198,8 +198,6 @@ bool begin_trans(THD *thd)
|
||||
LEX *lex= thd->lex;
|
||||
thd->options|= OPTION_BEGIN;
|
||||
thd->server_status|= SERVER_STATUS_IN_TRANS;
|
||||
if (lex->start_transaction_opt & MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT)
|
||||
error= ha_start_consistent_snapshot(thd);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
@@ -4027,6 +4025,11 @@ end_with_restore_list:
|
||||
}
|
||||
if (begin_trans(thd))
|
||||
goto error;
|
||||
if (lex->start_transaction_opt & MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT)
|
||||
{
|
||||
if (ha_start_consistent_snapshot(thd))
|
||||
goto error;
|
||||
}
|
||||
my_ok(thd);
|
||||
break;
|
||||
case SQLCOM_COMMIT:
|
||||
|
Reference in New Issue
Block a user