Bug #35951 | Backup: restore fails after directory removal | ||
---|---|---|---|
Submitted: | 9 Apr 2008 23:44 | Modified: | 20 Nov 2008 8:30 |
Reporter: | Peter Gulutzan | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S3 (Non-critical) |
Version: | 6.0.5-alpha-debug | OS: | Linux (SUSE 10 | 32-bit) |
Assigned to: | Jørgen Løland | CPU Architecture: | Any |
[9 Apr 2008 23:44]
Peter Gulutzan
[10 Apr 2008 11:05]
Sveta Smirnova
Thank you for the report. Verified as described.
[10 Apr 2008 11:07]
Sveta Smirnova
Maybe just update restriction page in the manual as it is not safe to create directories? Also as since 5.1.24 MySQL doesn't allow to point DATA DIRECTORY to MySQL datadir used modified test to verify: select @@datadir; create database x1; create database x2; use x2; show databases; --exec mkdir $MYSQL_TEST_DIR/var/tmp/x1 --eval create table t (s1 char(1)) data directory '$MYSQL_TEST_DIR/var/tmp/x1' backup database x2 to '1'; drop database x2; drop database x1; --exec rm -rf $MYSQL_TEST_DIR/var/tmp/x1 restore from '1';
[2 Oct 2008 7:35]
Jørgen Løland
Lars, Rafal, Chuck, Øystein, Jørgen agrees with Sveta: We should not create the missing directory. However, the error message you get when this occurs on the current backup branch is not very helpful. It only says "1677: Could not restore table `x2`.`t`", as opposed to the error message in the comment above: "Can't create/write to file '...'" We will wait for the new backup service interface (wl#4264). Alik will make sure it is possible to get hold of the error stack when an SQL statement fails. When the new interface is ready, the error message printed upon restore will be revised.
[19 Nov 2008 15:26]
Jørgen Løland
I just noticed that the error stack is available: mysql> create database x1; Query OK, 1 row affected (0.00 sec) mysql> use x1; Database changed mysql> create table t (s1 char(1)) data directory '/tmp/35951'; Query OK, 0 rows affected (0.00 sec) mysql> backup database x1 to '1'; +-----------+ | backup_id | +-----------+ | 270 | +-----------+ 1 row in set (0.14 sec) mysql> restore from '1'; ERROR 1683 (HY000): Could not restore table `x1`.`t` mysql> show warnings; +---------+------+------------------------------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------------------------------+ | Error | 1 | Can't create/write to file '/tmp/35951/t.MYD' (Errcode: 2) | | Error | 1005 | Can't create table 'x1.t' (errno: 2) | | Warning | 1683 | Could not restore table `x1`.`t` | +---------+------+------------------------------------------------------------+ 3 rows in set (0.00 sec) ************************ This is the trace I said we needed above. I think this is enough information.
[20 Nov 2008 8:30]
Jørgen Løland
Chuck agrees that there's nothing more to be done. The error messages shown above provides enough information. Closing as Won't fix