Bug #8763 INFORMATION_SCHEMA: Error while executing 'CHECK TABLE <viewname>'
Submitted: 24 Feb 2005 0:40 Modified: 1 Mar 2005 18:09
Reporter: Disha Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.2 OS:Windows (Windows 2003)
Assigned to: Sergei Glukhov CPU Architecture:Any

[24 Feb 2005 0:40] Disha
Description:
When 'CHECK TABLE <viewname>' is executed for a view, it shows that a view is invalid if an underlying column referenced in the view definition, has been renamed.

How to repeat:
 1          Delimiter//
 2	Drop table if exists T1 //
 3	Create table T1 (f1 char(20), f2 TEXT(25), f3 DATE, f4 bigint); //
 4 	Insert into T1 (f1,f2,f3,f4) values ('ABC','XYZ','1990-05-07',100); //
 5	Drop view v1     //
 6	Create view v1 as Select f1,f2,f4 from T1 //
 7	Select * from v1 //
 8	Alter table T1 change f4 ff4 bigint //
 9	Select * from v1 //
10	Check Table v1   //
			

Expected Results
It should have that the view is valid and executed successfully.

Following Message should be displayed for check table:
+------------+-------+----------+------------------------------------------------+
| Table      | Op    | Msg_type | Msg_text                           		 |
+------------+-------+----------+------------------------------------------------+
| test.v1    | check | ok       | No Error                         		 |
+------------+-------+----------+------------------------------------------------+
1 row in set (0.00 sec)	
    

Actual Results
The following message is displayed for check table:
+------------+-------+----------+------------------------------------------------+
| Table      | Op    | Msg_type | Msg_text                           		 |
+------------+-------+----------+------------------------------------------------+
| test.v1    | check | error    | Unknown column 'test.t1.f4' in 'field list'    |
+------------+-------+----------+------------------------------------------------+
1 row in set (0.00 sec)
[24 Feb 2005 9:34] Disha
Updated the synopsis.
[1 Mar 2005 8:47] Sergei Glukhov
After altering the view is not valid and
'select' from this view should generate an error.
It happens and  it is expexted behavoiur.
And 'check Table v1' returns correct result.
It seems to me it is not a bug.
[1 Mar 2005 18:09] Trudy Pelzer
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

The expected behaviour is that, if an underlying column is renamed,
the view is invalidated.