Bug #34101 Problem with MERGE tables. ERROR 1168 (HY000)
Submitted: 28 Jan 2008 12:49 Modified: 28 Jan 2008 15:17
Reporter: Radek Kavan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.23-pro OS:Linux
Assigned to: CPU Architecture:Any
Tags: merge, regression

[28 Jan 2008 12:49] Radek Kavan
Description:
In bug number  #26881 (http://bugs.mysql.com/bug.php?id=26881) is mentioned, that this bug it was repair in version 4.1.23, but i have still this problem.

we have mysql version 4.1.23-pro and still have problem with MERGE tables.

mysql> status
--------------
mysql  Ver 14.7 Distrib 4.1.23, for pc-linux-gnu (i686) using  EditLine wrapper

Connection id:          2
Current database:       XY
Current user:           XY@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         4.1.23-pro
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    cp1250
Db     characterset:    cp1250
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:            /tmp/mysql.sock

and we have still problem with Merge tables.

mysql> select * from m1;
ERROR 1168 (HY000): Unable to open underlying table which is differently defined or of
non-MyISAM type or doesn't exist

Is it possible to fix it in our licenced version?

How to repeat:
flush tables;
drop table t1;

mysql> create table t1 (
    -> i1 datetime,
    -> v1 varchar(30),
    -> m1 mediumint(8),
    -> s1 smallint(5),
    -> t1 tinyint(3),
    -> id INT AUTO_INCREMENT,
    -> PRIMARY KEY (id)
    -> )engine=myisam;
Query OK, 0 rows affected (0.04 sec)

drop table m1;

mysql> create table m1(
    -> i1 datetime,
    -> v1 varchar(30),
    -> m1 mediumint(8),
    -> s1 smallint(5),
    -> t1 tinyint(3)
    -> ) engine=merge union(t1);
Query OK, 0 rows affected (0.01 sec)

select * from t1;

ERROR 1168 (HY000): Unable to open underlying table which is differently defined or of
non-MyISAM type or doesn't exist
[28 Jan 2008 15:17] Valeriy Kravchuk
Have you read the last comment in http://bugs.mysql.com/bug.php?id=26881, in reply to your comment? 

You have additinal column, id INT AUTO_INCREMENT, in your t1 table that is not present in MERGE (m1) table, hence the error message.