distal-attribute
distal-attribute
distal-attribute
distal-attribute

Handling of MERGE tables

User, date Message
Written by djdjohnson
2 years ago
Category: Feature discussion
60 posts since Mon, 28 Jun 10
I recently began using MERGE tables in MySQL and it seems that HeidiSQL doesn't quite know how to handle them when performing copy or export operations.

When doing an export, or copy, or other type of operation that involves the data in a MERGE table, it would be best if HeidiSQL didn't try to copy the actual data. The table definition needs to be copied, but any attempt to copy the data will result in duplicated data in the destination database. This is because MERGE tables are virtual in that they combine data from two real tables... sort of like a view might do. So none of the data that appears to be in a MERGE table is actually there; it is coming from another table.

I can see some situations where someone might want to copy data in a MERGE table, but generally speaking if data is included, it is going to be duplicated.
Written by ansgar
2 years ago
4800 posts since Fri, 07 Apr 06
Yes, I should be able to exclude tables with ENGINE=MRG_MYISAM in data exporting. For the "Create table copy" dialog, there is a checkbox which should be fine if the user really wants data. Only the export dialog should have this self-intelligence. Only I'm having problems creating such a merge table...

CREATE TABLE `merge1` (`id` INT(10)) ENGINE=MYISAM;
CREATE TABLE `merge2` (`id` INT(10)) ENGINE=MYISAM;
CREATE TABLE `merge3` (`id` INT(10)) ENGINE=MRG_MYISAM UNION=(merge1,merge2);


This way, I get a broken merge3 table, when firing SHOW TABLE STATUS: "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist"
Written by ansgar
2 years ago
4800 posts since Fri, 07 Apr 06
Data from MRG_MYISAM tables are not exported in r4035.
 

Please login to leave a reply, or register at first.