1. 02 Feb, 2019 4 commits
    • Vladislav Vaintroub's avatar
      MDEV-18281 COM_RESET_CONNECTION changes the connection encoding · 261ce528
      Vladislav Vaintroub authored
      Store original charset during client authentication, and restore it for
      COM_RESET_CONNECTION
      261ce528
    • Marko Mäkelä's avatar
      Some more fixes for --suite=galera_3nodes · 915ed7e6
      Marko Mäkelä authored
      915ed7e6
    • Julius Goryavsky's avatar
      MDEV-18379: IPv6 compatibility changes/Unification of check for IPv6 · dfc9bff5
      Julius Goryavsky authored
      This patch contains the port of the MDEV-18379 patch
      for 10.2 branch, but also includes a number of changes
      made within MDEV-17835, which are necessary for the
      normal operation of tests that use IPv6:
      
      1) Currently, the three-node mtr suite for Galera (galera_3nodes)
      uses a separate IPv6 availability check using the "have_ipv6.inc"
      file. This check duplicates a more accurate check at suite.pm
      level, which can be used by including the file "check_ipv6.inc".
      This patch removes this discrepancy between suites.
      
      2) Fixed numerous bugs in the SST scripts and in the mtr test
      files (galera_3nodes mtr suite) that prevented the use of Galera
      with IPv6 addresses.
      
      3) Fixed flaws in the galera_3nodes mtr suite control scripts,
      because of which they could not work with mariabackup.
      
      4) Fixed flaws in the rsync and mysqldump tests (for galera_3nodes
      mtr tests suite). These tests were not performed successfully
      without these fixes.
      
      5) GAL-501 test in the galera_3nodes suite does not contain the
      option "--bind-address=::" that is needed for the test to work
      correctly with IPv6 (at least on some systems), since without
      it the server will not wait for connections on the IPv6
      interface.
      
      https://jira.mariadb.org/browse/MDEV-18379
      and partially https://jira.mariadb.org/browse/MDEV-17835
      dfc9bff5
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 081fd8bf
      Marko Mäkelä authored
      081fd8bf
  2. 01 Feb, 2019 7 commits
  3. 31 Jan, 2019 3 commits
  4. 30 Jan, 2019 2 commits
  5. 28 Jan, 2019 2 commits
  6. 27 Jan, 2019 3 commits
  7. 26 Jan, 2019 1 commit
    • Julius Goryavsky's avatar
      MDEV-18379: Unification of check for IPv6 · 4aea6b3e
      Julius Goryavsky authored
      This patch contains the port of the MDEV-18379 patch
      for 10.1 branch, but also includes a number of changes
      made within MDEV-17835, which are necessary for the
      normal operation of tests that use IPv6:
      
      1) Fixed flaws in the galera_3nodes mtr suite control scripts,
      because of which they could not work with mariabackup.
      
      2) Fixed numerous bugs in the SST scripts and in the mtr test
      files (galera_3nodes mtr suite) that prevented the use of Galera
      with IPv6 addresses.
      
      3) Fixed flaws in tests for rsync and mysqldump (for galera_3nodes
      mtr tests suite). These tests were not performed successfully
      without these fixes.
      
      4) Currently, the three-node mtr suite for Galera (galera_3nodes)
      uses a separate IPv6 availability check using the "have_ipv6.inc"
      file. This check duplicates a more accurate check at suite.pm
      level, which can be used by including the file "check_ipv6.inc".
      This patch removes this discrepancy between suites.
      
      5) GAL-501 test in the galera_3nodes suite does not contain the
      option "--bind-address=::" which is needed for the test to work
      correctly with IPv6 (at least on some systems), since without
      it the server will not wait for connections on the IPv6 interface.
      
      https://jira.mariadb.org/browse/MDEV-18379
      and partially https://jira.mariadb.org/browse/MDEV-17835
      4aea6b3e
  8. 25 Jan, 2019 8 commits
    • Sergei Golubchik's avatar
      3fb6d258
    • Sergei Golubchik's avatar
      Deb: don't edit control file from inside rules file · d4515d13
      Sergei Golubchik authored
      It's too late. Might work or not (and on buster it doesn't).
      d4515d13
    • Sergei Golubchik's avatar
      74f184af
    • Teemu Ollakka's avatar
      MDEV-15740 Backport wsrep recovery fixes from 10.4. · 040b840d
      Teemu Ollakka authored
      Clear wsrep XID in innobase_rollback_by_xid() for recovered wsrep
      transaction in order to avoid resetting XID storage when rolling back
      wsrep transaction during recovery.
      
      Sort wsrep XIDs read from storage engine in ascending order and
      erify that the range is continuous during crash recovery. If binlog is off,
      commit all recovered transactions for continuous seqno range. This is safe
      because all transactions with wsrep XID have been certified and must be
      committed in the cluster. On the other hand if binlog is on, respect binlog
      as a transaction coordinator in order to avoid missing transactions in binlog
      that have been committed into storage engine .
      040b840d
    • Teemu Ollakka's avatar
      Backported wsrep-recover test from 10.4. · ce28fa53
      Teemu Ollakka authored
      Backported wsrep-recover test from 10.4 to test the wsrep recovery
      after database shutdown or crash. Renamed the test to wsrep-recover-v25
      to avoid conflicts with existing test in 10.4 and to provide coverage
      for wsrep-API v25 compatible behavior.
      
      The test case in 10.2 is simpler because out of order prepare
      step cannot happen, the commit order critical section is grabbed
      before prepare phase.
      
      Test is not recorded since it does not produce expected result.
      ce28fa53
    • Eugene Kosov's avatar
      MDEV-18235: Changes related to fsync() · 31d0727a
      Eugene Kosov authored
      Remove fil_node_t::sync_event.
      
      I had a discussion with kernel fellows and they said it's safe to call
      fsync() simultaneously at least on VFS and ext4. So initially I wanted
      to disable check for recent Linux but than I realized code is buggy.
      
      Consider a case when one thread is inside fsync() and two others are
      waiting inside os_event. First thread after fsync() calls os_event_set()
      which is a broadcast! So two waiting threads will awake and may call
      fsync() at the same time.
      
      One fix is to add a notify_one() functionality to os_event but I decided
      to remove incorrect check completely. Note, it works for one waiting
      thread but not for more than one.
      
      IMO it's ok to avoid existing bugs but there is not too much sense in
      avoiding possible(!) bugs as this code does.
      
      fil_space_t::is_in_rotation_list(), fil_space_t::is_in_unflushed_spaces():
      Replace redundant bool fields with member functions.
      
      fil_node_t::needs_flush: Replaces fil_node_t::modification_counter and
      fil_node_t::flush_counter. We need to know whether there _are_ some
      unflushed writes and we do not need to know _how many_ writes.
      
      fil_system_t::modification_counter: Remove as not needed.
      Even if we needed fil_node_t::modification_counter, every file
      could have its own counter that would be incremented on each write.
      
      fil_system_t::modification_counter is a global modification counter
      for all files. It was incremented on every write. But whether some
      file was flushed or not is an internal fil_node_t deal/state and
      this makes fil_system_t::modification_counter useless.
      
      Closes #1061
      31d0727a
    • Andrei Elkin's avatar
      MDEV-17803: ulonglongization of table_mapping entry::table_id to fix windows... · ef0b91ea
      Andrei Elkin authored
      MDEV-17803: ulonglongization of table_mapping entry::table_id to fix windows compilation in particular.
      ef0b91ea
    • Marko Mäkelä's avatar
      MDEV-18352 Add a regression test for VARCHAR enlarging · d97db40a
      Marko Mäkelä authored
      Add a simplest regression test. Specifically, I want to be sure that
      SYS_COLUMNS.LEN is increased.
      
      Closes #1123
      d97db40a
  9. 24 Jan, 2019 10 commits
    • Andrei Elkin's avatar
      MDEV-10963 Fragmented BINLOG query · 5d48ea7d
      Andrei Elkin authored
      The problem was originally stated in
        http://bugs.mysql.com/bug.php?id=82212
      The size of an base64-encoded Rows_log_event exceeds its
      vanilla byte representation in 4/3 times.
      When a binlogged event size is about 1GB mysqlbinlog generates
      a BINLOG query that can't be send out due to its size.
      
      It is fixed with fragmenting the BINLOG argument C-string into
      (approximate) halves when the base64 encoded event is over 1GB size.
      The mysqlbinlog in such case puts out
      
          SET @binlog_fragment_0='base64-encoded-fragment_0';
          SET @binlog_fragment_1='base64-encoded-fragment_1';
          BINLOG @binlog_fragment_0, @binlog_fragment_1;
      
      to represent a big BINLOG.
      For prompt memory release BINLOG handler is made to reset the BINLOG argument
      user variables in the middle of processing, as if @binlog_fragment_{0,1} = NULL
      is assigned.
      
      Notice the 2 fragments are enough, though the client and server still may
      need to tweak their @@max_allowed_packet to satisfy to the fragment
      size (which they would have to do anyway with greater number of
      fragments, should that be desired).
      
      On the lower level the following changes are made:
      
      Log_event::print_base64()
        remains to call encoder and store the encoded data into a cache but
        now *without* doing any formatting. The latter is left for time
        when the cache is copied to an output file (e.g mysqlbinlog output).
        No formatting behavior is also reflected by the change in the meaning
        of the last argument which specifies whether to cache the encoded data.
      
      Rows_log_event::print_helper()
        is made to invoke a specialized fragmented cache-to-file copying function
        which is
      
      copy_cache_to_file_wrapped()
        that takes care of fragmenting also optionally wraps encoded
        strings (fragments) into SQL stanzas.
      
      my_b_copy_to_file()
        is refactored to into my_b_copy_all_to_file(). The former function
        is generalized
        to accepts more a limit argument to constraint the copying and does
        not reinitialize anymore the cache into reading mode.
        The limit does not do any effect on the fully read cache.
      5d48ea7d
    • Andrei Elkin's avatar
      MDEV-14605 Changes to "ON UPDATE CURRENT_TIMESTAMP" fields are not · f9ac7032
      Andrei Elkin authored
                 always logged properly with binlog_row_image=MINIMAL
      
      There are two issues fixed in this commit.
      The first is an observation of a multi-table UPDATE binlogged
      in row-format in binlog_row_image=MINIMAL mode. While the UPDATE aims
      at a table with an ON-UPDATE attribute its binlog after-image misses
      to record also installed default value.
      The reason for that turns out missed marking of default-capable fields
      in TABLE::write_set.
      
      This is fixed to mark such fields similarly to 10.2's MDEV-10134 patch (db7edfed)
      that introduced it. The marking follows up 93d1e5ce's idea
      to exploit TABLE:rpl_write_set introduced there though,
      and thus does not mess (in 10.1) with the actual MDEV-10134 agenda.
      The patch makes formerly arg-less TABLE::mark_default_fields_for_write()
      to accept an argument which would be TABLE:rpl_write_set.
      
      The 2nd issue is extra columns in in binlog_row_image=MINIMAL before-image
      while merely a packed primary key is enough. The test main.mysqlbinlog_row_minimal
      always had a wrong result recorded.
      This is fixed to invoke a function that intended for read_set
      possible filtering and which is called (supposed to) in all type of MDL, UPDATE
      including; the test results have gotten corrected.
      
      At *merging* from 10.1->10.2 the 1st "main" part of the patch is unnecessary
      since the bug is not observed in 10.2, so only hunks from
      
        sql/sql_class.cc
      
      are required.
      f9ac7032
    • Marko Mäkelä's avatar
      Fix the build after MDEV-17803 · fab531a1
      Marko Mäkelä authored
      Use the same data type 'ulong' to avoid type mismatch on Windows
      and on 32-bit systems.
      
      FIXME: The correct data type should probably be 64-bit.
      fab531a1
    • Alexander Barkov's avatar
      MDEV-18195 ASAN use-after-poison in my_strcasecmp_utf8 / Item::eq upon... · 17c75bd2
      Alexander Barkov authored
      MDEV-18195 ASAN use-after-poison in my_strcasecmp_utf8 / Item::eq upon prepared statement with ORDER BY NAME_CONST
      
      ASAN noticed a freed memory access during EXECUTE in this script:
        PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )";
        EXECUTE stmt;
      
      In case of a PREPARE statement, all Items, including Item_name_const,
      are created on Prepared_statement::main_mem_root.
      Item_name_const::fix_fields() did not take this into account
      and could allocate the value of Item::name on a wrong memory root,
      in this code:
      
        if (is_autogenerated_name)
        {
          set_name(thd, item_name->c_ptr(), (uint) item_name->length(),
                   system_charset_info);
        }
      
      When fix_fields() is called in the reported SQL script, THD's arena already
      points to THD::main_mem_root rather than to Prepared_statement::main_mem_root,
      so Item::name was allocated on THD::main_mem_root.
      Then, at the end of the dispatch_command() for the PREPARE statement,
      THD::main_mem_root got cleared. So during EXECUTE, Item::name
      pointed to an already freed memory.
      
      This patch changes the code to set the implicit name for Item_name_const
      at the constructor time rather than at fix_fields time. This guarantees
      that Item_name_const and its Item::name always reside on the same memory root.
      
      Note, this change makes the code for Item_name_const symmetric with other
      constant-alike items that set their default implicit names at the constructor
      call time rather than at fix_fields() time:
      - Item_string
      - Item_int
      - Item_real
      - Item_decimal
      - Item_null
      - Item_param
      17c75bd2
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 25161e62
      Marko Mäkelä authored
      25161e62
    • Geoff Montee's avatar
    • Marko Mäkelä's avatar
      Merge 10.0 into 10.1 · 65350042
      Marko Mäkelä authored
      65350042
    • Marko Mäkelä's avatar
      7930ab7e
    • Marko Mäkelä's avatar
      MDEV-15114: Fix memory leaks · 46f712c7
      Marko Mäkelä authored
      When innobase_allocate_row_for_vcol() returns true (for failure),
      it may already have invoked mem_heap_create(). However, some callers
      would fail to invoke mem_heap_free().
      46f712c7
    • Andrei Elkin's avatar