1. 20 Aug, 2019 2 commits
  2. 19 Aug, 2019 2 commits
    • Julius Goryavsky's avatar
      MDEV-18863: Galera SST scripts can't read [mysqldN] option groups · 457dc9d6
      Julius Goryavsky authored
      Some users and some scripts (for example, mysqld_multi.sh) use special
      option groups with names like [mysqld1], [mysqld2], ..., [mysqldN].
      
      But SST scripts can't currently fully support these option groups.
      The only option group-related value it gets from the server is
      --defaults-group-suffix, if that option was set for mysqld when
      the server was started.
      
      However, the SST scripts does not get told by the server to read
      these option groups, so this means that the SST script will fail
      to read options like innodb-data-home-dir when it is in a option
      group like [mysqld1]...[mysqldN].
      
      Moreover, SST scripts ignore many parameters that can be passed
      to them explicitly and cannot transfer them further, for example,
      to the input of mariabackup utility. Ideally, we want to transfer
      all the parameters of the original mysqld call to utilities such
      as mariabackup, however the SST script does not receive these
      parameters from the server and therefore cannot transfer them to
      mariabackup.
      
      To correct these shortcomings, we need to transfer to the scripts
      all of the parameters of the original mysqld call, and in the SST
      scripts themselves provide for the transfer all of these parameters
      to utilities such as mariabackup. To prevent these parameters from
      mixing with the script's own parameters, they should be transferred
      to SST script after the special option "--mysqld-args", followed by
      the string argument with the original parameters, as it received by
      the mysqld call at the time of launch (further all these parameters
      will be passed to mariabackup, for example).
      
      In addition, the SST scripts themselves must be refined so that
      they can read the parameters from the user-selected group, not just
      from the global mysqld configuration group. And also so that they
      can receive the parameters (which important for their work) as
      command-line arguments.
      457dc9d6
    • Igor Babaev's avatar
      MDEV-20265 Unknown column in field list · e746f451
      Igor Babaev authored
      This patch corrects the fix of the patch for mdev-19421 that resolved
      the problem of parsing some embedded join expressions such as
        t1 join t2 left join t3 on t2.a=t3.a on t1.a=t2.a.
      Yet the patch contained a bug that prevented proper context analysis
      of the queries where such expressions were used together with comma
      separated table references in from clauses.
      e746f451
  3. 16 Aug, 2019 4 commits
    • Alexander Barkov's avatar
      f987de71
    • Sergei Petrunia's avatar
      MDEV-19834 Selectivity of an equality condition discounted twice · ecdacf72
      Sergei Petrunia authored
      Update test results.
      ecdacf72
    • Alexander Barkov's avatar
      MDEV-15955 Assertion `field_types == 0 || field_types[field_pos] ==... · ec1f195e
      Alexander Barkov authored
      MDEV-15955 Assertion `field_types == 0 || field_types[field_pos] == MYSQL_TYPE_LONGLONG' failed in Protocol_text::store_longlong
      ec1f195e
    • Jan Lindström's avatar
      MDEV-18778: mysql_tzinfo_to_sql does not work correctly in MariaDB Galera · fa740888
      Jan Lindström authored
      There were two problems:
      
      (1) If user wanted same time zone information on all nodes in the Galera
      cluster all updates were not replicated as time zone information was
      stored on MyISAM tables. This is fixed on Galera by altering time zone
      tables to InnoDB while they are modified.
      
      (2) If user wanted different time zone information to nodes in the Galera
      cluster TRUNCATE TABLE for time zone tables was replicated by Galera
      destroying time zone information from other nodes. This is fixed
      on Galera by introducing new option for mysql_tzinfo_to_sql_symlink
      tool --skip-write-binlog to disable Galera replication while
      time zone tables are modified.
      
      Changes to be committed:
      	modified:   mysql-test/r/mysql_tzinfo_to_sql_symlink.result
      	modified:   mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result
      	new file:   mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result
      	new file:   mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test
      	modified:   sql/tztime.cc
      fa740888
  4. 15 Aug, 2019 1 commit
  5. 13 Aug, 2019 3 commits
  6. 12 Aug, 2019 4 commits
  7. 09 Aug, 2019 1 commit
    • Sachin's avatar
      MDEV-17614 INSERT on dup key update is replication unsafe · 284c72ea
      Sachin authored
      Problem:-
      When mysql executes INSERT ON DUPLICATE KEY INSERT, the storage engine checks
      if the inserted row would generate a duplicate key error. If yes, it returns
      the existing row to mysql, mysql updates it and sends it back to the storage
      engine.When the table has more than one unique or primary key, this statement
      is sensitive to the order in which the storage engines checks the keys.
      Depending on this order, the storage engine may determine different rows
      to mysql, and hence mysql can update different rows.The order that the
      storage engine checks keys is not deterministic. For example, InnoDB checks
      keys in an order that depends on the order in which indexes were added to
      the table. The first added index is checked first. So if master and slave
      have added indexes in different orders, then slave may go out of sync.
      
      Solution:-
      Make INSERT...ON DUPLICATE KEY UPDATE unsafe while using stmt or mixed format
      When there is more then one unique key.
      Although there is two exception.
        1. Auto Increment key is not counted because Innodb will get gap lock for
          failed Insert and concurrent insert will get a next increment value. But if
          user supplies auto inc value it can be unsafe.
        2. Count only unique keys for which insertion is performed.
      
      So this patch also addresses the bug id #72921
      284c72ea
  8. 07 Aug, 2019 1 commit
  9. 05 Aug, 2019 1 commit
    • Sujatha's avatar
      MDEV-18930: Failed CREATE OR REPLACE TEMPORARY not written into binary log... · eef75404
      Sujatha authored
      MDEV-18930: Failed CREATE OR REPLACE TEMPORARY not written into binary log makes data on master and slave diverge
      
      Problem:
      =======
      Failed CREATE OR REPLACE TEMPORARY TABLE statement which dropped the table but
      failed at a later stage of creation of temporary table is not written to
      binarylog in row based replication. This causes the slave to diverge.
      
      Analysis:
      ========
      CREATE OR REPLACE statements work as shown below.
      
      CREATE OR REPLACE TABLE table_name (a int);
      is basically the same as:
      
      DROP TABLE IF EXISTS table_name;
      CREATE TABLE table_name (a int);
      
      Hence every CREATE OR REPLACE TABLE command which dropped the table should be
      written to binary log, even when following CREATE TABLE part fails. In order
      to achieve this, during the execution of CREATE OR REPLACE command, when a
      table is dropped 'thd->log_current_statement' flag is set. When table creation
      results in an error within 'mysql_create_table' code, the error handling part
      looks for this flag. If it is set the failed CREATE OR REPLACE statement is
      written into the binary log inspite of error. This ensure that slave doesn't
      diverge from the master. In case of row based replication the error handling
      code returns very early, if the table is of type temporary. This is done based
      on the assumption that temporary tables are not replicated in row based
      replication.
      
      It fails to handle the cases where a temporary table was created as part of
      statement based replication at an earlier stage and the binary log format was
      changed to row because of an unsafe statement. In this case when a CREATE OR
      REPLACE statement is executed on this temporary table it will dropped but the
      query will not be written to binary log. Hence slave diverges.
      
      Fix:
      ===
      In error handling code check the return status of create table operation. If
      it is successful and replication mode is row based and table is of type
      temporary then return. Other wise proceed further to the code which checks for
      thd->log_current_statement flag and does appropriate logging.
      eef75404
  10. 01 Aug, 2019 1 commit
  11. 31 Jul, 2019 3 commits
  12. 26 Jul, 2019 6 commits
  13. 25 Jul, 2019 6 commits
    • Oleksandr Byelkin's avatar
      Merge branch '5.5' into 10.1 · 584d2132
      Oleksandr Byelkin authored
      584d2132
    • Oleksandr Byelkin's avatar
    • 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
  14. 24 Jul, 2019 5 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