WL#6390: Use new DD API for handling non-partitioned tables

Affects: Server-8.0   —   Status: Complete

Use new DD for opening tables, and update DDL to support
new object(s). 

The goal here is to make MySQL server use new DD API
to store metadata instead of .FRM files. Following are some
requirements to achieve the same.

R1) Create new DD tables as part of mysql_install_db.

  We need to create new DD tables before any other
  table is created. So that metadata of rest all
  tables (this is created in mysql_install_db) is
  stored in new DD tables.

  The new DD tables uses foreign keys. InnoDB needs
  innodb_table_stats and innodb_index_stats in order
  to stored foreign key details. Hence we treat
  these 2 innodb tables as DD tables for now and create
  them along with new DD tables.

  As this WL is being handled before the new DD
  bootstrapping is implemented, we should still use
  .FRM for new DD tables until then. Once bootstrapping
  is implemented we can get rid of .FRM's for new DD also.
  For more details on Bootstrapping refer WL#6394.

R2) Prepare TABLE_SHARE reading metadata from DD tables
    and not from '.FRM'.

  This work is mostly about writing code that is equivalent
  to what is done in open_binary_frm().

R3) Write metadata from TABLE_SHARE to DD tables.

  This work is mostly about writing code that is equivalent
  to what is done in mysql_create_frm();

R4) Store and remove metadata for DATABASE's in DD tables,
    for CREATE/DROP DATABASE command.

R5) Store and retrieve metadata for TABLE's in DD tables.
    Metadata for TABLE includes column and index metadata.

R6) Support renaming table using new DD.

R7) Make ALTER table work using new DD tables.

  Mostly we don't need special handle to make ALTER table work.
  As it creates temporary table and then does rename,
  if DROP and RENAME table works fine using new DD tables,
  then ALTER table should work fine.

R8) Do not generate bin-logs for DML on DD tables.

  As DDL statement use statement-based binlog mode,
  the DDL statement log is generated at the end of DDL
  processing. So, DML's on DD tables should not generate
  additional bin-logs. 

R9) Enable recursive call to open_table() in MySQL server.

  Currently in MySQL server, we open all the required
  tables for execution of a statement at-once at the
  begining of execution. DD framework might need to open
  DD table in fetch metadata of user table.
  Eg:. to prepare TABLE_SHARE for user table that is
       being opened.

R10) DML's from DD framework should use dedicated separate
     transaction.

  This is a requirement from InnoDB, in order to support
  DDL recovery.

R11) Avoid creation of .FRM for user tables.

  There is lot of code that invokes OS file system calls
  to check existence of a table and database.
  We need to remove all this code in order to get rid
  of .FRM. 

R12) Store INDEX/DATA DIRECTORY options of CREATE TABLE
     among other table options.

  These options are supported for MyISAM/InnoDB only,
  and they are not stored in FRM files. However, in order to
  simplify the SE code, we've been asked to store them
  among other table options.


Note: Removal of FRM files is linked to this WorkLog.