1. 08 Oct, 2015 1 commit
  2. 06 Oct, 2015 3 commits
    • Sergei Petrunia's avatar
      MDEV-8903: Buildbot valgrind failure: Invalid read of size 1 in sql_memdup... · 4a602046
      Sergei Petrunia authored
      When we calculate max_key_len for RANGE_OPT_PARAM::min_key/max_key, take
      into account that QUICK_RANGE::QUICK_RANGE for some reason assumes
      that there is one more byte there:
      
            max_key((uchar*) sql_memdup(max_key_arg,max_length_arg+1)),
      4a602046
    • Sergei Petrunia's avatar
      Fix for MDEV-8321, MDEV-6223 · 12897947
      Sergei Petrunia authored
      EXPLAIN INSERT ... SELECT tried to use SELECT's execution path. This
      caused a collection of problems:
      - SELECT_DESCRIBE flag was not put into select_lex->options, which
        means it was not in JOIN::select_options either (except for the first
        member of the UNION).
      - This caused UNION members to be executed. They would attempt to write
        join output rows to the output.
      - (Actual cause of the crash) second join sibling would call
        result->send_eof() when finished execution. Then,
        Explain_query::print_explain would attempt to write to query output
        again, and cause an assertion due to non-empty query output.
      12897947
    • Sergei Petrunia's avatar
      MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT · a7dd24cd
      Sergei Petrunia authored
      [EXPLAIN] INSERT .. SELECT creates a select_insert object.
      select_insert calls handler->start_bulk_insert() during
      initialization.
      
      For MyISAM/Aria this requires that a matching call to
      handler->end_bulk_insert() call is made.
      
      Regular INSERT .. SELECT accomplishes this by calling either
      select_result->send_eof() or select_result->abort_result_set().
      
      EXPLAIN INSERT ... SELECT didn't call either, which resulted in
      improper de-initializaiton of handler object. Make it call
      abort_result_set(), which invokes handler->end_bulk_insert().
      a7dd24cd
  3. 01 Oct, 2015 2 commits
    • Sergey Vojtovich's avatar
      MDEV-8379 - SUSE mariadb patches · bb22eb55
      Sergey Vojtovich authored
      Corrected variable name in dead code for consistency.
      
      Patch contributed by Michal Hrusecky.
      bb22eb55
    • Sergey Vojtovich's avatar
      MDEV-8379 - SUSE mariadb patches · 727da9c8
      Sergey Vojtovich authored
      Fixed unclean prototype declaration. According to ISO/IEC 9899:TC2:
      ...
      10. The special case of an unnamed parameter of type void as the only item in
          the list specifies that the function has no parameters.
      ...
      14. An identifier list declares only the identifiers of the parameters of the
          function. An empty list in a function declarator that is part of a
          definition of that function specifies that the function has no parameters.
          The empty list in a function declarator that is not part of a definition of
          that function specifies that no information about the number or types of the
          parameters is supplied. 124)
      ...
      6.11.6 Function declarators
      
      The use of function declarators with empty parentheses (not prototype-format
      parameter type declarators) is an obsolescent feature.
      ...
      
      Patch contributed by Michal Hrusecky.
      727da9c8
  4. 22 Sep, 2015 2 commits
  5. 21 Sep, 2015 1 commit
  6. 14 Sep, 2015 1 commit
  7. 11 Sep, 2015 4 commits
  8. 06 Sep, 2015 1 commit
  9. 04 Sep, 2015 1 commit
  10. 03 Sep, 2015 1 commit
  11. 02 Sep, 2015 3 commits
    • Kristian Nielsen's avatar
      Merge MDEV-8725 into 10.0 · 83c7b1e9
      Kristian Nielsen authored
      83c7b1e9
    • Kristian Nielsen's avatar
      Fix a potential lost wakeup for binlog_commit_wait_usec · 09bfaf3a
      Kristian Nielsen authored
      If a transaction T1 needs to wait for a transaction T2, T2's commit will
      skip the normal binlog_commit_wait_usec delay, in order not to needlessly
      stall throughput.
      
      This works by checking if T2 is already ready to commit. If so, it is woken
      up. If not, we set a flag in T2 so that when it gets ready to commit, it
      will do so immediately.
      
      But there was a potential race due to insufficient locking, if T2 gets ready
      to commit just at the point where T1 does the check. If the race hits, the
      wakeup (and early commit) of T2 might be lost.
      
      The race is only theoretical (from code inspection, no known test case), but
      seems best to fix it anyway, by properly locking LOCK_prepare_ordered around
      the check.
      09bfaf3a
    • Kristian Nielsen's avatar
      MDEV-8725: Assertion `!(thd->rgi_slave && thd->... · 999c43ae
      Kristian Nielsen authored
      MDEV-8725: Assertion `!(thd->rgi_slave && thd-> rgi_slave->did_mark_start_commit)' failed in ha_rollback_trans
      
      The assertion is there to catch cases where we rollback while
      mark_start_commit() is active. This can allow following event groups
      to be replicated too early, causing conflicts.
      
      But in this case, we have an _explicit_ ROLLBACK event in the binlog,
      which should not assert.
      
      We fix this by delaying the mark_start_commit() in the explicit
      ROLLBACK case. It seems safest to delay this in ROLLBACK case anyway,
      and there should be no reason to try to optimise this corner case.
      999c43ae
  12. 31 Aug, 2015 1 commit
  13. 23 Aug, 2015 2 commits
  14. 18 Aug, 2015 1 commit
    • Sergei Petrunia's avatar
      MDEV-8289: Semijoin inflates number of rows in query result · 9b475ee3
      Sergei Petrunia authored
      - Make semi-join optimizer not to choose LooseScan
        when 1) the index is not covered and 2) full index
        scan will be required.
      
      - Make sure that the code in make_join_select() that may change
        full index scan into a range scan is not invoked when the table
        uses full scan.
      9b475ee3
  15. 12 Aug, 2015 2 commits
    • Monty's avatar
      Fixed mysqltest run failure: · 1bfe4da1
      Monty authored
      Test did not clean up after itself properly
      1bfe4da1
    • Monty's avatar
      Fixed overrun in key cache if one tried to allocate a key cache · afa9cb75
      Monty authored
      of more than 45G with a key_cache_block_size of 1024 or less.
      
      The problem was that some of the arguments to my_multi_malloc() got to be
      more than 4G.
      
      Fix:
      - Inntroduced my_multi_malloc_large() that can handle big regions.
      - Changed MyISAM and Aria key caches to use my_multi_malloc_large().
      
      I didn't change the default my_multi_malloc() as this would be a too big
      patch and we don't allocate 4G blocks anywhere else.
      afa9cb75
  16. 05 Aug, 2015 3 commits
  17. 04 Aug, 2015 8 commits
    • Sergei Golubchik's avatar
      Merge branch 'bb-10.0-jan' into 10.0 · 1610c428
      Sergei Golubchik authored
      5.5 with our InnoDB changes
      1610c428
    • Sergei Golubchik's avatar
      correct the NULL-pointer test · fa51f70d
      Sergei Golubchik authored
      fa51f70d
    • Sergei Golubchik's avatar
      after-merge fixes · 006ffca5
      Sergei Golubchik authored
      006ffca5
    • Kristian Nielsen's avatar
      Merge fix of embedded server build. · d6d54584
      Kristian Nielsen authored
      d6d54584
    • Kristian Nielsen's avatar
      Fix embedded server build · 5ca061e6
      Kristian Nielsen authored
      5ca061e6
    • Kristian Nielsen's avatar
      Merge MDEV-8302 into 10.0 · e8e2ef47
      Kristian Nielsen authored
      e8e2ef47
    • Kristian Nielsen's avatar
      MDEV-8302: Duplicate key with parallel replication · 9b9c5e89
      Kristian Nielsen authored
      This bug is essentially another variant of MDEV-7458.
      
      If a transaction conflict caused a deadlock kill of T2 in record_gtid()
      during commit, the code would do a rollback _before_ running
      rgi->unmark_start_commit(). This creates a race where following transactions
      could start too early (before T2 has completed its transaction retry). This
      in turn could lead to replication failure, if there was a conflict that
      caused eg. duplicate key error or similar.
      
      The fix is to remove these rollbacks (in Query_log_event::do_apply_event()
      and Xid_log_event::do_apply_event(). They seem out-of-place; code in
      log_event.cc generally does not roll back on error, this is handled higher
      up.
      
      In addition, because of the extreme difficulty of reproducing bugs like
      MDEV-7458 and MDEV-8302, this patch adds some extra precations to try to
      detect (in debug builds) or prevent (in release builds) similar bugs.
      ha_rollback_trans() will now call unmark_start_commit() if needed (and
      assert in debug build when a caller does rollback without unmark first).
      
      We also add an extra check for thd->killed() so that we avoid doing
      mark_start_commit() if we already have a pending deadlock kill.
      
      And we add a missing unmark_start_commit() call in the error case, found by
      the above assertion.
      9b9c5e89
    • Jan Lindström's avatar
      Fix merge error. · d71b5840
      Jan Lindström authored
      d71b5840
  18. 03 Aug, 2015 3 commits
    • Jan Lindström's avatar
      Merge commit '96badb16' into 10.0 · 9a5787db
      Jan Lindström authored
      Conflicts:
      	client/mysql_upgrade.c
      	mysql-test/r/func_misc.result
      	mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
      	mysql-test/suite/innodb/r/innodb-fk.result
      	mysql-test/t/subselect_sj_mat.test
      	sql/item.cc
      	sql/item_func.cc
      	sql/log.cc
      	sql/log_event.cc
      	sql/rpl_utility.cc
      	sql/slave.cc
      	sql/sql_class.cc
      	sql/sql_class.h
      	sql/sql_select.cc
      	storage/innobase/dict/dict0crea.c
      	storage/innobase/dict/dict0dict.c
      	storage/innobase/handler/ha_innodb.cc
      	storage/xtradb/dict/dict0crea.c
      	storage/xtradb/dict/dict0dict.c
      	storage/xtradb/handler/ha_innodb.cc
      	vio/viosslfactories.c
      9a5787db
    • Sergei Petrunia's avatar
      MDEV-7040: Crash in field_conv, memcpy_field_possible, part#2 · b74795b0
      Sergei Petrunia authored
      The problem was with Materialized_cursor and temporary table it uses.
      Temorary table's fields had Field::orig_table pointing to the tables
      that were used in the query that produced data for the cursor.
      When "FETCH INTO sp_var" statement is executed, those original tables
      were already closed.  However, copying from Materialized_cursor's table
      into SP variable may cause field_conv() to be invoked which calls
      field->type() which may access field->orig_table (for certain field types).
      
      Fixed by setting Materialized_cursor->table->field[i]->orig_table to point
      to Materialized_cursor->table.  (this is how it is done for regular base
      tables)
      b74795b0
    • Sergei Petrunia's avatar
      Merge branch 'tmp' into 10.0 · cb925491
      Sergei Petrunia authored
      cb925491