1. 10 May, 2012 2 commits
    • Annamalai Gurusami's avatar
      326b40c9
    • Annamalai Gurusami's avatar
      Bug #14007649 65111: INNODB SOMETIMES FAILS TO UPDATE ROWS INSERTED · 391ea219
      Annamalai Gurusami authored
      BY A CONCURRENT TRANSACTIO
      
      The member function QUICK_RANGE_SELECT::init_ror_merged_scan() performs
      a table handler clone. Innodb does not provide a clone operation.  
      The ha_innobase::clone() is not there. The handler::clone() does not 
      take care of the ha_innobase->prebuilt->select_lock_type.  Because of 
      this what happens is that for one index we do a locking read, and 
      for the other index we were doing a non-locking (consistent) read. 
      The patch introduces ha_innobase::clone() member function.  
      It is implemented similar to ha_myisam::clone().  It calls the 
      base class handler::clone() and then does any additional operation 
      required.  I am setting the ha_innobase->prebuilt->select_lock_type 
      correctly. 
      
      rb://1060 approved by Marko
      391ea219
  2. 09 May, 2012 1 commit
  3. 08 May, 2012 1 commit
  4. 07 May, 2012 3 commits
    • Joerg Bruehe's avatar
      Merge 5.5.24 back into main 5.5. · 5be07cea
      Joerg Bruehe authored
      This is a weave merge, but without any conflicts.
      In 14 source files, the copyright year needed to be updated to 2012.
      5be07cea
    • Venkata Sidagam's avatar
      Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY · 1d47bbe3
      Venkata Sidagam authored
                           CAUSES RESTORE PROBLEM
      
      Merging the fix from mysql-5.1 to mysql-5.5
      
      mysql-test/t/mysqldump.test:
        There is a difference in the testcase which is added as 
        part of this fix, when compared with mysql-5.1. In mysql-5.5 
        and mysql-5.6, "DROP mysql database" fails by enabling 
        logging, hence removed those lines.
      1d47bbe3
    • Venkata Sidagam's avatar
      Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY · e7364ec2
      Venkata Sidagam authored
                           CAUSES RESTORE PROBLEM
      Problem Statement:
      ------------------
      mysqldump is not having the dump stmts for general_log and slow_log
      tables. That is because of the fix for Bug#26121. Hence, after 
      dropping the mysql database, and applying the dump by enabling the 
      logging, "'general_log' table not found" errors are logged into the 
      server log file.
      
      Analysis:
      ---------
      As part of the fix for Bug#26121, we skipped the dumping of tables 
      for general_log and slow_log, because the data dump of those tables 
      are taking LOCKS, which is not allowed for log tables.
      
      Fix:
      ----
      We came up with an approach that instead of taking both meta data 
      and data dump information for those tables, take only the meta data 
      dump which doesn't need LOCKS.
      As part of fixing the issue we came up with below algorithm.
      Design before fix:
      1) mysql database is having tables like db, event,... general_log,
         ... slow_log...
      2) Skip general_log and slow_log while preparing the tables list
      3) Take the TL_READ lock on tables which are present in the table 
         list and do 'show create table'.
      4) Release the lock.
      
      Design with the fix:
      1) mysql database is having tables like db, event,... general_log,
         ... slow_log...
      2) Skip general_log and slow_log while preparing the tables list
      3) Explicitly call the 'show create table' for general_log and 
         slow_log
      3) Take the TL_READ lock on tables which are present in the table 
         list and do 'show create table'.
      4) Release the lock.
      
      While taking the meta data dump for general_log and slow_log the 
      "CREATE TABLE" is replaced with "CREATE TABLE IF NOT EXISTS". 
      This is because we skipped "DROP TABLE" for those tables, 
      "DROP TABLE" fails for these tables if logging is enabled. 
      Customer is applying the dump by enabling logging so, if the dump 
      has "DROP TABLE" it will fail. Hence, removed the "DROP TABLE" 
      stmts for those tables.
        
      After the fix we could observe "Table 'mysql.general_log' 
      doesn't exist" errors initially that is because in the customer 
      scenario they are dropping the mysql database by enabling the 
      logging, Hence, those errors are expected. Once we apply the 
      dump which is taken before the "drop database mysql", the errors 
      will not be there.
      
      client/mysqldump.c:
        In get_table_structure() added code to skip the DROP TABLE stmts for general_log
        and slow_log tables, because when logging is enabled those stmts will fail. And
        replaced CREATE TABLE with CREATE IF NOT EXISTS for those tables, just to make 
        sure CREATE stmt for those tables doesn't fail since we removed DROP stmts for
        those tables.
        In dump_all_tables_in_db() added code to call get_table_structure() for 
        general_log and slow_log tables.
      mysql-test/r/mysqldump.result:
        Added a test as part of fix for Bug #11754178
      mysql-test/t/mysqldump.test:
        Added a test as part of fix for Bug #11754178
      e7364ec2
  5. 04 May, 2012 2 commits
    • Venkata Sidagam's avatar
      Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY · daafaa0f
      Venkata Sidagam authored
                           CAUSES RESTORE PROBLEM
      Problem Statement:
      ------------------
      mysqldump is not having the dump stmts for general_log and slow_log
      tables. That is because of the fix for Bug#26121. Hence, after 
      dropping the mysql database, and applying the dump by enabling the 
      logging, "'general_log' table not found" errors are logged into the 
      server log file.
      
      Analysis:
      ---------
      As part of the fix for Bug#26121, we skipped the dumping of tables 
      for general_log and slow_log, because the data dump of those tables 
      are taking LOCKS, which is not allowed for log tables.
      
      Fix:
      ----
      We came up with an approach that instead of taking both meta data 
      and data dump information for those tables, take only the meta data 
      dump which doesn't need LOCKS.
      As part of fixing the issue we came up with below algorithm.
      Design before fix:
      1) mysql database is having tables like db, event,... general_log,
         ... slow_log...
      2) Skip general_log and slow_log while preparing the tables list
      3) Take the TL_READ lock on tables which are present in the table 
         list and do 'show create table'.
      4) Release the lock.
      
      Design with the fix:
      1) mysql database is having tables like db, event,... general_log,
         ... slow_log...
      2) Skip general_log and slow_log while preparing the tables list
      3) Explicitly call the 'show create table' for general_log and 
         slow_log
      3) Take the TL_READ lock on tables which are present in the table 
         list and do 'show create table'.
      4) Release the lock.
      
      While taking the meta data dump for general_log and slow_log the 
      "CREATE TABLE" is replaced with "CREATE TABLE IF NOT EXISTS". 
      This is because we skipped "DROP TABLE" for those tables, 
      "DROP TABLE" fails for these tables if logging is enabled. 
      Customer is applying the dump by enabling logging so, if the dump 
      has "DROP TABLE" it will fail. Hence, removed the "DROP TABLE" 
      stmts for those tables.
        
      After the fix we could observe "Table 'mysql.general_log' 
      doesn't exist" errors initially that is because in the customer 
      scenario they are dropping the mysql database by enabling the 
      logging, Hence, those errors are expected. Once we apply the 
      dump which is taken before the "drop database mysql", the errors 
      will not be there.
      
      client/mysqldump.c:
        In get_table_structure() added code to skip the DROP TABLE stmts for general_log
        and slow_log tables, because when logging is enabled those stmts will fail. And
        replaced CREATE TABLE with CREATE IF NOT EXISTS for those tables, just to make 
        sure CREATE stmt for those tables doesn't fail since we removed DROP stmts for
        those tables.
        In dump_all_tables_in_db() added code to call get_table_structure() for 
        general_log and slow_log tables.
      mysql-test/r/mysqldump.result:
        Added a test as part of fix for Bug #11754178
      mysql-test/t/mysqldump.test:
        Added a test as part of fix for Bug #11754178
      daafaa0f
    • Annamalai Gurusami's avatar
      In perl, to break out of a foreach loop we need to use · b757c130
      Annamalai Gurusami authored
      the keyword "last" and not "break".  Fixing the failing
      test case. 
      b757c130
  6. 27 Apr, 2012 6 commits
  7. 26 Apr, 2012 3 commits
  8. 24 Apr, 2012 1 commit
  9. 23 Apr, 2012 9 commits
  10. 21 Apr, 2012 3 commits
  11. 20 Apr, 2012 4 commits
    • Mayank Prasad's avatar
      BUG#12427262 : 60961: SHOW TABLES VERY SLOW WHEN NOT IN SYSTEM DISK CACHE · dcb5071b
      Mayank Prasad authored
      Details:
       - test case bug12427262.test was failing on windows because
         on windows '/' was not recognized. And this was used in
         LIKE clause of the query being run in this test case.
      
      Fix:
       - Windows needs '\\\\' for path seperater in mysql. I was 
         not sure how to keep a single query with two different 
         syntax based on platform. So modifying query to make sure
         it runs correctly on both platform.
      dcb5071b
    • Nuno Carvalho's avatar
      BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER · d3968407
      Nuno Carvalho authored
      Merge from 5.1 into 5.5.
      
      Conflicts:
       * sql/log.h
       * sql/sql_repl.cc
      d3968407
    • Nuno Carvalho's avatar
      BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER · cdaae169
      Nuno Carvalho authored
      The function mysql_show_binlog_events has a local stack variable
      'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
      this variable goes out of scope and is destroyed before clean
      thd->current_linfo.
      
      The problem is solved by moving 'LOG_INFO linfo;' to function scope.
      cdaae169
    • Andrei Elkin's avatar
      BUG#11754117 incorrect logging of INSERT into auto-increment · 49e484c8
      Andrei Elkin authored
      BUG#11761686 insert_id event is not filtered.
        
      Two issues are covered.
        
      INSERT into autoincrement field which is not the first part in the composed primary key 
      is unsafe by autoincrement logging design. The case is specific to MyISAM engine
      because Innodb does not allow such table definition.
        
      However no warnings and row-format logging in the MIXED mode was done, and
      that is fixed.
        
      Int-, Rand-, User-var log-events were not filtered along with their parent
      query that made possible them to screw up execution context of the following
      query.
        
      Fixed with deferring their execution until the parent query.
      
      ******
      Bug#11754117 
      
      Post review fixes.
      
      mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result:
        a new result file is added.
      mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result:
        results updated.
      mysql-test/suite/rpl/t/rpl_auto_increment_bug45679.test:
        regression test for BUG#11754117-45670 is added.
      mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test:
        regression test for filtering issue of BUG#11754117 - 45670 is added.
      sql/log_event.cc:
        Logics are added for deferring and executing events associated 
        with the Query event.
      sql/log_event.h:
        Interface to deferred events batch execution is added.
      sql/rpl_rli.cc:
        initialization for new RLI members is added.
      sql/rpl_rli.h:
        New members to RLI are added to facilitate deferred events gathering
        and execution control;
        two general character RLI cleanup methods are constructed.
      sql/rpl_utility.cc:
        Deferred_log_events methods are difined.
      sql/rpl_utility.h:
        A new class Deferred_log_events is defined to implement
        IRU events gathering, execution and cleanup.
      sql/slave.cc:
        Necessary changes to initialize `rli->deferred_events' and prevent
        deferred event deletion in the main read-exec branch.
      sql/sql_base.cc:
        A new safe-check function for multi-part pk with auto-increment is defined
        and deployed in lock_tables().
      sql/sql_class.cc:
        Initialization for a new member and replication cleanups are added
        to THD class.
      sql/sql_class.h:
        THD class receives a new member to hold a specific execution
        context for slave applier.
      sql/sql_parse.cc:
        Execution of the deferred event in started prior to its parent query.
      49e484c8
  12. 19 Apr, 2012 2 commits
  13. 18 Apr, 2012 3 commits