1. 12 Mar, 2018 1 commit
    • Teemu Ollakka's avatar
      MDEV-15505 Fix wsrep XID seqno byte order · dd74b948
      Teemu Ollakka authored
      The problem is that the seqno part of wsrep XID is always
      stored in host byte order. This may cause issues when a physical
      backup is restored on a host with different architecture, the
      seqno part with XID may have incorrect value.
      
      In order to fix this, wsrep XID seqno is always written into
      XID data buffer in little endian byte order using int8store()
      and read from data buffer using sint8korr(). For backwards
      compatibility the seqno is read from TRX_SYS page in host
      byte order during upgrade.
      
      This patch implements byte ordering in wsrep_xid_init(),
      wsrep_xid_seqno(), and exposes functions to read wsrep
      XID uuid and seqno in wsrep_service_st. Backwards compatibility
      for upgrade is provided in trx_rseg_init_wsrep_xid().
      dd74b948
  2. 09 Mar, 2018 1 commit
  3. 07 Mar, 2018 3 commits
    • Alexander Barkov's avatar
      MDEV-15497 Wrong empty value in a GEOMETRY column on LOAD DATA · 6ec3de5d
      Alexander Barkov authored
      - Adding a new virtual method Field::load_data_set_no_data().
      - Overriding Field_timestamp::load_data_set_no_data() and moving
        the TIMESTAMP specific code there.
      - Overriding Field_geom::load_data_set_no_data() and implementing
        GEOMETRY specific behavior, to prevent writing empty strings
        when the loaded file ends unexpectedly. This fixes the bug.
      - Adding a new test gis-loaddaata.test.
      - The test in loaddata.test for CHAR was added simply to record behavior.
        The CHAR data type did not change its behaviour (only GEOMRYRY did).
      - Additionally, moving duplicate code into a new method
        Field::load_data_set_value() and reusing it in three places.
      6ec3de5d
    • Daniel Black's avatar
      my_fdopen: list all args in comment · 2ef2863c
      Daniel Black authored
      2ef2863c
    • Ian Gilfillan's avatar
      08fa3218
  4. 06 Mar, 2018 3 commits
    • Marko Mäkelä's avatar
      ReadView::snapshot(): Define inline · 8f361a83
      Marko Mäkelä authored
      8f361a83
    • Marko Mäkelä's avatar
      MDEV-15418 innodb_force_recovery=5 displays bogus warnings · 93d495f3
      Marko Mäkelä authored
      With MDEV-15132 in MariaDB 10.3.5, InnoDB no longer writes the
      transaction identifier to the TRX_SYS page. The information is
      only written to undo log headers and sometimes rollback segment
      headers. Because the setting innodb_force_recovery=5 will skip
      reading any of those pages, the maximum transaction identifier
      will no longer be determined.
      
      innobase_map_isolation_level(): Always report READ UNCOMMITTED
      if innodb_force_recovery has been set to 5 or more, or
      innodb_read_only is set. This will avoid errors reported by
      lock_check_trx_id_sanity() and ReadView::check_trx_id_sanity().
      
      lock_clust_rec_cons_read_sees(): Do not check for
      innodb_read_only, now that innobase_map_isolation_level() will
      guarantee that no read view will be created or used.
      
      row_search_mvcc(): Do not check for innodb_force_recovery<5,
      now that innobase_map_isolation_level() will guarantee that
      no read view will be created or used.
      93d495f3
    • Marko Mäkelä's avatar
      MDEV-15443 Properly read wsrep XID and binlog position from rollback segment headers · 67f6d40b
      Marko Mäkelä authored
      The problem is a regression caused by MDEV-15158.
      If some transactions were committed with wsrep_on=0, a
      rollback segment header having the highest trx_id assigned might
      store undefined wsrep XID. When reading the wsrep checkpoint
      from InnodB, the undefined wsrep XID might be returned instead
      of the highest valid one.
      
      Similarly, if the binary log is intermittently disabled or enabled
      while InnoDB transactions are being committed, the latest updated
      rollback segment header page might not contain the latest binlog metadata.
      
      Therefore, the MDEV-15158 logic to rely on TRX_RSEG_MAX_TRX_ID for
      determining the most recent WSREP XID or binlog position is invalid.
      We must choose the maximum entries among the rollback segment header
      pages.
      
      This fix is based on code submitted by Teemu Ollakka from Codership
      and by Thirunarayanan Balathandayuthapani from MariaDB Corporation.
      
      trx_purge_add_undo_to_history(): Only write TRX_RSEG_MAX_TRX_ID
      when it was used to be written before MDEV-15158.
      
      wsrep_seqno: Renamed from trx_sys_cur_xid_seqno.
      
      wsrep_uuid: Renamed from trx_sys_cur_xid_uuid, and enable in non-debug
      builds.
      
      read_wsrep_xid_uuid(): Make non-debug, and remove the memcpy().
      
      trx_rseg_update_wsrep_checkpoint(): Correctly compare and copy
      the entire UUID in the debug check. In case of UUID mismatch,
      write the WSREP XID to all 128 rollback segment headers in
      a single mini-transaction.
      
      trx_rseg_read_wsrep_checkpoint(rseg_header, xid): Make static.
      In case the information is absent, do not overwrite xid.
      
      trx_rseg_read_wsrep_checkpoint(xid): Determine the maximum
      WSREP XID.
      
      trx_rseg_mem_restore(): Remove the parameter max_rseg_trx_id.
      Determine the latest binlog file and position by comparing
      file names and offsets. Declare trx_sys.recovered_binlog_offset
      as an unsigned type.
      67f6d40b
  5. 02 Mar, 2018 2 commits
  6. 01 Mar, 2018 1 commit
  7. 28 Feb, 2018 2 commits
  8. 27 Feb, 2018 2 commits
    • Alexander Barkov's avatar
    • Alexander Barkov's avatar
      MDEV-11952 Oracle-style packages: stage#5 · 5f7c764f
      Alexander Barkov authored
      Backporting from bb-10.2-compatibility to bb-10.2-ext
      
      Version: 2018-01-26
      
      - CREATE PACKAGE [BODY] statements are now
        entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'.
      - CREATE PACKAGE BODY now supports IF NOT EXISTS
      - DROP PACKAGE BODY now supports IF EXISTS
      - CREATE OR REPLACE PACKAGE [BODY] is now supported
      - CREATE PACKAGE [BODY] now support the DEFINER clause:
      
          CREATE DEFINER user@host PACKAGE pkg ... END;
          CREATE DEFINER user@host PACKAGE BODY pkg ... END;
      
      - CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.:
      
          CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END;
      
      - Package routines are now created from the package CREATE PACKAGE BODY
        statement and don't produce individual records in mysql.proc.
      
      - CREATE PACKAGE BODY now supports package-wide variables.
        Package variables can be read and set inside package routines.
        Package variables are stored in a separate sp_rcontext,
        which is cached in THD on the first packate routine call.
      
      - CREATE PACKAGE BODY now supports the initialization section.
      
      - All public routines (i.e. declared in CREATE PACKAGE)
        must have implementations in CREATE PACKAGE BODY
      
      - Only public package routines are available outside of the package
      
      - {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE
        privileges
      
      - "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported
      
      - SHOW CREATE PACKAGE [BODY] is now supported
      
      - SHOW PACKAGE [BODY] STATUS is now supported
      
      - CREATE and DROP for PACKAGE [BODY] now works for non-current databases
      
      - mysqldump now supports packages
      
      - "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines
      
      - "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section)
      
      - A new package body level MDL was added
      
      - Recursive calls for package procedures are now possible
      
      - Routine forward declarations in CREATE PACKATE BODY are now supported.
      
      - Package body variables now work as SP OUT parameters
      
      - Package body variables now work as SELECT INTO targets
      
      - Package body variables now support ROW, %ROWTYPE, %TYPE
      5f7c764f
  9. 25 Feb, 2018 3 commits
    • Alexander Barkov's avatar
      MDEV-11952 Oracle-style packages: stage#5 · 583eb96c
      Alexander Barkov authored
      - CREATE PACKAGE [BODY] statements are now
        entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'.
      - CREATE PACKAGE BODY now supports IF NOT EXISTS
      - DROP PACKAGE BODY now supports IF EXISTS
      - CREATE OR REPLACE PACKAGE [BODY] is now supported
      - CREATE PACKAGE [BODY] now support the DEFINER clause:
      
          CREATE DEFINER user@host PACKAGE pkg ... END;
          CREATE DEFINER user@host PACKAGE BODY pkg ... END;
      
      - CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.:
      
          CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END;
      
      - Package routines are now created from the package CREATE PACKAGE BODY
        statement and don't produce individual records in mysql.proc.
      
      - CREATE PACKAGE BODY now supports package-wide variables.
        Package variables can be read and set inside package routines.
        Package variables are stored in a separate sp_rcontext,
        which is cached in THD on the first packate routine call.
      
      - CREATE PACKAGE BODY now supports the initialization section.
      
      - All public routines (i.e. declared in CREATE PACKAGE)
        must have implementations in CREATE PACKAGE BODY
      
      - Only public package routines are available outside of the package
      
      - {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE
        privileges
      
      - "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported
      
      - SHOW CREATE PACKAGE [BODY] is now supported
      
      - SHOW PACKAGE [BODY] STATUS is now supported
      
      - CREATE and DROP for PACKAGE [BODY] now works for non-current databases
      
      - mysqldump now supports packages
      
      - "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines
      
      - "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section)
      
      - A new package body level MDL was added
      
      - Recursive calls for package procedures are now possible
      
      - Routine forward declarations in CREATE PACKATE BODY are now supported.
      
      - Package body variables now work as SP OUT parameters
      
      - Package body variables now work as SELECT INTO targets
      
      - Package body variables now support ROW, %ROWTYPE, %TYPE
      583eb96c
    • Sergei Golubchik's avatar
      MDEV-15405 Mixed replication fails with "Could not execute Delete_rows_v1... · 83ea839f
      Sergei Golubchik authored
      MDEV-15405 Mixed replication fails with "Could not execute Delete_rows_v1 event" upon DELETE HISTORY
      
      Allow slave thread to set time for system versioning
      
      Note that every binlog event stores now(0), while microseconds
      are only stored when they're actually used in the query.
      
      Meaning for unversioned->versioned replication, there will be
      no microseconds. Need to compensate for that.
      83ea839f
    • Sergei Golubchik's avatar
      fix THD::system_time to follow, well, system time · ac2d4d49
      Sergei Golubchik authored
      Because NOW() is set to system time, unless overriden.
      And both should follow big manual system time changes,
      while still coping with lowres system clocks.
      
      Ignoring system time changes is both confusing and
      breaks with restarts.
      ac2d4d49
  10. 24 Feb, 2018 11 commits
  11. 23 Feb, 2018 11 commits