1. 05 May, 2019 2 commits
  2. 03 May, 2019 2 commits
  3. 02 May, 2019 3 commits
    • Monty's avatar
      Fixed deadlock in main.flush_read_lock · 18663539
      Monty authored
      local_global_read_lock did release all HANDLER's before taking its
      MDL_BACKUP_FTWRL# locks. This had a potential race condition if
      there was a waiting LOCK TABLE for one of the freed handlers.
      
      Fixed by moving the release of HANDLER's to after the backup locks are
      taken.
      
      After commit 8cf7e345 it's not anymore critical to free HANDLER's in
      FTWRL, but we will keep the mysql_ha_cleanup_no_free() call until 10.5
      to not cause any issues with 10.4 just before it's going GA.
      18663539
    • Monty's avatar
      Enable mysqlcheck and flush_read_lock tests · 0cc7c608
      Monty authored
      - Updated results
      - Run mysqlcheck without --user-stat-tables=PREFERABLY to keep results
        consistent
      - Don't allow one to run analyze table under FTWRL as analyze table
        nowadays has to update status tables.
      0cc7c608
    • Igor Babaev's avatar
      MDEV-19363 Assertion `select_lex' failed in LEX::pop_select · 2b7e080f
      Igor Babaev authored
      This patch corrects the patch for MDEV-19324. The latter did not
      work properly in the cases when the transformation
        (SELECT ... ORDER BY ...) LIMIT ... =>
         SELECT ... ORDER BY ... LIMIT ...
      was applied to the operands of a set operation.
      2b7e080f
  4. 01 May, 2019 1 commit
  5. 30 Apr, 2019 1 commit
  6. 29 Apr, 2019 7 commits
  7. 27 Apr, 2019 3 commits
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 4d59f452
      Marko Mäkelä authored
      4d59f452
    • Marko Mäkelä's avatar
      Adjust perfschema.privilege_table_io result · 81f6a3b0
      Marko Mäkelä authored
      This is fixup for the merge commit e6bdf77e
      
      FIXME: Find out why the results differ between release and debug builds.
      81f6a3b0
    • Igor Babaev's avatar
      MDEV-19324 Wrong results from query, using brackets with ORDER BY ..LIMIT · 5dee4a99
      Igor Babaev authored
      If a select query was of the form (SELECT ... ORDER BY ...) LIMIT ...
      then in most cases it returned incorrect result. It happened because
      SELECT ... ORDER BY ... was wrapped into a select with materialized
      derived table:
        SELECT ... ORDER BY ... =>
        SELECT * FROM (SELECT ... ORDER BY ...) dt.
      Yet for any materialized derived table ORDER BY without LIMIT is ignored.
      This patch resolves the problem by the conversion
        (SELECT ... ORDER BY ...) LIMIT ... =>
        SELECT ... ORDER BY ... LIMIT ...
      at the parser stage.
      
      Similarly
        ((SELECT ... UNION ...) ORDER BY ...) LIMIT ...
      is converted to
        (SELECT ... UNION ...) ORDER BY ... LIMIT ...
      This conversion optimizes execution of the query because the result of
      (SELECT ... UNION ...) ORDER BY ... is not materialized into a temporary
      table anymore.
      5dee4a99
  8. 26 Apr, 2019 11 commits
    • Alexander Barkov's avatar
      Tests for MDEV-15881 Assertion `is_valid_value_slow()' failed in... · 00377147
      Alexander Barkov authored
      Tests for MDEV-15881 Assertion `is_valid_value_slow()' failed in Datetime::Datetime or corrupt data after ALTER with indexed persistent column
      
      The patch for "MDEV-18486 Database crash on a table with indexed virtual column"
      fixed MDEV-15881 as well. So adding tests only.
      00377147
    • Marko Mäkelä's avatar
      1a5ba2a4
    • Marko Mäkelä's avatar
      Remove roll_node_t::partial · 4e9f8c9c
      Marko Mäkelä authored
      The field roll_node_t::partial holds if and only if
      savept has been set. Make savept a pointer.
      
      trx_rollback_start(): Use the semantic type undo_no_t for roll_limit.
      4e9f8c9c
    • Aditya A's avatar
      Bug #29021730 CRASHING INNOBASE_COL_CHECK_FK WITH FOREIGN KEYS · f3a9f12b
      Aditya A authored
      PROBLEM
      -------
      Function innodb_base_col_setup_for_stored() was skipping to store
      the base column information for a generated column if the base column
      was a "STORED" generated column. This later causes a crash in function
      innoabse_col_check_fk() where it says that a generated columns depends
      upon two base columns ,but there is information on only one of them.
      There was a explicit check barring the stored columns being stored,
      which is wrong because the documentation says that a generated stored
      column can be a part of a generated column.
      
      FIX
      ----
      Store the information of base column if it is a stored generated column.
      
      #RB21247
      Reviewed by: Debarun Banerjee <debarun.banerjee@oracle.com>
      f3a9f12b
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      MDEV-12004: Add the Bug#28825718 test case · c795a9f3
      Marko Mäkelä authored
      Adapt the test case from
      mysql/mysql-server@2bbbcddd903626c84c610dd2ed82cc22ee4d6cde
      (MySQL 5.7.26).
      c795a9f3
    • Sachin Agarwal's avatar
      Bug #27850600 INNODB ASYNC IO ERROR HANDLING IN IO_EVENT · 06ec56f5
      Sachin Agarwal authored
      Problem:
      io_getevents() - read asynchronous I/O events from the completion
      queue. For each IO event, the res field in io_event tells whether IO
      event is succeeded or not. To see if the IO actually succeeded we
      always need to check event.res (negative=error,
      positive=bytesread/written).
      LinuxAIOHandler::collect() doesn't check event.res value for each event.
      which leads to incorrect value in n_bytes for IO context (or IO Slot).
      
      Fix:
      Added a check for event.res negative value.
      
      RB: 20871
      Reviewed by : annamalai.gurusami@oracle.com
      06ec56f5
    • Marko Mäkelä's avatar
      innobase_col_check_fk(): Remove copying · 1c4d1f3d
      Marko Mäkelä authored
      1c4d1f3d
    • Alexander Barkov's avatar
      MDEV-16518 MYSQL57_GENERATED_FIELD: The code in... · 5cfc7799
      Alexander Barkov authored
      MDEV-16518 MYSQL57_GENERATED_FIELD: The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
      5cfc7799
    • Varun Gupta's avatar
    • Sujatha Sivakumar's avatar
      MDEV-17260: Memory leaks in mysqlbinlog · 9a5a86f2
      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
      
      Analysis:
      =========
      Two types of leaks were observed during above execution.
      
      1) Leak in Log_event::read_log_event(char const*, unsigned int, char const**,
         Format_description_log_event const*, char)
         File: sql/log_event.cc:2150
      
      For all row based replication events the memory which is allocated during
      read_log_event is not freed after the event is processed. The event specific
      memory has to be retained only when flashback option is enabled with
      mysqlbinlog tool. In this case all the events are retained till the end
      statement is received and they are processed in reverse order and they are
      destroyed. But in the existing code all events are retained irrespective of
      flashback mode. Hence the memory leaks are observed.
      
      2) read_remote_annotate_event(unsigned char*, unsigned long, char const**)
         File: client/mysqlbinlog.cc:194
      
      In general the Annotate event is not printed immediately because all
      subsequent rbr-events can be filtered away. Instead it will be printed
      together with the first not filtered away Table map or the last rbr will be
      processed. While reading remote annotate events memory is allocated for event
      buffer and event's temp_buf is made to point to the allocated buffer as shown
      below.  The TRUE flag is used for doing proper cleanup using free_temp_buf().
      i.e at the time of deletion of annotate event its destructor takes care of
      clearing the temp_buf.
      
      /*
        Ensure the event->temp_buf is pointing to the allocated buffer.
        (TRUE = free temp_buf on the event deletion)
      */
       event->register_temp_buf((char*)event_buf, TRUE);
      
      But existing code does the following when it receives a remote annotate_event.
      
      if (remote_opt)
        ev->temp_buf= 0;
      
      That is code immediately sets temp_buf=0, because of which free_temp_buf()
      call will return empty handed as it has lost the reference to the allocated
      temporary buffer. This results in memory leak
      
      Fix:
      ====
      1) If not in flashback mode, destroy the memory for events once they are
      processed.
      
      2) Remove the ev->temp_buf=0 code for remote option. Let the proper cleanup to
      be done as part of free_temp_buf().
      9a5a86f2
  9. 25 Apr, 2019 10 commits
    • Varun Gupta's avatar
      Results updated for tokudb tests · 87472974
      Varun Gupta authored
      87472974
    • Oleksandr Byelkin's avatar
      MDEV-16240: Assertion `0' failed in row_sel_convert_mysql_key_to_innobase · 4e01bc8c
      Oleksandr Byelkin authored
      Set table in row ID position mode before using this function.
      4e01bc8c
    • Kentoku SHIBA's avatar
    • Oleksandr Byelkin's avatar
      MDEV-17036: BULK with replace doesn't take the first parameter in account · 3dffdee6
      Oleksandr Byelkin authored
      INSERT and REPLACE served by the same function, so flags (and processing) should be the same.
      3dffdee6
    • Kentoku SHIBA's avatar
      MDEV-18995 Some bugs in direct join (#1285) · 82d06989
      Kentoku SHIBA authored
      Add const_table support to the direct join feature and condition pushdown feature
      82d06989
    • Marko Mäkelä's avatar
      Implement --debug=d,ib_log_checkpoint_avoid · b2dbc781
      Marko Mäkelä authored
      Normally, the InnoDB master thread executes InnoDB log checkpoints
      so frequently that bugs in crash recovery or redo logging can be
      hard to reproduce. This is because crash recovery would start replaying
      the log only from the latest checkpoint. Because the InnoDB redo log
      format only allows saving information for at most 2 latest checkpoints,
      and because the log files are written in a circular fashion, it would
      be challenging to implement a debug option that would start the redo
      log apply from the very start of the redo log file.
      b2dbc781
    • Eugene Kosov's avatar
      MDEV-19231 make DB_SUCCESS equal to 0 · 6c5c1f0b
      Eugene Kosov authored
      It's a micro optimization. On most platforms CPUs has instructions to
      compare with 0 fast. DB_SUCCESS is the most popular outcome of functions
      and this patch optimized code like (err == DB_SUCCESS)
      
      BtrBulk::finish(): bogus assertion fixed
      
      fil_node_t::read_page0(): corrected usage of os_file_read()
      
      que_eval_sql(): bugus assertion removed. Apparently it checked that
      the field was assigned after having been zero-initialized at
      object creation.
      
      It turns out that the return type of os_file_read_func() was changed
      in mysql/mysql-server@98909cefbc37e54efc6452c7e95bccbf64ac9213 (MySQL 5.7)
      from ibool to dberr_t. The reviewer (if there was any) failed to
      point out that because of future merges, it could be a bad idea to
      change the return type of a function without changing the function name.
      
      This change was applied to MariaDB 10.2.2 in
      commit 2e814d47 but the
      MariaDB-specific code was not fully adjusted accordingly,
      e.g. in fil_node_open_file(). Essentially, code like
      !os_file_read(...) became dead code in MariaDB and later
      in Mariabackup 10.2, and we could be dealing with an uninitialized
      buffer after a failed page read.
      6c5c1f0b
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · e6bdf77e
      Marko Mäkelä authored
      In is_eits_usable(), we disable an assertion that fails due to
      MDEV-19334.
      e6bdf77e
    • Sergey Vojtovich's avatar
      trans_xa_detach() framework · 1599825f
      Sergey Vojtovich authored
      Part of MDEV-7974 - backport fix for mysql bug#12161 (XA and binlog)
      1599825f
    • Sergey Vojtovich's avatar
      Move XID_STATE::xid to XID_cache_element · 210855ce
      Sergey Vojtovich authored
      Part of MDEV-7974 - backport fix for mysql bug#12161 (XA and binlog)
      210855ce