Temporary commit of 10.0-merge
Push a lot of small fixes to get larger parts to compile
Applied all changes from Igor and Sanja
Fixed patch that was part of last push that didn't apply correctly.
More merge fixes:
- mdl.cc and mdl.h merged completely
- mysql_system_tables*.sql merged completely
- Fixed wrong merge of lock_tables
- Added some missing functions:
 - bool THD::notify_shared_lock()
 - Dynamic_array::pop, Dynamic_array::del
- Added MDL_context_owner to THD
- Added metadata_locks_hash_instances
Cassandra SE build fix for merge.
Debugging output fixed to make finding executing commands easy.

Error processing in mysql_create_table() fixed.
Fixed some merge issues:
- temporary tables now works
- mysql-system_tables updated to not use temporary tables
- PASSWORD() function fixed
- Support for STATS_AUTO_RECALC, STATS_PERSISTENT and STATS_SAMPLE_PAGES table options
Finished merging wl5986 started by Igor.
Fixed some memory leaks
Disabled some asserts that we can't yet have enabled
Fixed memory leaks. alias.test now runs clean with valgrind
Case when we close temporary table which was not opened in its engine (ALTER TABLE) fixed.
Don't update table and index statics for temporary tables
Fixed type and testing of last_update type for innodb_table_stats
Added option to avoid warnings from innodb
Some corrections of the merge for the partition code.
A fix of unions with duplicate rows and returning bug fix for lp:732124 union + limit returns wrong result
MDEV-4058

MySQL 5.6.10 performance schema: merge of host_cache table
ha_partition.cc and ha_partition.h are now completely merged
Added sql_mode_t to simplify merges
merge of 2876.430.11 & 2876.430.1
CF_PREOPEN_TMP_TABLES & CF_HA_CLOSE & Patch for Bug#11746602 (27480: Extend CREATE TEMPORARY TABLES 
  privilege to allow temp table operations).
Fixed some wrong format strings.
Fixed OPTIMIZE with innodb