CREATE TABLE t0 (v1 DOUBLE, v2 ENUM('red', 'green', 'blue'), v3 INT, v4 TINYBLOB);
CREATE TABLE t1 (v1 VARBINARY(6), v2 BOOLEAN, v3 FLOAT, v4 LONGTEXT);
CREATE TABLE t2 (v1 DATE, v2 TEXT, v3 SMALLINT, v4 DATETIME);
CREATE VIEW v0 AS SELECT t0.v1, t0.v2, t1.v3, t2.v4 FROM t0 JOIN t1 ON t0.v3 = CAST(HEX(t1.v1) AS UNSIGNED) JOIN t2 ON t0.v3 = t2.v3 WHERE t0.v2 = 'blue' AND t1.v2 = TRUE;
ALTER VIEW v0 AS SELECT t0.v1, t0.v2, t1.v3, t2.v4 FROM t0 JOIN t1 ON t0.v3 = CAST(HEX(t1.v1) AS UNSIGNED) JOIN t2 ON t0.v3 = t2.v3 WHERE t0.v2 = 'green' AND t1.v2 = FALSE;
CREATE SERVER srv_mariadb FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '/var/run/mysqld/mysqld.sock', USER 'mariadb_user');
FLUSH TABLE t0, t1 FOR EXPORT;
OPTIMIZE TABLE t0, t1;
DROP SERVER srv_mariadb;

