Commit Graph

3 Commits

Author SHA1 Message Date
Azat Khuzhin
103eb17107 Force table creation on SYSTEM FLUSH LOGS (v2)
After this patch SYSTEM FLUSH LOGS will force system.*_log table
creatoins (only for enabled tables of course).

This will avoid such hacks like:

   set log_queries=1;
   select 1;
   system flush logs;

This is the second version of the patch, since first has a deadlock [1]
(reported by @alesapin). This version does not use separate lock and do
not issue CREATE TABLE from the query execution thread, instead it
activate flushing thread to do so, hence this should be the same as if
the table will be created during flush.

  [1]: https://gist.github.com/alesapin/d915d1deaa27d49aa31223daded02be2

Fixes: #11563
Cc: @alesapin
Cc: @nikitamikhaylov
2020-06-11 23:12:23 +03:00
alesapin
5a9a63e9a1
Revert "Force table creation on SYSTEM FLUSH LOGS" 2020-06-11 13:22:24 +03:00
Azat Khuzhin
8a78cffe5c Force table creation on SYSTEM FLUSH LOGS 2020-06-09 21:11:08 +03:00