Bug #48315 | Metadata lock is not taken for merged views that use an INFORMATION_SCHEMA table | ||
---|---|---|---|
Submitted: | 26 Oct 2009 15:16 | Modified: | 7 Mar 2010 19:57 |
Reporter: | Jon Olav Hauglid | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Locking | Severity: | S3 (Non-critical) |
Version: | mysql-6.0-codebase | OS: | Any |
Assigned to: | Jon Olav Hauglid | CPU Architecture: | Any |
Tags: | mdl |
[26 Oct 2009 15:16]
Jon Olav Hauglid
[26 Jan 2010 15:27]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/98210 3055 Jon Olav Hauglid 2010-01-26 Bug #48315 Metadata lock is not taken for merged views that use an INFORMATION_SCHEMA table The problem was that after an information schema table had been merged into a view, a metadata lock would not be taken to protect the view definition. This meant that it was possible for concurrent view DDL to execute, thereby breaking the binary log. For example, it would be possible for DROP VIEW to appear in the binary log before a query using the view. The view is opened normally and merged at prepare or first time a stored procedure is executed. This bug would only be triggered after merging - i.e. execution of a prepared statement or second invocation of a stored procedure. This patch resolves the problem by making sure a metadata lock is taken for merged views that use information schema tables. Test cased added to bug48315.test. This is a temporary file, the test case will be merged into sp-sync.test before push.
[16 Feb 2010 15:29]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/100521 3102 Jon Olav Hauglid 2010-02-16 Bug #48315 Metadata lock is not taken for merged views that use an INFORMATION_SCHEMA table The problem was that after an information schema table had been merged into a view, a metadata lock would not be taken to protect the view definition. This meant that it was possible for concurrent view DDL to execute, thereby breaking the binary log. For example, it would be possible for DROP VIEW to appear in the binary log before a query using the view. The view is opened normally and merged at prepare or first time a stored procedure is executed. This bug would only be triggered after merging - i.e. execution of a prepared statement or second invocation of a stored procedure. This patch resolves the problem by making sure a metadata lock is taken for merged views that use information schema tables. Test cased added to view.test.
[18 Feb 2010 13:54]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/100756 3103 Jon Olav Hauglid 2010-02-18 Bug #48315 Metadata lock is not taken for merged views that use an INFORMATION_SCHEMA table When a prepared statement using a merged view containing an information schema table was executed, a metadata lock of the view was not taken. This meant that it was possible for concurrent view DDL to execute, thereby breaking the binary log. For example, it was possible for DROP VIEW to appear in the binary log before a query using the view. This also happened when a statement in a stored routine was executed a second time. For such views, the information schema table is merged into the view during the prepare phase (or first execution of a statement in a routine). The problem was that we took a short cut and were not executing full-blown view opening during subsequent executions of the statement. As a result, a metadata lock on the view was not taken to protect the view definition. This patch resolves the problem by making sure a metadata lock is taken for views even after information schema tables are merged into them. Test cased added to view.test.
[18 Feb 2010 14:37]
Jon Olav Hauglid
Pushed to mysql-next-4284.
[25 Feb 2010 19:47]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100225194420-p60r4u90tszj8q2x) (version source revid:alik@sun.com-20100223155607-rq7rqm3ghgag75b7) (merge vers: 6.0.14-alpha) (pib:16)
[25 Feb 2010 19:49]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100225194305-h49uyjrlfl3mwo60) (version source revid:wlad@sun.com-20100223223036-f9tvi5gqrtj91r5o) (pib:16)
[6 Mar 2010 11:04]
Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:alik@sun.com-20100225195857-farb6yvy8x06bylj) (merge vers: 5.5.99-m3) (pib:16)
[7 Mar 2010 19:57]
Paul DuBois
Noted in 5.5.3, 6.0.14 changelog. If a prepared statement using a merged view referencing an INFORMATION_SCHEMA table was executed, no metadata lock of the view was taken. Consequently, it was possible for concurrent DDL statements on the view to execute and cause statements to be written in the wrong order to the binary log.
[13 Apr 2010 4:58]
Paul DuBois
Correction: Not present in any 5.5.x release. 5.5.3 changelog entry removed.