Bug #45587 Backup of tables using a non-existent storage engine does not give warning/error

Submitted: 18 Jun 2009 12:21 Modified: 7 Mar 2010 19:39
Reporter: Jon Olav Hauglid Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:5.4-azalea-bugfixing OS:Any
Assigned to: Ritheesh Vedire CPU Architecture:Any

[18 Jun 2009 12:21] Jon Olav Hauglid
Description:
During work on Bug#36021, I enabled the backup_no_engine test.
In this test, a backup is made of two tables where one of them
use a non-existent storage engine (from std_data/bug30938.frm).

This latter table is ignored when backup is made, but no 
warnings are given. 

Tracing shows that 
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str);
is executed in open_binary_frm() in table.cc

How to repeat:
Run the backup_no_engine test.
SHOW WARNINGS; after BACKUP DATABASE db TO "db.backup";
does not report anything.

Suggested fix:
Report unknown storage engine during backup as warning (or even error).
[18 Jun 2009 12:21] Jon Olav Hauglid
Possible regression of Bug#33562 ?
[29 Sep 2009 6:01] Ritheesh Vedire
REFINED PROBLEM DESCRIPTION :
The query s_stream in the function obs::get_db_tables() (file: si_objects.cc):

    SELECT <db_name>, table_name FROM INFORMATION_SCHEMA.TABLES
    WHERE table_schema = '<db_name>' AND table_type = 'BASE TABLE';

does not return the list of tables  in the database , whose *.frm  files are invalid. So, the backup engine does not know the existence of those tables at all.That is why it doesn't report any warnings or errors.
[29 Sep 2009 6:42] Ritheesh Vedire
INFORMATION_SCHEMA.tables  SELECT inconsistencies. See bug#47697
[30 Sep 2009 11:11] 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/85189

2872 Ritheesh Vedire	2009-09-30
      Bug#45587 Backup of tables using a non-existent storage engine does not give warning/error
      
      
      This happens because backup engine does not know the existence of all invalid tables
     @ sql/si_objects.cc
        Bug#45587 Backup of tables using a non-existent storage engine does not give warning/error
        
         The query s_stream in the function obs::get_db_tables() (file: si_objects.cc):
        
            SELECT <db_name>, table_name FROM INFORMATION_SCHEMA.TABLES
            WHERE table_schema = '<db_name>' AND table_type = 'BASE TABLE';
        
        does not return invalid tables  . See bug#47697
        
        So I have changed the query as shown, to get all the tables including invalid ones from the information_schema.tables. After that back up engine knows about invalid tables and throws error messages. 
        
        This fix is temporary . once bug#47697 is fixed, the present fix is redundant and we can revert to original s_stream query.
[30 Sep 2009 13:41] 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/85213

2876 Ritheesh Vedire	2009-09-30
      Bug#45587 Backup of tables using a non-existent storage engine
      does not give warning/error
      
       This happens because backup engine does not know the existence of
      all invalid tables
     @ mysql-test/suite/backup/t/backup_no_engine.test
        The test file was edited and RESTORE command is removed ( as there is no point in restoring if backup fails) . This test reports errors for unidentified storage engines
     @ sql/si_objects.cc
        The query s_stream in the function obs::get_db_tables() (file:
        si_objects.cc):
                
                    SELECT <db_name>, table_name FROM INFORMATION_SCHEMA.TABLES
                    WHERE table_schema = '<db_name>' AND table_type = 'BASE
        TABLE';
                
                does not return invalid tables  . See bug#47697
                
                So I have changed the query , to get all the tables
        including invalid ones from the information_schema.tables. After that
        back up engine knows about invalid tables and throws error messages. 
                
                This fix is temporary . once bug#47697 is fixed, the present
        fix is redundant and we can revert to original s_stream query.
[30 Sep 2009 13:45] Rafal Somla
Good to push.
[2 Oct 2009 2:00] Chuck Bell
Patch rejected. Setting back to in progress.
[6 Nov 2009 12:11] 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/89577

2888 Ritheesh Vedire	2009-11-06
      BUG#45587: Backup of tables using a non-existent storage engine does not give warning/error
     @ mysql-test/suite/backup/r/backup_no_engine.result
        T
     @ mysql-test/suite/backup/t/backup_no_engine.test
        Test case suppresses errors in the Server Log file.
[6 Nov 2009 13:37] Rafal Somla
Approved modified patch (with some suggestions).
[6 Nov 2009 19:43] Chuck Bell
Approved pending changes required. See patch reply email.
[6 Nov 2009 19:43] Chuck Bell
ooops
[9 Nov 2009 10:56] 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/89763

2888 Ritheesh Vedire	2009-11-09
      BUG#45587:Backup of tables using a non-existent storage engine does not give warning/error.
      
        
     @ mysql-test/suite/backup/t/backup_no_engine.test
        Changed the test case to throw errors. Test case suppresses the errors in the Server Log.
     @ sql/si_objects.cc
        Changed the query s_stream  in get_db_tables() to return invalid tables. See BUG#47697.
[20 Feb 2010 9:16] Bugs System
Pushed into 6.0.14-alpha (revid:ingo.struewing@sun.com-20100218152520-s4v1ld76bif06eqn) (version source revid:ingo.struewing@sun.com-20100119103538-wtp5alpz4p2jayl5) (merge vers: 6.0.14-alpha) (pib:16)
[7 Mar 2010 19:39] Paul DuBois
Noted in 6.0.14 changelog.

BACKUP DATABASE failed to produce an error if a table to be backed up
required a storage engine that was not loaded.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.