~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/r/sp-destruct.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted");
 
2
use test;
 
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()
 
8
set @x = 42;
 
9
create function bug14233_f() returns int
 
10
return 42;
 
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;
 
14
call bug14233();
 
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;
 
23
call bug14233();
 
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;
 
30
call bug14233();
 
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;
 
37
flush privileges;
 
38
delete from mysql.proc where name like 'bug14233%';
 
39
insert into mysql.proc
 
40
(
 
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,
 
44
body_utf8
 
45
)
 
46
values
 
47
(
 
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', '', '',
 
52
'', '', '',
 
53
'select count(*) from mysql.user'
 
54
),
 
55
(
 
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', '', '',
 
60
'', '', '',
 
61
'begin declare x int; select count(*) into x from mysql.user; end'
 
62
),
 
63
(
 
64
'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO',
 
65
'DEFINER', '', '',
 
66
'alksj wpsj sa ^#!@ ',
 
67
'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
 
68
'', '', '',
 
69
'alksj wpsj sa ^#!@ '
 
70
);
 
71
select bug14233_1();
 
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)
 
75
select bug14233_2();
 
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)
 
79
call bug14233_3();
 
80
ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
 
81
drop trigger t1_ai;
 
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)
 
85
drop trigger t1_ai;
 
86
drop table t1;
 
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()
 
102
SET @foo = 10;
 
103
CALL 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()
 
110
SET @foo = 10;
 
111
ERROR HY000: Cannot load from mysql.proc. The table is probably corrupted
 
112
# Procedure loaded from the cache
 
113
CALL p1();
 
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;