Bug #16502 mysqlcheck gets confused with views
Submitted: 14 Jan 2006 2:59 Modified: 15 Aug 2006 3:44
Reporter: Roland Volkmann Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.18-nt/5.0.19 BK OS:Windows (Windows XP Prof./Linux)
Assigned to: Jim Winstead CPU Architecture:Any

[14 Jan 2006 2:59] Roland Volkmann
Description:
If you have an innodb database with views, "mysqlcheck --analyze mydb" and "mysqlcheck --optimize mydb" also tries to handle the views in addition to the tables, but fails.

With best regards,
Roland.

How to repeat:
mysql> create database test;
Query OK, 1 row affected (0.00 sec)

mysql> use test;
Database changed
mysql> create table ttt (id integer);
Query OK, 0 rows affected (0.00 sec)

mysql> create view v_test as select * from ttt;
Query OK, 0 rows affected (0.00 sec)

mysql> exit

Shell>mysqlcheck.exe --analyze --user=root --password=secret test
test.ttt                                           OK
test.v_test
error    : 'test.v_test' is not BASE TABLE

Shell>mysqlcheck.exe --optimize --user=root --password=secret test
test.ttt                                           OK
test.v_test
error    : 'test.v_test' is not BASE TABLE

Shell>
[14 Jan 2006 9:18] MySQL Verification Team
Thank you for the bug report.

miguel@hegel:~/dbs/5.0> bin/mysqladmin -uroot create db15
miguel@hegel:~/dbs/5.0> bin/mysql -uroot db15
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.19-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table ttt (id integer);
Query OK, 0 rows affected (0.01 sec)

mysql> create view v_test as select * from ttt;
Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye
miguel@hegel:~/dbs/5.0> bin/mysqlcheck -uroot --analyze db15
db15.ttt                                           Table is already up to date
db15.v_test
error    : 'db15.v_test' is not BASE TABLE
miguel@hegel:~/dbs/5.0>
[15 Mar 2006 2:56] MySQL Verification Team
Bug: http://bugs.mysql.com/bug.php?id=18244 was marked as duplicate
of this one.
[12 Jun 2006 21:10] Timothy Smith
Also, see the feature request bug #6220, which should probably be handled as part of the fix for this bug.
[21 Jul 2006 17:53] 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/9427
[24 Jul 2006 20:39] 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/9519
[3 Aug 2006 2:41] Jim Winstead
Pushed to mysql-5.0-maint.
[3 Aug 2006 16:46] Magnus BlÄudd
Pushed to 5.0.25
[9 Aug 2006 20:25] Paul DuBois
Noted in 5.0.25 changelog.

mysqlcheck tried to check views instead of ignoring them.
[14 Aug 2006 20:53] Konstantin Osipov
Merged into 5.1.12
[15 Aug 2006 3:44] Paul DuBois
Noted in 5.1.12 changelog.