1
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted");
2
call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc");
4
drop procedure if exists bug14233;
5
drop function if exists bug14233;
6
drop table if exists t1;
7
drop view if exists v1;
8
create procedure bug14233()
10
create function bug14233_f() returns int
12
create table t1 (id int);
13
create trigger t1_ai after insert on t1 for each row call bug14233();
14
alter table mysql.proc drop type;
16
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
17
create view v1 as select bug14233_f();
18
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
19
insert into t1 values (0);
20
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
21
show procedure status;
22
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
23
flush table mysql.proc;
25
ERROR HY000: Incorrect information in file: './mysql/proc.frm'
26
create view v1 as select bug14233_f();
27
ERROR HY000: Incorrect information in file: './mysql/proc.frm'
28
insert into t1 values (0);
29
ERROR HY000: Incorrect information in file: './mysql/proc.frm'
30
flush table mysql.proc;
32
ERROR 42S02: Table 'mysql.proc' doesn't exist
33
create view v1 as select bug14233_f();
34
ERROR 42S02: Table 'mysql.proc' doesn't exist
35
insert into t1 values (0);
36
ERROR 42S02: Table 'mysql.proc' doesn't exist
37
flush table mysql.proc;
39
delete from mysql.proc where name like 'bug14233%';
40
insert into mysql.proc
42
db, name, type, specific_name, language, sql_data_access, is_deterministic,
43
security_type, param_list, returns, body, definer, created, modified,
44
sql_mode, comment, character_set_client, collation_connection, db_collation,
49
'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO',
50
'DEFINER', '', 'int(10)',
51
'select count(*) from mysql.user',
52
'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
54
'select count(*) from mysql.user'
57
'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO',
58
'DEFINER', '', 'int(10)',
59
'begin declare x int; select count(*) into x from mysql.user; end',
60
'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
62
'begin declare x int; select count(*) into x from mysql.user; end'
65
'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO',
67
'alksj wpsj sa ^#!@ ',
68
'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
73
ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
74
create view v1 as select bug14233_1();
75
ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
77
ERROR HY000: Failed to load routine test.bug14233_2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
78
create view v1 as select bug14233_2();
79
ERROR HY000: Failed to load routine test.bug14233_2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
81
ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
83
create trigger t1_ai after insert on t1 for each row call bug14233_3();
84
insert into t1 values (0);
85
ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
88
drop function bug14233_1;
89
drop function bug14233_2;
90
drop procedure bug14233_3;
91
show procedure status where db=DATABASE();
92
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
93
show function status where db=DATABASE();
94
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
95
DROP TABLE IF EXISTS proc_backup;
96
DROP PROCEDURE IF EXISTS p1;
97
# Backup the proc table
98
RENAME TABLE mysql.proc TO proc_backup;
99
CREATE TABLE mysql.proc LIKE proc_backup;
100
FLUSH TABLE mysql.proc;
101
# Test with a valid table.
102
CREATE PROCEDURE p1()
105
SHOW PROCEDURE STATUS;
106
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
107
test p1 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
108
# Modify a field of the table.
109
ALTER TABLE mysql.proc MODIFY comment CHAR (32);
110
CREATE PROCEDURE p2()
112
ERROR HY000: Cannot load from mysql.proc. The table is probably corrupted
113
# Procedure loaded from the cache
115
SHOW PROCEDURE STATUS;
116
ERROR HY000: Cannot load from mysql.proc. The table is probably corrupted
117
DROP TABLE mysql.proc;
118
RENAME TABLE proc_backup TO mysql.proc;
119
FLUSH TABLE mysql.proc;
121
# Bug#51376 Assert `! is_set()' failed in
122
# Diagnostics_area::set_ok_status on DROP FUNCTION
124
DROP FUNCTION IF EXISTS f1;
125
CREATE FUNCTION f1() RETURNS INT RETURN 1;
126
# Backup the procs_priv table
127
RENAME TABLE mysql.procs_priv TO procs_priv_backup;
128
FLUSH TABLE mysql.procs_priv;
130
ERROR 42S02: Table 'mysql.procs_priv' doesn't exist
133
Error 1146 Table 'mysql.procs_priv' doesn't exist
134
Warning 1405 Failed to revoke all privileges to dropped routine
135
# Restore the procs_priv table
136
RENAME TABLE procs_priv_backup TO mysql.procs_priv;
137
FLUSH TABLE mysql.procs_priv;
139
# Bug #56137 "Assertion `thd->lock == 0' failed on upgrading from
142
drop database if exists mysqltest;
144
flush table mysql.proc;
145
create database mysqltest;
146
# Corrupt mysql.proc to make it unusable by current version of server.
147
alter table mysql.proc drop column type;
148
# The below statement should not cause assertion failure.
149
drop database mysqltest;
151
Error 1547 Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
152
# Restore mysql.proc.
153
drop table mysql.proc;
155
# Bug#58414 mysql_upgrade fails on dump upgrade between 5.1.53 -> 5.5.8
157
DROP TABLE IF EXISTS proc_backup;
158
DROP DATABASE IF EXISTS db1;
159
# Backup the proc table
160
RENAME TABLE mysql.proc TO proc_backup;
161
CREATE TABLE mysql.proc LIKE proc_backup;
163
CREATE PROCEDURE db1.p1() SET @foo = 10;
164
# Modify a field of the table.
165
ALTER TABLE mysql.proc MODIFY comment CHAR (32);
168
Error 1548 Cannot load from mysql.proc. The table is probably corrupted
170
DROP TABLE mysql.proc;
171
RENAME TABLE proc_backup TO mysql.proc;