From 938925211a6ea23b06859a875a3891810ed5e6e9 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 19 Aug 2019 19:49:45 +0300 Subject: MDEV-19254 Server crashes in maria_status with partitioned table Bug was that storage_engine::info() was called with not opened table in ha_partition::info(). Fixed by ensuring that we are using an opened table. --- sql/ha_partition.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sql/ha_partition.cc') diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index aa630e83ba0..5a78249644d 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -8304,6 +8304,7 @@ int ha_partition::info(uint flag) ulonglong max_records= 0; uint32 i= 0; uint32 handler_instance= 0; + bool handler_instance_set= 0; file_array= m_file; do @@ -8316,8 +8317,9 @@ int ha_partition::info(uint flag) !bitmap_is_set(&(m_part_info->read_partitions), (uint) (file_array - m_file))) file->info(HA_STATUS_VARIABLE | no_lock_flag | extra_var_flag); - if (file->stats.records > max_records) + if (file->stats.records > max_records || !handler_instance_set) { + handler_instance_set= 1; max_records= file->stats.records; handler_instance= i; } -- cgit v1.2.1