~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

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
call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc");
 
3
use test;
 
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()
 
9
set @x = 42;
 
10
create function bug14233_f() returns int
 
11
return 42;
 
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;
 
15
call bug14233();
 
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;
 
24
call bug14233();
 
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;
 
31
call bug14233();
 
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;
 
38
flush privileges;
 
39
delete from mysql.proc where name like 'bug14233%';
 
40
insert into mysql.proc
 
41
(
 
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,
 
45
body_utf8
 
46
)
 
47
values
 
48
(
 
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', '', '',
 
53
'', '', '',
 
54
'select count(*) from mysql.user'
 
55
),
 
56
(
 
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', '', '',
 
61
'', '', '',
 
62
'begin declare x int; select count(*) into x from mysql.user; end'
 
63
),
 
64
(
 
65
'test', 'bug14233_3', 'PROCEDURE', 'bug14233_3', 'SQL', 'READS_SQL_DATA','NO',
 
66
'DEFINER', '', '',
 
67
'alksj wpsj sa ^#!@ ',
 
68
'root@localhost', NOW() , '0000-00-00 00:00:00', '', '',
 
69
'', '', '',
 
70
'alksj wpsj sa ^#!@ '
 
71
);
 
72
select bug14233_1();
 
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)
 
76
select bug14233_2();
 
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)
 
80
call bug14233_3();
 
81
ERROR HY000: Failed to load routine test.bug14233_3. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
 
82
drop trigger t1_ai;
 
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)
 
86
drop trigger t1_ai;
 
87
drop table t1;
 
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()
 
103
SET @foo = 10;
 
104
CALL 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()
 
111
SET @foo = 10;
 
112
ERROR HY000: Cannot load from mysql.proc. The table is probably corrupted
 
113
# Procedure loaded from the cache
 
114
CALL p1();
 
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;
 
120
#
 
121
# Bug#51376 Assert `! is_set()' failed in 
 
122
#           Diagnostics_area::set_ok_status on DROP FUNCTION
 
123
#
 
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;
 
129
DROP FUNCTION f1;
 
130
ERROR 42S02: Table 'mysql.procs_priv' doesn't exist
 
131
SHOW WARNINGS;
 
132
Level   Code    Message
 
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;
 
138
#
 
139
# Bug #56137 "Assertion `thd->lock == 0' failed on upgrading from
 
140
#             5.1.50 to 5.5.6".
 
141
#
 
142
drop database if exists mysqltest;
 
143
# Backup mysql.proc.
 
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;
 
150
Warnings:
 
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;
 
154
#
 
155
# Bug#58414 mysql_upgrade fails on dump upgrade between 5.1.53 -> 5.5.8
 
156
#
 
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;
 
162
CREATE DATABASE db1;
 
163
CREATE PROCEDURE db1.p1() SET @foo = 10;
 
164
# Modify a field of the table.
 
165
ALTER TABLE mysql.proc MODIFY comment CHAR (32);
 
166
DROP DATABASE db1;
 
167
Warnings:
 
168
Error   1548    Cannot load from mysql.proc. The table is probably corrupted
 
169
# Restore mysql.proc
 
170
DROP TABLE mysql.proc;
 
171
RENAME TABLE proc_backup TO mysql.proc;