summaryrefslogtreecommitdiff
path: root/mysql-test/main/mysql_upgrade_noengine.test
blob: 1d65e7ffa1c3a15f997c6472ec04a4334ebbbc0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# MDEV-11942 BLACKHOLE is no longer active in 10.1 by default, mysql_upgrade not handling the situation
#
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;
}

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';

# upgrade from 10.1 - engines aren't enabled
exec $MYSQL_UPGRADE 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';

# 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

# still upgrade from 10.1
exec $MYSQL_UPGRADE 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';

alter table mysql.user drop column default_role, drop column max_statement_time;
remove_file $datadir/mysql_upgrade_info;

# upgrade from 10.0 - engines are enabled
exec $MYSQL_UPGRADE 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;
uninstall plugin blackhole;
uninstall plugin archive;