mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-32919 Cannot select particular field from IS.tables in case table needs upgrade from MySQL 5.7
use the same condition in fill_schema_table_from_frm() when open_table_from_share() fails, as in fill_schema_table_from_frm() when tdc_aquire_share() fails and as in fill_schema_table_from_open() when open_table_from_share() fails
This commit is contained in:
@@ -20,6 +20,15 @@ show create table tempty;
|
|||||||
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.tempty` FORCE" or dump/reload to fix it!
|
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.tempty` FORCE" or dump/reload to fix it!
|
||||||
select * from tempty;
|
select * from tempty;
|
||||||
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.tempty` FORCE" or dump/reload to fix it!
|
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.tempty` FORCE" or dump/reload to fix it!
|
||||||
|
select table_name, table_comment from information_schema.tables where table_schema='test' and table_comment!='VIEW';
|
||||||
|
table_name table_comment
|
||||||
|
mysql_json_test Table rebuild required. Please do "ALTER TABLE `test.mysql_json_test` FORCE" or dump/reload to fix it!
|
||||||
|
mysql_json_test_big Table rebuild required. Please do "ALTER TABLE `test.mysql_json_test_big` FORCE" or dump/reload to fix it!
|
||||||
|
tempty Table rebuild required. Please do "ALTER TABLE `test.tempty` FORCE" or dump/reload to fix it!
|
||||||
|
Warnings:
|
||||||
|
Warning 1707 Table rebuild required. Please do "ALTER TABLE `test.mysql_json_test_big` FORCE" or dump/reload to fix it!
|
||||||
|
Warning 1707 Table rebuild required. Please do "ALTER TABLE `test.mysql_json_test` FORCE" or dump/reload to fix it!
|
||||||
|
Warning 1707 Table rebuild required. Please do "ALTER TABLE `test.tempty` FORCE" or dump/reload to fix it!
|
||||||
alter table tempty force;
|
alter table tempty force;
|
||||||
show create table tempty;
|
show create table tempty;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@@ -43,6 +43,9 @@ show create table tempty;
|
|||||||
--error ER_TABLE_NEEDS_REBUILD
|
--error ER_TABLE_NEEDS_REBUILD
|
||||||
select * from tempty;
|
select * from tempty;
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
select table_name, table_comment from information_schema.tables where table_schema='test' and table_comment!='VIEW';
|
||||||
|
|
||||||
alter table tempty force;
|
alter table tempty force;
|
||||||
show create table tempty;
|
show create table tempty;
|
||||||
|
|
||||||
|
@@ -5078,10 +5078,17 @@ static int fill_schema_table_from_frm(THD *thd, MEM_ROOT *mem_root,
|
|||||||
goto end_share;
|
goto end_share;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!open_table_from_share(thd, share, table_name, 0,
|
res= open_table_from_share(thd, share, table_name, 0,
|
||||||
(EXTRA_RECORD | OPEN_FRM_FILE_ONLY),
|
EXTRA_RECORD | OPEN_FRM_FILE_ONLY,
|
||||||
thd->open_options, &tbl, FALSE))
|
thd->open_options, &tbl, FALSE);
|
||||||
|
if (res && hide_object_error(thd->get_stmt_da()->sql_errno()))
|
||||||
|
res= 0;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
char buf[NAME_CHAR_LEN + 1];
|
||||||
|
if (unlikely(res))
|
||||||
|
get_table_engine_for_i_s(thd, buf, &table_list, db_name, table_name);
|
||||||
|
|
||||||
tbl.s= share;
|
tbl.s= share;
|
||||||
table_list.table= &tbl;
|
table_list.table= &tbl;
|
||||||
table_list.view= (LEX*) share->is_view;
|
table_list.view= (LEX*) share->is_view;
|
||||||
|
Reference in New Issue
Block a user