diff options
Diffstat (limited to 'storage/perfschema/table_replication_applier_status_by_coordinator.cc')
-rw-r--r-- | storage/perfschema/table_replication_applier_status_by_coordinator.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.cc b/storage/perfschema/table_replication_applier_status_by_coordinator.cc index 5f2427bed67..47b13cbcb5b 100644 --- a/storage/perfschema/table_replication_applier_status_by_coordinator.cc +++ b/storage/perfschema/table_replication_applier_status_by_coordinator.cc @@ -1,14 +1,21 @@ /* - Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 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 Foundation; version 2 of the License. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software @@ -85,7 +92,7 @@ table_replication_applier_status_by_coordinator::m_share= NULL, /* write_row */ NULL, /* delete_all_rows */ table_replication_applier_status_by_coordinator::get_row_count, - sizeof(PFS_simple_index), /* ref length */ + sizeof(pos_t), /* ref length */ &m_table_lock, &m_field_def, false, /* checked */ @@ -122,12 +129,10 @@ ha_rows table_replication_applier_status_by_coordinator::get_row_count() int table_replication_applier_status_by_coordinator::rnd_next(void) { Master_info *mi; - int res= HA_ERR_END_OF_FILE; - channel_map.rdlock(); for(m_pos.set_at(&m_next_pos); - m_pos.m_index < channel_map.get_max_channels() && res != 0; + m_pos.m_index < channel_map.get_max_channels(); m_pos.next()) { mi= channel_map.get_mi_at_pos(m_pos.m_index); @@ -144,12 +149,13 @@ int table_replication_applier_status_by_coordinator::rnd_next(void) { make_row(mi); m_next_pos.set_after(&m_pos); - res= 0; + channel_map.unlock(); + return 0; } } channel_map.unlock(); - return res; + return HA_ERR_END_OF_FILE; } int table_replication_applier_status_by_coordinator::rnd_pos(const void *pos) |