1
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted");
3
drop procedure if exists bug14233;
4
drop function if exists bug14233;
5
drop table if exists t1;
6
drop view if exists v1;
7
create procedure bug14233()
9
create function bug14233_f() returns int
11
create table t1 (id int);
12
create trigger t1_ai after insert on t1 for each row call bug14233();
13
alter table mysql.proc drop type;
15
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
16
create view v1 as select bug14233_f();
17
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
18
insert into t1 values (0);
19
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
20
show procedure status;
21
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
22
flush table mysql.proc;
24
ERROR HY000: Incorrect information in file: './mysql/proc.frm'
25
create view v1 as select bug14233_f();
26
ERROR HY000: Incorrect information in file: './mysql/proc.frm'
27
insert into t1 values (0);
28
ERROR HY000: Incorrect information in file: './mysql/proc.frm'
29
flush table mysql.proc;
31
ERROR 42S02: Table 'mysql.proc' doesn't exist
32
create view v1 as select bug14233_f();
33
ERROR 42S02: Table 'mysql.proc' doesn't exist
34
insert into t1 values (0);
35
ERROR 42S02: Table 'mysql.proc' doesn't exist
36
flush table mysql.proc;
38
delete from mysql.proc where name like 'bug14233%';
39
insert into mysql.proc
41
db, name, type, specific_name, language, sql_data_access, is_deterministic,
42
security_type, param_list, returns, body, definer, created, modified,
43
sql_mode, comment, character_set_client, collation_connection, db_collation,
48
'test', 'bug14233_1', 'FUNCTION', 'bug14233_1', 'SQL', 'READS_SQL_DATA', 'NO',
49
'DEFINER', '', 'int(10)',
50
'select count(*) from mysql.user',
51
'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
53
'select count(*) from mysql.user'
56
'test', 'bug14233_2', 'FUNCTION', 'bug14233_2', 'SQL', 'READS_SQL_DATA', 'NO',
57
'DEFINER', '', 'int(10)',
58
'begin declare x int; select count(*) into x from mysql.user; end',
59
'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
61
'begin declare x int; select count(*) into x from mysql.user; end'
64
'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO',
66
'alksj wpsj sa ^#!@ ',
67
'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
72
ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
73
create view v1 as select bug14233_1();
74
ERROR HY000: Failed to load routine test.bug14233_1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
76
ERROR HY000: Failed to load routine test.bug14233_2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
77
create view v1 as select bug14233_2();
78
ERROR HY000: Failed to load routine test.bug14233_2. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
80
ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
82
create trigger t1_ai after insert on t1 for each row call bug14233_3();
83
insert into t1 values (0);
84
ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
87
drop function bug14233_1;
88
drop function bug14233_2;
89
drop procedure bug14233_3;
90
show procedure status where db=DATABASE();
91
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
92
show function status where db=DATABASE();
93
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
94
DROP TABLE IF EXISTS proc_backup;
95
DROP PROCEDURE IF EXISTS p1;
96
# Backup the proc table
97
RENAME TABLE mysql.proc TO proc_backup;
98
CREATE TABLE mysql.proc LIKE proc_backup;
99
FLUSH TABLE mysql.proc;
100
# Test with a valid table.
101
CREATE PROCEDURE p1()
104
SHOW PROCEDURE STATUS;
105
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
106
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
107
# Modify a field of the table.
108
ALTER TABLE mysql.proc MODIFY comment CHAR (32);
109
CREATE PROCEDURE p2()
111
ERROR HY000: Cannot load from mysql.proc. The table is probably corrupted
112
# Procedure loaded from the cache
114
SHOW PROCEDURE STATUS;
115
ERROR HY000: Cannot load from mysql.proc. The table is probably corrupted
116
DROP TABLE mysql.proc;
117
RENAME TABLE proc_backup TO mysql.proc;
118
FLUSH TABLE mysql.proc;