Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MySQL 8.0に負けないテストの作り方(仮)

Avatar for yoku0825 yoku0825
June 02, 2020

MySQL 8.0に負けないテストの作り方(仮)

Avatar for yoku0825

yoku0825

June 02, 2020
Tweet

More Decks by yoku0825

Other Decks in Technology

Transcript

  1. MySQL 8.0 mysql80 160> SELECT CURDATE() /* JST */; +------------+

    | CURDATE() | +------------+ | 2018-04-20 | +------------+ 1 row in set (0.00 sec) mysql80 160> SELECT @@version; +-----------+ | @@version | +-----------+ | 8.0.11 | +-----------+ 1 row in set (0.00 sec) 10/21
  2. MySQL 8.0 mysql80 671> SELECT CURDATE() /* JST */; +------------+

    | CURDATE() | +------------+ | 2020-06-02 | +------------+ 1 row in set (0.00 sec) mysql80 671> SELECT @@version; +-----------+ | @@version | +-----------+ | 8.0.20 | +-----------+ 1 row in set (0.00 sec) 11/21
  3. MySQL 8.0 ナッツシェル( What is New in MySQL 8.0 の章)が何故かどんどん増える

    $ curl -L -s https://dev.mysql.com/doc/refman/8.0/en/mysql-nutshell.html | perl -nlE 'if ($_ =~ /(8\.0\.\d+)/) { say $1 }' | sort -t "." -k 3 -n | uniq -c 1 8.0.0 3 8.0.2 4 8.0.3 2 8.0.4 2 8.0.12 6 8.0.13 6 8.0.14 9 8.0.16 10 8.0.17 6 8.0.18 7 8.0.19 9 8.0.20 8 8.0.21 8.0.15はガチで8.0.14のリグレッションを1件だけ直した「メンテナンスリリース」だった。よってWhat is Newの中にはない 12/21
  4. MySQL 8.0は1つ1つのメンテナンスリリースにメジャーバージョンアップ並 みの機能追加をぶち込んでくる version New Feature 8.0.12 Instant ADD Column

    8.0.13 式デフォルト, 関数インデックス 8.0.14 Lateral, InnoDBパラレルスキャン, log_slow_extra 8.0.16 CHECK制約, partial_revokes, Async C-Library 8.0.17 Clone, 配列INDEX, JSON_SCHEMA_VALID, Anti- semijoin, binlog暗号化 8.0.18 Hash-join, EXPLAIN ANALYZE 8.0.19 InnoDB ReplicaSet, 時刻リテラルのオフセット, VALUESス テートメント 8.0.20 Binlog圧縮 一部抜粋しただけです 13/21
  5. MySQL 8.0は1つ1つのメンテナンスリリースにメジャーバージョンアップ並 みの機能削除もぶち込んでくる version Deprecated Removed 8.0.12 GROUP BY ..

    ASC - 8.0.13 PAD_CHAR_TO_FULL_LENGTH GROUP BY .. ASC 8.0.14 ibdata1でのパーティショニング - 8.0.16 mysql_upgrade, sha256_password 暗黙のテンポラリーテーブルMyISAM 8.0.17 ZEROFILL, DECIMAL with UNSIGNED, &&, || , 非整数型での auto_increment, CALC_FOUND_ROWS - 8.0.18 MYSQL_PWD, relay_log_info_file - 8.0.19 YEAR型の桁指定 INT型の桁指定の表示 8.0.20 UNION with INTO, INSERT INTO .. DUPLICATE KEY UPDATEの中での VALUES - 一部抜粋しただけです 14/21
  6. MySQL 8.0 「メンテナンスリリース」 だと言い張る The MySQL 8.0.12 Maintenance Release is

    Generally Available | MySQL Server Blog ‐ The MySQL 8.0.13 Maintenance Release is Generally Available | MySQL Server Blog ‐ The MySQL 8.0.14 Maintenance Release is Generally Available | MySQL Server Blog ‐ The MySQL 8.0.16 Maintenance Release is Generally Available | MySQL Server Blog ‐ The MySQL 8.0.17 Maintenance Release is Generally Available | MySQL Server Blog ‐ The MySQL 8.0.18 Maintenance Release is Generally Available | MySQL Server Blog ‐ The MySQL 8.0.19 Maintenance Release is Generally Available | MySQL Server Blog ‐ The MySQL 8.0.20 Maintenance Release is Generally Available | MySQL Server Blog ‐ 8.0.15はガチで8.0.14のリグレッションを1件だけ直した「メンテナンスリリース」だった。よって公式ブログに記事は無い() 15/21
  7. MySQL 8.0の進化に取り残されないようなテスト…の前に “What Is New in MySQL 8.0” (俗称ナッツシェル) の

    “Features {Deprecated| Removed} in MySQL 8.0” は有効な情報源 https://dev.mysql.com/doc/refman/8.0/en/mysql-nutshell.html ‐ MySQL ShellのUpgrade Checkerは「存在するオブジェクト」に関しては有効 予約語とカブるカラム名、非推奨になった属性で作られているストアド、etc. ‐ https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-upgrade.html ‐ 17/21
  8. MySQL 8.0の進化に取り残されないようなテスト モックではなく実物を使う Test::mysqld ‐ Dockerコンテナでもいい ‐ 拾えるなら SHOW WARNINGS

    は全部拾う 拾えなくても performance_schema.events_errors_summary_global_by_error や performance_schema.events_statements_summary_by_digest が使えるかも、諦め ないで! 18/21