1. 27 Aug, 2007 14 commits
  2. 26 Aug, 2007 1 commit
    • unknown's avatar
      BUG#21842 (Cluster fails to replicate to innodb or myisam with err 134 · 3a433c9c
      unknown 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).
      
      
      sql/log_event.cc:
        - Initialization of new Rows_log_event members.
        - Fixing some typos in documentation.
        
        In Rows_log_event::do_apply_event:
        - Set COMPLETE_ROWS_F flag (when master and slave have the same number of 
        columns and all colums are present in the row)
        - Move initialization of tables write/read sets here, outside the rows
        processing loop (and out of unpack_row() function).
        - Remove calls to do_prepare_row() - no longer needed.
        - Add code managing m_curr_row and m_curr_row_end pointers.
        
        - Change signatures of row processing methods of Rows_log_event and it
        descendants - now most arguments are taken from class members.
        - Remove do_prepare_row() methods which are no longer used.
        - The auto_afree_ptr template is moved to rpl_utility.h (so that it can
        be used in log_event_old.cc).
        - Removed copy_extra_fields() function - no longer used.
        
        In Rows_log_event::write_row (former replace_record):
        - The old code is moved to log_event_old.cc.
        - Use prepare_record() and non-destructive unpack_current_row() to fill record
        with data.
        - In case a record being inserted already exists on slave and row data is 
        incomplete use the record found and non-destructive unpack_current_row() to 
        combine new column values with existing ones.
        - More debug info added.
        
        In Rows_log_event::find_row (former find_and_fetch_row function):
        - The old code is moved to log_event_old.cc.
        - Unpacking of the row is moved here.
        - In case of search using PK, the key data is prepared here.
        - More debug info added.
        
        - Remove initialization of Rows_log_event::m_after_image buffer which is no
        longer used. 
        - Use new row unpacking methods in Update_rows_log_event::do_exec_row() to 
        create before and after image.
        
        Note: all existing code used by Rows_log_event::do_apply_event() has been moved
        to log_event_old.cc to be used by *_rows_log_event_old classes.
      sql/log_event.h:
        - Add new COMPLETE_ROWS_F flag in Rows_log_event.
        - Add Rows_log_event members describing the row being processed.
        - Add a pointer to key buffer which is used in derived classes.
        - Add new methods: find__row(), write_row() and unpack_current_row().
        - Change signatures of do_...() methods (replace method arguments by
        class members).
        - Remove do_prepare_row() method which is no longer used.
        - Update method documentation.
        - Add Old_rows_log_event class, which contains the old row processing code, as
        a friend of Rows_log_event so that it can access all members of an event 
        instance.
      sql/log_event_old.cc:
        Move here old implementation of Rows_log_event::do_apply_event() and 
        helper methods.
      sql/log_event_old.h:
        - Define new class Old_rows_log_event encapsulating old version of
        Rows_log_event::do_apply_event() and the helper methods.
        - Add the Old_rows_log_event class as a base for *_old versions of RBR event
        classes, ensure that the old version of do_apply_event() is called.
        - For *_old classes, declare the helper methods used in the old version of
        do_apply_event().
      sql/rpl_record.cc:
        - Make unpack_row non-destructive for columns not present in the row.
        - Don't fill read/write set here as it is done outside these functions.
        - Move initialization of a record with default values to a separate
        function prepare_record().
      sql/rpl_record.h:
        - Change signature of unpack_row().
        - Declare function prepare_record().
      sql/rpl_utility.cc:
        Make tabe_def::calc_field_size() a const method.
      sql/rpl_utility.h:
        Make table_def::calc_field_size() a const method.
        
        Move auto_afree_ptr template here so that it can be re-used (currently
        in log_event.cc and log_event_old.cc). Similar with DBUG_PRINT_BITSET 
        macro.
      mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test:
        Modification of rpl_ndb_2multi_eng test. Tests with partitioned tables 
        are removed and a setup with slave having different number of columns 
        than master is added.
      mysql-test/include/rpl_multi_engine2.inc:
        Modification of rpl_multi_engine3.inc which operates on more rows and
        replaces "DELETE FROM t1" with "TRUNCATE TABLE t1" as the first form
        doesn't replicate in NDB -> non-NDB setting (BUG#28538).
      mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result:
        Results of the test.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt:
        Test options. --log-slave-updates=0 is compulsory as otherwise non-NDB 
        slave applying row events from NDB master will fail when trying to log
        them.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test:
        Test replication of NDB table to slave using other engine. The main test
        is in extra/rpl_tests/rpl_ndb_2multi_basic.test. It is included here
        several times with different settings of default storage engine on slave.
      3a433c9c
  3. 24 Aug, 2007 6 commits
  4. 23 Aug, 2007 9 commits
    • unknown's avatar
      Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · a7ff0f0c
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/target-5.1.22/mysql-5.1-target-5.1.22
      
      a7ff0f0c
    • unknown's avatar
      Fixed bug #30396. · 64c17322
      unknown 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.
      
      
      mysql-test/r/select.result:
        Added a test case for bug #30396.
        Recommit to 5.1.22.
      mysql-test/t/select.test:
        Added a test case for bug #30396.
        Recommit to 5.1.22.
      sql/item_cmpfunc.h:
        Removed max_members from the COND_EQUAL class as not useful anymore. 
        Recommit to 5.1.22.
      sql/sql_base.cc:
        Added the max_equal_elems field to the st_select_lex structure.
        Recommit to 5.1.22.
      sql/sql_lex.cc:
        Added the max_equal_elems field to the st_select_lex structure.
        Recommit to 5.1.22.
      sql/sql_lex.h:
        Added the max_equal_elems field to the st_select_lex structure.
        The field contains the maximal number of elements in multiple equalities
        built for the query conditions.
        Recommit to 5.1.22.
      sql/sql_select.cc:
        Fixed bug #30396.
        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.
         
        The max_equal_elems field to the st_select_lex structure is used now
        to calculate the above mentioned upper bound. The field contains the
        maximal number of elements in multiple equalities built for the query
        conditions.
      64c17322
    • unknown's avatar
      Fixed bug #30201. · 72c56fde
      unknown 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.
      
      
      
      sql/sql_cache.cc:
        Fixed bug #30201.
        Recommit to 5.1.22.
        The  query_cache_end_of_result function has been modified to abort query
        cache in the case of query execution failure. Also this function has been
        modified to remove incomplete query block.
      72c56fde
    • unknown's avatar
      Fixed bug #30287. · 110f2a48
      unknown authored
      Recommit to 5.1.22.
      The server created temporary tables for filesort in the working directory
      instead of the specified tmpdir directory.
      
      
      sql/item.cc:
        Fixed bug #30287.
        Recommit to 5.1.22.
        The Item_field::set_field method has been modified to reset the any_privileges
        flag to false in case of system temporary table. This modification prevents the
        server from unnecessary checking of user privileges to access system temporary
        tables.
      sql/sql_select.cc:
        Fixed bug #30287.
        Recommit to 5.1.22.
        Bugfix for #29015 has been removed: TABLE_SHARE::table_name of system
        temporary tables contains full path to table file basename again.
      sql/sql_view.cc:
        Fixed bug #30287.
        Recommit to 5.1.22.
        Commentary has been added.
      110f2a48
    • unknown's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · 9a0199f7
      unknown authored
      into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
      
      9a0199f7
    • unknown's avatar
      BUG#30017 log-slave-updates incorrect behavior for cluster · f189aebf
      unknown authored
      - let the receiving injector thread decide what to do
      (recommit for 5.1.22 target)
      
      
      sql/ha_ndbcluster.cc:
        BUG#30017 log-slave-updates incorrect behavior for cluster
        - let the receiving injector thread decide what to do
      sql/ha_ndbcluster_binlog.cc:
        BUG#30017 log-slave-updates incorrect behavior for cluster
        - let the receiving injector thread decide what to do
      f189aebf
    • unknown's avatar
      Bug#28744, Bug#29363 · 5f82852c
      unknown authored
      
      mysql-test/suite/rpl/include/rpl_mixed_ddl.inc:
        updated main test for DDL
      mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
        updated main test for DML
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
        updated result file
      mysql-test/suite/rpl/t/disabled.def:
        updated disabled.def
      5f82852c
    • unknown's avatar
      Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · 7c9fcbea
      unknown authored
      into  mysql.com:/data1/mysql-5.1-target-5.1.22
      
      7c9fcbea
    • unknown's avatar
      BUG#30134 restore of backup from different endian can work for timestamp column · c46e0ade
      unknown authored
      (recommit for 5.1.22 target)
      
      
      storage/ndb/tools/restore/Restore.cpp:
        Convert byte order of timestamp data type
      c46e0ade
  5. 22 Aug, 2007 4 commits
    • unknown's avatar
      Bug#30359 · eab8f796
      unknown authored
        "Test federated_bug_25714 issues non-existing shell command"
        Problem caused by missing '$' symbol in eval statement causing it
        to always attempt to run test even if the test was not compiled.
      
      
      mysql-test/include/have_bug25714.inc:
        bug30359
          missing '$' in eval statement
      eab8f796
    • unknown's avatar
      Fix the version number. · fc5331d6
      unknown authored
      
      configure.in:
        Version is 5.1.22 !
      fc5331d6
    • unknown's avatar
      ndb_dd_ddl.test, ndb_dd_ddl.result: · 6f285765
      unknown authored
        Updated test case to correst inconsistant results on different OS per #bug30559
      
      
      mysql-test/suite/ndb/t/ndb_dd_ddl.test:
        Updated test case to correst inconsistant results on different OS per #bug30559
      mysql-test/suite/ndb/r/ndb_dd_ddl.result:
        Updated test case to correst inconsistant results on different OS per #bug30559
      6f285765
    • unknown's avatar
      Merge trift2.:/MySQL/M51/clone-5.1 · d2d44381
      unknown authored
      into  trift2.:/MySQL/M51/target-5.1.22
      
      d2d44381
  6. 21 Aug, 2007 1 commit
    • unknown's avatar
      ndb_dd_dump.test, ndb_dd_dump.result: · 04b5bf98
      unknown authored
        uncommented the test case stated in bug18856 and commiting to mysql-5.1-target-5.1.22 clone per Tomas
      
      
      mysql-test/suite/ndb/t/ndb_dd_dump.test:
        uncommented the test case stated in bug18856 and commiting to mysql-5.1-target-5.1.22 clone per Tomas
      mysql-test/suite/ndb/r/ndb_dd_dump.result:
        uncommented the test case stated in bug18856 and commiting to mysql-5.1-target-5.1.22 clone per Tomas
      04b5bf98
  7. 20 Aug, 2007 1 commit
  8. 16 Aug, 2007 4 commits
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.1-marvel · 445859d6
      unknown authored
      into  mysql.com:/data0/mysqldev/my/build-200708161639-5.1.21-beta/mysql-5.1-release
      
      
      sql/log_event.cc:
        Auto merged
      445859d6
    • unknown's avatar
      Set back version number after pulling bugfix · 49284e9b
      unknown authored
      49284e9b
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel · 24381881
      unknown authored
      into  mysql.com:/data0/mysqldev/my/mysql-5.1-30367
      
      
      sql/sql_show.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      sql/log_event.cc:
        Manual merge, later version of the fix takes precedence.
      24381881
    • unknown's avatar
      Fixed errors found by pushbuild: · 1667b968
      unknown authored
      Fixed failing func_misc test for embedded server
      Added casts to avoid compiler warnings
      Removed Table_locks_immediate as it's depending on log file cacheing
      Changed type of get_time() to avoid warnings
      Removed testing if purger master logs succeded as this is not deterministic
      
      
      libmysqld/lib_sql.cc:
        Fixed failing func_misc test for embedded server
      mysql-test/mysql-test-run.pl:
        Shut first down slaves, then masters.
        This should avoid some errors in the log file about not being able to connect to master during shutdown
      mysql-test/r/func_misc.result:
        Move DROP TABLE's first
      mysql-test/r/status.result:
        Removed Table_locks_immediate as it's depending on log file cacheing
      mysql-test/suite/ndb/r/ndb_binlog_basic.result:
        Removed testing if purger master logs succeded as this is not deterministic
      mysql-test/suite/ndb/t/ndb_binlog_basic.test:
        Removed testing if purger master logs succeded as this is not deterministic
      mysql-test/t/func_misc.test:
        Move DROP TABLE's first
      mysql-test/t/status.test:
        Removed Table_locks_immediate as it's depending on log file cacheing
      sql/log_event.cc:
        Added cast to avoid warnings
      sql/log_event.h:
        Changed type of get_time() to avoid warnings
      1667b968