Bug #12838 mysqldump cannot dump views when tables are locked
Submitted: 26 Aug 2005 17:17 Modified: 31 Oct 2005 19:50
Reporter: Max Mether Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.0.11/BK source 5.0 OS:Any (all)
Assigned to: Bugs System CPU Architecture:Any

[26 Aug 2005 17:17] Max Mether
Description:
When using mysqldump with the -x option on a database with views the dump exits with an error

How to repeat:
Do the following:

create database dumptest;
use dumptest;
create table t1 (a int, b int);
create view v1 as (select * from t1);

Then do:

mysqldump -x dumptest

=>
mysqldump: mysqldump: Couldn't execute 'CREATE TEMPORARY TABLE `v1` SELECT * FROM `v1` WHERE 0': Can't execute the query
 because you have a conflicting read lock (1223)
[6 Sep 2005 0:14] Patrick Galbraith
Max, I will focus on this 8th and 9th, and hope to have a patch in by then.
[28 Sep 2005 23:06] Patrick Galbraith
So, viewing the code, I see that the "CREATE TEMPORARY TABLE result_table SELECT * FROM result_table WHERE 0" is required for the view (bug #10927). So, if this is required, I don't know how a temp table could be created if all tables are locked. Looking into a work-around to this requirement.
[14 Oct 2005 1:09] 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/internals/31083
[14 Oct 2005 1:22] 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/internals/31085
[22 Oct 2005 1:40] 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/internals/31320
[25 Oct 2005 17:04] 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/internals/31464
[27 Oct 2005 7:18] Jon Stephens
Need 3-part version number(s) to which fix was pushed. Thanks!
[31 Oct 2005 16:24] Patrick Galbraith
5.0.16 bk (was the version mysqld indicated to me)
[31 Oct 2005 19:50] Paul Dubois
Noted in 5.0.16 changelog.