前回のエントリーでMySQL Shellのバグについて書きました。バグの原因を調査するために、MySQL Shellをビルドしたんですが、ビルドに苦労しました、、、 MySQL Shell をビルドするために乗り越えた障害と対応を方法をメモしておきます。
まず、MySQL Shell をビルドするには、事前にMySQL Server もビルドしておく必要があります。
2つのcmakeが必要
…
[さらに読む]MySQL Release note でわいわい言う勉強会 8.0.22 でLTしてきました。
MySQL Shell の dumpInstance の仕組み
MySQL Shell のバックアップ機能 dumpInstance
がどのようにして、一貫性のあるバックアップを実現しているか説明しました。 8.0.21 までは FLUSH
TALBES WITH READ LOCK を利用してロックをかける方式のみでしたが、 8.0.22
以降では、FTWRLが使えない場合は、LOCK TABLES を代替として利用するようになっています。
MySQL Shell dumpInstance の仕組み from …
[さらに読む]MySQL 8.0.22 の新機能で DNS SRV レコードのサポートというのがあったので試してみた。 https://dev.mysql.com/doc/refman/8.0/en/connecting-using-dns-srv.html
MySQLサーバー3台 (a.example.com, b.example.com, c.example.com)とそれに接続するためのクライアントの計4台を docker-compose で作成する。
Dockerfile
FROM ubuntu RUN apt update RUN apt install -y mysql-client libmysqlclient-dev gcc unbound bind9-dnsutils RUN rm -f /etc/unbound/unbound.conf.d/root-auto-trust-anchor-file.conf COPY entrypoint.sh / RUN chmod +x /entrypoint.sh ENTRYPOINT /entrypoint.sh
docker-compose.yml
services:
client:
build: .
hostname: client
volumes:
- ./resolv.conf:/etc/resolv.conf
- ./unbound-example.conf:/etc/unbound/unbound.conf.d/example.conf
- .:/work …[さらに読む]
MySQL 8.0.22 のリリースノートによるとプリペアドステートメントまわりに非互換があるらしい。
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-22.html
For a prepared statement of the form SELECT expr1, expr2, ... FROM table ORDER BY ?, passing an integer value N for the parameter no longer causes ordering of the results by the Nth expression in the select list; the results are no longer ordered, as is expected with ORDER BY constant.
order by の引数をプレースホルダで与えても無視されるらしい。
試してみる。
8.0.21:
% docker run -p 13306:3306 --name mysql8021 -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 mysql:8.0.21 % docker exec -it mysql8021 mysql mysql> create database test; mysql> use test; mysql> create table t (id int …[さらに読む]
概要
8.0.22のリリースノートを見るとprepared statementの挙動が変わっているらしい。
特にこれが気になったので、試してみる
For a prepared statement of the form SELECT expr1, expr2, ... FROM table ORDER BY ?, passing an integer value N for the parameter no longer causes ordering of the results by the Nth expression in the select list; the results are no longer ordered, as is expected with ORDER BY constant.
どうやら8.0.22からはSELECT expr1, expr2, ... FROM table ORDER BY ? といったクエリをprepareして、placeholderにselect listの番号を表す数値Nを指定する場合にsortが効かなくなるらしい
実験
8.0.21, …
[さらに読む]TL;DR
History list
length ( trx_rseg_history_len ) の監視を追加した
--history-list-enable=1
すると有効になる(そのうちこっちをデフォルトにする…)
History list lengthとは(これは SHOW ENGINE INNODB STATUS
の出力に載ってる用語、 information_schema.innodb_metrics 的には
trx_rseg_history_len …