Bug #33567 Backup: duplicate database names allowed
Submitted: 29 Dec 2007 0:32 Modified: 3 Nov 2008 10:55
Reporter: Peter Gulutzan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0.5-alpha-debug OS:Linux (SUSE 10 64-bit)
Assigned to: Rafal Somla CPU Architecture:Any

[29 Dec 2007 0:32] Peter Gulutzan
Description:
I can use the same database name more than once in
BACKUP DATABASE statements.
This is minor because, when I say RESTORE,
the rows in the database are not duplicated.
But users wouldn't enter the same name twice
except in error, so this should be an error.

Built from mysql-6.0-backup source with BUILD/compile-pentium-debug-max.
Last changeset = "ChangeSet@1.2753, 2007-12-20 15:32:22-05:00".

See also Bug#31765.

How to repeat:
CREATE DATABASE wa;
USE wa
CREATE TABLE t (s1 INT);
INSERT INTO t VALUES (1);
BACKUP DATABASE wa,wa TO '/usr/local/mysql/var/t29';
DROP DATABASE wa;
RESTORE FROM '/usr/local/mysql/var/t29';
SELECT * FROM t;
[29 Dec 2007 5:47] MySQL Verification Team
Thank you for the bug report. Verified as described.
[24 Oct 2008 10:22] Rafal Somla
See also BUG#36933 and BUG#34480.
[24 Oct 2008 11:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/56995

2717 Rafal Somla	2008-10-24
      BUG#36933, BUG#34480, BUG#33567 (Backup: snapshot error + crash if double backup)
      
      Before: When user specified the same database twice in the BACKUP DATABASE statement, 
      it was included twice in the backup image. This lead to a host of problems.
      
      After: BACKUP DATABASE will ignore duplicates in the database list. Each database,
      together with its objects, will be included only once in the produced backup image.
[31 Oct 2008 9:29] Jørgen Løland
Good to push
[31 Oct 2008 15:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/57578

2717 Rafal Somla	2008-10-31
      BUG#36933, BUG#34480, BUG#33567 (Backup: snapshot error + crash if double 
      backup)
      
      Before: When user specified the same database twice in the BACKUP DATABASE 
      statement, it was included twice in the backup image. This lead to a host 
      of problems.
      
      After: 
      
      1. Parser reports error if the same database repeated twice in the list (similar 
      as for other SQL statements, e.g., DROP TABLE).
      
      2. Backup kernel code will ignore duplicates in the database list (if they ever
      get there) and never try to backup the same database twice.
[3 Nov 2008 10:55] Rafal Somla
Fixed by BUG#36933.
[5 Nov 2008 9:42] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/57862

2727 Rafal Somla	2008-11-05
      BUG#36933, BUG#34480, BUG#33567 (Backup: snapshot error + crash if double 
      backup)
      
      Before: When user specified the same database twice in the BACKUP DATABASE 
      statement, it was included twice in the backup image. This lead to a host 
      of problems.
      
      After: 
      
      1. Parser reports error if the same database repeated twice in the list (similar 
      as for other SQL statements, e.g., DROP TABLE).
      
      2. Backup kernel code will ignore duplicates in the database list (if they ever
      get there) and never try to backup the same database twice.
[14 Nov 2008 14:50] Bugs System
Pushed into 6.0.9-alpha  (revid:rafal.somla@sun.com-20081105094115-zcpha090jreyw5jf) (version source revid:jorgen.loland@sun.com-20081114134411-xypyf8wyjc2nm3ly) (pib:5)