Fixes over the original patch:
- Fix variable/class/other names
- Fix the JSON output to be in line with the output of other JSON
constructs we produce
When writing rows with a minimal row image, it is possible to receive
empty events. In that case m_curr_row and m_rows_end are the same,
however the event implies an insert into the table with the default
values associated for that table.
Due to how events are created with a minimal binlog_row_image, it is
possible to receive empty write events because all the columns
in the table have a default value. (For example an auto-increment)
Make sure we account for that.
The rpl_injector code is now considered dead code.
This patch only removes the minimum number of function calls
to allow implementing binlog_row_image. The other functions are to be
removed in a subsequent patch.
Depending on which binlog_row_image we are using, we must
mark columns which to update differently both in the before image
as well as the after image.
Analysis: Flush changed page bitmaps calls log_online_follow_redo_log
that later calls log_group_read_log_seg with release_mutex = true
and that causes the log_sys mutex being released before
log_decrypt_after_read function that later required log_sys mutex.
Fix: Enter log_sys mutex before log_decrypt_after_read if mutex
is released and release the mutex after the function if we
acquired it before function call.
TDC_element::free_tables_back() had pre-lfhash leftover code, which referenced
TDC_element::free_tables via TDC_element::share. This is not correct as share
may be NULL (newly inserted or to be removed), instead access free_tables
directly.
ORDER BY against union may confuse name resolution context, causing valid
SQL statements to fail.
The purpose of context change was presumably intended for the duration of
gathering field list for ORDER BY. However it isn't actually required (name
resolution context is never accessed by the latter).
See also alternative solution (in MySQL 5.7): 92145b95.
Test create_or_replace should make sure that background decrypt
operation is finished and flush all dirty pages using restart
to clean up the database before ending.
Pretend that CREATE TABLE and CREATE TEMPORARY TABLE are
two different commands internally. The user doesn't need
to know that they both are SQLCOM_CREATE_TABLE.
Same for DROP [TEMPORARY] TABLE
Old code worked because plugin locking guaranteed that
encryption plugin is deinitialized last.
But compiled-in plugins are never locked.
This fixes encryption failures on fulltest builder