#! /usr/bin/env bash

query="
DROP DATABASE IF EXISTS ${1};
CREATE DATABASE ${1};
USE ${1};
CREATE TABLE t0(c0 INT);
OPTIMIZE TABLE t0 NOWAIT;
"

while :
do
 mariadb -h 127.0.01 -uroot -proot -f -v -v -v <<< $query |& grep "Internal error" -C 3
done

