1. 12 Dec, 2018 15 commits
  2. 11 Dec, 2018 16 commits
    • Sergei Golubchik's avatar
      MDEV-17658 change the structure of mysql.user table · 4abb8216
      Sergei Golubchik authored
      Implement User_table_json.
      Fix scripts to use mysql.global_priv.
      Fix tests.
      4abb8216
    • Sergei Golubchik's avatar
      json helpers · d68d7e50
      Sergei Golubchik authored
      d68d7e50
    • Sergei Golubchik's avatar
      MDEV-17658 change the structure of mysql.user table · a76aadf7
      Sergei Golubchik authored
      Introduce User_table_tabular(mysql.user) and User_table_json(mysql.global_priv).
      The latter is not implemented.
      Automatic fallback to the old implementation works.
      
      Results change because privilege tables are opened in a different
      order now.
      a76aadf7
    • Sergei Golubchik's avatar
      cleanup: simplify opening of priv tables · 9887d2e8
      Sergei Golubchik authored
      prepare TABLE_LIST in a loop and just before opening
      don't store TABLE_LIST inside Grant_table_base.
      9887d2e8
    • Sergei Golubchik's avatar
      cleanup: refactor grant table classes in sql_acl.cc · a701426b
      Sergei Golubchik authored
      move all backward compatibility related code into User_table,
      the caller should not know or care anymore.
      
      Other tables (Db_table, etc) are *not* refactored.
      
      For consistency with other updates, setting a default role
      no longer errors out when the mysql.user table is too old.
      a701426b
    • Sergei Golubchik's avatar
      fix the test for the empty password hash string · 3df7287d
      Sergei Golubchik authored
      because the first byte of a _binary hash_ can be 0x00 too.
      
      This fixes main.connect test on centos73-ppc64
      3df7287d
    • Sergei Golubchik's avatar
      1db6c3a2
    • Sergei Golubchik's avatar
      mysqld: ignore SIGHUP sent by the kernel · 07e9b138
      Sergei Golubchik authored
      SIGHUP causes debug info in the error log and reload of
      logs/privileges/tables/etc. The server should only do it when
      a user intentionally sends SUGHUP, not when a parent terminal gets
      disconnected or something.
      
      In particular, not ignoring kernel SIGHUP causes FLUSH PRIVILEGES
      at some random point during non-systemd Debian upgrades (Debian
      restarts mysqld, debian-start script runs mysql_upgrade in the background,
      postinit script ends and kernel sends SIGHUP to all background processes
      it has started). And during mysql_upgrade privilege tables aren't
      necessarily ready to be reloaded.
      07e9b138
    • Sergei Golubchik's avatar
      simplify usage of logger.set_handlers() · 97dbb356
      Sergei Golubchik authored
      97dbb356
    • Sergei Golubchik's avatar
      more tests for mysql_install_db.exe · a4ac987c
      Sergei Golubchik authored
      a4ac987c
    • Sergei Golubchik's avatar
      MDEV-17926 FederatedX TODO is obsolete · 7af62f8a
      Sergei Golubchik authored
      7af62f8a
    • Alexey Botchkov's avatar
      MDEV-5313 Improving audit api. · b1527ef5
      Alexey Botchkov authored
      Service added to handle json.
      b1527ef5
    • Eugene Kosov's avatar
      MDEV-17833 ALTER TABLE is not enforcing prefix index size limit · d956709b
      Eugene Kosov authored
      ha_innobase::prepare_inplace_alter_table(): check max column length for every
      index in a table, not just added in this particular ALTER TABLE with ADD INDEX ones.
      d956709b
    • Marko Mäkelä's avatar
      MDEV-17901 Crash after instant DROP COLUMN of AUTO_INCREMENT column · dc6ad597
      Marko Mäkelä authored
      We failed to reset the dict_table_t::persistent_autoinc after
      instantly dropping an AUTO_INCREMENT column, causing a bogus
      call to row_parse_int() on a subsequent insert.
      dc6ad597
    • Jiaye Wu's avatar
      Fix UNICODE issue of dlerror() · 8dc460b8
      Jiaye Wu authored
      Current implementation is conflicting. If `UNICODE` is defined, `FormatMessage()` will be `FormatMessageW()`, and variable `win_errormsg` with type `char` can not be passed to it, which should be changed to `TCHAR` instead. Since we don't use UNICODE here, we can use `FormatMessageA()` directly to avoid conversion error.
      ```
      my_global.h(1092): error C2664: 'DWORD FormatMessageW(D
      WORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,va_list *)' : cannot convert argument 5 from 'char [2048]' to 'LPWSTR'
      ```
      8dc460b8
    • Marko Mäkelä's avatar
      MDEV-17899: Fix a regression from MDEV-17793 · 1b31d885
      Marko Mäkelä authored
      The fix of MDEV-17793 was updating SYS_INDEXES.TABLE_ID in order
      to make the table invisible to purge (lazily delete old undo log
      records).
      
      By design of InnoDB, an update of TABLE_ID cannot be rolled back,
      because the rollback would effectively drop all indexes of the table
      due to the internal 'trigger' on SYS_INDEXES modifications.
      
      So, we revert the code change of MDEV-17793 and instead fix
      MDEV-17793 in a different way: by tweaking the undo log parsing
      during purge.
      
      The MDEV-17793 bug scenario is that a table becomes empty and
      a third instant ALTER TABLE is executed before purge processes
      the undo log record for the second instant ALTER TABLE. After
      this point, when purge sees the record, the table could have
      a mismatching number of rows.
      
      The test case works with this alternative fix. But what about
      a scenario where a fourth instant ALTER TABLE arrives before
      purge processes the second one? Could anything bad happen?
      
      Purge is only doing two things: First, free any BLOBs that
      were affected by the update record, and then, reset the
      DB_TRX_ID,DB_ROLL_PTR if a matching record is found.
      For the hidden metadata record, the only BLOB that we update
      is the hidden metadata BLOB that was introduced by MDEV-15562.
      Any other BLOBs (for the initial default values of instantly
      added columns) are never updated.
      
      So, in our scenario, the metadata BLOB that was created by
      the first instant ALTER TABLE (if it involved dropping or
      permuting columns) would be freed by purge when it is processing
      the undo record of the second ALTER TABLE. The BLOB value that
      was written by the second ALTER TABLE should be freed when
      the table is emptied. This is currently not done: MDEV-17383
      should fix that. There is no possibility of double-free, because
      purge would only free old values of BLOBs.
      
      What about MVCC and other callers of trx_undo_update_rec_get_update()?
      The answer is simple: they should never be accessing the hidden
      metadata record in the first place.
      
      dict_table_t::reassign_id(): Remove.
      
      btr_cur_pessimistic_delete(): Clarify a comment.
      
      row_mysql_table_id_reassign(), row_discard_tablespace_for_mysql():
      Add comments explaining that the operation cannot be rolled back.
      
      trx_undo_update_rec_get_update(): Avoid out-of-bounds access when
      parsing a metadata record. Avoid unnecessary memory allocation when
      filtering out fields from the update vector.
      1b31d885
  3. 10 Dec, 2018 9 commits