WL#9173: New data-dictionary: Improve crash-safety of non-table DDL.

Affects: Server-8.0   —   Status: Complete

With the advent of new data-dictionary it becomes possible to package 
metadata changes and writing binary log into single transaction.      
                                                                      
We aim to make DDL statements crash-safe by using    
this feature. However they don't cover DDL which does not involve     
storage engine.                                                       
                                                                     
The goal of this WL is to improve crash-safety of non-table DDLs:

  * CREATE [DEFINER = { user | CURRENT_USER }] FUNCTION 
            ([func_parameter[,...]]) RETURNS type
           [characteristic ...] 

  * ALTER FUNCTION  [ characteristic ...]

  * DROP FUNCTION [IF_EXISTS] 

  * CREATE [DEFINER = { user | CURRENT_USER }] PROCEDURE
           ([proc_parameters[,...]])
           [characteristic ... ] 

  * ALTER PROCEDURE  [ characteristic ...]

  * DROP PROCEDURE [IF_EXISTS] 

  * CREATE [DEFINER = { user | CURRENT_USER }] EVENT
           [IF NOT EXISTS] 
	   ON SCHEDULE schedule [ON COMPLETION [NOT] PRESERVE]
	   [ENABLE | DISABLE | DISABLE ON SLAVE] [COMMENT 'comment']
	   DO ;

  * ALTER [DEFINER = { user | CURRENT_USER }] EVENT
	    [ON SCHEDULE schedule]
	   [ON COMPLETION [NOT] PRESERVE] [RENAME TO new_event_name]
	   [ENABLE | DISABLE | DISABLE ON SLAVE] [COMMENT 'comment']
	   [DO event_body]

  * DROP EVENT [IF EXISTS] 

  * CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
           [DEFINER = { user | CURRENT_USER }]
           [SQL SECURITY { DEFINER | INVOKER }]
           VIEW  [(column_list)]
           AS select_statement
           [WITH [CASCADED | LOCAL] CHECK OPTION]


  * ALTER [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
          [DEFINER = { user | CURRENT_USER }]
	  [SQL SECURITY { DEFINER | INVOKER }]
	  VIEW  [(column_list)]
	  AS select_statement
	  [WITH [CASCADED | LOCAL] CHECK OPTION]

  * DROP VIEW [IF EXISTS] view_name [, view_name] ...
         [RESTRICT | CASCADE]

  * CREATE [AGGREGATE] FUNCTION  RETURNS
	   {STRING|INTEGER|REAL|DECIMAL} SONAME 

  * DROP FUNCTION 
                                                                      
                                                                      
By employing the new data-dictionary support for transactional changes.

The current approach for CREATE/DROP trigger bundles the operation
on data-dictionary tables and binlog event write in the same
transaction. Hence CREATE/DROP TRIGGER statements are already atomic
and no code changes are done for it as part of this WL.

ACL DDL's are already made atomic.

Other non-table DDLs
  * INSTALL PLUGIN plugin_name SONAME 'shared_library_name'

  * UNINSTALL PLUGIN plugin_name

  * INSTALL COMPONENT component_name [, component_name ] ...

  * UNINSTALL COMPONENT component_name [, component_name ] ...

  * CREATE SERVER server_name FOREIGN DATA WRAPPER wrapper_name
           OPTIONS (option[, option] ...)

  * ALTER SERVER  server_name OPTIONS (option [, option] ...)

  * DROP SERVER [ IF EXISTS ] server_name are handled