Description:
When investigating bug#38751 I found that ha_archive rely on ::info calls for flushing written data from its write buffer to disk before reading. This seems like a violation of the handler api, and should be changed.
How to repeat:
in either gdb or by using the debug-output:
do a insert and then alter the same table.
Read the code in ha_archive.cc (ha_archive::info) and in sql_table.cc (mysql_prepare_alter_table)
Suggested fix:
Implement ha_archive::extra, and send a
HA_EXTRA_FLUSH_CACHE in mysql_prepare_alter_table, instead of doing the flush through:
mysql_alter_table
mysql_prepare_alter_table
table->file->update_create_info
info(HA_STATUS_AUTO)
flush of written records...
Should probably be:
mysql_alter_table
mysql_prepare_alter_table
table->file->extra(HA_EXTRA_FLUSH_CACHE)
flush of written records...
And add comments for this use of HA_EXTRA_FLUSH_CACHE. (There might be a better flag to use, but this seems close enough for me)