Bug #4635 ALTER TABLE .. TYPE = INNODB doesn't complain if mysql server doesn't support i
Submitted: 19 Jul 2004 23:01 Modified: 26 Aug 2004 12:01
Reporter: Jorge del Conde Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.13 OS:Any (any)
Assigned to: Antony Curtis CPU Architecture:Any

[19 Jul 2004 23:01] Jorge del Conde
I was trying to alter tables using 
ALTER TABLE foo TYPE = INNODB; and it executed but show table status still showed them as myisam.

After some investigation I noticed that mysqladmin variables showed
| have_innodb | NO |

Which explained. However I believe the command should fail if it didn't execute properly.

All it says is.
mysql> ALTER TABLE sessions TYPE = INNODB;
Query OK, 2345 rows affected, 2 warnings (0.18 sec)
Records: 2345 Duplicates: 0 Warnings: 0

How to repeat:
create a myisam table:

mysql> create table a (a int) type=myisam;

stop mysqld

start mysqld with --skip-innodb

mysql> alter table a type=innodb;
Query OK, 2 rows affected, 2 warnings (0.09 sec)
Records: 2  Duplicates: 0  Warnings: 0

Suggested fix:
Print out an error saying innodb is not supported
[30 Jul 2004 17:25] Sergei Golubchik
It cannot be an error, but only a warning.
But warning should be issued, of course.
[26 Aug 2004 12:01] Antony Curtis
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:

A warning is issued when MySQL has to use a different storage engine because 
the requested storage engine is unavailable. 
mysql> alter table a type=innodb; 
Query OK, 0 rows affected, 2 warnings (0.02 sec) 
Records: 0  Duplicates: 0  Warnings: 0 
mysql> show warnings; 
| Level   | Code | Message                                                                  | 
| Warning | 1287 | 'TYPE=storage_engine' is deprecated; use 
'ENGINE=storage_engine' instead | 
| Warning | 1266 | Using storage engine MyISAM for table 'a'                                
2 rows in set (0.00 sec)