mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / r / sp-destruct.result
bloba9db461e84e9f6a98f4bcac625863c54ef848065
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
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
47 values
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'
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'
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 ^#!@ '
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;