diff options
author | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-06-26 22:23:28 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-06-26 22:23:28 +0200 |
commit | 349b34b3638e70eccdbbfa98daebb5c382ab4f29 (patch) | |
tree | a5506eed3455c1edf9496ac0accdbf1e623f01f8 /sql/lock.cc | |
parent | d3b910da8eea2c1c6dd5bab6394b9cf2b09f6774 (diff) | |
download | mariadb-git-349b34b3638e70eccdbbfa98daebb5c382ab4f29.tar.gz |
Bug #49891 View DDL breaks REPEATABLE READ
The problem was that if a query accessing a view was blocked due to
conflicting locks on tables in the view definition, it would be possible
for a different connection to alter the view definition before the view
query completed. When the view query later resumed, it used the old view
definition. This meant that if the view query was later repeated inside
the same transaction, the two executions of the query would give different
results, thus breaking repeatable read. (The first query used the old
view definition, the second used the new view definition).
This bug is no longer repeatable with the recent changes to the metadata
locking subsystem (revno: 3040). The view query will no longer back-off
and release the lock on the view definiton. Instead it will wait for
the conflicting lock(s) to go away while keeping the view definition lock.
This means that it is no longer possible for a concurrent connection to
alter the view definition. Instead, any such attempt will be blocked.
In the case from the bug report where the same view query was executed
twice inside the same transaction, any ALTER VIEW from other connections
will now be blocked until the transaction has completed (or aborted).
The view queries will therefore use the same view definition and we will
have repeatable read.
Test case added to innodb_mysql_lock.test.
This patch contains no code changes.
Diffstat (limited to 'sql/lock.cc')
0 files changed, 0 insertions, 0 deletions