1. 28 Aug, 2007 4 commits
  2. 27 Aug, 2007 20 commits
  3. 26 Aug, 2007 1 commit
    • rafal@quant.(none)'s avatar
      BUG#21842 (Cluster fails to replicate to innodb or myisam with err 134 · f8b64e17
      rafal@quant.(none) authored
      using TPC-B):
       
      Problem: A RBR event can contain incomplete row data (only key value and
      fields which have been changed). In that case, when the row is unpacked
      into record and written to a table, the missing fields get incorrect NULL
      values leading to master-slave inconsistency.
       
      Solution: Use values found in slave's table for columns which are not given
      in the rows event. The code for writing a single row uses the following 
      algorithm: 
      
      1. unpack row_data into table->record[0],
      2. try to insert record,
      3. if duplicate record found, fetch it into table->record[0],
      4. unpack row_data into table->record[0],
      5. write table->record[0] into the table.
      
      Where row_data is the row as stored in the data area of a rows event. 
      Thus:
      
      a) unpacking of row_data happens at the time when row is written into 
       a table,
      
      b) when unpacking (in step 4), only columns present in row_data are 
       overwritten - all other columns remain as they were found in the table.
       
      Since all data needed for the above algorithm is stored inside 
      Rows_log_event class, functions which locate and write rows are turned 
      into methods of that class.
      
      replace_record()     -> Rows_log_event::write_row()
      find_and_fetch_row() -> Rows_log_event::find_row()
      
      Both methods take row data from event's data buffer - the row being 
      processed is pointed by m_curr_row. They unpack the data as needed into 
      table's record buffers record[0] or record[1]. When row is unpacked, 
      m_curr_row_end is set to point at next row in the data buffer.
      
      Other changes introduced in this changeset:
      
      - Change signature of unpack_row(): don't report errors and don't
      setup table's rw_set here. Errors can happen only when setting default 
      values in prepare_record() function and are detected there.
       
      - In Rows_log_event and derived classes, don't pass arguments to
      the execution primitives (do_...() member functions) but use class
      members instead.
      
      - Move old row handling code into log_event_old.cc to be used by 
      *_rows_log_event_old classes.
      
      Also, a new test rpl_ndb_2other is added which tests basic replication 
      from master using ndb tables to slave storing the same tables using 
      (possibly) different engine (myisam,innodb).
        
      Test is based on existing tests rpl_ndb_2myisam and rpl_ndb_2innodb. 
      However, these tests doesn't work for various reasons and currently are 
      disabled (see BUG#19227).
        
      The new test differs from the ones it is based on as follows:
        
      1. Single test tests replication with different storage engines on slave 
      (myisam, innodb, ndb).
        
      2. Include file extra/rpl_tests/rpl_ndb_2multi_eng.test containing 
      original tests is replaced by extra/rpl_tests/rpl_ndb_2multi_basic.test 
      which doesn't contain tests using partitioned tables as these don't work 
      currently. Instead, it tests replication to a slave which has more or 
      less columns than master.
        
      3. Include file include/rpl_multi_engine3.inc is replaced with 
      include/rpl_multi_engine2.inc. The later differs by performing slightly 
      different operations (updating more than one row in the table) and 
      clearing table with "TRUNCATE TABLE" statement instead of "DELETE FROM" 
      as replication of "DELETE" doesn't work well in this setting.
        
      4. Slave must use option --log-slave-updates=0 as otherwise execution of 
      replication events generated by ndb fails if table uses a different 
      storage engine on slave (see BUG#29569).
      f8b64e17
  4. 25 Aug, 2007 2 commits
    • tsmith@ramayana.hindu.god's avatar
      Apply InnoDB snapshot innodb-5.1-ss1751. · f01f1993
      tsmith@ramayana.hindu.god authored
      Bug #16979: AUTO_INC lock in InnoDB works a table level lock
        Add a table level counter that tracks the number of AUTOINC locks that are
        pending and/or granted on a table. We peek at this value to determine whether
        a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
        acquire the AUTOINC lock or not. This change is related to Bug# 16979.
      Bug #27950: Duplicate entry error in auto-inc after mysqld restart
        We check whether the AUTOINC sub-system has been initialized (first) by
        holding the AUTOINC mutex and if initialization is required then we
        initialize using our normal procedure.
      f01f1993
    • tsmith@ramayana.hindu.god's avatar
      Apply InnoDB snapshot innodb-5.1-ss1726. · 159d5b71
      tsmith@ramayana.hindu.god authored
      Bug #16979: AUTO_INC lock in InnoDB works a table level lock
        - this is a major change in InnoDB auto-inc handling.
      Bug #27950: Duplicate entry error in auto-inc after mysqld restart
        - Init AUTOINC from delete_row().
      Bug #28781: InnoDB increments auto-increment value incorrectly with ON DUPLICATE KEY UPDATE
        - Use value specified by MySQL, in update_row().
      159d5b71
  5. 24 Aug, 2007 6 commits
  6. 23 Aug, 2007 7 commits
    • gshchepa/uchum@gleb.loc's avatar
      Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · 72bcbc65
      gshchepa/uchum@gleb.loc authored
      into  gleb.loc:/home/uchum/work/bk/target-5.1.22/mysql-5.1-target-5.1.22
      72bcbc65
    • gshchepa/uchum@gleb.loc's avatar
      Fixed bug #30396. · 4a7fdf86
      gshchepa/uchum@gleb.loc authored
      Recommit to 5.1.22.
      The bug caused memory corruption for some queries with top OR level
      in the WHERE condition if they contained equality predicates and 
      other sargable predicates in disjunctive parts of the condition.
      
      The corruption happened because the upper bound of the memory
      allocated for KEY_FIELD and SARGABLE_PARAM internal structures
      containing info about potential lookup keys was calculated incorrectly
      in some cases. In particular it was calculated incorrectly when the
      WHERE condition was an OR formula with disjuncts being AND formulas
      including equalities and other sargable predicates.
      4a7fdf86
    • gshchepa/uchum@gleb.loc's avatar
      Fixed bug #30201. · 6e76e82e
      gshchepa/uchum@gleb.loc authored
      Recommit to 5.1.22.
      Killing a SELECT query with KILL QUERY or KILL CONNECTION
      causes a server crash if the query cache is enabled.
      
      Normal evaluation of a query may be interrupted by the
      KILL QUERY/CONNECTION statement, in this case the mysql_execute_command
      function returns TRUE, and the thd->killed flag has true value.
      In this case the result of the query may
      be cached incompletely (omitting call to query_cache_insert inside
      the net_real_write function), and next call to query_cache_end_of_result
      may lead to server crash.
      Thus, the query_cache_end_of_result function has been modified to abort
      query cache in the case of killed thread.
      6e76e82e
    • gshchepa/uchum@gleb.loc's avatar
      Fixed bug #30287. · e543c743
      gshchepa/uchum@gleb.loc authored
      Recommit to 5.1.22.
      The server created temporary tables for filesort in the working directory
      instead of the specified tmpdir directory.
      e543c743
    • tomas@whalegate.ndb.mysql.com's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · eea05b72
      tomas@whalegate.ndb.mysql.com authored
      into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
      eea05b72
    • tomas@whalegate.ndb.mysql.com's avatar
      BUG#30017 log-slave-updates incorrect behavior for cluster · 8fb593b8
      tomas@whalegate.ndb.mysql.com authored
      - let the receiving injector thread decide what to do
      (recommit for 5.1.22 target)
      8fb593b8
    • skozlov/ksm@mysql.com/virtop.localdomain's avatar
      7094223e