SET STATEMENT tx_isolation = FOR ... inside a transaction is meaningless and cannot have any effect, but is allowed

Description

Transaction isolation level cannot be changed inside a transaction. Unlike most session variables, session-level transaction properties, when they are modified, become effective from the next transaction. Thus, changing the value for a single statement inside a non-atomic transaction is meaningless and should be prohibited. Now it is not.

Percona server works OK, it returns the expected error:

Test case

With MariaDB, the last set statement ... for select returns an empty set, which shows that the tx_isolation setting didn't work.

With Percona server, the same query causes an error.

Environment

None

Status

Assignee

Oleksandr Byelkin

Reporter

Elena Stepanova

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure