MDEV-16267 Wrong INFORMATION_SCHEMA.INNODB_BUFFER_PAGE.TABLE_NAME

i_s_innodb_buffer_page_fill(), i_s_innodb_buf_page_lru_fill():
Only invoke Field::set_notnull() if the index was found.
This commit is contained in:
Marko Mäkelä 2018-05-24 11:38:34 +03:00
parent a816aa066e
commit a61724a3ca
2 changed files with 38 additions and 18 deletions

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -4955,9 +4955,11 @@ i_s_innodb_buffer_page_fill(
mutex_enter(&dict_sys->mutex); mutex_enter(&dict_sys->mutex);
if (const dict_index_t* index = const dict_index_t* index =
dict_index_get_if_in_cache_low( dict_index_get_if_in_cache_low(
page_info->index_id)) { page_info->index_id);
if (index) {
table_name_end = innobase_convert_name( table_name_end = innobase_convert_name(
table_name, sizeof(table_name), table_name, sizeof(table_name),
index->table_name, index->table_name,
@ -4980,7 +4982,10 @@ i_s_innodb_buffer_page_fill(
OK(ret); OK(ret);
fields[IDX_BUFFER_PAGE_TABLE_NAME]->set_notnull(); if (index) {
fields[IDX_BUFFER_PAGE_TABLE_NAME]
->set_notnull();
}
} }
OK(fields[IDX_BUFFER_PAGE_NUM_RECS]->store( OK(fields[IDX_BUFFER_PAGE_NUM_RECS]->store(
@ -5657,9 +5662,11 @@ i_s_innodb_buf_page_lru_fill(
mutex_enter(&dict_sys->mutex); mutex_enter(&dict_sys->mutex);
if (const dict_index_t* index = const dict_index_t* index =
dict_index_get_if_in_cache_low( dict_index_get_if_in_cache_low(
page_info->index_id)) { page_info->index_id);
if (index) {
table_name_end = innobase_convert_name( table_name_end = innobase_convert_name(
table_name, sizeof(table_name), table_name, sizeof(table_name),
index->table_name, index->table_name,
@ -5682,7 +5689,10 @@ i_s_innodb_buf_page_lru_fill(
OK(ret); OK(ret);
fields[IDX_BUF_LRU_PAGE_TABLE_NAME]->set_notnull(); if (index) {
fields[IDX_BUF_LRU_PAGE_TABLE_NAME]
->set_notnull();
}
} }
OK(fields[IDX_BUF_LRU_PAGE_NUM_RECS]->store( OK(fields[IDX_BUF_LRU_PAGE_NUM_RECS]->store(

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -4943,9 +4943,11 @@ i_s_innodb_buffer_page_fill(
mutex_enter(&dict_sys->mutex); mutex_enter(&dict_sys->mutex);
if (const dict_index_t* index = const dict_index_t* index =
dict_index_get_if_in_cache_low( dict_index_get_if_in_cache_low(
page_info->index_id)) { page_info->index_id);
if (index) {
table_name_end = innobase_convert_name( table_name_end = innobase_convert_name(
table_name, sizeof(table_name), table_name, sizeof(table_name),
index->table_name, index->table_name,
@ -4968,7 +4970,10 @@ i_s_innodb_buffer_page_fill(
OK(ret); OK(ret);
fields[IDX_BUFFER_PAGE_TABLE_NAME]->set_notnull(); if (index) {
fields[IDX_BUFFER_PAGE_TABLE_NAME]
->set_notnull();
}
} }
OK(fields[IDX_BUFFER_PAGE_NUM_RECS]->store( OK(fields[IDX_BUFFER_PAGE_NUM_RECS]->store(
@ -5642,9 +5647,11 @@ i_s_innodb_buf_page_lru_fill(
mutex_enter(&dict_sys->mutex); mutex_enter(&dict_sys->mutex);
if (const dict_index_t* index = const dict_index_t* index =
dict_index_get_if_in_cache_low( dict_index_get_if_in_cache_low(
page_info->index_id)) { page_info->index_id);
if (index) {
table_name_end = innobase_convert_name( table_name_end = innobase_convert_name(
table_name, sizeof(table_name), table_name, sizeof(table_name),
index->table_name, index->table_name,
@ -5667,7 +5674,10 @@ i_s_innodb_buf_page_lru_fill(
OK(ret); OK(ret);
fields[IDX_BUF_LRU_PAGE_TABLE_NAME]->set_notnull(); if (index) {
fields[IDX_BUF_LRU_PAGE_TABLE_NAME]
->set_notnull();
}
} }
OK(fields[IDX_BUF_LRU_PAGE_NUM_RECS]->store( OK(fields[IDX_BUF_LRU_PAGE_NUM_RECS]->store(