mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Fix for bug#7211: information_schema: crash if bad view(after review)
This commit is contained in:
@@ -599,6 +599,18 @@ create view t3 (c) as select sub1(1);
|
|||||||
create table t4(f1 int, KEY f1_key (f1));
|
create table t4(f1 int, KEY f1_key (f1));
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop function sub1;
|
drop function sub1;
|
||||||
|
select table_name from information_schema.views
|
||||||
|
where table_schema='test';
|
||||||
|
table_name
|
||||||
|
Warnings:
|
||||||
|
Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s)
|
||||||
|
Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s)
|
||||||
|
select table_name from information_schema.views
|
||||||
|
where table_schema='test';
|
||||||
|
table_name
|
||||||
|
Warnings:
|
||||||
|
Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s)
|
||||||
|
Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s)
|
||||||
select column_name from information_schema.columns
|
select column_name from information_schema.columns
|
||||||
where table_schema='test';
|
where table_schema='test';
|
||||||
column_name
|
column_name
|
||||||
|
@@ -295,6 +295,7 @@ show tables like "T%";
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Bug#7212: information_schema: "Can't find file" errors if storage engine gone
|
# Bug#7212: information_schema: "Can't find file" errors if storage engine gone
|
||||||
|
# Bug#7211: information_schema: crash if bad view
|
||||||
#
|
#
|
||||||
use test;
|
use test;
|
||||||
create function sub1(i int) returns int
|
create function sub1(i int) returns int
|
||||||
@@ -305,6 +306,10 @@ create view t3 (c) as select sub1(1);
|
|||||||
create table t4(f1 int, KEY f1_key (f1));
|
create table t4(f1 int, KEY f1_key (f1));
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop function sub1;
|
drop function sub1;
|
||||||
|
select table_name from information_schema.views
|
||||||
|
where table_schema='test';
|
||||||
|
select table_name from information_schema.views
|
||||||
|
where table_schema='test';
|
||||||
select column_name from information_schema.columns
|
select column_name from information_schema.columns
|
||||||
where table_schema='test';
|
where table_schema='test';
|
||||||
select index_name from information_schema.statistics where table_schema='test';
|
select index_name from information_schema.statistics where table_schema='test';
|
||||||
|
@@ -2871,7 +2871,14 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables,
|
|||||||
table->file->write_row(table->record[0]);
|
table->file->write_row(table->record[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBUG_RETURN(res);
|
else
|
||||||
|
{
|
||||||
|
if (tables->view)
|
||||||
|
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||||
|
thd->net.last_errno, thd->net.last_error);
|
||||||
|
thd->clear_error();
|
||||||
|
}
|
||||||
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user