1. 25 Jun, 2019 4 commits
  2. 20 Jun, 2019 1 commit
  3. 19 Jun, 2019 2 commits
  4. 17 Jun, 2019 1 commit
    • Igor Babaev's avatar
      MDEV-19790 Wrong result for query with outer join and IS NOT TRUE predicate · 167da05f
      Igor Babaev authored
                 in where clause
      
      The classes Item_func_isnottrue and Item_func_isnotfalse inherited the
      implementation of the eval_not_null_tables method from the Item_func
      class. As a result the not_null_tables_cache was set incorrectly for
      the objects of these classes. It led to improper conversion of outer
      joins to inner joins when the where clause of the processed query
      contained IS NOT TRUE or IS NOT FALSE predicates. The coverted query
      in many cases produced a wrong result set.
      167da05f
  5. 14 Jun, 2019 1 commit
  6. 12 Jun, 2019 7 commits
    • Oleksandr Byelkin's avatar
      Merge branch '5.5' into 10.1 · 5b65d61d
      Oleksandr Byelkin authored
      5b65d61d
    • Eugene Kosov's avatar
      MDEV-13631 Make use of clang-format · 039b8782
      Eugene Kosov authored
      Explicitly mention every options in .clang-format to protect us from possible
      future changes.
      
      Remove separate InnoDB style.
      
      Change style to look more like this script:
      for x in $@
      do
       indent -kr -bl -bli0 -l79 -i2 -nut -c48 -dj -cp0 $x
       sed -ri -e 's/ = /= /g'\
               -e '/switch.*\)$/{N;s/\n[ ]+/ /}' $x
      done
      
      Significant different is that 'switch' and '{' are put on different lines
      because it's impossible in clang-format to set formatting rules just for
      'switch' statement.
      039b8782
    • Marko Mäkelä's avatar
      MDEV-16111 encryption.innodb_lotoftables failed in buildbot with wrong result · 56c60b2f
      Marko Mäkelä authored
      Remove the test, because it easily fails with a result difference.
      Analysis by Thirunarayanan Balathandayuthapani:
      
      By default, innodb_encrypt_tables=0.
      1) Test case creates 100 tables in innodb_encrypt_1.
      2) creates another 100 unencrypted tables (encryption=off) in innodb_encrypt_2
      3) creates another 100 encrypted tables (encryption=on) in innodb_encrypt_3
      4) enabling innodb_encrypt_tables=1 and checking that only
      100 encrypted tables exist. (already we have 100 in dictionary)
      5) opening all tables again (no idea why)
      6) After that, set innodb_encrypt_tables=0 and wait for 100 tables
      to be decrypted (already we have 100 unencrypted tables)
      7) dropping all databases
      
      Sporadic failure happens because after step 4, it could encrypt the
      normal table too, because innodb_encryption_threads=4.
      
      This test was added in MDEV-9931, which was about InnoDB startup being
      slow due to all .ibd files being opened. There have been a number of
      later fixes to this problem. Currently the latest one is
      commit cad56fba, in which some tests
      (in particular the test innodb.alter_kill) could fail if all InnoDB
      .ibd files are read during startup. That could make this test redundant.
      
      Let us remove the test, because it is big, slow, unreliable, and
      does not seem to reliably catch the problem that all files are being
      read on InnoDB startup.
      56c60b2f
    • sjaakola's avatar
      MDEV-19563 Removed references to deprecated option innodb_locks_unsafe_for_binlog · efc3cb93
      sjaakola authored
      innodb_locks_unsafe_for_binlog variabe removed from wsrep_info test configuration and
      recommendation to use this variable in README-wsrep was removed as well
      
      Also relates to issue: MDEV-19544
      efc3cb93
    • Sergey Vojtovich's avatar
      MDEV-16467 - MariaDB crashes because of "long semaphore wait"after migrating from 10.1 to 10.3 · 9d886de4
      Sergey Vojtovich authored
      This patch fixes 10.2 issue reported in MDEV-16467 by partial backport of
      c2118a08. Specifically "Remove not needed LOCK_thread_count from
      thd_get_error_context_description()".
      9d886de4
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-16866 InnoDB fails to start upon crash recovery with "[ERROR] InnoDB:... · b2f76bac
      Thirunarayanan Balathandayuthapani authored
      MDEV-16866 InnoDB fails to start upon crash recovery with "[ERROR] InnoDB: Redo log crypto: failed to decrypt log block"
      
      - Post-push fix to change the copyright of both xtradb and innodb file.
      b2f76bac
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-16866 InnoDB fails to start upon crash recovery with "[ERROR] InnoDB:... · c5fe1b8f
      Thirunarayanan Balathandayuthapani authored
      MDEV-16866 InnoDB fails to start upon crash recovery with "[ERROR] InnoDB: Redo log crypto: failed to decrypt log block"
      
      - If InnoDB encounters garbage or incomplete written log block during
      recovery then don't throw the error. Treat it as end of the log.
      - This kind of incomplete or empty block can be result of killing
      InnoDB when writing the redo log.
      c5fe1b8f
  7. 11 Jun, 2019 2 commits
  8. 09 Jun, 2019 1 commit
    • Igor Babaev's avatar
      MDEV-19580 Unrelated JOINs corrupt usage of 'WHERE function() IN (subquery)' · 6db2ebbb
      Igor Babaev authored
      Handling of top level conjuncts in WHERE whose used_tables() contained
      RAND_TABLE_BIT in the function make_join_select() was incorrect.
      As a result if such a conjunct referred to fields non of which belonged
      to the last joined table  it was pushed twice. (This could be seen
      for a test case from subselect.test whose output was changed after this
      patch had been applied. In 10.1 when running EXPLAIN FORMAT=JSON for
      the query from this test case we clearly see that one of the conjuncts
      is pushed twice.) This fact by itself was not good. Besides, if such a
      conjunct was pushed to a table that was the result of materialization
      of a semi-join the query could return a wrong result set. In particular
      we could watch it for queries with semi-join subqueries whose left parts
      used stored functions without "deterministic' specifier.
      6db2ebbb
  9. 07 Jun, 2019 1 commit
  10. 05 Jun, 2019 1 commit
  11. 03 Jun, 2019 1 commit
  12. 01 Jun, 2019 2 commits
    • Sergei Golubchik's avatar
      MDEV-19491 update query stopped working after mariadb upgrade 10.2.23 -> 10.2.24 · 6660c072
      Sergei Golubchik authored
      as well as
      
      MDEV-19500 Update with join stopped worked if there is a call to a procedure in a trigger
      MDEV-19521 Update Table Fails with Trigger and Stored Function
      MDEV-19497 Replication stops because table not found
      MDEV-19527 UPDATE + JOIN + TRIGGERS = table doesn't exists error
      
      Reimplement the fix for (5d510fdb)
      
      MDEV-18507 can't update temporary table when joined with table with triggers on read-only
      
      instead of calling open_tables() twice, put multi-update
      prepare code inside open_tables() loop.
      
      Add a test for a MDL backoff-and-retry loop inside open_tables()
      across multi-update prepare code.
      6660c072
    • Sergei Golubchik's avatar
      cleanup · 1d4ac3d4
      Sergei Golubchik authored
      1d4ac3d4
  13. 31 May, 2019 1 commit
  14. 30 May, 2019 3 commits
    • Eugene Kosov's avatar
      MDEV-13631 Make use of clang-format · 5de08a53
      Eugene Kosov authored
      Add .clang-format files to a root directory and to storage/innobase
      5de08a53
    • Sergey Vojtovich's avatar
      MDEV-15734 - calculation inside sizeof() warning · dd939d6f
      Sergey Vojtovich authored
      Reverted incorrect change introduced by 548d03d7.
      
      As result is char**, third qsort() parameter must be sizeof(char*).
      Not sizeof(result[0] + 2), which is same as sizeof(result[0]).
      Not even sizeof(result[0]) + 2, which would cause invalid memory access.
      
      Proper sorting is responsibility of logfilenamecompare() callback.
      dd939d6f
    • Sujatha's avatar
      MDEV-18913: typo in error log · 78c1be8b
      Sujatha authored
      Problem:
      ========
      Following typo in error log:
      
      2019-03-13 15:58:10 0 [Note] Reading of all Master_info entries succeded
      
      Should be 'succeeded'
      
      Fix:
      ===
      Fixed the typo with the right word 'succeeded'.
      78c1be8b
  15. 29 May, 2019 3 commits
    • Sujatha's avatar
      MDEV-11094: Blackhole table updates on slave fail when row annotation is enabled · a47464d1
      Sujatha authored
      Post push fix.
      
      Simplified the earlier fixes.
      a47464d1
    • Sujatha's avatar
      MDEV-11094: Blackhole table updates on slave fail when row annotation is enabled · b3473961
      Sujatha authored
      Problem:
      =======
      rpl_blackhole.test fails when executed with following options
      mysqld=--binlog_annotate_row_events=1, mysqld=--replicate_annotate_row_events=1
      
      Test output:
      ------------
      worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      rpl.rpl_blackhole_bug 'mix'              [ pass ]    791
      rpl.rpl_blackhole_bug 'row'              [ fail ]
      Replicate_Wild_Ignore_Table
      Last_Errno	1032
      Last_Error	Could not execute Update_rows_v1 event on table test.t1; Can't find
      record in 't1', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's
      master log master-bin.000001, end_log_pos 1510
      
      Analysis:
      =========
      Enabling "replicate_annotate_row_events" on slave, Tells the slave to write
      annotate rows events received from the master to its own binary log. The
      received annotate events are applied after the Gtid event as shown below.
      thd->query() will be set to the actual query received from the master, through
      annotate event. Annotate_rows event should not be deleted after the event is
      applied as the thd->query will be used to generate new Annotate_rows event
      during applying the subsequent Rows events. After the last Rows event has been
      applied, the saved Annotate_rows event (if any) will be deleted.
      
      In balckhole engine all the DML operations are noops as they donot store any
      data. They simply return success without doing any operation. But the existing
      strictly expects thd->query() to be 'NULL' to identify that row based
      replication is in use. This assumption will fail when row annotations are
      enabled as the query is not 'NULL'. Hence various row based operations like
      'update', 'delete', 'index lookup' will fail when row annotations are enabled.
      
      Fix:
      ===
      Extend the row based replication check to include row annotations as well.
      i.e Either the thd->query() is NULL or thd->query() points to query and row
      annotations are in use.
      b3473961
    • Igor Babaev's avatar
      MDEV-18479 Complement · cbb90f77
      Igor Babaev authored
      This patch complements the patch that fixes bug MDEV-18479.
      This patch takes care of possible overflow when calculating the
      estimated number of rows in a materialized derived table / view.
      cbb90f77
  16. 28 May, 2019 7 commits
    • Igor Babaev's avatar
      MDEV-19588 Wrong results from query, using left join. · eb09580b
      Igor Babaev authored
      This bug could happen when queries with nested outer joins were
      executed employing join buffers. At such an execution if the method
      JOIN_CACHE::join_records() is called when a join buffer has become
      full no 'first_unmatched' field should be cleaned up in the JOIN_TAB
      structure to which the join cache with this buffer is attached.
      eb09580b
    • Marko Mäkelä's avatar
      MDEV-19614: Fix innodb_plugin on Windows · 8358c6f0
      Marko Mäkelä authored
      LOCK_global_system_variables: Declare with MYSQL_PLUGIN_IMPORT
      8358c6f0
    • Marko Mäkelä's avatar
      Merge 5.5 into 10.1 · bf8fe324
      Marko Mäkelä authored
      bf8fe324
    • Marko Mäkelä's avatar
      MDEV-19614 SET GLOBAL innodb_ deadlock due to LOCK_global_system_variables · 626f2a1c
      Marko Mäkelä authored
      The update callback functions for several settable global InnoDB variables
      are acquiring InnoDB latches while holding LOCK_global_system_variables.
      
      On the other hand, some InnoDB code is invoking THDVAR() while holding
      InnoDB latches. An example of this is thd_lock_wait_timeout() that is
      called by lock_rec_enqueue_waiting(). In some cases, the
      intern_sys_var_ptr() that is invoked by THDVAR() may acquire
      LOCK_global_system_variables, via sync_dynamic_session_variables().
      
      In lock_rec_enqueue_waiting(), we really must be holding some InnoDB
      latch while invoking THDVAR(). This implies that
      LOCK_global_system_variables must conceptually reside below any InnoDB
      latch in the latching order. That in turns implies that the various
      update callback functions must release LOCK_global_system_variables
      before acquiring any InnoDB mutexes or rw-locks, and reacquire
      LOCK_global_system_variables later. The validate functions are being
      invoked while not holding LOCK_global_system_variables and thus they
      do not need any changes.
      
      The following statements are affected by this:
      
      SET GLOBAL innodb_adaptive_hash_index = …;
      SET GLOBAL innodb_cmp_per_index_enabled = 1;
      SET GLOBAL innodb_old_blocks_pct = …;
      SET GLOBAL innodb_fil_make_page_dirty_debug = …; -- debug builds only
      SET GLOBAL innodb_buffer_pool_evict = uncompressed; -- debug builds only
      SET GLOBAL innodb_purge_run_now = 1; -- debug builds only
      SET GLOBAL innodb_purge_stop_now = 1; -- debug builds only
      SET GLOBAL innodb_log_checkpoint_now = 1; -- debug builds only
      SET GLOBAL innodb_buf_flush_list_now = 1; -- debug builds only
      SET GLOBAL innodb_buffer_pool_dump_now = 1;
      SET GLOBAL innodb_buffer_pool_load_now = 1;
      SET GLOBAL innodb_buffer_pool_load_abort = 1;
      SET GLOBAL innodb_status_output = …;
      SET GLOBAL innodb_status_output_locks = …;
      SET GLOBAL innodb_encryption_threads = …;
      SET GLOBAL innodb_encryption_rotate_key_age = …;
      SET GLOBAL innodb_encryption_rotation_iops = …;
      SET GLOBAL innodb_encrypt_tables = …;
      SET GLOBAL innodb_disallow_writes = …;
      
      buf_LRU_old_ratio_update(): Correct the return type.
      626f2a1c
    • Marko Mäkelä's avatar
      MDEV-6812: Remove the wrapper my_log2f() · 242a28c3
      Marko Mäkelä authored
      242a28c3
    • Marko Mäkelä's avatar
      Mention the sample IPv4 address 10.0.0.1 · 661289f4
      Marko Mäkelä authored
      661289f4
    • Igor Babaev's avatar
      MDEV-18479 Assertion `join->best_read < double(1.79769313486231570815e+308L)' · 0955462d
      Igor Babaev authored
      or server crashes in JOIN::fix_all_splittings_in_plan after EXPLAIN
      
      This patch resolves the problem of overflowing when performing
      calculations to estimate the cost of an evaluated query execution plan.
      The overflowing in a non-debug build could cause different kind of
      problems uncluding crashes of the server.
      0955462d
  17. 24 May, 2019 2 commits
    • Andrei Elkin's avatar
      MDEV-17948 Assertion `thd_killed(thd) || !m_active_tranxs .. · aaf53ea0
      Andrei Elkin authored
      Simulation of a big-sized event in rpl.rpl_semi_sync_skip_repl did not clean
      up after itself so screw the last binlog event offset which could jump
      backwards.
      The test is refined to rotate a binlog file with simulation and use the next
      one for logics of the test incl master-slave synchonization.
      aaf53ea0
    • Igor Babaev's avatar
      MDEV-19258 RIGHT JOIN hangs in MariaDB · e57bb1f7
      Igor Babaev authored
      This patch corrects the patch for the bug 10006. The latter incorrectly
      calculates the attribute TABLE_LIST::dep_tables for inner tables
      of outer joins that are to be converted into inner joins.
      As a result after the patch some valid join orders were not evaluated
      and the optimizer could choose an execution plan that was far from
      being optimal.
      e57bb1f7