Bug #50374 Test failures when compiling with -DBACKUP_TEST
Submitted: 15 Jan 2010 16:13 Modified: 10 Feb 2010 7:48
Reporter: Chuck Bell Email Updates:
Status: Patch queued Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:5.6.0, 6.0.X OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[15 Jan 2010 16:13] Chuck Bell
Description:
Several tests fail when the compile directive -DBACKUP_TEST is used.

Tests fail because backup_test becomes a defined symbol and therefore is recognized as a keyword. Tests fail with various errors relating to keyword conflicts:

mysqltest: In included file "./suite/backup/include/basic_data.inc": At line 13: query 'CREATE DATABASE backup_test' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'backup_test' at line 1

How to repeat:
Build with -DBACKUP_TEST. For example, on Mac do:

./BUILD/autorun.sh
CC="gcc -static-libgcc" CFLAGS="-g -O -arch i386 -fno-common" CXX="gcc -static-libgcc" CXXFLAGS="-g -O -arch i386 -felide-constructors -fno-common "  ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bin --with-comment="MySQL Community Server - Debug (GPL)" --with-server-suffix="-debug" --enable-thread-safe-client --enable-local-infile --with-pic --with-client-ldflags="-static" --with-mysqld-ldflags="-static" --with-zlib-dir=bundled --with-debug --with-big-tables --with-ssl --with-readline --with-embedded-server --with-partition --with-innodb --without-ndbcluster --with-archive-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --without-example-storage-engine --with-federated-storage-engine --with-extra-charsets=complex

then run ./mysql-test-run.pl backup_security_var

Suggested fix:
Do one of the following suggestions:

* rename all references to backup_test as `backup_test` in all of the tests
* rename all references to backup_test as bup_test in all of the tests
* remove the backup_test code if it is not being used anymore -- this will
  include backup_test.h/.cc and all references to backup_test in the code
  including sql_parse.cc and the lexical parsing code (hint: search for
  BACKUP_TEST).
* rename the backup_test keyword to something more obscure
[2 Feb 2010 9:04] 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/98900

2943 Satya B	2010-02-02
      BUG#50374 - Test failures when compiling with -DBACKUP_TEST
      
      This option was added to test BACKUP/RESTORE code easily in the early
      stages of development.
      
      Since we no longer use this and we can do testing of backup code even
      without this option '-DBACKUP_TEST', backup_test code is removed.
      
      Note: There is no testcase and has to be tested by running unit tests
            (make test-unit) and backup tests.
     @ CMakeLists.txt
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
     @ sql/backup/CMakeLists.txt
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
     @ sql/backup/Makefile.am
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
     @ sql/backup/backup_test.cc
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
     @ sql/backup/backup_test.h
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
     @ sql/lex.h
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
     @ sql/sql_parse.cc
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
     @ sql/sql_yacc.yy
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
     @ win/configure.js
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Removed backup_test code.
[5 Feb 2010 14:52] Chuck Bell
Approved.
[8 Feb 2010 13:38] Rafal Somla
Good to push.
[10 Feb 2010 7:21] 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/99782

3086 Satya B	2010-02-10
      BUG#50374 - Test failures when compiling with -DBACKUP_TEST
            
      This option was added to test BACKUP/RESTORE code easily in the early
      stages of development.
            
      Since we no longer use this and we can do testing of backup code even
      without this option '-DBACKUP_TEST', backup_test code is removed.
            
      Note: There is no test case and has to be tested by running unit tests
            (make test-unit) and backup tests.
     @ sql/backup/CMakeLists.txt
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Remove backup_test code.
     @ sql/backup/Makefile.am
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Remove backup_test code.
     @ sql/backup/backup_test.cc
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Remove backup_test code.
     @ sql/backup/backup_test.h
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Remove backup_test code.
     @ sql/lex.h
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Remove backup_test code.
     @ sql/sql_parse.cc
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Remove backup_test code.
     @ sql/sql_yacc.yy
        BUG#50374 - Test failures when compiling with -DBACKUP_TEST
        
        Remove backup_test code.
[10 Feb 2010 7:48] Satya B
Patch queued to mysql-next-mr-backup tree with revision number: 3806
revision id: satya.bn@sun.com-20100210072024-xnyx6vw5207wgn6u