@@ -37,11 +37,14 @@ alter server s1 options(host 'server.example.org');
3737rename table mysql.servers to mysql.servers_save;
3838create table mysql.servers (x int);
3939alter server s1 options(host 'server.example.org');
40- ERROR HY000: The foreign server name you are trying to reference does not exist. Data source error: s1
40+ ERROR HY000: Cannot load from mysql.servers. The table is probably corrupted
41+ drop server s1;
42+ ERROR HY000: Cannot load from mysql.servers. The table is probably corrupted
4143create server s2 foreign data wrapper foo options(user 'a');
42- ERROR HY000: Can't read record in system table
44+ ERROR HY000: Cannot load from mysql.servers. The table is probably corrupted
4345drop table mysql.servers;
4446rename table mysql.servers_save to mysql.servers;
47+ flush privileges;
4548drop server s1;
4649#
4750# MDEV-35641 foreign server "disappears" after ALTERing the servers system table to use innodb and FLUSH PRIVILEGES
@@ -50,3 +53,54 @@ CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (HOST '127.0.0.1');
5053ALTER TABLE mysql.servers ENGINE=innodb;
5154FLUSH PRIVILEGES;
5255drop server s1;
56+ #
57+ # MDEV-35622 SEGV, ASAN use-after-poison when reading system table with less than expected number of columns
58+ # MDEV-37777 upgrade from MySQL 5.7 regression, mysql.servers invalid structure
59+ #
60+ # no crash:
61+ rename table mysql.servers to mysql.servers_save;
62+ create table mysql.servers like mysql.servers_save;
63+ alter table mysql.servers drop column owner;
64+ insert into mysql.servers values(0,0,0,0,0,0,0,0);
65+ flush privileges;
66+ ERROR HY000: Cannot load from mysql.servers. The table is probably corrupted
67+ drop table mysql.servers;
68+ # w/o PK
69+ create table mysql.servers like mysql.servers_save;
70+ alter table mysql.servers drop primary key;
71+ insert into mysql.servers values(0,0,0,0,0,0,0,0,0);
72+ flush privileges;
73+ ERROR HY000: Cannot load from mysql.servers. The table is probably corrupted
74+ drop table mysql.servers;
75+ # upgrade is ok
76+ create table mysql.servers like mysql.servers_save;
77+ alter table mysql.servers add column Options text;
78+ create server s1 foreign data wrapper mysql options (host '127.0.0.1');
79+ flush privileges;
80+ drop server s1;
81+ drop table mysql.servers;
82+ # MySQL 5.7 (MDEV-37777)
83+ create table mysql.servers like mysql.servers_save;
84+ alter table mysql.servers modify Host char(64) not null, modify Owner char(64) not null;
85+ create server s1 foreign data wrapper mysql options (host '127.0.0.1');
86+ flush privileges;
87+ drop server s1;
88+ drop table mysql.servers;
89+ rename table mysql.servers_save to mysql.servers;
90+ # plugin
91+ create table mysql.plugin_save like mysql.plugin;
92+ alter table mysql.plugin drop column dl;
93+ install soname "ha_example";
94+ ERROR HY000: Cannot load from mysql.plugin. The table is probably corrupted
95+ uninstall soname "ha_example";
96+ ERROR HY000: Cannot load from mysql.plugin. The table is probably corrupted
97+ drop table mysql.plugin;
98+ create table mysql.plugin like mysql.plugin_save;
99+ alter table mysql.plugin drop primary key;
100+ install soname "ha_example";
101+ ERROR HY000: Cannot load from mysql.plugin. The table is probably corrupted
102+ uninstall soname "ha_example";
103+ ERROR HY000: Cannot load from mysql.plugin. The table is probably corrupted
104+ drop table mysql.plugin;
105+ rename table mysql.plugin_save to mysql.plugin;
106+ # End of 10.11 tests
0 commit comments