diff options
author | Monty <monty@mariadb.org> | 2019-08-19 19:49:45 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2019-08-19 19:49:45 +0300 |
commit | 938925211a6ea23b06859a875a3891810ed5e6e9 (patch) | |
tree | 64ec2d25e49d465888be78e382579b1b5f082948 /sql/ha_partition.cc | |
parent | 6dd3f24090ce2d237037eb09cf7db083ebbc92f9 (diff) | |
download | mariadb-git-938925211a6ea23b06859a875a3891810ed5e6e9.tar.gz |
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.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |