summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/mysql_upgrade_noengine.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/mysql_upgrade_noengine.test
parentInitial commit. (diff)
downloadmariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz
mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/mysql_upgrade_noengine.test')
-rw-r--r--mysql-test/main/mysql_upgrade_noengine.test86
1 files changed, 86 insertions, 0 deletions
diff --git a/mysql-test/main/mysql_upgrade_noengine.test b/mysql-test/main/mysql_upgrade_noengine.test
new file mode 100644
index 00000000..3cb811bb
--- /dev/null
+++ b/mysql-test/main/mysql_upgrade_noengine.test
@@ -0,0 +1,86 @@
+#
+# MDEV-11942 BLACKHOLE is no longer active in 10.1 by default, mysql_upgrade not handling the situation
+#
+source include/mysql_upgrade_preparation.inc;
+source include/have_innodb.inc;
+source include/not_embedded.inc;
+
+if (!$HA_BLACKHOLE_SO) {
+ skip Need blackhole plugin;
+}
+if (!$HA_ARCHIVE_SO) {
+ skip Need Archive plugin;
+}
+
+source include/switch_to_mysql_user.inc;
+drop view mysql.user_bak;
+
+let $datadir= `select @@datadir`;
+
+install soname 'ha_blackhole';
+install soname 'ha_archive';
+
+vertical_results;
+create table t1 (a int) engine=blackhole;
+create table t2 (a int) engine=archive;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1';
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2';
+
+flush tables;
+uninstall plugin blackhole;
+uninstall plugin archive;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1';
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2';
+
+--echo # upgrade from 10.1 - engines aren't enabled
+--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB /
+exec $MYSQL_UPGRADE --silent 2>&1;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1';
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2';
+
+drop table mysql.global_priv;
+rename table mysql.global_priv_bak to mysql.global_priv;
+source include/switch_to_mysql_user.inc;
+drop view mysql.user_bak;
+
+# pretend it's an upgrade from 10.0
+alter table mysql.user drop column default_role, drop column max_statement_time;
+
+# but mysql_upgrade_info tells otherwise
+remove_file $datadir/mysql_upgrade_info;
+write_file $datadir/mysql_upgrade_info;
+10.1.10-MariaDB
+EOF
+
+--echo # still upgrade from 10.1
+--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB /
+exec $MYSQL_UPGRADE --silent 2>&1;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1';
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2';
+
+drop table mysql.global_priv;
+rename table mysql.global_priv_bak to mysql.global_priv;
+source include/switch_to_mysql_user.inc;
+drop view mysql.user_bak;
+
+alter table mysql.user drop column default_role, drop column max_statement_time;
+remove_file $datadir/mysql_upgrade_info;
+
+--echo # upgrade from 10.0 - engines are enabled
+--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB /
+exec $MYSQL_UPGRADE --silent 2>&1;
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1';
+select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2';
+
+drop table t1, t2;
+
+remove_file $datadir/mysql_upgrade_info;
+# This is needed as mysql_upgrade can load the plugins
+uninstall plugin blackhole;
+uninstall plugin archive;
+
+drop table mysql.global_priv;
+rename table mysql.global_priv_bak to mysql.global_priv;
+
+FLUSH PRIVILEGES;
+SHOW GRANTS FOR root@localhost;