MySQL view error

From Noah.org
Jump to: navigation, search


When using MySQL 5.x with views you might see the following errors. There is no cure that I know of. It's hard to repeat. I am able to drop the view, so I can get around the problem that way.

mysql> show index from `my_table_view`;
ERROR 1241 (21000): Operand should contain 3 column(s)
mysql> desc `my_table_view`;
ERROR 1241 (21000): Operand should contain 3 column(s)
mysql> show create table `my_table_view`;
ERROR 1241 (21000): Operand should contain 3 column(s)

Or when using phpMyAdmin you might see this:

SQL query: Edit

SHOW INDEX FROM `my_table_view` ;

MySQL said: Documentation
#1241 - Operand should contain 3 column(s) 

or this:

SQL query: Edit

SHOW KEYS FROM `my_table_view` ;

MySQL said: Documentation
#1241 - Operand should contain 3 column(s)