1. 15 Aug, 2019 1 commit
  2. 14 Aug, 2019 7 commits
  3. 13 Aug, 2019 13 commits
  4. 12 Aug, 2019 10 commits
    • Marko Mäkelä's avatar
      MDEV-20316 InnoDB writes uninitialised tail of XID buffer · ae1d17f5
      Marko Mäkelä authored
      Starting with commit 210855ce
      Valgrind became aware that the unused tail of the buffer that
      is returned by thd_get_xid() is actually uninitialized.
      
      The problem should exist already in MySQL 5.0. I was able to
      repeat it on MariaDB Server 5.5 with some additional instrumentation.
      InnoDB is allocating 128+4+4 bytes for the XID and the lengths of
      its components, even when the XID is shorter than 64+64 bytes.
      In MariaDB Server 10.3, while running the test main.xa_binlog,
      in the xid_t::set() that is called by sql_yacc.yy, the 128-byte data
      buffer was uninitialized according to Valgrind, and only the first bytes
      were initialized. When the xid_t::data was copied to
      thd.transaction.xid_state.xid.data, it happened so that the entire
      target buffer was considered initialized. With MariaDB Server 10.4 since
      the said commit, Valgrind will correctly be detect the tail of the buffer
      as uninitialized.
      
      The impact of this bug is as follows:
      
      (1) InnoDB will write unnecessarily much redo log for XA PREPARE.
      (2) InnoDB will write garbage bytes to the redo log and undo log pages.
      (3) The garbage should be 'harmless', because on recovery, only the
      actual payload of the XID will be used, based on the written length.
      
      trx_rseg_write_wsrep_checkpoint(), trx_undo_write_xid(): Write only
      the actually used length of xid->data to the data page, and
      zero out the rest of the buffer by mlog_memset().
      ae1d17f5
    • Marko Mäkelä's avatar
      Revert part of 05619f69 · 97bbac8e
      Marko Mäkelä authored
      This fixes the following test failures related to index cardinality:
      main.join main.stat_tables main.partition main.stat_tables_innodb
      innodb.innodb_bug57252
      97bbac8e
    • Marko Mäkelä's avatar
      MDEV-17614: After-merge fix · 609ea2f3
      Marko Mäkelä authored
      MDEV-17614 flags INSERT…ON DUPLICATE KEY UPDATE unsafe for statement-based
      replication when there are multiple unique indexes. This correctly fixes
      something whose attempted fix in MySQL 5.7
      in mysql/mysql-server@c93b0d9a972cb6f98fd445f2b69d924350f9128a
      caused lock conflicts. That change was reverted in MySQL 5.7.26
      in mysql/mysql-server@066b6fdd433aa6673622341f1a2f0a3a20018043
      (with a substantial amount of other changes).
      
      In MDEV-17073 we already disabled the unfortunate MySQL change when
      statement-based replication was not being used. Now, thanks to MDEV-17614,
      we can actually remove the change altogether.
      
      This reverts commit 8a346f31 (MDEV-17073)
      and mysql/mysql-server@c93b0d9a972cb6f98fd445f2b69d924350f9128a while
      keeping the test cases.
      609ea2f3
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · be33124c
      Marko Mäkelä authored
      be33124c
    • Monty's avatar
      Fixed issues found by valgrind · fe8181ac
      Monty authored
      - mysqltest didn't free read_command_buf
      - wait_for_slave_param did write different things to the log if valgrind
        was used.
      - Table open cache should not write the initial variable value as it
        can depend on the configuration or if valgrind is used
      - A variable in GetResult was used uninitalized
      fe8181ac
    • Marko Mäkelä's avatar
      Merge 5.5 into 10.1 · 15c1ab52
      Marko Mäkelä authored
      15c1ab52
    • Marko Mäkelä's avatar
      MDEV-17614: Re-record a result · 7a9e1fcd
      Marko Mäkelä authored
      7a9e1fcd
    • Marko Mäkelä's avatar
      Fix -Wimplicit-fallthrough · 1217e4a0
      Marko Mäkelä authored
      1217e4a0
    • Marko Mäkelä's avatar
      b2a387a3
    • Monty's avatar
      Fixes based on warnings from gcc/clang and valgrind · 05619f69
      Monty authored
      - Initialize variables that could be used uninitialized
      - Added extra end space to DbugStringItemTypeValue to get rid of warnings
        from c_ptr()
      - Session_sysvars_tracker::update() accessed unitialized memory if called
        with NULL value.
      - get_schema_stat_record() accessed unitialized memory if HA_KEY_LONG_HASH
        was used
      - parse_vcol_defs() accessed random memory for tables without keys.
      05619f69
  5. 11 Aug, 2019 7 commits
  6. 09 Aug, 2019 2 commits
    • Sergei Petrunia's avatar
      MDEV-16955: rocksdb_sys_vars.rocksdb_update_cf_options_basic · 3b234104
      Sergei Petrunia authored
      ... produces "bytes lost" warnings
      
      When rocksdb_validate_update_cf_options() returns an error,
      the update won't happen.
      Free the copy of the string in this case.
      3b234104
    • Sachin's avatar
      MDEV-17614 INSERT on dup key update is replication unsafe · 284c72ea
      Sachin authored
      Problem:-
      When mysql executes INSERT ON DUPLICATE KEY INSERT, the storage engine checks
      if the inserted row would generate a duplicate key error. If yes, it returns
      the existing row to mysql, mysql updates it and sends it back to the storage
      engine.When the table has more than one unique or primary key, this statement
      is sensitive to the order in which the storage engines checks the keys.
      Depending on this order, the storage engine may determine different rows
      to mysql, and hence mysql can update different rows.The order that the
      storage engine checks keys is not deterministic. For example, InnoDB checks
      keys in an order that depends on the order in which indexes were added to
      the table. The first added index is checked first. So if master and slave
      have added indexes in different orders, then slave may go out of sync.
      
      Solution:-
      Make INSERT...ON DUPLICATE KEY UPDATE unsafe while using stmt or mixed format
      When there is more then one unique key.
      Although there is two exception.
        1. Auto Increment key is not counted because Innodb will get gap lock for
          failed Insert and concurrent insert will get a next increment value. But if
          user supplies auto inc value it can be unsafe.
        2. Count only unique keys for which insertion is performed.
      
      So this patch also addresses the bug id #72921
      284c72ea