mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31776 Online ALTER reports the number of affected rows incorrectly
Add a new virtual function that will increase the inserted rows count for the insert log event and decrease it for the delete event. Reuses Rows_log_event::m_row_count on the replication side, which was only set on the logging side.
This commit is contained in:
committed by
Sergei Golubchik
parent
9c8554259a
commit
e026a366bf
@@ -1564,6 +1564,12 @@ public:
|
||||
|
||||
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
|
||||
|
||||
/**
|
||||
Increase or decrease the rows inserted during ALTER TABLE based on the event
|
||||
type.
|
||||
*/
|
||||
virtual void online_alter_update_row_count(ha_rows *) const {}
|
||||
|
||||
/**
|
||||
Apply the event to the database.
|
||||
|
||||
@@ -4973,6 +4979,11 @@ public:
|
||||
|
||||
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
|
||||
uint8 get_trg_event_map() const override;
|
||||
|
||||
void online_alter_update_row_count(ha_rows *rows) const override
|
||||
{
|
||||
*rows += m_row_count;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
@@ -5148,6 +5159,11 @@ public:
|
||||
|
||||
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
|
||||
uint8 get_trg_event_map() const override;
|
||||
|
||||
void online_alter_update_row_count(ha_rows *rows) const override
|
||||
{
|
||||
*rows -= m_row_count;
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user