1. 25 Apr, 2019 14 commits
  2. 24 Apr, 2019 5 commits
    • Marko Mäkelä's avatar
      Merge 5.5 into 10.1 · bfb0726f
      Marko Mäkelä authored
      bfb0726f
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-15772 Potential list overrun during XA recovery · d5da8ae0
      Thirunarayanan Balathandayuthapani authored
      InnoDB could return the same list again and again if the buffer
      passed to trx_recover_for_mysql() is smaller than the number of
      transactions that InnoDB recovered in XA PREPARE state.
      
      We introduce the transaction state TRX_PREPARED_RECOVERED, which
      is like TRX_PREPARED, but will be set during trx_recover_for_mysql()
      so that each transaction will only be returned once.
      
      Because init_server_components() is invoking ha_recover() twice,
      we must reset the state of the transactions back to TRX_PREPARED
      after returning the complete list, so that repeated traversals
      will see the complete list again, instead of seeing an empty list.
      Without this tweak, the test main.tc_heuristic_recover would hang
      in MariaDB 10.1.
      d5da8ae0
    • Varun Gupta's avatar
      MDEV-15837: Assertion `item1->type() == Item::FIELD_ITEM && item2->type() == Item::FIELD_ITEM' · 1f1a61cf
      Varun Gupta authored
                  failed in compare_order_elements function
      
      The issue here is the function compare_order_lists() is called for the order by list of the window functions
      so that those window function that can be computed together are adjacent.
      So in the function compare_order_list we iterate over all the elements in the order list of the two functions and
      compare the items in their order by clause.
      The function compare_order_elements() is called for each item in the
      order by clause. This function assumes that all the items that are in the order by list would be of the type
      Item::FIELD_ITEM.
      
      The case we have is that we have constants in the order by clause. We should ignore the constant and only compare
      items of the type Item::FIELD_ITEM in compare_order_elements()
      1f1a61cf
    • Sujatha Sivakumar's avatar
      MDEV-17260: Memory leaks in mysqlbinlog · cb8d888c
      Sujatha Sivakumar authored
      Problem:
      ========
      The mysqlbinlog tool is leaking memory, causing failures in various tests when
      compiling and testing with AddressSanitizer or LeakSanitizer like this:
      
      cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_ASAN:BOOL=ON /path/to/source
      make -j$(nproc)
      cd mysql-test
      ASAN_OPTIONS=abort_on_error=1 ./mtr --parallel=auto rpl.rpl_row_mysqlbinlog
      
      CURRENT_TEST: rpl.rpl_row_mysqlbinlog
      
      Direct leak of 112 byte(s) in 1 object(s) allocated from:
      #0 0x4eff87 in __interceptor_malloc (/dev/shm/5.5/client/mysqlbinlog+0x4eff87)
      #1 0x60eaab in my_malloc /mariadb/5.5/mysys/my_malloc.c:41:10
      #2 0x5300dd in Log_event::read_log_event(char const*, unsigned int, char const**,
         Format_description_log_event const*, char) /mariadb/5.5/sql/log_event.cc:1568:
      #3 0x564a9c in dump_remote_log_entries(st_print_event_info*, char const*)
      /mariadb/5.5/client/mysqlbinlog.cc:1978:17
      
      Analysis:
      ========
      'mysqlbinlog' tool is being used to read binary log events from a remote server.
      While reading binary log, if a fake rotate event is found following actions are
      taken.
      
      If 'to-last-log' option is specified, then fake rotate event is processed.
      In the absence of 'to-last-log' skip the fake rotate event.
      
      In this skipped case the fake rotate event object is not getting cleaned up
      resulting in memory leak.
      
      Fix:
      ===
      Cleanup the fake rotate event.
      
      This issues is already fixed in MariaDB 10.0.23 and higher versions as part of
      commit c3018b0f
      cb8d888c
    • Igor Babaev's avatar
      MDEV-17796 WHERE filter is ignored by DISTINCT IFNULL(GROUP_CONCAT(X), Y) · 5fc8dd8b
      Igor Babaev authored
                 with GROUP BY + ORDER BY
      
      The method JOIN::create_postjoin_aggr_table() should not call
      call JOIN::add_sorting_to_table() unless the first non-constant join
      table is passed as the first parameter to the method.
      5fc8dd8b
  3. 23 Apr, 2019 6 commits
  4. 22 Apr, 2019 4 commits
  5. 21 Apr, 2019 1 commit
    • Alexander Barkov's avatar
      MDEV-19239 ERROR 1300 (HY000): Invalid utf8 character string in 10.3.13-MariaDB · 765ae6e8
      Alexander Barkov authored
      A sequence of <digits>e<mbhead><mbtail>, e.g.:
      
        SELECT 123eXYzzz FROM t1;
      
      was not scanned correctly (where XY is a multi-byte character).
      
      The multi-byte head byte X was appended to 123e separately from
      the multi-byte tail byte Y, so a pointer to "Yzzz" was passed
      into scan_ident_start(), which failed on a bad multi-byte sequence.
      
      After this change, scan_ident_start() gets a pointer to "XYzzz",
      so it correctly sees the whole multi-byte character.
      765ae6e8
  6. 19 Apr, 2019 9 commits
    • Igor Babaev's avatar
      MDEV-19255 Server crash in st_join_table::save_explain_data or assertion · a65d3b2c
      Igor Babaev authored
                 `sel->quick' failure in JOIN::make_range_rowid_filters upon query
                 with rowid_filter=ON
      
      Index ranges can be defined using conditions with inexpensive subqueries.
      Such a subquery is evaluated when some representation of a possible range
      sequence is built. After the evaluation the JOIN structure of the subsquery is distroyed.
      Any attempt to build the above representation may fail because the
      function that checks whether a subquery is inexpensive in some cases uses
      the join structure of the subquery.
      When a range rowid filter is built by a range sequence constructed out of
      a range condition that uses an inexpensive subquery the representation of
      the the sequence is built twice. Building the second representation fails
      due to the described problem with the execution of Item_subselect::is_expensive().
      The function was corrected to return the result of the last its invocation
      if the Item_subselect object has been already evaluated.
      a65d3b2c
    • Alexander Barkov's avatar
      Backporting from 10.4 to 10.3: MDEV-17325 NULL-ability problems with LEAST()... · f4019f5b
      Alexander Barkov authored
      Backporting from 10.4 to 10.3: MDEV-17325 NULL-ability problems with LEAST() in combination with NO_ZERO_DATE and NO_ZERO_IN_DATE
      
      This also fixes:
      MDEV-17299 Assertion `maybe_null' failed in make_sortkey
      
      Note, during merge of the 10.1 version of MDEV-17299,
      please use the 10.3 version of the code (i.e. null merge the 10.1 version).
      f4019f5b
    • Alexander Barkov's avatar
    • Andrei Elkin's avatar
      MDEV-18096 The server would crash when has configs... · 42c58b87
      Andrei Elkin authored
      MDEV-18096 The server would crash when has configs rpl_semi_sync_master_enabled = OFF rpl_semi_sync_master_wait_no_slave = OFF
      
      The patch fixes a fired assert in the semisync master module. The assert
      caught attempt to switch semisync off (per rpl_semi_sync_master_wait_no_slave = OFF)
      when it was not even initialized (per rpl_semi_sync_master_enabled = OFF).
      The switching-off execution branch is relocated under one that executes
      enable_master() first.
      
      A minor cleaup is done to remove the int return from two functions that
      did not return anything but an error which could not happen in the functions.
      42c58b87
    • Monty's avatar
      MDEV-19224 Assertion `marked_for_read()' failed · 38f390f5
      Monty authored
      Problem was that wrong key_info variable was used, which caused UNIQUE
      key to be used as a covering key
      38f390f5
    • Monty's avatar
      MDEV-19252 Problem with DBUG_ASSERT_AS_PRINTF and marked_for_write() · c07e346c
      Monty authored
      Problem was that DBUG_FIX_WRITE_SET was not enabled when using
      DBUG_ASSERT_AS_PRINTF
      c07e346c
    • Monty's avatar
      Fixed compiler warnings form gcc 7.3.1 · a0246490
      Monty authored
      a0246490
    • Marko Mäkelä's avatar
      Remove IBUF_COUNT_DEBUG · d315b4ff
      Marko Mäkelä authored
      The compile-time option IBUF_COUNT_DEBUG has not been used for years.
      It would only work with up to 3 created .ibd files, with no buffered
      changes existing while InnoDB is started up.
      d315b4ff
    • Alexander Barkov's avatar
  7. 18 Apr, 2019 1 commit
    • Sergei Petrunia's avatar
      MDEV-17297: stats.records=0 for a table of Archive engine when it has rows,... · 056b6fe1
      Sergei Petrunia authored
      MDEV-17297: stats.records=0 for a table of Archive engine when it has rows, when we run ANALYZE command
      
      Archive storage engine assumed that any query that attempts to read from
      the table will call ha_archive::info() beforehand. ha_archive would flush
      un-written data in that call (this would make it visible for the reads).
      
      Break this assumption. Flush the data when the table is opened for reading.
      
      This way, one can do multiple write statements without causing a flush, but
      as soon as we might need the data, we flush it.
      056b6fe1