1. 25 Jul, 2019 4 commits
    • Oleksandr Byelkin's avatar
      Merge branch '5.5' into 10.1 · ae476868
      Oleksandr Byelkin authored
      ae476868
    • Sujatha's avatar
      MDEV-20091 DROP TEMPORARY table is logged despite no CREATE was logged · 8d0dabc5
      Sujatha authored
      Fixing post push test issues.
      
      Recorded the result files for following:
      rpl_stm_drop_create_temp_table.result
      rpl_mixed_drop_create_temp_table.result.
      8d0dabc5
    • Marko Mäkelä's avatar
      Replace ut_timer() with my_interval_timer() · f6ea0389
      Marko Mäkelä authored
      The function pointer ut_timer() was only used by the
      InnoDB defragmenting thread. Let InnoDB use a single monotonic
      high-precision timer, my_interval_timer() [in nanoseconds],
      occasionally wrapped by microsecond_interval_timer().
      
      srv_defragment_interval: Change from "timer" units to nanoseconds.
      
      This concludes the InnoDB time function cleanup that was
      motivated by MDEV-14154. Only ut_time_ms() will remain for now,
      wrapping my_interval_timer().
      f6ea0389
    • Sujatha's avatar
      MDEV-20091 DROP TEMPORARY table is logged despite no CREATE was logged · e32f29b7
      Sujatha authored
      MDEV-5589 commit set up a policy to skip DROP TEMPORARY TABLE binary logging
      in case the target table has not been "CREATEed" in binlog (no CREATE
      Query-log-event was logged into the binary log).
      
      It turns out that
      
      1. the rule did not cover non-existing table DROPped with IF-EXISTS clause.
         The logged-create knowledge for the non-existing one does not even need
         MDEV-5589 patch, and
      
      2. connection close disobeys it to trigger automatic DROP-IF-EXISTS
         binlogging.
      
      Either 1 or 2 or even both is/are also responsible for unexpected binlog
      records observed in MDEV-17863, actually rendering a referred
      @@global.read_only irrelevant as far as the described stored procedure
      definition *and* the ROW binlog-format are concerned.
      e32f29b7
  2. 24 Jul, 2019 15 commits
    • Marko Mäkelä's avatar
      0c7c6101
    • Marko Mäkelä's avatar
      MDEV-14154: Failing assertion: slot->last_run <= current_time in fts0opt.cc · c663a941
      Marko Mäkelä authored
      The FTS optimizer thread made a false assumption that time(NULL)
      is monotonic. The system clock can be adjusted to the past,
      for example if the hardware clock was drifting to the future,
      and it was adjusted by NTP.
      
      fts_slot_t::interval_time: Replace with the constant
      FTS_OPTIMIZE_INTERVAL_IN_SECS.
      
      fts_slot_t::last_run, fts_slot_t::completed: Clarify the
      documentation.
      
      fts_optimize_get_time_limit(): Remove a type cast, and
      add a FIXME comment about domain mismatch.
      
      fts_optimize_compact(), fts_optimize_words(): Limit the time
      also when the current time has been moved to the past.
      
      fts_optimize_table_bk(): Check for wrap-around.
      
      fts_optimize_how_many(): Check for wrap-around, and remove the
      failing assertions.
      
      fts_is_sync_needed(): Remove a redundant call to time(NULL).
      c663a941
    • Marko Mäkelä's avatar
      Reduce the amount of time(NULL) calls for lock processing · 9e5df967
      Marko Mäkelä authored
      lock_t::requested_time: Document what the field is used for.
      
      lock_t::wait_time: Document that the field is only used for
      diagnostics and may be garbage if the system time is being adjusted.
      
      srv_slot_t::suspend_time: Document that this is duplicating
      trx_lock_t::wait_started.
      
      lock_table_print(), lock_rec_print(): Declare in static scope.
      Add a parameter for the current time.
      
      lock_deadlock_check_and_resolve(), lock_deadlock_lock_print(),
      lock_deadlock_joining_trx_print():
      Add a parameter for the current time.
      9e5df967
    • Marko Mäkelä's avatar
      MDEV-14154: Document some time_t fields better · 2b5bc761
      Marko Mäkelä authored
      srv_slot_t::suspend_time, os_aio_slot_t::reservation_time,
      sync_cell_t::reservation_time: Explain what could happen
      if the system time has is being adjusted.
      
      fts_sync_t::start_time: Document that the field is mostly unused.
      2b5bc761
    • Marko Mäkelä's avatar
      Always initialize trx_t::start_time_micro · 10727b69
      Marko Mäkelä authored
      This affects the function has_higher_priority() for internal or
      recovered transactions.
      10727b69
    • Marko Mäkelä's avatar
      Remove ut_usectime(), ut_gettimeofday() · 10ee1b95
      Marko Mäkelä authored
      Replace ut_usectime() with my_interval_timer(),
      which is equivalent, but monotonically counting nanoseconds
      instead of counting the microseconds of real time.
      
      os_event_wait_time_low(): Use my_hrtime() instead of ut_usectime().
      
      FIXME: Set a clock attribute on the condition variable that allows
      a monotonic clock to be chosen as the time base, so that the wait
      is immune to adjustments of the system clock.
      10ee1b95
    • Marko Mäkelä's avatar
      Correct the type of a parameter · e764d5bc
      Marko Mäkelä authored
      e764d5bc
    • Marko Mäkelä's avatar
      MDEV-14154: Remove ut_time_us() · ab6dd774
      Marko Mäkelä authored
      Use microsecond_interval_timer()
      or my_interval_timer() [in nanoseconds] instead.
      ab6dd774
    • Marko Mäkelä's avatar
      Remove unused ut_get_year_month_day() · 86767f4a
      Marko Mäkelä authored
      86767f4a
    • Nisha Gopalakrishnan's avatar
      BUG#28642318: POINT IN TIME RECOVERY USING MYSQLBINLOG BROKEN WITH TEMPORARY TABLE -> ERRORS · 2536c0b1
      Nisha Gopalakrishnan authored
      Analysis
      ========
      Point in time recovery using mysqlbinlog containing queries
      operating on temporary tables results in an error.
      
      While writing the query log event in the binary log, the
      thread id used for execution of DROP TABLE and DELETE commands
      were incorrect. The thread variable 'thread_specific_used'
      is used to determine whether a specific thread id is to used
      while executing the statements i.e using 'SET
      @@session.pseudo_thread_id'. This variable was not set
      correctly for DROP TABLE query and was never set for DELETE
      query. The thread id is important for temporary tables
      since the tables are session specific. DROP TABLE and DELETE
      queries executed using a wrong thread id resulted in errors
      while applying the queries generated by mysqlbinlog utility.
      
      Fix
      ===
      Set the 'thread_specific_used' THD variable for DROP TABLE and
      DELETE queries.
      
      ReviewBoard: 21833
      2536c0b1
    • Gleb Shchepa's avatar
      Bug #29419820: MEMORY LEAK IN MY_YYOVERFLOW() · 7473a71a
      Gleb Shchepa authored
      Note: this patch is for 5.6.
      
      Detected by ASAN.
      
      The patch fixes the cleanup of parser stack pointers.
      Reviewed-by: default avatarGuilhem Bichot <guilhem.bichot@oracle.com>
      7473a71a
    • Sergei Golubchik's avatar
      Bug#27167197 USING ? IN INSTALL PLUGIN QUERY ABORTS DEBUG, AND HANGS OPTIMIZED SERVER · 8ddb7e3e
      Sergei Golubchik authored
      check_valid_path() uses my_strcspn() that cannot handle invalid characters
      properly. This is fixed by a big refactoring in 10.2 (MDEV-6353).
      
      For 5.5, let's simply swap tests, because check_string_char_length()
      rejects invalid characters just fine.
      8ddb7e3e
    • Sergei Golubchik's avatar
      Bug#27302459: EMPTY VALUE IN MYSQL.PLUGIN TABLE CAUSES SERVER TO EXIT ON STARTUP · 5e8ab9b7
      Sergei Golubchik authored
      Description:- During server startup, the server exits if
      the 'mysql.plugin' system table has any rows with empty
      value for the field 'name' (plugin name).
      5e8ab9b7
    • Georgi Kodinov's avatar
      Bug #27312862: ASAN: HEAP-USE-AFTER-FREE: UPDATEXML RB#21666 RB#21666 · c5e96743
      Georgi Kodinov authored
      The xpath parsing function was using a local string buffer that was
      deallocated when going out of scope. However references to it are
      preserved in the XPATH parse tree. This was causing read-after-free.
      
      Fixed by making the xpath buffer a local variable inside the Item
      class for the relevant xpath function, thus being preserved for the
      duration of the query.
      c5e96743
    • Anushree Prakash B's avatar
      Bug#27259654 - ISSUES FOUND BY PVS-STUDIO STATIC ANALYZER · 9c6777c0
      Anushree Prakash B authored
      DESCRIPTION
      ===========
      PVS-Studio static code analyzer found several suspicious
      fragments of code across various files.
      
      i)   sizeof() is using the pointer
      ii)  memcpy() doesn't copy the whole string.
      iii) enumeration constant 'wkb_multilinestring' is used as
           a variable of a Boolean-type.
      iv) 'throw' keyword is missing from std::runtime_error()
      
      FIX
      ===
      i)   Use sizeof({actual object/data type})
      ii)  Use strncpy() and set last char as '\0'
      iii) N/A (Issue has already been fixed)
      iv)  Add 'throw' before the exception.
      
      RB: 21502
      9c6777c0
  3. 23 Jul, 2019 10 commits
    • Elena Stepanova's avatar
      c83663e5
    • Marko Mäkelä's avatar
      5.6.44-86.0 · 1f498f90
      Marko Mäkelä authored
      1f498f90
    • Marko Mäkelä's avatar
      MDEV-14154: Make ut_time_ms(), ut_time_us() monotonic · d653db32
      Marko Mäkelä authored
      This is motivated by PS-5221 in
      percona/percona-server@2817c561fce9e20a83b13272ac45fd333467715d
      
      The coarser-precision ut_time() will still refer to the
      system clock, meaning that bad things can happen if the
      real time clock is adjusted backwards.
      d653db32
    • Laurynas Biveinis's avatar
      Fix PS-5388 (Enable hardware CRC32 under Valgrind) · c385d80a
      Laurynas Biveinis authored
      Valgrind started supporting CRC32 instruction starting with version
      3.6.1, released in 2011. Thus remove the fallback to software
      implementation in case running under Valgrind.
      c385d80a
    • Marko Mäkelä's avatar
      MDEV-20127 Merge new release of InnoDB 5.6.45 to 10.1 · 61b5e244
      Marko Mäkelä authored
      There is one directly applicable change to InnoDB:
      commit 739f5239 in the
      5.5 branch will be merged before the next MariaDB releases.
      
      Another potentially applicable change will be tracked
      separately as MDEV-20126.
      
      Thus, here we only update the InnoDB version number and do
      not change anything else.
      61b5e244
    • Marko Mäkelä's avatar
      gen_lex_hash: Omit deprecated register keywords · e6c1e588
      Marko Mäkelä authored
      This is follow-up to d36c107a
      e6c1e588
    • Marko Mäkelä's avatar
      MDEV-8827: Fix the 32-bit build · 9d93f9da
      Marko Mäkelä authored
      Follow-up to 07ba5560:
      Use the correct 64-bit type name ulonglong instead of ulint,
      like in mysql/mysql-server@4e0100d86b1b46be0107ebd46a98a0c2dbb0fab4
      9d93f9da
    • Rahul Malik's avatar
      Bug#15851528 DUPLICATE KEY ERROR ON AUTO-INC PK WITH MIXED AUTO_INCREMENT_INCREMENT CLIENTS · 739f5239
      Rahul Malik authored
      Problem: Clients running different values for auto_increment_increment
      and doing concurrent inserts leads to "Duplicate key error" in one of them.
      
      Analysis:
      When auto_increment_increment value is reduced in a session,
      InnoDB uses last auto_increment_increment value
      to recalculate the autoinc value.
      In case, some other session has inserted a value
      with different auto_increment_increment, InnoDB recalculate
      autoinc values based on current session previous auto_increment_increment
      instead of considering the auto_increment_increment used for last insert
      across all session
      
      Fix:
      revert 7acdf29c
      a.k.a. 7c12a9e5
      as it causing the bug.
      
      Reviewed By:
      Bin <bin.x.su@oracle.com>
      Kevin <kevin.lewis@oracle.com>
      RB#21777
      
      Note: In MariaDB Server, earlier changes in
      ae5bc059
      for MDEV-533 require that the original test in
      mysql/mysql-server@1ccd472d63a042d3237a55f5827239164219ef7e
      be adjusted for MariaDB.
      
      Also, ef47b625 (MDEV-8827)
      had to be reverted after the upstream fix had been backported.
      739f5239
    • Marko Mäkelä's avatar
      Revert "MDEV-8827 Duplicate key with auto increment" · 7153e155
      Marko Mäkelä authored
      This reverts commit ef47b625.
      The parent commit 07ba5560
      which is a backport of
      mysql/mysql-server@1198267c331b045b9cad26be72b1a5b4f8930a79
      fixes the issue differently.
      7153e155
    • Thirunarayanan Balathandayuthapani's avatar
      Bug #20989615 INNODB AUTO_INCREMENT PRODUCES SAME VALUE TWICE · 07ba5560
      Thirunarayanan Balathandayuthapani authored
      Problem:
      =======
      Autoincrement value gives duplicate values because of the following reasons.
      
      (1) In InnoDB handler function, current autoincrement value is not changed
      based on newly set auto_increment_increment or auto_increment_offset variable.
      
      (2) Handler function does the rounding logic and changes the current
      autoincrement value and InnoDB doesn't aware of the change in current
      autoincrement value.
      
      Solution:
      ========
      Fix the problem(1), InnoDB always respect the auto_increment_increment
      and auto_increment_offset value in case of current autoincrement value.
      By fixing the problem (2), handler layer won't change any current
      autoincrement value.
      Reviewed-by: default avatarJimmy Yang <jimmy.yang@oracle.com>
      RB: 13748
      07ba5560
  4. 22 Jul, 2019 1 commit
    • Marko Mäkelä's avatar
      MDEV-20102 Phantom InnoDB table remains after interrupted CREATE...SELECT · a5e268a2
      Marko Mäkelä authored
      This is a regression due to MDEV-16515 that affects some versions in
      the MariaDB 10.1 server series starting with 10.1.35, and possibly
      all versions starting with 10.2.17, 10.3.8, and 10.4.0.
      
      The idea of MDEV-16515 is to allow DROP TABLE to be interrupted,
      in case it was stuck due to some concurrent activity. We already
      made some cases of internal DROP TABLE immune to kill in MDEV-18237,
      MDEV-16647, MDEV-17470. We must include the cleanup of
      CREATE TABLE...SELECT in the list of such internal DROP TABLE.
      
      ha_innobase::delete_table(): Pass create_failed=true if the current
      SQL statement is CREATE, so that the table will be dropped.
      
      row_drop_table_for_mysql(): If create_failed=true, do not allow
      the operation to be interrupted.
      a5e268a2
  5. 21 Jul, 2019 1 commit
  6. 19 Jul, 2019 2 commits
  7. 18 Jul, 2019 7 commits