1. 25 Jul, 2019 6 commits
    • Aditya A's avatar
      Bug #29127203 VIRTUAL GENERATED COLUMN INDEX DATA INCONSISTENCY · 60069a98
      Aditya A authored
      PROBLEM
      -------
      
      Index defined on a virtual column whose base column was in a fk
      relation was not getting updated. This is because while getting
      the updated field information from the update vector of the parent
      table we were comparing the column number of the base column (for
      virtual column) in child table with the associated column number
      in the parent table. There was a mismatch in this column number
      because of which this update field information was skipped and
      subsequently index was not getting updated.
      
      FIX
      60069a98
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · b6ac6738
      Marko Mäkelä authored
      b6ac6738
    • 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
    • Anel Husakovic's avatar
    • 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 11 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
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-19870 gcol.innodb_virtual_debug_purge doesn't fail if... · 8fb39b2c
      Thirunarayanan Balathandayuthapani authored
      MDEV-19870 gcol.innodb_virtual_debug_purge doesn't fail if row_vers_old_has_index_entry gives wrong result
      
      1) Whenever purge thread tries to remove the secondary virtual index
      entry, purge thread acquires metadata lock for the table and release
      dict_operation_lock. After that, it retries the secondary index
      deletion if MDL acquired successfully.
      
      2) Inside row_vers_old_has_index_entry(), Change the safe_to_purge
      to unsafe_to_purge goto statement. So it can be more appropriate to
      return true if it is unsafe_to_purge.
      
      3) Previously, row_vers_old_has_index_entry() returns false if InnoDB
      fetched the MDL on the table for the first time. This check(two cases)
      should checked only during purge thread. In row_purge_poss_sec(), again
      InnoDB checks whether the MDL fetched for the first time. If it is then
      InnoDB retry the secondary index deletion logic. So in that case,
      InnoDB have to clean up the memory used inside row_vers_old_has_index_entry()
      and shouldn't care about return value.
      8fb39b2c
    • Elena Stepanova's avatar
      c22305f0
  3. 23 Jul, 2019 8 commits
  4. 22 Jul, 2019 6 commits
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 60c790d6
      Marko Mäkelä authored
      60c790d6
    • 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
    • Nikita Malyavin's avatar
      MDEV-17005 ASAN heap-use-after-free in innobase_get_computed_value · 12614af1
      Nikita Malyavin authored
      This is the race between DELETE and INSERT (or other any two operations accessing to the table).
      What should happen in good case:
      1. ALTER TABLE is issued. vc_templ->default_rec is initialized with temporary share's default_fields
      2. temporary share is freed, but datadict is still there, with garbage in vc_templ->default_rec
      3. DELETE is issued. It is first after ALTER TABLE finished.
      4. ha_innobase::open() is called, ib_table->get_ref_count() should be one
      5. we reinitialize vc_templ, so no garbage anymore
      
      What actually happens:
      3. DELETE is issued.
      4. ha_innobase::open() is called and ib_table->get_ref_count() is 1
      5. INSERT (or SELECT etc.) is issued in parallel
      6. ha_innobase::open() is called and ib_table->get_ref_count() is 1
      7. we check ib_table->get_ref_count()  and it is 2 in both threads when we want reinitialize vc_templ
      8. garbage is there
      
      Fix:
      * Do not store pointers to SHARE memory in table dict, copy it instead.
      * But then we don't need to refresh it each time when refcount=1.
      12614af1
    • Nikita Malyavin's avatar
    • Julius Goryavsky's avatar
      The test for the wsrep_info plugin needs the same flexible wsrep version... · f27a0043
      Julius Goryavsky authored
      The test for the wsrep_info plugin needs the same flexible wsrep version checking as the tests for Galera (continuation of MDEV-18565 task)
      f27a0043
  5. 21 Jul, 2019 1 commit
  6. 20 Jul, 2019 1 commit
  7. 19 Jul, 2019 7 commits