Bug #8705 | merge table of 2 temp tables works only if merge is also temporary | ||
---|---|---|---|
Submitted: | 22 Feb 2005 18:35 | Modified: | 29 Jul 2005 14:48 |
Reporter: | Martin Friebe (Gold Quality Contributor) (OCA) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.10 | OS: | Any (*) |
Assigned to: | Ingo Strüwing | CPU Architecture: | Any |
[22 Feb 2005 18:35]
Martin Friebe
[22 Feb 2005 19:08]
Martin Friebe
merge tables are generally not obeying the datadir. (as tmp tables are written to a different dir, that is why the above fails) create table src1 (a int) select 1 a; create table src2 (a int) data directory='/tmp' select 2 a; create table mrx (a int, b int) ENGINE='MERGE' UNION (src1, src2); select * from mrx; ERROR 1016 (HY000): Can't open file: 'mrx.MRG' (errno: 143) # looking at the files cat /var/db/mysql/xxx/mrx.MRG /var/db/mysql/xxx/src1 /var/db/mysql/xxx/src2 # obviously not here
[22 Feb 2005 19:36]
Martin Friebe
ignore the last comment, it works, if the table specs are correct (sorry), but the original submission is still valid
[22 Feb 2005 20:14]
Martin Friebe
actually create merge table, doesnt check anything about the tables in the union. create table merge1 (a int) ENGINE='MERGE' UNION (fredgerws_does_not_exists) ; Query OK, 0 rows affected (0.00 sec)
[29 Jul 2005 14:48]
Ingo Strüwing
It is normal behaviour of MERGE tables that no checks are done at creation time. This is documented. The weird error messages are normal behaviour too. This is not documented though. ;) The MERGE engine is to be replaced by something else in the forseable future. This should hopefully fix these problems. A MERGE table must be temporary if the MyISAM tables are temporary (you found this by yourself). I requested this to be documented soon. There is a test for temporary MERGE tables in our test suite (see mysql-test/t/merge.test).