Bug #8719 mysqldump fails if a DB has views
Submitted: 23 Feb 2005 0:30 Modified: 23 Feb 2005 1:34
Reporter: Tim Graves Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S2 (Serious)
Version:5.0.1 OS:Solaris (Solaris)
Assigned to: CPU Architecture:Any

[23 Feb 2005 0:30] Tim Graves
Description:
I have a database with views. When I run mysqldump to back it up I get the following error message

/export/tim/mysqld/bin/mysqldump: Can't get CREATE TABLE for table 'minorareanames' (Table 'minorareanames' was not locked with LOCK TABLES)

When I drop the view the mysqldump proceeds as prior to the view being created

The view is created using the following SQL
DROP VIEW IF EXISTS minorAreaNames ;
CREATE VIEW minorAreaNames AS
SELECT product.name AS productName, majorArea.name AS majorName, minorArea.name AS minorName,
	CONCAT(product.name,' / ',majorArea.name,' / ', minorArea.name) AS name,
	minorarea.productCode AS productCode, minorarea.majorCode AS majorCode, minorArea.minorCode AS minorCode, minorArea.description AS description,
	product.importanceAdjustment * majorArea.importanceAdjustment * minorArea.importanceAdjustment AS importanceAdjustment
FROM product 
	INNER JOIN majorarea ON majorarea.productCode=product.productCode 
	INNER JOIN minorarea ON minorarea.productCode=majorArea.productCode AND minorarea.majorCode=majorArea.majorCode ;

How to repeat:
This seems to happen with any view I create
[23 Feb 2005 1:34] Hartmut Holzgraefe
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/

Additional info:

Already fixed in 5.0.2