2023年2月にMariaDB 10.11がリリースされました。
https://mariadb.com/kb/en/changes-improvements-in-mariadb-1011/
LTSリリースということで、2028年2月までのサポートとなります。
基本的には、リリースノートを見ていただければとは思いますが、
個人的には system versioning テーブルの dump/restore サポートがついに入ったか〜という感じです。
たとえば、こんな感じで、テーブルつくって、データ操作します。
create table t_system_versioning ( id int not null, name varchar(32) not null, primary key (id) ) with system versioning; insert into t_system_versioning values (1, 'n1'); update t_system_versioning set name = 'n2' where id = 1; delete from t_system_versioning where id = 1; |
このあとの段階では、当然以下のようになります。
MariaDB [test]> select * from t_system_versioning; Empty set (0.000 sec) |
履歴をすべてを出力すると、以下のようになります。
MariaDB [test]> select *, row_start, row_end from t_system_versioning for system_time all; +----+------+----------------------------+----------------------------+ | id | name | row_start | row_end | +----+------+----------------------------+----------------------------+ | 1 | n1 | 2023-03-22 16:56:29.376669 | 2023-03-22 16:56:53.845864 | | 1 | n2 | 2023-03-22 16:56:53.845864 | 2023-03-22 16:57:08.520850 | +----+------+----------------------------+----------------------------+ 2 rows in set (0.000 sec) |
これまでは、これらの履歴データが dump で取得できませんでした。
10.11で追加されたオプション「–dump-history」を使うことで、履歴が dump に載るようになります。
$ mariadb-dump --databases test --tables t_system_versioning --dump-history : : /*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */; LOCK TABLES `t_system_versioning` WRITE; /*!40000 ALTER TABLE `t_system_versioning` DISABLE KEYS */; INSERT INTO `t_system_versioning` (`id`, `name`, row_start, row_end) VALUES (1,'n1','2023-03-22 07:56:29.376669','2023-03-22 07:56:53.845864'), (1,'n2','2023-03-22 07:56:53.845864','2023-03-22 07:57:08.520850'); /*!40000 ALTER TABLE `t_system_versioning` ENABLE KEYS */; UNLOCK TABLES; : : |
これで、やっと system versioning も使い易くなった感じです。
デフォルトの挙動としてもいい気がしますが。。
その他として、GPGキーが2023年から変わっています。
https://mariadb.com/kb/en/gpg/
バージョンアップの際は、上記を参考にGPGキーを更新する必要があるので、注意が必要です。
また、自分が作成している magentadesk も10.11 に対応しました。
https://github.com/shigenobu/magentadesk
v0.4.9 が 10.11 の対応版となります。
以上