| Bug #48449 | hang on show create view after upgrading when view contains function of view | ||
|---|---|---|---|
| Submitted: | 31 Oct 13:10 | Modified: | 31 Oct 13:10 |
| Reporter: | Susanne Ebrecht | ||
| Status: | Analyzing | ||
| Category: | Server: DDL | Severity: | S1 (Critical) |
| Version: | 5.1 | OS: | Any |
| Assigned to: | Susanne Ebrecht | Target Version: | |
| Triage: | Needs Triage: D1 (Critical) | ||
[31 Oct 13:10]
Susanne Ebrecht
[13 Nov 10:19]
Shane Bester
how to repeat:
--------------
1. on 5.0.87 run this sql:
delimiter ;
drop table if exists t1,t2,v1,v2;
drop function if exists f;
create table t1(a int)engine=myisam;
insert into t1 values (1),(2);
create or replace view v1 as select * from t1;
delimiter $
create function f() returns int
begin
select * from v1 left join v1 t1 using(a) limit 1 into @a;
return @a;
end $
delimiter ;
create or replace view v2 as select f() from v1;
show create table v2;
2. Now, shutdown 5.0.87 and place this datadir into 5.1.40.
3. startup 5.1.40 and run mysql_upgrade -uroot.
4. login to 5.1.40 and run 'show create table v2'.
5. cpu flatlines at 100%.
we also notice a bug in the mysql_upgrade procedure, the following messages appear in the
error log:
Stored routine 'test'.'f': invalid value in column mysql.proc.character_set_client.
Stored routine 'test'.'f': invalid value in column mysql.proc.collation_connection.
Stored routine 'test'.'f': invalid value in column mysql.proc.db_collation.
