MDEV-33348 ALTER TABLE lock waiting stages are indistinguishable
Several points of synchronization during ALTER TABLE COPY looked identical
in the progress report query. Besides, if its the late lock upgrade stage,
the data would be:
STAGE 0
MAX_STAGE 0
PROGRESS 0.000
which looks irrelevant.
This patch moves thd_progress_deinit call after the last lock upgrade.
Also, for online alter, if there is nothing to replicate, the
progress and max_progress values would be 0, which discard the result data
on the side of sql_show, see processlist_callback in sql_show.cc.
So now the minimal max_progress will be 1. To avoid 0% progress in the
report, minimax progress value is also set to 1, so we will see 100% if
there's nothing to replicate.
online alter: relax the lock to upgrade to on the last replication stage
This will allow selects pass until the rename/commit stage.
The lock is anyway upgraded to MDL_EXCLUSIVE later by the
wait_while_table_is_used call in mysql_alter_table.
MDEV-32614 LeakSanitizer errors in copy_data_between_tables
The memory leak occurs on error when backup_reset_alter_copy_lock fails
with timeout. This leads to the alter rollback, but flush_unused is not
called.
Move table flushing on error handling to a single place and mind more
possible failures this time.
MDEV-32803 Assertion `total == 0' failed in Event_log::write_cache_raw
A second DML in a transaction for a table of non-rollbackable engine
leads to a cache corruption, because the cache wasn't reset after a
statement end, but also wasn't destroyed.
This patch resets the cache for a reuse by subsequent statements in
current transaction.
MDEV-33182 Server assertion fails when trying to test the connection with DBeaver
Some connectors (JDBC, Node.js) can sent non-default collation IDs
in the handshake packet. The code in thd_init_client_charset() handling
@@character_set_collations did not expect that and crashed on DBUG_ASSERT.
Changing the code to ignore @@character_set_collations in case of non-default
IDs. This fixes the problem in a backward compatible
(with pre-@@character_set_collations server versions) way for such connectors
sending non-default IDs.
468d29f...
by
Rucha Deodhar <email address hidden>