USE `Test_Voorraadbeheer`;

--
-- Current Database: `Test_vogoo`
--

USE `Test_vogoo`;

--
-- Current Database: `Voorraadbeheer`
--

USE `Voorraadbeheer`;

--
-- Final view structure for view `Bestellingen_met_reserveringen`
--

/*!50001 DROP TABLE IF EXISTS `Bestellingen_met_reserveringen`*/;
/*!50001 DROP VIEW IF EXISTS `Bestellingen_met_reserveringen`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`sander`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `Bestellingen_met_reserveringen` AS select `N`.`Id` AS `Id`,`N`.`Auteurnaam` AS `Auteurnaam`,`N`.`Aantal` AS `Aantal`,`N`.`Prijs` AS `Prijs`,`N`.`Bestellingid` AS `Bestellingid`,`N`.`Ean` AS `Ean`,`N`.`Omschrijving` AS `Omschrijving`,`N`.`Geexporteerd` AS `Geexporteerd`,`N`.`KortingPercentage` AS `KortingPercentage`,`N`.`IsPromo` AS `IsPromo`,`N`.`KortingReden` AS `KortingReden`,`N`.`KortingMP` AS `KortingMP`,`N`.`KostenMP` AS `KostenMP`,`N`.`DTOrderregel` AS `DTOrderregel`,`N`.`VastePrijs` AS `VastePrijs`,`N`.`ActiePrijs` AS `ActiePrijs`,`N`.`BTWTarief` AS `BTWTarief`,`N`.`BTWCode` AS `BTWCode`,`N`.`AantalBackorder` AS `AantalBackorder`,`N`.`BackorderOrigineel` AS `BackorderOrigineel`,`N`.`BackorderReden` AS `BackorderReden`,`N`.`BriefCode` AS `BriefCode`,`N`.`DTExactExport` AS `DTExactExport`,`N`.`KortingBedrag` AS `KortingBedrag`,`N`.`KortingBedragExBtw` AS `KortingBedragExBtw`,`N`.`PrijsExBtwExKorting` AS `PrijsExBtwExKorting`,`N`.`PrijsExBtwIncKorting` AS `PrijsExBtwIncKorting`,`N`.`BedragExBtwExKorting` AS `BedragExBtwExKorting`,`N`.`BedragIncBtwExKorting` AS `BedragIncBtwExKorting`,`N`.`BedragIncBtwIncKorting` AS `BedragIncBtwIncKorting`,`N`.`BedragExBtwIncKorting` AS `BedragExBtwIncKorting`,`N`.`BedragBTW` AS `BedragBTW`,`N`.`LineNr` AS `LineNr`,`N`.`Geannuleerd` AS `Geannuleerd`,`N`.`Bijdrage` AS `Bijdrage`,`N`.`OmzetExBtwExKorting` AS `OmzetExBtwExKorting`,`N`.`OmzetExBtwIncKorting` AS `OmzetExBtwIncKorting`,`N`.`OmzetIncBtwExKorting` AS `OmzetIncBtwExKorting`,`N`.`OmzetIncBtwIncKorting` AS `OmzetIncBtwIncKorting`,`N`.`StatusId` AS `StatusId`,`N`.`FactuurId` AS `FactuurId`,`N`.`RegelReferentie` AS `RegelReferentie`,`N`.`BoekStatusBijBestelling` AS `BoekStatusBijBestelling`,`Voorraadbeheer`.`regelReserveringen`('Managementboek',`N`.`Id`) AS `Reserveringen` from `Managementboek_Klanten`.`Bestellingen` `N` */;

--
-- Final view structure for view `VoorraadInclusiefCB`
--

/*!50001 DROP TABLE IF EXISTS `VoorraadInclusiefCB`*/;
/*!50001 DROP VIEW IF EXISTS `VoorraadInclusiefCB`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`sander`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `VoorraadInclusiefCB` AS select `V`.`Ean` AS `Ean`,(`V`.`GereserveerdeVoorraad` - ifnull(`C`.`MainpressMutatie`,0)) AS `GereserveerdeVoorraad`,(`V`.`FysiekeVoorraad` + ifnull(`C`.`Voorraad`,0)) AS `FysiekeVoorraad`,`V`.`FysiekeVoorraad` AS `FysiekeMBVoorraad`,ifnull(`C`.`Voorraad`,0) AS `FysiekeCBVoorraad`,(`V`.`BeschikbareVoorraad` + ifnull(`C`.`BeschikbareCBVoorraad`,0)) AS `BeschikbareVoorraad`,`V`.`BeschikbareVoorraad` AS `BeschikbareMBVoorraad`,ifnull(`C`.`BeschikbareCBVoorraad`,0) AS `BeschikbareCBVoorraad` from (`Voorraadbeheer`.`Voorraad` `V` left join `CbBoeken`.`ActueleVoorraad` `C` on((convert(`V`.`Ean` using utf8) = `C`.`Ean`))) */;

--
-- Current Database: `Voorraadbeheer_temp`
--

USE `Voorraadbeheer_temp`;

--
-- Current Database: `Zendingen`
--

USE `Zendingen`;

--
-- Current Database: `apache`
--

USE `apache`;

--
-- Current Database: `boom`
--

USE `boom`;

--
-- Current Database: `cms2`
--

USE `cms2`;

--
-- Final view structure for view `page_content_params`
--

/*!50001 DROP TABLE IF EXISTS `page_content_params`*/;
/*!50001 DROP VIEW IF EXISTS `page_content_params`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`rutger`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `page_content_params` AS (select `pc`.`content_id` AS `content_id`,`pc`.`page_id` AS `page_id`,`content_params`.`content_param_id` AS `content_param_id`,`content_params`.`param_name` AS `param_name`,`content_params`.`param_value` AS `param_value`,`content_params`.`value_order` AS `value_order` from (`page_contents` `pc` left join `content_params` on((`pc`.`content_id` = `content_params`.`content_id`)))) */;

--
-- Final view structure for view `pages_totaal`
--

/*!50001 DROP TABLE IF EXISTS `pages_totaal`*/;
/*!50001 DROP VIEW IF EXISTS `pages_totaal`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`sander`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `pages_totaal` AS select `site_pages`.`page_id` AS `page_id`,`sites`.`site_id` AS `site_id`,`sites`.`site_name` AS `site_name`,`sites`.`site_domain` AS `site_domain`,`sites`.`site_directory` AS `site_directory`,`sites`.`publishes_to` AS `publishes_to`,`sites`.`klantendb` AS `klantendb`,`sites`.`boekendb` AS `boekendb`,`pages`.`page_name` AS `page_name`,`pages`.`published` AS `published`,`pages`.`start_dt` AS `start_dt`,`pages`.`end_dt` AS `end_dt` from ((`sites` left join `site_pages` on((`sites`.`site_id` = `site_pages`.`site_id`))) join `pages` on((`site_pages`.`page_id` = `pages`.`page_id`))) */;

--
-- Current Database: `common_schema`
--

USE `common_schema`;

--
-- Final view structure for view `_bare_grantee_grants`
--

/*!50001 DROP TABLE IF EXISTS `_bare_grantee_grants`*/;
/*!50001 DROP VIEW IF EXISTS `_bare_grantee_grants`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_bare_grantee_grants` AS select `sql_grants`.`GRANTEE` AS `GRANTEE`,`sql_grants`.`user` AS `user`,`sql_grants`.`host` AS `host`,group_concat(concat(substring_index(replace(`sql_grants`.`sql_grant`,`sql_grants`.`GRANTEE`,''),'IDENTIFIED BY PASSWORD',1),';') order by `sql_grants`.`sql_grant` ASC separator '
') AS `sql_grants` from `common_schema`.`sql_grants` group by `sql_grants`.`GRANTEE`,`sql_grants`.`user`,`sql_grants`.`host` */;

--
-- Final view structure for view `_columns_privileges`
--

/*!50001 DROP TABLE IF EXISTS `_columns_privileges`*/;
/*!50001 DROP VIEW IF EXISTS `_columns_privileges`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_columns_privileges` AS select `information_schema`.`COLUMN_PRIVILEGES`.`GRANTEE` AS `GRANTEE`,`information_schema`.`COLUMN_PRIVILEGES`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`COLUMN_PRIVILEGES`.`TABLE_NAME` AS `TABLE_NAME`,max(`information_schema`.`COLUMN_PRIVILEGES`.`IS_GRANTABLE`) AS `IS_GRANTABLE`,concat(`information_schema`.`COLUMN_PRIVILEGES`.`PRIVILEGE_TYPE`,' (',group_concat(`information_schema`.`COLUMN_PRIVILEGES`.`COLUMN_NAME` order by `information_schema`.`COLUMN_PRIVILEGES`.`COLUMN_NAME` ASC separator ', '),')') AS `column_privileges` from `INFORMATION_SCHEMA`.`COLUMN_PRIVILEGES` group by `information_schema`.`COLUMN_PRIVILEGES`.`GRANTEE`,`information_schema`.`COLUMN_PRIVILEGES`.`TABLE_SCHEMA`,`information_schema`.`COLUMN_PRIVILEGES`.`TABLE_NAME`,`information_schema`.`COLUMN_PRIVILEGES`.`PRIVILEGE_TYPE` */;

--
-- Final view structure for view `_flattened_keys`
--

/*!50001 DROP TABLE IF EXISTS `_flattened_keys`*/;
/*!50001 DROP VIEW IF EXISTS `_flattened_keys`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_flattened_keys` AS select `information_schema`.`STATISTICS`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`STATISTICS`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`STATISTICS`.`INDEX_NAME` AS `INDEX_NAME`,max(`information_schema`.`STATISTICS`.`NON_UNIQUE`) AS `non_unique`,max(if(isnull(`information_schema`.`STATISTICS`.`SUB_PART`),0,1)) AS `subpart_exists`,group_concat(`information_schema`.`STATISTICS`.`COLUMN_NAME` order by `information_schema`.`STATISTICS`.`SEQ_IN_INDEX` ASC separator ',') AS `index_columns` from `INFORMATION_SCHEMA`.`STATISTICS` where ((`information_schema`.`STATISTICS`.`INDEX_TYPE` = 'BTREE') and (`information_schema`.`STATISTICS`.`TABLE_SCHEMA` not in ('mysql','INFORMATION_SCHEMA','PERFORMANCE_SCHEMA'))) group by `information_schema`.`STATISTICS`.`TABLE_SCHEMA`,`information_schema`.`STATISTICS`.`TABLE_NAME`,`information_schema`.`STATISTICS`.`INDEX_NAME` */;

--
-- Final view structure for view `_global_status_sleep`
--

/*!50001 DROP TABLE IF EXISTS `_global_status_sleep`*/;
/*!50001 DROP VIEW IF EXISTS `_global_status_sleep`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_global_status_sleep` AS (select `information_schema`.`GLOBAL_STATUS`.`VARIABLE_NAME` AS `VARIABLE_NAME`,`information_schema`.`GLOBAL_STATUS`.`VARIABLE_VALUE` AS `VARIABLE_VALUE` from `INFORMATION_SCHEMA`.`GLOBAL_STATUS`) union all (select '' AS `VARIABLE_NAME`,sleep(10) AS `SLEEP(10)`) */;

--
-- Final view structure for view `_global_status_wrapper`
--

/*!50001 DROP TABLE IF EXISTS `_global_status_wrapper`*/;
/*!50001 DROP VIEW IF EXISTS `_global_status_wrapper`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_global_status_wrapper` AS (select `information_schema`.`GLOBAL_STATUS`.`VARIABLE_NAME` AS `VARIABLE_NAME`,`information_schema`.`GLOBAL_STATUS`.`VARIABLE_VALUE` AS `VARIABLE_VALUE` from `INFORMATION_SCHEMA`.`GLOBAL_STATUS`) union all (select '' AS `VARIABLE_NAME`,0 AS `0`) */;

--
-- Final view structure for view `_processlist_grantees_exploded`
--

/*!50001 DROP TABLE IF EXISTS `_processlist_grantees_exploded`*/;
/*!50001 DROP VIEW IF EXISTS `_processlist_grantees_exploded`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_processlist_grantees_exploded` AS select `processlist_grantees`.`ID` AS `id`,`processlist_grantees`.`sql_kill_query` AS `sql_kill_query`,`processlist_grantees`.`sql_kill_connection` AS `sql_kill_connection`,`processlist_grantees`.`GRANTEE` AS `grantee`,concat(`processlist_grantees`.`grantee_user`,'@',`processlist_grantees`.`grantee_host`) AS `unqualified_grantee`,`processlist_grantees`.`grantee_host` AS `grantee_host`,`processlist_grantees`.`grantee_user` AS `grantee_user`,concat('\'',`processlist_grantees`.`USER`,'\'@\'',substring_index(`processlist_grantees`.`HOST`,':',1),'\'') AS `qualified_user_host`,concat(`processlist_grantees`.`USER`,'@',substring_index(`processlist_grantees`.`HOST`,':',1)) AS `unqualified_user_host`,substring_index(`processlist_grantees`.`HOST`,':',1) AS `hostname`,`processlist_grantees`.`USER` AS `user` from `common_schema`.`processlist_grantees` */;

--
-- Final view structure for view `_qs_variables`
--

/*!50001 DROP TABLE IF EXISTS `_qs_variables`*/;
/*!50001 DROP VIEW IF EXISTS `_qs_variables`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_qs_variables` AS select `_global_qs_variables`.`server_id` AS `server_id`,`_global_qs_variables`.`session_id` AS `session_id`,`_global_qs_variables`.`variable_name` AS `variable_name`,`_global_qs_variables`.`mapped_user_defined_variable_name` AS `mapped_user_defined_variable_name`,`_global_qs_variables`.`declaration_depth` AS `declaration_depth`,`_global_qs_variables`.`declaration_id` AS `declaration_id`,`_global_qs_variables`.`scope_end_id` AS `scope_end_id`,`_global_qs_variables`.`value_snapshot` AS `value_snapshot` from `_global_qs_variables` where (`_global_qs_variables`.`session_id` = connection_id()) */
/*!50002 WITH CASCADED CHECK OPTION */;

--
-- Final view structure for view `_query_profiling_minmax`
--

/*!50001 DROP TABLE IF EXISTS `_query_profiling_minmax`*/;
/*!50001 DROP VIEW IF EXISTS `_query_profiling_minmax`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_query_profiling_minmax` AS select min(`information_schema`.`PROFILING`.`QUERY_ID`) AS `min_query_id`,max(`information_schema`.`PROFILING`.`QUERY_ID`) AS `max_query_id` from `INFORMATION_SCHEMA`.`PROFILING` */;

--
-- Final view structure for view `_query_profiling_summary`
--

/*!50001 DROP TABLE IF EXISTS `_query_profiling_summary`*/;
/*!50001 DROP VIEW IF EXISTS `_query_profiling_summary`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_query_profiling_summary` AS select `information_schema`.`PROFILING`.`QUERY_ID` AS `QUERY_ID`,count(0) AS `count_state_calls`,count(distinct `information_schema`.`PROFILING`.`STATE`) AS `count_distinct_states`,sum(`information_schema`.`PROFILING`.`DURATION`) AS `sum_duration`,sum(`information_schema`.`PROFILING`.`CPU_USER`) AS `sum_cpu_user`,sum(`information_schema`.`PROFILING`.`CPU_SYSTEM`) AS `sum_cpu_system`,sum(`information_schema`.`PROFILING`.`SWAPS`) AS `sum_swpas` from `INFORMATION_SCHEMA`.`PROFILING` group by `information_schema`.`PROFILING`.`QUERY_ID` order by `information_schema`.`PROFILING`.`QUERY_ID` */;

--
-- Final view structure for view `_script_report_data`
--

/*!50001 DROP TABLE IF EXISTS `_script_report_data`*/;
/*!50001 DROP VIEW IF EXISTS `_script_report_data`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_script_report_data` AS select `_global_script_report_data`.`id` AS `id`,`_global_script_report_data`.`info` AS `info`,`_global_script_report_data`.`server_id` AS `server_id`,`_global_script_report_data`.`session_id` AS `session_id` from `_global_script_report_data` where ((`_global_script_report_data`.`server_id` = `_get_server_id`()) and (`_global_script_report_data`.`session_id` = connection_id())) */
/*!50002 WITH CASCADED CHECK OPTION */;

--
-- Final view structure for view `_split_column_names_table`
--

/*!50001 DROP TABLE IF EXISTS `_split_column_names_table`*/;
/*!50001 DROP VIEW IF EXISTS `_split_column_names_table`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_split_column_names_table` AS select `_global_split_column_names_table`.`server_id` AS `server_id`,`_global_split_column_names_table`.`session_id` AS `session_id`,`_global_split_column_names_table`.`column_order` AS `column_order`,`_global_split_column_names_table`.`split_table_name` AS `split_table_name`,`_global_split_column_names_table`.`split_index_name` AS `split_index_name`,`_global_split_column_names_table`.`column_name` AS `column_name`,`_global_split_column_names_table`.`min_variable_name` AS `min_variable_name`,`_global_split_column_names_table`.`max_variable_name` AS `max_variable_name`,`_global_split_column_names_table`.`range_start_variable_name` AS `range_start_variable_name`,`_global_split_column_names_table`.`range_end_variable_name` AS `range_end_variable_name` from `_global_split_column_names_table` where (`_global_split_column_names_table`.`session_id` = connection_id()) */
/*!50002 WITH CASCADED CHECK OPTION */;

--
-- Final view structure for view `_sql_accounts_base`
--

/*!50001 DROP TABLE IF EXISTS `_sql_accounts_base`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_accounts_base`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_accounts_base` AS select `mysql`.`user`.`User` AS `user`,`mysql`.`user`.`Host` AS `host`,`mysql_grantee`(`mysql`.`user`.`User`,`mysql`.`user`.`Host`) AS `grantee`,`mysql`.`user`.`Password` AS `password`,((`mysql`.`user`.`Password` = '') or (`mysql`.`user`.`Password` regexp '^[?]{41}$')) AS `is_empty_password`,((`mysql`.`user`.`Password` regexp '^[*][0-9a-fA-F]{40}$') or (`mysql`.`user`.`Password` regexp '^[0-9a-fA-F]{40}[*]$')) AS `is_new_password`,((`mysql`.`user`.`Password` regexp '^[0-9a-fA-F]{16}$') or (`mysql`.`user`.`Password` regexp '^[~]{25}[0-9a-fA-F]{16}$')) AS `is_old_password`,((`mysql`.`user`.`Password` regexp '^[0-9a-fA-F]{40}[*]$') or (`mysql`.`user`.`Password` regexp '^[~]{25}[0-9a-fA-F]{16}$') or (`mysql`.`user`.`Password` regexp '^[?]{41}$')) AS `is_blocked`,reverse(`mysql`.`user`.`Password`) AS `reversed_password`,replace(`mysql`.`user`.`Password`,'~','') AS `untiled_password`,concat(convert(repeat('~',if((char_length(`mysql`.`user`.`Password`) = 16),25,0)) using latin1),`mysql`.`user`.`Password`) AS `tiled_password` from `mysql`.`user` */;

--
-- Final view structure for view `_sql_accounts_password`
--

/*!50001 DROP TABLE IF EXISTS `_sql_accounts_password`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_accounts_password`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_accounts_password` AS select `_sql_accounts_base`.`user` AS `user`,`_sql_accounts_base`.`host` AS `host`,`_sql_accounts_base`.`grantee` AS `grantee`,`_sql_accounts_base`.`password` AS `password`,`_sql_accounts_base`.`is_empty_password` AS `is_empty_password`,`_sql_accounts_base`.`is_new_password` AS `is_new_password`,`_sql_accounts_base`.`is_old_password` AS `is_old_password`,`_sql_accounts_base`.`is_blocked` AS `is_blocked`,`_sql_accounts_base`.`reversed_password` AS `reversed_password`,`_sql_accounts_base`.`untiled_password` AS `untiled_password`,`_sql_accounts_base`.`tiled_password` AS `tiled_password`,(case when `_sql_accounts_base`.`is_blocked` then `_sql_accounts_base`.`password` when `_sql_accounts_base`.`is_empty_password` then convert(repeat('?',41) using latin1) when `_sql_accounts_base`.`is_new_password` then `_sql_accounts_base`.`reversed_password` when `_sql_accounts_base`.`is_old_password` then `_sql_accounts_base`.`tiled_password` end) AS `password_for_sql_block_account`,(case when (`_sql_accounts_base`.`is_blocked` = 0) then `_sql_accounts_base`.`password` when `_sql_accounts_base`.`is_empty_password` then '' when `_sql_accounts_base`.`is_new_password` then `_sql_accounts_base`.`reversed_password` when `_sql_accounts_base`.`is_old_password` then `_sql_accounts_base`.`untiled_password` end) AS `password_for_sql_release_account` from `common_schema`.`_sql_accounts_base` */;

--
-- Final view structure for view `_sql_alter_table_tokudb_internal`
--

/*!50001 DROP TABLE IF EXISTS `_sql_alter_table_tokudb_internal`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_alter_table_tokudb_internal`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_alter_table_tokudb_internal` AS select `sql_alter_table`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`sql_alter_table`.`TABLE_NAME` AS `TABLE_NAME`,`sql_alter_table`.`ENGINE` AS `ENGINE`,concat(`sql_alter_table`.`sql_drop_keys`,', ',`sql_alter_table`.`sql_add_keys`,', engine=tokudb row_format=tokudb_fast key_block_size=0') AS `alter_fast_clause`,concat(`sql_alter_table`.`sql_drop_keys`,', ',`sql_alter_table`.`sql_add_keys`,', engine=tokudb row_format=tokudb_small key_block_size=0') AS `alter_small_clause` from `common_schema`.`sql_alter_table` */;

--
-- Final view structure for view `_sql_grants_components`
--

/*!50001 DROP TABLE IF EXISTS `_sql_grants_components`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_grants_components`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_grants_components` AS (select `information_schema`.`USER_PRIVILEGES`.`GRANTEE` AS `GRANTEE`,'*.*' AS `priv_level`,'user' AS `priv_level_name`,'' AS `object_type`,NULL AS `object_schema`,NULL AS `object_name`,'USAGE' AS `current_privileges`,max(`information_schema`.`USER_PRIVILEGES`.`IS_GRANTABLE`) AS `IS_GRANTABLE`,1 AS `result_order` from `INFORMATION_SCHEMA`.`USER_PRIVILEGES` group by `information_schema`.`USER_PRIVILEGES`.`GRANTEE`) union all (select `information_schema`.`USER_PRIVILEGES`.`GRANTEE` AS `GRANTEE`,'*.*' AS `priv_level`,'user' AS `priv_level_name`,'' AS `object_type`,NULL AS `object_schema`,NULL AS `object_name`,group_concat(`information_schema`.`USER_PRIVILEGES`.`PRIVILEGE_TYPE` order by `information_schema`.`USER_PRIVILEGES`.`PRIVILEGE_TYPE` ASC separator ', ') AS `current_privileges`,max(`information_schema`.`USER_PRIVILEGES`.`IS_GRANTABLE`) AS `IS_GRANTABLE`,2 AS `result_order` from `INFORMATION_SCHEMA`.`USER_PRIVILEGES` group by `information_schema`.`USER_PRIVILEGES`.`GRANTEE` having (group_concat(`information_schema`.`USER_PRIVILEGES`.`PRIVILEGE_TYPE` order by `information_schema`.`USER_PRIVILEGES`.`PRIVILEGE_TYPE` ASC separator ',') <> 'USAGE')) union all (select `information_schema`.`SCHEMA_PRIVILEGES`.`GRANTEE` AS `GRANTEE`,concat('`',`information_schema`.`SCHEMA_PRIVILEGES`.`TABLE_SCHEMA`,'`.*') AS `priv_level`,'schema' AS `priv_level_name`,'' AS `object_type`,NULL AS `object_schema`,`information_schema`.`SCHEMA_PRIVILEGES`.`TABLE_SCHEMA` AS `object_name`,group_concat(`information_schema`.`SCHEMA_PRIVILEGES`.`PRIVILEGE_TYPE` order by `information_schema`.`SCHEMA_PRIVILEGES`.`PRIVILEGE_TYPE` ASC separator ', ') AS `current_privileges`,max(`information_schema`.`SCHEMA_PRIVILEGES`.`IS_GRANTABLE`) AS `IS_GRANTABLE`,3 AS `result_order` from `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES` group by `information_schema`.`SCHEMA_PRIVILEGES`.`GRANTEE`,`information_schema`.`SCHEMA_PRIVILEGES`.`TABLE_SCHEMA`) union all (select `information_schema`.`TABLE_PRIVILEGES`.`GRANTEE` AS `GRANTEE`,concat('`',`information_schema`.`TABLE_PRIVILEGES`.`TABLE_SCHEMA`,'`.`',`information_schema`.`TABLE_PRIVILEGES`.`TABLE_NAME`,'`') AS `priv_level`,'table' AS `priv_level_name`,'table' AS `object_type`,`information_schema`.`TABLE_PRIVILEGES`.`TABLE_SCHEMA` AS `object_schema`,`information_schema`.`TABLE_PRIVILEGES`.`TABLE_NAME` AS `object_name`,group_concat(`information_schema`.`TABLE_PRIVILEGES`.`PRIVILEGE_TYPE` order by `information_schema`.`TABLE_PRIVILEGES`.`PRIVILEGE_TYPE` ASC separator ', ') AS `current_privileges`,max(`information_schema`.`TABLE_PRIVILEGES`.`IS_GRANTABLE`) AS `IS_GRANTABLE`,4 AS `result_order` from `INFORMATION_SCHEMA`.`TABLE_PRIVILEGES` group by `information_schema`.`TABLE_PRIVILEGES`.`GRANTEE`,`information_schema`.`TABLE_PRIVILEGES`.`TABLE_SCHEMA`,`information_schema`.`TABLE_PRIVILEGES`.`TABLE_NAME`) union all (select `_columns_privileges`.`GRANTEE` AS `GRANTEE`,concat('`',`_columns_privileges`.`TABLE_SCHEMA`,'`.`',`_columns_privileges`.`TABLE_NAME`,'`') AS `priv_level`,'column' AS `priv_level_name`,'' AS `object_type`,`_columns_privileges`.`TABLE_SCHEMA` AS `object_schema`,`_columns_privileges`.`TABLE_NAME` AS `object_name`,group_concat(`_columns_privileges`.`column_privileges` order by `_columns_privileges`.`column_privileges` ASC separator ', ') AS `current_privileges`,max(`_columns_privileges`.`IS_GRANTABLE`) AS `IS_GRANTABLE`,5 AS `result_order` from `common_schema`.`_columns_privileges` group by `_columns_privileges`.`GRANTEE`,`_columns_privileges`.`TABLE_SCHEMA`,`_columns_privileges`.`TABLE_NAME`) union all (select `routine_privileges`.`GRANTEE` AS `GRANTEE`,concat('`',`routine_privileges`.`ROUTINE_SCHEMA`,'`.`',`routine_privileges`.`ROUTINE_NAME`,'`') AS `priv_level`,'routine' AS `priv_level_name`,max(`routine_privileges`.`ROUTINE_TYPE`) AS `object_type`,`routine_privileges`.`ROUTINE_SCHEMA` AS `object_schema`,`routine_privileges`.`ROUTINE_NAME` AS `object_name`,group_concat(`routine_privileges`.`PRIVILEGE_TYPE` order by `routine_privileges`.`PRIVILEGE_TYPE` ASC separator ', ') AS `current_privileges`,max(`routine_privileges`.`IS_GRANTABLE`) AS `IS_GRANTABLE`,6 AS `result_order` from `common_schema`.`routine_privileges` group by `routine_privileges`.`GRANTEE`,`routine_privileges`.`ROUTINE_SCHEMA`,`routine_privileges`.`ROUTINE_NAME`) */;

--
-- Final view structure for view `_sql_range_partitions_analysis`
--

/*!50001 DROP TABLE IF EXISTS `_sql_range_partitions_analysis`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_range_partitions_analysis`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_range_partitions_analysis` AS select `_sql_range_partitions_summary`.`table_schema` AS `table_schema`,`_sql_range_partitions_summary`.`table_name` AS `table_name`,`_sql_range_partitions_summary`.`count_partitions` AS `count_partitions`,`_sql_range_partitions_summary`.`count_past_timestamp` AS `count_past_timestamp`,`_sql_range_partitions_summary`.`count_future_timestamp` AS `count_future_timestamp`,`_sql_range_partitions_summary`.`count_past_from_unixtime` AS `count_past_from_unixtime`,`_sql_range_partitions_summary`.`count_future_from_unixtime` AS `count_future_from_unixtime`,`_sql_range_partitions_summary`.`count_past_from_days` AS `count_past_from_days`,`_sql_range_partitions_summary`.`count_future_from_days` AS `count_future_from_days`,`_sql_range_partitions_summary`.`first_partition_name` AS `first_partition_name`,`_sql_range_partitions_summary`.`first_partition_name_skipping_zero` AS `first_partition_name_skipping_zero`,`_sql_range_partitions_summary`.`last_partition_name` AS `last_partition_name`,`_sql_range_partitions_summary`.`has_maxvalue` AS `has_maxvalue`,`_sql_range_partitions_summary`.`maxvalue_partition_name` AS `maxvalue_partition_name`,`_sql_range_partitions_summary`.`max_partition_description` AS `max_partition_description`,substring_index((case when (`_sql_range_partitions_diff`.`diff_year_from_unixtime` <> 0) then unix_timestamp((from_unixtime(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_year_from_unixtime` year)) when (`_sql_range_partitions_diff`.`diff_month_from_unixtime` <> 0) then unix_timestamp((from_unixtime(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_month_from_unixtime` month)) when (`_sql_range_partitions_diff`.`diff_week_from_unixtime` <> 0) then unix_timestamp((from_unixtime(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_week_from_unixtime` week)) when (`_sql_range_partitions_diff`.`diff_day_from_unixtime` <> 0) then unix_timestamp((from_unixtime(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_day_from_unixtime` day)) when (`_sql_range_partitions_diff`.`diff_year_from_days` <> 0) then to_days((from_days(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_year_from_days` year)) when (`_sql_range_partitions_diff`.`diff_month_from_days` <> 0) then to_days((from_days(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_month_from_days` month)) when (`_sql_range_partitions_diff`.`diff_week_from_days` <> 0) then to_days((from_days(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_week_from_days` week)) when (`_sql_range_partitions_diff`.`diff_day_from_days` <> 0) then to_days((from_days(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_day_from_days` day)) when (`_sql_range_partitions_diff`.`diff_year` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + interval `_sql_range_partitions_diff`.`diff_year` year) when (`_sql_range_partitions_diff`.`diff_month` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + interval `_sql_range_partitions_diff`.`diff_month` month) when (`_sql_range_partitions_diff`.`diff_week` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + interval `_sql_range_partitions_diff`.`diff_week` week) when (`_sql_range_partitions_diff`.`diff_day` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + interval `_sql_range_partitions_diff`.`diff_day` day) when (`_sql_range_partitions_diff`.`diff` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + `_sql_range_partitions_diff`.`diff`) else NULL end),'.',1) AS `next_partition_description`,substring_index((case when (`_sql_range_partitions_diff`.`diff_year_from_unixtime` <> 0) then (from_unixtime(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_year_from_unixtime` year) when (`_sql_range_partitions_diff`.`diff_month_from_unixtime` <> 0) then (from_unixtime(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_month_from_unixtime` month) when (`_sql_range_partitions_diff`.`diff_week_from_unixtime` <> 0) then (from_unixtime(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_week_from_unixtime` week) when (`_sql_range_partitions_diff`.`diff_day_from_unixtime` <> 0) then (from_unixtime(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_day_from_unixtime` day) when (`_sql_range_partitions_diff`.`diff_year_from_days` <> 0) then (from_days(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_year_from_days` year) when (`_sql_range_partitions_diff`.`diff_month_from_days` <> 0) then (from_days(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_month_from_days` month) when (`_sql_range_partitions_diff`.`diff_week_from_days` <> 0) then (from_days(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_week_from_days` week) when (`_sql_range_partitions_diff`.`diff_day_from_days` <> 0) then (from_days(`_sql_range_partitions_summary`.`max_partition_description`) + interval `_sql_range_partitions_diff`.`diff_day_from_days` day) when (`_sql_range_partitions_diff`.`diff_year` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + interval `_sql_range_partitions_diff`.`diff_year` year) when (`_sql_range_partitions_diff`.`diff_month` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + interval `_sql_range_partitions_diff`.`diff_month` month) when (`_sql_range_partitions_diff`.`diff_week` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + interval `_sql_range_partitions_diff`.`diff_week` week) when (`_sql_range_partitions_diff`.`diff_day` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + interval `_sql_range_partitions_diff`.`diff_day` day) when (`_sql_range_partitions_diff`.`diff` <> 0) then (`_sql_range_partitions_summary`.`max_partition_description` + `_sql_range_partitions_diff`.`diff`) else NULL end),'.',1) AS `next_partition_human_description`,(case when ((`_sql_range_partitions_diff`.`diff_year_from_unixtime` <> 0) or (`_sql_range_partitions_diff`.`diff_month_from_unixtime` <> 0) or (`_sql_range_partitions_diff`.`diff_week_from_unixtime` <> 0) or (`_sql_range_partitions_diff`.`diff_day_from_unixtime` <> 0)) then `_sql_range_partitions_summary`.`count_past_from_unixtime` when ((`_sql_range_partitions_diff`.`diff_year_from_days` <> 0) or (`_sql_range_partitions_diff`.`diff_month_from_days` <> 0) or (`_sql_range_partitions_diff`.`diff_week_from_days` <> 0) or (`_sql_range_partitions_diff`.`diff_day_from_days` <> 0)) then `_sql_range_partitions_summary`.`count_past_from_days` when ((`_sql_range_partitions_diff`.`diff_year` <> 0) or (`_sql_range_partitions_diff`.`diff_month` <> 0) or (`_sql_range_partitions_diff`.`diff_week` <> 0) or (`_sql_range_partitions_diff`.`diff_day` <> 0)) then `_sql_range_partitions_summary`.`count_past_timestamp` else NULL end) AS `count_past_partitions`,(case when ((`_sql_range_partitions_diff`.`diff_year_from_unixtime` <> 0) or (`_sql_range_partitions_diff`.`diff_month_from_unixtime` <> 0) or (`_sql_range_partitions_diff`.`diff_week_from_unixtime` <> 0) or (`_sql_range_partitions_diff`.`diff_day_from_unixtime` <> 0)) then `_sql_range_partitions_summary`.`count_future_from_unixtime` when ((`_sql_range_partitions_diff`.`diff_year_from_days` <> 0) or (`_sql_range_partitions_diff`.`diff_month_from_days` <> 0) or (`_sql_range_partitions_diff`.`diff_week_from_days` <> 0) or (`_sql_range_partitions_diff`.`diff_day_from_days` <> 0)) then `_sql_range_partitions_summary`.`count_future_from_days` when ((`_sql_range_partitions_diff`.`diff_year` <> 0) or (`_sql_range_partitions_diff`.`diff_month` <> 0) or (`_sql_range_partitions_diff`.`diff_week` <> 0) or (`_sql_range_partitions_diff`.`diff_day` <> 0)) then `_sql_range_partitions_summary`.`count_future_timestamp` else NULL end) AS `count_future_partitions` from (`common_schema`.`_sql_range_partitions_diff` join `common_schema`.`_sql_range_partitions_summary` on(((`_sql_range_partitions_diff`.`table_schema` = `_sql_range_partitions_summary`.`table_schema`) and (`_sql_range_partitions_diff`.`table_name` = `_sql_range_partitions_summary`.`table_name`)))) */;

--
-- Final view structure for view `_sql_range_partitions_base`
--

/*!50001 DROP TABLE IF EXISTS `_sql_range_partitions_base`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_range_partitions_base`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_range_partitions_base` AS select `p0`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`p0`.`TABLE_NAME` AS `table_name`,`unquote`(`p0`.`PARTITION_DESCRIPTION`) AS `unquoted_description`,(`p0`.`PARTITION_DESCRIPTION` >= to_days('1000-01-01')) AS `valid_from_days`,(`p1`.`PARTITION_DESCRIPTION` - `p0`.`PARTITION_DESCRIPTION`) AS `diff`,timestampdiff(DAY,`_as_datetime`(`unquote`(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(`unquote`(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_day`,timestampdiff(WEEK,`_as_datetime`(`unquote`(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(`unquote`(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_week`,timestampdiff(MONTH,`_as_datetime`(`unquote`(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(`unquote`(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_month`,timestampdiff(YEAR,`_as_datetime`(`unquote`(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(`unquote`(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_year`,timestampdiff(DAY,`_as_datetime`(from_unixtime(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(from_unixtime(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_day_from_unixtime`,timestampdiff(WEEK,`_as_datetime`(from_unixtime(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(from_unixtime(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_week_from_unixtime`,timestampdiff(MONTH,`_as_datetime`(from_unixtime(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(from_unixtime(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_month_from_unixtime`,timestampdiff(YEAR,`_as_datetime`(from_unixtime(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(from_unixtime(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_year_from_unixtime`,timestampdiff(DAY,`_as_datetime`(from_days(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(from_days(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_day_from_days`,timestampdiff(WEEK,`_as_datetime`(from_days(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(from_days(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_week_from_days`,timestampdiff(MONTH,`_as_datetime`(from_days(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(from_days(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_month_from_days`,timestampdiff(YEAR,`_as_datetime`(from_days(`p0`.`PARTITION_DESCRIPTION`)),`_as_datetime`(from_days(`p1`.`PARTITION_DESCRIPTION`))) AS `diff_year_from_days` from (`information_schema`.`partitions` `p0` join `information_schema`.`partitions` `p1` on(((`p0`.`TABLE_SCHEMA` = `p1`.`TABLE_SCHEMA`) and (`p0`.`TABLE_NAME` = `p1`.`TABLE_NAME`) and (`p0`.`PARTITION_ORDINAL_POSITION` = (`p1`.`PARTITION_ORDINAL_POSITION` - 1))))) where ((`p0`.`PARTITION_METHOD` in ('RANGE','RANGE COLUMNS')) and (`p1`.`PARTITION_DESCRIPTION` <> 'MAXVALUE') and ((`p0`.`PARTITION_ORDINAL_POSITION` <> 1) or (`p0`.`PARTITION_DESCRIPTION` <> 0))) */;

--
-- Final view structure for view `_sql_range_partitions_beautified`
--

/*!50001 DROP TABLE IF EXISTS `_sql_range_partitions_beautified`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_range_partitions_beautified`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_range_partitions_beautified` AS select `_sql_range_partitions_analysis`.`table_schema` AS `table_schema`,`_sql_range_partitions_analysis`.`table_name` AS `table_name`,`_sql_range_partitions_analysis`.`count_partitions` AS `count_partitions`,`_sql_range_partitions_analysis`.`count_past_timestamp` AS `count_past_timestamp`,`_sql_range_partitions_analysis`.`count_future_timestamp` AS `count_future_timestamp`,`_sql_range_partitions_analysis`.`count_past_from_unixtime` AS `count_past_from_unixtime`,`_sql_range_partitions_analysis`.`count_future_from_unixtime` AS `count_future_from_unixtime`,`_sql_range_partitions_analysis`.`count_past_from_days` AS `count_past_from_days`,`_sql_range_partitions_analysis`.`count_future_from_days` AS `count_future_from_days`,`_sql_range_partitions_analysis`.`first_partition_name` AS `first_partition_name`,`_sql_range_partitions_analysis`.`first_partition_name_skipping_zero` AS `first_partition_name_skipping_zero`,`_sql_range_partitions_analysis`.`last_partition_name` AS `last_partition_name`,`_sql_range_partitions_analysis`.`has_maxvalue` AS `has_maxvalue`,`_sql_range_partitions_analysis`.`maxvalue_partition_name` AS `maxvalue_partition_name`,`_sql_range_partitions_analysis`.`max_partition_description` AS `max_partition_description`,`_sql_range_partitions_analysis`.`next_partition_description` AS `next_partition_description`,`_sql_range_partitions_analysis`.`next_partition_human_description` AS `next_partition_human_description`,`_sql_range_partitions_analysis`.`count_past_partitions` AS `count_past_partitions`,`_sql_range_partitions_analysis`.`count_future_partitions` AS `count_future_partitions`,concat('p_',ifnull(date_format(`_as_datetime`(`_sql_range_partitions_analysis`.`next_partition_human_description`),'%Y%m%d%H%i%s'),`_sql_range_partitions_analysis`.`next_partition_human_description`)) AS `next_partition_name`,(`_as_datetime`(`_sql_range_partitions_analysis`.`next_partition_human_description`) is not null) AS `next_partition_human_description_is_datetime`,ifnull(concat(' /* ',convert(`_as_datetime`(`_sql_range_partitions_analysis`.`next_partition_human_description`) using utf8),' */ '),'') AS `next_partition_human_description_comment` from `common_schema`.`_sql_range_partitions_analysis` */;

--
-- Final view structure for view `_sql_range_partitions_diff`
--

/*!50001 DROP TABLE IF EXISTS `_sql_range_partitions_diff`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_range_partitions_diff`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_range_partitions_diff` AS select `_sql_range_partitions_base`.`TABLE_SCHEMA` AS `table_schema`,`_sql_range_partitions_base`.`table_name` AS `table_name`,if((count(distinct `_sql_range_partitions_base`.`diff`) = 1),min(`_sql_range_partitions_base`.`diff`),0) AS `diff`,if((count(distinct `_sql_range_partitions_base`.`diff_day`) = 1),min(`_sql_range_partitions_base`.`diff_day`),0) AS `diff_day`,if((count(distinct `_sql_range_partitions_base`.`diff_week`) = 1),min(`_sql_range_partitions_base`.`diff_week`),0) AS `diff_week`,if((count(distinct `_sql_range_partitions_base`.`diff_month`) = 1),min(`_sql_range_partitions_base`.`diff_month`),0) AS `diff_month`,if((count(distinct `_sql_range_partitions_base`.`diff_year`) = 1),min(`_sql_range_partitions_base`.`diff_year`),0) AS `diff_year`,if((count(distinct `_sql_range_partitions_base`.`diff_day_from_unixtime`) = 1),min(`_sql_range_partitions_base`.`diff_day_from_unixtime`),0) AS `diff_day_from_unixtime`,if((count(distinct `_sql_range_partitions_base`.`diff_week_from_unixtime`) = 1),min(`_sql_range_partitions_base`.`diff_week_from_unixtime`),0) AS `diff_week_from_unixtime`,if((count(distinct `_sql_range_partitions_base`.`diff_month_from_unixtime`) = 1),min(`_sql_range_partitions_base`.`diff_month_from_unixtime`),0) AS `diff_month_from_unixtime`,if((count(distinct `_sql_range_partitions_base`.`diff_year_from_unixtime`) = 1),min(`_sql_range_partitions_base`.`diff_year_from_unixtime`),0) AS `diff_year_from_unixtime`,if(((count(distinct `_sql_range_partitions_base`.`diff_day_from_days`) = 1) and min(`_sql_range_partitions_base`.`valid_from_days`)),min(`_sql_range_partitions_base`.`diff_day_from_days`),0) AS `diff_day_from_days`,if(((count(distinct `_sql_range_partitions_base`.`diff_week_from_days`) = 1) and min(`_sql_range_partitions_base`.`valid_from_days`)),min(`_sql_range_partitions_base`.`diff_week_from_days`),0) AS `diff_week_from_days`,if(((count(distinct `_sql_range_partitions_base`.`diff_month_from_days`) = 1) and min(`_sql_range_partitions_base`.`valid_from_days`)),min(`_sql_range_partitions_base`.`diff_month_from_days`),0) AS `diff_month_from_days`,if(((count(distinct `_sql_range_partitions_base`.`diff_year_from_days`) = 1) and min(`_sql_range_partitions_base`.`valid_from_days`)),min(`_sql_range_partitions_base`.`diff_year_from_days`),0) AS `diff_year_from_days` from `common_schema`.`_sql_range_partitions_base` group by `_sql_range_partitions_base`.`TABLE_SCHEMA`,`_sql_range_partitions_base`.`table_name` */;

--
-- Final view structure for view `_sql_range_partitions_summary`
--

/*!50001 DROP TABLE IF EXISTS `_sql_range_partitions_summary`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_range_partitions_summary`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_range_partitions_summary` AS select `information_schema`.`partitions`.`TABLE_SCHEMA` AS `table_schema`,`information_schema`.`partitions`.`TABLE_NAME` AS `table_name`,count(0) AS `count_partitions`,sum((`_as_datetime`(`unquote`(`information_schema`.`partitions`.`PARTITION_DESCRIPTION`)) < now())) AS `count_past_timestamp`,sum((`_as_datetime`(`unquote`(`information_schema`.`partitions`.`PARTITION_DESCRIPTION`)) >= now())) AS `count_future_timestamp`,sum(if((`information_schema`.`partitions`.`PARTITION_DESCRIPTION` = 'MAXVALUE'),0,(`_as_datetime`(from_unixtime(`information_schema`.`partitions`.`PARTITION_DESCRIPTION`)) < now()))) AS `count_past_from_unixtime`,sum(if((`information_schema`.`partitions`.`PARTITION_DESCRIPTION` = 'MAXVALUE'),0,(`_as_datetime`(from_unixtime(`information_schema`.`partitions`.`PARTITION_DESCRIPTION`)) >= now()))) AS `count_future_from_unixtime`,sum(if((`information_schema`.`partitions`.`PARTITION_DESCRIPTION` = 'MAXVALUE'),0,(`_as_datetime`(from_days(`information_schema`.`partitions`.`PARTITION_DESCRIPTION`)) < now()))) AS `count_past_from_days`,sum(if((`information_schema`.`partitions`.`PARTITION_DESCRIPTION` = 'MAXVALUE'),0,(`_as_datetime`(from_days(`information_schema`.`partitions`.`PARTITION_DESCRIPTION`)) >= now()))) AS `count_future_from_days`,substring_index(group_concat(`information_schema`.`partitions`.`PARTITION_NAME` order by `information_schema`.`partitions`.`PARTITION_ORDINAL_POSITION` ASC separator ','),',',1) AS `first_partition_name`,substring_index(group_concat(if(((`information_schema`.`partitions`.`PARTITION_ORDINAL_POSITION` = 1) and (`information_schema`.`partitions`.`PARTITION_DESCRIPTION` = 0)),NULL,`information_schema`.`partitions`.`PARTITION_NAME`) order by `information_schema`.`partitions`.`PARTITION_ORDINAL_POSITION` ASC separator ','),',',1) AS `first_partition_name_skipping_zero`,substring_index(group_concat(`information_schema`.`partitions`.`PARTITION_NAME` order by `information_schema`.`partitions`.`PARTITION_ORDINAL_POSITION` ASC separator ','),',',-(1)) AS `last_partition_name`,sum((`information_schema`.`partitions`.`PARTITION_DESCRIPTION` = 'MAXVALUE')) AS `has_maxvalue`,max(if((`information_schema`.`partitions`.`PARTITION_DESCRIPTION` = 'MAXVALUE'),`information_schema`.`partitions`.`PARTITION_NAME`,NULL)) AS `maxvalue_partition_name`,max(if((`information_schema`.`partitions`.`PARTITION_DESCRIPTION` <> 'MAXVALUE'),ifnull(`_as_datetime`(`unquote`(`information_schema`.`partitions`.`PARTITION_DESCRIPTION`)),cast(`information_schema`.`partitions`.`PARTITION_DESCRIPTION` as signed)),NULL)) AS `max_partition_description` from `information_schema`.`partitions` where (`information_schema`.`partitions`.`PARTITION_METHOD` in ('RANGE','RANGE COLUMNS')) group by `information_schema`.`partitions`.`TABLE_SCHEMA`,`information_schema`.`partitions`.`TABLE_NAME` */;

--
-- Final view structure for view `_sql_table_keys`
--

/*!50001 DROP TABLE IF EXISTS `_sql_table_keys`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_table_keys`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_table_keys` AS select `information_schema`.`STATISTICS`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`STATISTICS`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`STATISTICS`.`INDEX_NAME` AS `INDEX_NAME`,concat(if((min(`information_schema`.`STATISTICS`.`NON_UNIQUE`) = 0),if((`information_schema`.`STATISTICS`.`INDEX_NAME` = 'PRIMARY'),'PRIMARY ','UNIQUE '),''),'KEY ',if((`information_schema`.`STATISTICS`.`INDEX_NAME` = 'PRIMARY'),'',`mysql_qualify`(`information_schema`.`STATISTICS`.`INDEX_NAME`)),'(',group_concat(`mysql_qualify`(`information_schema`.`STATISTICS`.`COLUMN_NAME`),ifnull(concat('(',`information_schema`.`STATISTICS`.`SUB_PART`,')'),'') order by `information_schema`.`STATISTICS`.`SEQ_IN_INDEX` ASC separator ','),')') AS `sql_index_definition` from `INFORMATION_SCHEMA`.`STATISTICS` where (`information_schema`.`STATISTICS`.`TABLE_SCHEMA` not in ('mysql','INFORMATION_SCHEMA','performance_schema')) group by `information_schema`.`STATISTICS`.`TABLE_SCHEMA`,`information_schema`.`STATISTICS`.`TABLE_NAME`,`information_schema`.`STATISTICS`.`INDEX_NAME` */;

--
-- Final view structure for view `_sql_tokens`
--

/*!50001 DROP TABLE IF EXISTS `_sql_tokens`*/;
/*!50001 DROP VIEW IF EXISTS `_sql_tokens`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_sql_tokens` AS select `_global_sql_tokens`.`server_id` AS `server_id`,`_global_sql_tokens`.`session_id` AS `session_id`,`_global_sql_tokens`.`id` AS `id`,`_global_sql_tokens`.`start` AS `start`,`_global_sql_tokens`.`level` AS `level`,`_global_sql_tokens`.`token` AS `token`,`_global_sql_tokens`.`state` AS `state` from `_global_sql_tokens` where (`_global_sql_tokens`.`session_id` = connection_id()) */
/*!50002 WITH CASCADED CHECK OPTION */;

--
-- Final view structure for view `_unique_keys`
--

/*!50001 DROP TABLE IF EXISTS `_unique_keys`*/;
/*!50001 DROP VIEW IF EXISTS `_unique_keys`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `_unique_keys` AS select `information_schema`.`STATISTICS`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`STATISTICS`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`STATISTICS`.`INDEX_NAME` AS `INDEX_NAME`,count(0) AS `COUNT_COLUMN_IN_INDEX`,if((sum((`information_schema`.`STATISTICS`.`NULLABLE` = 'YES')) > 0),1,0) AS `has_nullable`,if((`information_schema`.`STATISTICS`.`INDEX_NAME` = 'PRIMARY'),1,0) AS `is_primary`,group_concat(`information_schema`.`STATISTICS`.`COLUMN_NAME` order by `information_schema`.`STATISTICS`.`SEQ_IN_INDEX` ASC separator ',') AS `COLUMN_NAMES`,substring_index(group_concat(`information_schema`.`STATISTICS`.`COLUMN_NAME` order by `information_schema`.`STATISTICS`.`SEQ_IN_INDEX` ASC separator ','),',',1) AS `FIRST_COLUMN_NAME` from `INFORMATION_SCHEMA`.`STATISTICS` where (`information_schema`.`STATISTICS`.`NON_UNIQUE` = 0) group by `information_schema`.`STATISTICS`.`TABLE_SCHEMA`,`information_schema`.`STATISTICS`.`TABLE_NAME`,`information_schema`.`STATISTICS`.`INDEX_NAME` */;

--
-- Final view structure for view `auto_increment_columns`
--

/*!50001 DROP TABLE IF EXISTS `auto_increment_columns`*/;
/*!50001 DROP VIEW IF EXISTS `auto_increment_columns`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `auto_increment_columns` AS select `information_schema`.`COLUMNS`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`COLUMNS`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`COLUMNS`.`COLUMN_NAME` AS `COLUMN_NAME`,`information_schema`.`COLUMNS`.`DATA_TYPE` AS `DATA_TYPE`,`information_schema`.`COLUMNS`.`COLUMN_TYPE` AS `COLUMN_TYPE`,(locate('unsigned',`information_schema`.`COLUMNS`.`COLUMN_TYPE`) = 0) AS `is_signed`,(locate('unsigned',`information_schema`.`COLUMNS`.`COLUMN_TYPE`) > 0) AS `is_unsigned`,((case `information_schema`.`COLUMNS`.`DATA_TYPE` when 'tinyint' then 255 when 'smallint' then 65535 when 'mediumint' then 16777215 when 'int' then 4294967295 when 'bigint' then 18446744073709551615 end) >> if((locate('unsigned',`information_schema`.`COLUMNS`.`COLUMN_TYPE`) > 0),0,1)) AS `max_value`,`information_schema`.`TABLES`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,(`information_schema`.`TABLES`.`AUTO_INCREMENT` / ((case `information_schema`.`COLUMNS`.`DATA_TYPE` when 'tinyint' then 255 when 'smallint' then 65535 when 'mediumint' then 16777215 when 'int' then 4294967295 when 'bigint' then 18446744073709551615 end) >> if((locate('unsigned',`information_schema`.`COLUMNS`.`COLUMN_TYPE`) > 0),0,1))) AS `auto_increment_ratio` from (`INFORMATION_SCHEMA`.`COLUMNS` join `INFORMATION_SCHEMA`.`TABLES` on(((`information_schema`.`COLUMNS`.`TABLE_SCHEMA` = `information_schema`.`TABLES`.`TABLE_SCHEMA`) and (`information_schema`.`COLUMNS`.`TABLE_NAME` = `information_schema`.`TABLES`.`TABLE_NAME`)))) where ((`information_schema`.`COLUMNS`.`TABLE_SCHEMA` not in ('mysql','INFORMATION_SCHEMA','performance_schema')) and (`information_schema`.`TABLES`.`TABLE_TYPE` = 'BASE TABLE') and (`information_schema`.`COLUMNS`.`EXTRA` = 'auto_increment')) */;

--
-- Final view structure for view `candidate_keys`
--

/*!50001 DROP TABLE IF EXISTS `candidate_keys`*/;
/*!50001 DROP VIEW IF EXISTS `candidate_keys`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `candidate_keys` AS select `information_schema`.`COLUMNS`.`TABLE_SCHEMA` AS `table_schema`,`information_schema`.`COLUMNS`.`TABLE_NAME` AS `table_name`,`_unique_keys`.`INDEX_NAME` AS `index_name`,`_unique_keys`.`has_nullable` AS `has_nullable`,`_unique_keys`.`is_primary` AS `is_primary`,`_unique_keys`.`COLUMN_NAMES` AS `column_names`,`_unique_keys`.`COUNT_COLUMN_IN_INDEX` AS `count_column_in_index`,`information_schema`.`COLUMNS`.`DATA_TYPE` AS `data_type`,`information_schema`.`COLUMNS`.`CHARACTER_SET_NAME` AS `character_set_name`,((((case ifnull(`information_schema`.`COLUMNS`.`CHARACTER_SET_NAME`,'') when '' then 0 else 1 end) << 20) + ((case lcase(`information_schema`.`COLUMNS`.`DATA_TYPE`) when 'tinyint' then 0 when 'smallint' then 1 when 'int' then 2 when 'timestamp' then 3 when 'bigint' then 4 when 'datetime' then 5 else 9 end) << 16)) + (`_unique_keys`.`COUNT_COLUMN_IN_INDEX` << 0)) AS `candidate_key_rank_in_table` from (`INFORMATION_SCHEMA`.`COLUMNS` join `common_schema`.`_unique_keys` on(((`information_schema`.`COLUMNS`.`TABLE_SCHEMA` = `_unique_keys`.`TABLE_SCHEMA`) and (`information_schema`.`COLUMNS`.`TABLE_NAME` = `_unique_keys`.`TABLE_NAME`) and (`information_schema`.`COLUMNS`.`COLUMN_NAME` = `_unique_keys`.`FIRST_COLUMN_NAME`)))) order by `information_schema`.`COLUMNS`.`TABLE_SCHEMA`,`information_schema`.`COLUMNS`.`TABLE_NAME`,((((case ifnull(`information_schema`.`COLUMNS`.`CHARACTER_SET_NAME`,'') when '' then 0 else 1 end) << 20) + ((case lcase(`information_schema`.`COLUMNS`.`DATA_TYPE`) when 'tinyint' then 0 when 'smallint' then 1 when 'int' then 2 when 'timestamp' then 3 when 'bigint' then 4 when 'datetime' then 5 else 9 end) << 16)) + (`_unique_keys`.`COUNT_COLUMN_IN_INDEX` << 0)) */;

--
-- Final view structure for view `candidate_keys_recommended`
--

/*!50001 DROP TABLE IF EXISTS `candidate_keys_recommended`*/;
/*!50001 DROP VIEW IF EXISTS `candidate_keys_recommended`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `candidate_keys_recommended` AS select `candidate_keys`.`table_schema` AS `table_schema`,`candidate_keys`.`table_name` AS `table_name`,substring_index(group_concat(`candidate_keys`.`index_name` order by `candidate_keys`.`candidate_key_rank_in_table` ASC separator ','),',',1) AS `recommended_index_name`,cast(substring_index(group_concat(`candidate_keys`.`has_nullable` order by `candidate_keys`.`candidate_key_rank_in_table` ASC separator ','),',',1) as unsigned) AS `has_nullable`,cast(substring_index(group_concat(`candidate_keys`.`is_primary` order by `candidate_keys`.`candidate_key_rank_in_table` ASC separator ','),',',1) as unsigned) AS `is_primary`,cast(substring_index(group_concat(`candidate_keys`.`count_column_in_index` order by `candidate_keys`.`candidate_key_rank_in_table` ASC separator ','),',',1) as unsigned) AS `count_column_in_index`,substring_index(group_concat(`candidate_keys`.`column_names` order by `candidate_keys`.`candidate_key_rank_in_table` ASC separator '
'),'\n',1) AS `column_names` from `common_schema`.`candidate_keys` group by `candidate_keys`.`table_schema`,`candidate_keys`.`table_name` order by `candidate_keys`.`table_schema`,`candidate_keys`.`table_name` */;

--
-- Final view structure for view `data_size_per_engine`
--

/*!50001 DROP TABLE IF EXISTS `data_size_per_engine`*/;
/*!50001 DROP VIEW IF EXISTS `data_size_per_engine`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `data_size_per_engine` AS select `information_schema`.`TABLES`.`ENGINE` AS `ENGINE`,count(0) AS `count_tables`,sum(`information_schema`.`TABLES`.`DATA_LENGTH`) AS `data_size`,sum(`information_schema`.`TABLES`.`INDEX_LENGTH`) AS `index_size`,sum((`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH`)) AS `total_size`,substring_index(group_concat(concat('`',`information_schema`.`TABLES`.`TABLE_SCHEMA`,'`.`',`information_schema`.`TABLES`.`TABLE_NAME`,'`') order by (`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH`) DESC separator ','),',',1) AS `largest_table`,max((`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH`)) AS `largest_table_size` from `INFORMATION_SCHEMA`.`TABLES` where ((`information_schema`.`TABLES`.`TABLE_SCHEMA` not in ('INFORMATION_SCHEMA','performance_schema')) and (`information_schema`.`TABLES`.`ENGINE` is not null)) group by `information_schema`.`TABLES`.`ENGINE` */;

--
-- Final view structure for view `data_size_per_schema`
--

/*!50001 DROP TABLE IF EXISTS `data_size_per_schema`*/;
/*!50001 DROP VIEW IF EXISTS `data_size_per_schema`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `data_size_per_schema` AS select `information_schema`.`TABLES`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,sum((`information_schema`.`TABLES`.`TABLE_TYPE` = 'BASE TABLE')) AS `count_tables`,sum((`information_schema`.`TABLES`.`TABLE_TYPE` = 'VIEW')) AS `count_views`,count(distinct `information_schema`.`TABLES`.`ENGINE`) AS `distinct_engines`,sum(`information_schema`.`TABLES`.`DATA_LENGTH`) AS `data_size`,sum(`information_schema`.`TABLES`.`INDEX_LENGTH`) AS `index_size`,sum((`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH`)) AS `total_size`,substring_index(group_concat(if((`information_schema`.`TABLES`.`TABLE_TYPE` = 'BASE TABLE'),`information_schema`.`TABLES`.`TABLE_NAME`,NULL) order by (`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH`) DESC separator ','),',',1) AS `largest_table`,max((`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH`)) AS `largest_table_size` from `INFORMATION_SCHEMA`.`TABLES` where (`information_schema`.`TABLES`.`TABLE_SCHEMA` not in ('INFORMATION_SCHEMA','performance_schema')) group by `information_schema`.`TABLES`.`TABLE_SCHEMA` */;

--
-- Final view structure for view `debugged_routines`
--

/*!50001 DROP TABLE IF EXISTS `debugged_routines`*/;
/*!50001 DROP VIEW IF EXISTS `debugged_routines`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `debugged_routines` AS select `information_schema`.`ROUTINES`.`ROUTINE_SCHEMA` AS `ROUTINE_SCHEMA`,`information_schema`.`ROUTINES`.`ROUTINE_NAME` AS `ROUTINE_NAME`,`information_schema`.`ROUTINES`.`ROUTINE_TYPE` AS `ROUTINE_TYPE`,concat('call `',database(),'`.rdebug_compile_routine(',quote(`information_schema`.`ROUTINES`.`ROUTINE_SCHEMA`),', ',quote(`information_schema`.`ROUTINES`.`ROUTINE_NAME`),', false)') AS `sql_undebug_routine` from `INFORMATION_SCHEMA`.`ROUTINES` where (locate(`_rdebug_get_debug_code_start`(),`information_schema`.`ROUTINES`.`ROUTINE_DEFINITION`) > 0) */;

--
-- Final view structure for view `global_status_diff`
--

/*!50001 DROP TABLE IF EXISTS `global_status_diff`*/;
/*!50001 DROP VIEW IF EXISTS `global_status_diff`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `global_status_diff` AS select straight_join lcase(`gs0`.`VARIABLE_NAME`) AS `variable_name`,`gs0`.`VARIABLE_VALUE` AS `variable_value_0`,`gs1`.`VARIABLE_VALUE` AS `variable_value_1`,(`gs1`.`VARIABLE_VALUE` - `gs0`.`VARIABLE_VALUE`) AS `variable_value_diff`,((`gs1`.`VARIABLE_VALUE` - `gs0`.`VARIABLE_VALUE`) / 10) AS `variable_value_psec`,(((`gs1`.`VARIABLE_VALUE` - `gs0`.`VARIABLE_VALUE`) * 60) / 10) AS `variable_value_pminute` from (`common_schema`.`_global_status_sleep` `gs0` join `common_schema`.`_global_status_wrapper` `gs1` on((`gs0`.`VARIABLE_NAME` = `gs1`.`VARIABLE_NAME`))) */;

--
-- Final view structure for view `global_status_diff_clean`
--

/*!50001 DROP TABLE IF EXISTS `global_status_diff_clean`*/;
/*!50001 DROP VIEW IF EXISTS `global_status_diff_clean`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `global_status_diff_clean` AS select `global_status_diff`.`variable_name` AS `variable_name`,`global_status_diff`.`variable_value_0` AS `variable_value_0`,`global_status_diff`.`variable_value_1` AS `variable_value_1`,if((`global_status_diff`.`variable_value_diff` = 0),'',`global_status_diff`.`variable_value_diff`) AS `variable_value_diff`,if((`global_status_diff`.`variable_value_diff` = 0),'',`global_status_diff`.`variable_value_psec`) AS `variable_value_psec`,if((`global_status_diff`.`variable_value_diff` = 0),'',`global_status_diff`.`variable_value_pminute`) AS `variable_value_pminute` from `common_schema`.`global_status_diff` */;

--
-- Final view structure for view `global_status_diff_nonzero`
--

/*!50001 DROP TABLE IF EXISTS `global_status_diff_nonzero`*/;
/*!50001 DROP VIEW IF EXISTS `global_status_diff_nonzero`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `global_status_diff_nonzero` AS select `global_status_diff`.`variable_name` AS `variable_name`,`global_status_diff`.`variable_value_0` AS `variable_value_0`,`global_status_diff`.`variable_value_1` AS `variable_value_1`,`global_status_diff`.`variable_value_diff` AS `variable_value_diff`,`global_status_diff`.`variable_value_psec` AS `variable_value_psec`,`global_status_diff`.`variable_value_pminute` AS `variable_value_pminute` from `common_schema`.`global_status_diff` where (`global_status_diff`.`variable_value_diff` <> 0) */;

--
-- Final view structure for view `innodb_locked_transactions`
--

/*!50001 DROP TABLE IF EXISTS `innodb_locked_transactions`*/;
/*!50001 DROP VIEW IF EXISTS `innodb_locked_transactions`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `innodb_locked_transactions` AS select `locked_transaction`.`trx_id` AS `locked_trx_id`,`locked_transaction`.`trx_started` AS `locked_trx_started`,`locked_transaction`.`trx_wait_started` AS `locked_trx_wait_started`,`locked_transaction`.`trx_mysql_thread_id` AS `locked_trx_mysql_thread_id`,`locked_transaction`.`trx_query` AS `locked_trx_query`,`information_schema`.`INNODB_LOCK_WAITS`.`requested_lock_id` AS `requested_lock_id`,`information_schema`.`INNODB_LOCK_WAITS`.`blocking_lock_id` AS `blocking_lock_id`,`locking_transaction`.`trx_id` AS `locking_trx_id`,`locking_transaction`.`trx_started` AS `locking_trx_started`,`locking_transaction`.`trx_wait_started` AS `locking_trx_wait_started`,`locking_transaction`.`trx_mysql_thread_id` AS `locking_trx_mysql_thread_id`,`locking_transaction`.`trx_query` AS `locking_trx_query`,timestampdiff(SECOND,`locked_transaction`.`trx_wait_started`,now()) AS `trx_wait_seconds`,concat('KILL QUERY ',`locking_transaction`.`trx_mysql_thread_id`) AS `sql_kill_blocking_query`,concat('KILL ',`locking_transaction`.`trx_mysql_thread_id`) AS `sql_kill_blocking_connection` from ((`INFORMATION_SCHEMA`.`INNODB_TRX` `locked_transaction` join `INFORMATION_SCHEMA`.`INNODB_LOCK_WAITS` on((`locked_transaction`.`trx_id` = `information_schema`.`INNODB_LOCK_WAITS`.`requesting_trx_id`))) join `INFORMATION_SCHEMA`.`INNODB_TRX` `locking_transaction` on((`locking_transaction`.`trx_id` = `information_schema`.`INNODB_LOCK_WAITS`.`blocking_trx_id`))) where (`locking_transaction`.`trx_mysql_thread_id` <> connection_id()) */;

--
-- Final view structure for view `innodb_simple_locks`
--

/*!50001 DROP TABLE IF EXISTS `innodb_simple_locks`*/;
/*!50001 DROP VIEW IF EXISTS `innodb_simple_locks`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `innodb_simple_locks` AS select `information_schema`.`INNODB_LOCKS`.`lock_id` AS `lock_id`,`information_schema`.`INNODB_LOCKS`.`lock_trx_id` AS `lock_trx_id`,`information_schema`.`INNODB_LOCKS`.`lock_type` AS `lock_type`,`information_schema`.`INNODB_LOCKS`.`lock_table` AS `lock_table`,`information_schema`.`INNODB_LOCKS`.`lock_index` AS `lock_index`,`information_schema`.`INNODB_LOCKS`.`lock_data` AS `lock_data` from `INFORMATION_SCHEMA`.`INNODB_LOCKS` */;

--
-- Final view structure for view `innodb_transactions`
--

/*!50001 DROP TABLE IF EXISTS `innodb_transactions`*/;
/*!50001 DROP VIEW IF EXISTS `innodb_transactions`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `innodb_transactions` AS select `information_schema`.`INNODB_TRX`.`trx_id` AS `trx_id`,`information_schema`.`INNODB_TRX`.`trx_state` AS `trx_state`,`information_schema`.`INNODB_TRX`.`trx_started` AS `trx_started`,`information_schema`.`INNODB_TRX`.`trx_requested_lock_id` AS `trx_requested_lock_id`,`information_schema`.`INNODB_TRX`.`trx_wait_started` AS `trx_wait_started`,`information_schema`.`INNODB_TRX`.`trx_weight` AS `trx_weight`,`information_schema`.`INNODB_TRX`.`trx_mysql_thread_id` AS `trx_mysql_thread_id`,`information_schema`.`INNODB_TRX`.`trx_query` AS `trx_query`,`information_schema`.`INNODB_TRX`.`trx_operation_state` AS `trx_operation_state`,`information_schema`.`INNODB_TRX`.`trx_tables_in_use` AS `trx_tables_in_use`,`information_schema`.`INNODB_TRX`.`trx_tables_locked` AS `trx_tables_locked`,`information_schema`.`INNODB_TRX`.`trx_lock_structs` AS `trx_lock_structs`,`information_schema`.`INNODB_TRX`.`trx_lock_memory_bytes` AS `trx_lock_memory_bytes`,`information_schema`.`INNODB_TRX`.`trx_rows_locked` AS `trx_rows_locked`,`information_schema`.`INNODB_TRX`.`trx_rows_modified` AS `trx_rows_modified`,`information_schema`.`INNODB_TRX`.`trx_concurrency_tickets` AS `trx_concurrency_tickets`,`information_schema`.`INNODB_TRX`.`trx_isolation_level` AS `trx_isolation_level`,`information_schema`.`INNODB_TRX`.`trx_unique_checks` AS `trx_unique_checks`,`information_schema`.`INNODB_TRX`.`trx_foreign_key_checks` AS `trx_foreign_key_checks`,`information_schema`.`INNODB_TRX`.`trx_last_foreign_key_error` AS `trx_last_foreign_key_error`,`information_schema`.`INNODB_TRX`.`trx_adaptive_hash_latched` AS `trx_adaptive_hash_latched`,`information_schema`.`INNODB_TRX`.`trx_adaptive_hash_timeout` AS `trx_adaptive_hash_timeout`,`information_schema`.`INNODB_TRX`.`trx_is_read_only` AS `trx_is_read_only`,`information_schema`.`INNODB_TRX`.`trx_autocommit_non_locking` AS `trx_autocommit_non_locking`,`information_schema`.`PROCESSLIST`.`INFO` AS `INFO`,timestampdiff(SECOND,`information_schema`.`INNODB_TRX`.`trx_started`,now()) AS `trx_runtime_seconds`,timestampdiff(SECOND,`information_schema`.`INNODB_TRX`.`trx_wait_started`,now()) AS `trx_wait_seconds`,if((`information_schema`.`PROCESSLIST`.`COMMAND` = 'Sleep'),`information_schema`.`PROCESSLIST`.`TIME`,0) AS `trx_idle_seconds`,concat('KILL QUERY ',`information_schema`.`INNODB_TRX`.`trx_mysql_thread_id`) AS `sql_kill_query`,concat('KILL ',`information_schema`.`INNODB_TRX`.`trx_mysql_thread_id`) AS `sql_kill_connection` from (`INFORMATION_SCHEMA`.`INNODB_TRX` left join `INFORMATION_SCHEMA`.`PROCESSLIST` on((`information_schema`.`INNODB_TRX`.`trx_mysql_thread_id` = `information_schema`.`PROCESSLIST`.`ID`))) where (`information_schema`.`INNODB_TRX`.`trx_mysql_thread_id` <> connection_id()) */;

--
-- Final view structure for view `innodb_transactions_summary`
--

/*!50001 DROP TABLE IF EXISTS `innodb_transactions_summary`*/;
/*!50001 DROP VIEW IF EXISTS `innodb_transactions_summary`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `innodb_transactions_summary` AS select count(0) AS `count_transactions`,ifnull(sum((`information_schema`.`INNODB_TRX`.`trx_state` = 'RUNNING')),0) AS `running_transactions`,ifnull(sum((`information_schema`.`INNODB_TRX`.`trx_requested_lock_id` is not null)),0) AS `locked_transactions`,count(distinct `information_schema`.`INNODB_TRX`.`trx_requested_lock_id`) AS `distinct_locks` from `INFORMATION_SCHEMA`.`INNODB_TRX` where (`information_schema`.`INNODB_TRX`.`trx_mysql_thread_id` <> connection_id()) */;

--
-- Final view structure for view `last_query_profiling`
--

/*!50001 DROP TABLE IF EXISTS `last_query_profiling`*/;
/*!50001 DROP VIEW IF EXISTS `last_query_profiling`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `last_query_profiling` AS select `query_profiling`.`QUERY_ID` AS `QUERY_ID`,`query_profiling`.`STATE` AS `STATE`,`query_profiling`.`state_calls` AS `state_calls`,`query_profiling`.`state_sum_duration` AS `state_sum_duration`,`query_profiling`.`state_duration_per_call` AS `state_duration_per_call`,`query_profiling`.`state_duration_pct` AS `state_duration_pct`,`query_profiling`.`state_seqs` AS `state_seqs` from (`common_schema`.`query_profiling` join `common_schema`.`_query_profiling_minmax` on((`query_profiling`.`QUERY_ID` = `_query_profiling_minmax`.`max_query_id`))) */;

--
-- Final view structure for view `no_pk_innodb_tables`
--

/*!50001 DROP TABLE IF EXISTS `no_pk_innodb_tables`*/;
/*!50001 DROP VIEW IF EXISTS `no_pk_innodb_tables`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `no_pk_innodb_tables` AS select `information_schema`.`TABLES`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`TABLES`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`TABLES`.`ENGINE` AS `ENGINE`,group_concat(if((`information_schema`.`TABLE_CONSTRAINTS`.`CONSTRAINT_TYPE` = 'UNIQUE'),`information_schema`.`TABLE_CONSTRAINTS`.`CONSTRAINT_NAME`,NULL) separator ',') AS `candidate_keys` from (`INFORMATION_SCHEMA`.`TABLES` left join `INFORMATION_SCHEMA`.`TABLE_CONSTRAINTS` on(((`information_schema`.`TABLES`.`TABLE_SCHEMA` = `information_schema`.`TABLE_CONSTRAINTS`.`TABLE_SCHEMA`) and (`information_schema`.`TABLES`.`TABLE_NAME` = `information_schema`.`TABLE_CONSTRAINTS`.`TABLE_NAME`)))) where (`information_schema`.`TABLES`.`ENGINE` = 'InnoDB') group by `information_schema`.`TABLES`.`TABLE_SCHEMA`,`information_schema`.`TABLES`.`TABLE_NAME`,`information_schema`.`TABLES`.`ENGINE` having (ifnull(sum((`information_schema`.`TABLE_CONSTRAINTS`.`CONSTRAINT_TYPE` = 'PRIMARY KEY')),0) = 0) */;

--
-- Final view structure for view `processlist_grantees`
--

/*!50001 DROP TABLE IF EXISTS `processlist_grantees`*/;
/*!50001 DROP VIEW IF EXISTS `processlist_grantees`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `processlist_grantees` AS select `information_schema`.`PROCESSLIST`.`ID` AS `ID`,`information_schema`.`PROCESSLIST`.`USER` AS `USER`,`information_schema`.`PROCESSLIST`.`HOST` AS `HOST`,`information_schema`.`PROCESSLIST`.`DB` AS `DB`,`information_schema`.`PROCESSLIST`.`COMMAND` AS `COMMAND`,`information_schema`.`PROCESSLIST`.`TIME` AS `TIME`,`information_schema`.`PROCESSLIST`.`STATE` AS `STATE`,`information_schema`.`PROCESSLIST`.`INFO` AS `INFO`,`information_schema`.`USER_PRIVILEGES`.`GRANTEE` AS `GRANTEE`,`mysql`.`user`.`User` AS `grantee_user`,`mysql`.`user`.`Host` AS `grantee_host`,sum((`information_schema`.`USER_PRIVILEGES`.`PRIVILEGE_TYPE` = 'SUPER')) AS `is_super`,((`information_schema`.`PROCESSLIST`.`USER` = 'system user') or (`information_schema`.`PROCESSLIST`.`COMMAND` = 'Binlog Dump')) AS `is_repl`,(`information_schema`.`PROCESSLIST`.`ID` = connection_id()) AS `is_current`,concat('KILL QUERY ',`information_schema`.`PROCESSLIST`.`ID`) AS `sql_kill_query`,concat('KILL ',`information_schema`.`PROCESSLIST`.`ID`) AS `sql_kill_connection` from ((`INFORMATION_SCHEMA`.`PROCESSLIST` left join `INFORMATION_SCHEMA`.`USER_PRIVILEGES` on((`match_grantee`(`information_schema`.`PROCESSLIST`.`USER`,`information_schema`.`PROCESSLIST`.`HOST`) = `information_schema`.`USER_PRIVILEGES`.`GRANTEE`))) left join `mysql`.`user` on((concat('\'',`mysql`.`user`.`User`,'\'@\'',`mysql`.`user`.`Host`,'\'') = `information_schema`.`USER_PRIVILEGES`.`GRANTEE`))) group by `information_schema`.`PROCESSLIST`.`ID`,`information_schema`.`PROCESSLIST`.`USER`,`information_schema`.`PROCESSLIST`.`HOST`,`information_schema`.`PROCESSLIST`.`DB`,`information_schema`.`PROCESSLIST`.`COMMAND`,`information_schema`.`PROCESSLIST`.`TIME`,`information_schema`.`PROCESSLIST`.`STATE`,`information_schema`.`PROCESSLIST`.`INFO`,`information_schema`.`USER_PRIVILEGES`.`GRANTEE`,`mysql`.`user`.`User`,`mysql`.`user`.`Host` */;

--
-- Final view structure for view `processlist_per_userhost`
--

/*!50001 DROP TABLE IF EXISTS `processlist_per_userhost`*/;
/*!50001 DROP VIEW IF EXISTS `processlist_per_userhost`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `processlist_per_userhost` AS select `information_schema`.`PROCESSLIST`.`USER` AS `user`,min(substring_index(`information_schema`.`PROCESSLIST`.`HOST`,':',1)) AS `host`,count(0) AS `count_processes`,sum((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep')) AS `active_processes`,cast(`split_token`(group_concat(if((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep'),`information_schema`.`PROCESSLIST`.`TIME`,NULL) order by `information_schema`.`PROCESSLIST`.`TIME` ASC separator ','),',',(count(if((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep'),`information_schema`.`PROCESSLIST`.`TIME`,NULL)) / 2)) as decimal(10,2)) AS `median_active_time`,cast(`split_token`(group_concat(if((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep'),`information_schema`.`PROCESSLIST`.`TIME`,NULL) order by `information_schema`.`PROCESSLIST`.`TIME` ASC separator ','),',',((count(if((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep'),`information_schema`.`PROCESSLIST`.`TIME`,NULL)) * 95) / 100)) as decimal(10,2)) AS `median_95pct_active_time`,max(if((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep'),`information_schema`.`PROCESSLIST`.`TIME`,NULL)) AS `max_active_time`,avg(if((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep'),`information_schema`.`PROCESSLIST`.`TIME`,NULL)) AS `average_active_time` from `INFORMATION_SCHEMA`.`PROCESSLIST` where (`information_schema`.`PROCESSLIST`.`ID` <> connection_id()) group by `information_schema`.`PROCESSLIST`.`USER`,substring_index(`information_schema`.`PROCESSLIST`.`HOST`,':',1) */;

--
-- Final view structure for view `processlist_repl`
--

/*!50001 DROP TABLE IF EXISTS `processlist_repl`*/;
/*!50001 DROP VIEW IF EXISTS `processlist_repl`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `processlist_repl` AS select `information_schema`.`PROCESSLIST`.`ID` AS `ID`,`information_schema`.`PROCESSLIST`.`USER` AS `USER`,`information_schema`.`PROCESSLIST`.`HOST` AS `HOST`,`information_schema`.`PROCESSLIST`.`DB` AS `DB`,`information_schema`.`PROCESSLIST`.`COMMAND` AS `COMMAND`,`information_schema`.`PROCESSLIST`.`TIME` AS `TIME`,`information_schema`.`PROCESSLIST`.`STATE` AS `STATE`,`information_schema`.`PROCESSLIST`.`INFO` AS `INFO`,`information_schema`.`PROCESSLIST`.`TIME_MS` AS `TIME_MS`,`information_schema`.`PROCESSLIST`.`STAGE` AS `STAGE`,`information_schema`.`PROCESSLIST`.`MAX_STAGE` AS `MAX_STAGE`,`information_schema`.`PROCESSLIST`.`PROGRESS` AS `PROGRESS`,`information_schema`.`PROCESSLIST`.`MEMORY_USED` AS `MEMORY_USED`,`information_schema`.`PROCESSLIST`.`EXAMINED_ROWS` AS `EXAMINED_ROWS`,`information_schema`.`PROCESSLIST`.`QUERY_ID` AS `QUERY_ID`,(`information_schema`.`PROCESSLIST`.`USER` = 'system user') AS `is_system`,(((`information_schema`.`PROCESSLIST`.`USER` = 'system user') and (`common_schema`.`_known_thread_states`.`state_type` = 'replication_io_thread')) is true) AS `is_io_thread`,(((`information_schema`.`PROCESSLIST`.`USER` = 'system user') and (`common_schema`.`_known_thread_states`.`state_type` = 'replication_sql_thread')) is true) AS `is_sql_thread`,(`information_schema`.`PROCESSLIST`.`COMMAND` = 'Binlog Dump') AS `is_slave` from (`INFORMATION_SCHEMA`.`PROCESSLIST` left join `common_schema`.`_known_thread_states` on((convert(`common_schema`.`_known_thread_states`.`state` using utf8) like concat(`information_schema`.`PROCESSLIST`.`STATE`,'%')))) where ((`information_schema`.`PROCESSLIST`.`USER` = 'system user') or (`information_schema`.`PROCESSLIST`.`COMMAND` = 'Binlog Dump')) */;

--
-- Final view structure for view `processlist_states`
--

/*!50001 DROP TABLE IF EXISTS `processlist_states`*/;
/*!50001 DROP VIEW IF EXISTS `processlist_states`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `processlist_states` AS select `information_schema`.`PROCESSLIST`.`STATE` AS `state`,count(0) AS `count_processes`,cast(`split_token`(group_concat(`information_schema`.`PROCESSLIST`.`TIME` order by `information_schema`.`PROCESSLIST`.`TIME` ASC separator ','),',',(count(0) / 2)) as decimal(10,2)) AS `median_state_time`,cast(`split_token`(group_concat(`information_schema`.`PROCESSLIST`.`TIME` order by `information_schema`.`PROCESSLIST`.`TIME` ASC separator ','),',',((count(0) * 95) / 100)) as decimal(10,2)) AS `median_95pct_state_time`,max(`information_schema`.`PROCESSLIST`.`TIME`) AS `max_state_time`,sum(`information_schema`.`PROCESSLIST`.`TIME`) AS `sum_state_time` from `INFORMATION_SCHEMA`.`PROCESSLIST` where (`information_schema`.`PROCESSLIST`.`ID` <> connection_id()) group by `information_schema`.`PROCESSLIST`.`STATE` order by count(0) desc */;

--
-- Final view structure for view `processlist_summary`
--

/*!50001 DROP TABLE IF EXISTS `processlist_summary`*/;
/*!50001 DROP VIEW IF EXISTS `processlist_summary`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `processlist_summary` AS select count(0) AS `count_processes`,sum((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep')) AS `active_processes`,sum((`information_schema`.`PROCESSLIST`.`COMMAND` = 'Sleep')) AS `sleeping_processes`,sum(((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep') and (`information_schema`.`PROCESSLIST`.`USER` <> 'system user') and (`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Binlog Dump'))) AS `active_queries`,ifnull(sum(if(((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep') and (`information_schema`.`PROCESSLIST`.`USER` <> 'system user') and (`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Binlog Dump')),(`information_schema`.`PROCESSLIST`.`TIME` >= 1),NULL)),0) AS `num_queries_over_1_sec`,ifnull(sum(if(((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep') and (`information_schema`.`PROCESSLIST`.`USER` <> 'system user') and (`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Binlog Dump')),(`information_schema`.`PROCESSLIST`.`TIME` >= 10),NULL)),0) AS `num_queries_over_10_sec`,ifnull(sum(if(((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep') and (`information_schema`.`PROCESSLIST`.`USER` <> 'system user') and (`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Binlog Dump')),(`information_schema`.`PROCESSLIST`.`TIME` >= 60),NULL)),0) AS `num_queries_over_60_sec`,ifnull(avg(if(((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep') and (`information_schema`.`PROCESSLIST`.`USER` <> 'system user') and (`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Binlog Dump')),`information_schema`.`PROCESSLIST`.`TIME`,NULL)),0) AS `average_active_time`,ifnull(cast(`split_token`(group_concat(if(((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep') and (`information_schema`.`PROCESSLIST`.`USER` <> 'system user') and (`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Binlog Dump')),`information_schema`.`PROCESSLIST`.`TIME`,NULL) order by `information_schema`.`PROCESSLIST`.`TIME` ASC separator ','),',',((count(0) * 95) / 100)) as decimal(10,2)),0) AS `median_95pct_active_time` from `INFORMATION_SCHEMA`.`PROCESSLIST` where (`information_schema`.`PROCESSLIST`.`ID` <> connection_id()) */;

--
-- Final view structure for view `processlist_top`
--

/*!50001 DROP TABLE IF EXISTS `processlist_top`*/;
/*!50001 DROP VIEW IF EXISTS `processlist_top`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `processlist_top` AS select `information_schema`.`PROCESSLIST`.`ID` AS `ID`,`information_schema`.`PROCESSLIST`.`USER` AS `USER`,`information_schema`.`PROCESSLIST`.`HOST` AS `HOST`,`information_schema`.`PROCESSLIST`.`DB` AS `DB`,`information_schema`.`PROCESSLIST`.`COMMAND` AS `COMMAND`,`information_schema`.`PROCESSLIST`.`TIME` AS `TIME`,`information_schema`.`PROCESSLIST`.`STATE` AS `STATE`,`information_schema`.`PROCESSLIST`.`INFO` AS `INFO`,`information_schema`.`PROCESSLIST`.`TIME_MS` AS `TIME_MS`,`information_schema`.`PROCESSLIST`.`STAGE` AS `STAGE`,`information_schema`.`PROCESSLIST`.`MAX_STAGE` AS `MAX_STAGE`,`information_schema`.`PROCESSLIST`.`PROGRESS` AS `PROGRESS`,`information_schema`.`PROCESSLIST`.`MEMORY_USED` AS `MEMORY_USED`,`information_schema`.`PROCESSLIST`.`EXAMINED_ROWS` AS `EXAMINED_ROWS`,`information_schema`.`PROCESSLIST`.`QUERY_ID` AS `QUERY_ID`,concat('KILL QUERY ',`information_schema`.`PROCESSLIST`.`ID`) AS `sql_kill_query`,concat('KILL ',`information_schema`.`PROCESSLIST`.`ID`) AS `sql_kill_connection` from `INFORMATION_SCHEMA`.`PROCESSLIST` where ((`information_schema`.`PROCESSLIST`.`COMMAND` <> 'Sleep') and (`information_schema`.`PROCESSLIST`.`ID` <> connection_id())) order by `information_schema`.`PROCESSLIST`.`TIME` desc */;

--
-- Final view structure for view `query_profiling`
--

/*!50001 DROP TABLE IF EXISTS `query_profiling`*/;
/*!50001 DROP VIEW IF EXISTS `query_profiling`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `query_profiling` AS select `information_schema`.`PROFILING`.`QUERY_ID` AS `QUERY_ID`,`information_schema`.`PROFILING`.`STATE` AS `STATE`,count(0) AS `state_calls`,sum(`information_schema`.`PROFILING`.`DURATION`) AS `state_sum_duration`,(sum(`information_schema`.`PROFILING`.`DURATION`) / count(0)) AS `state_duration_per_call`,round(((100.0 * sum(`information_schema`.`PROFILING`.`DURATION`)) / max(`_query_profiling_summary`.`sum_duration`)),2) AS `state_duration_pct`,group_concat(`information_schema`.`PROFILING`.`SEQ` order by `information_schema`.`PROFILING`.`SEQ` ASC separator ',') AS `state_seqs` from (`INFORMATION_SCHEMA`.`PROFILING` join `common_schema`.`_query_profiling_summary` on((`information_schema`.`PROFILING`.`QUERY_ID` = `_query_profiling_summary`.`QUERY_ID`))) group by `information_schema`.`PROFILING`.`QUERY_ID`,`information_schema`.`PROFILING`.`STATE` */;

--
-- Final view structure for view `redundant_keys`
--

/*!50001 DROP TABLE IF EXISTS `redundant_keys`*/;
/*!50001 DROP VIEW IF EXISTS `redundant_keys`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `redundant_keys` AS select `redundant_keys`.`TABLE_SCHEMA` AS `table_schema`,`redundant_keys`.`TABLE_NAME` AS `table_name`,`redundant_keys`.`INDEX_NAME` AS `redundant_index_name`,`redundant_keys`.`index_columns` AS `redundant_index_columns`,`redundant_keys`.`non_unique` AS `redundant_index_non_unique`,`dominant_keys`.`INDEX_NAME` AS `dominant_index_name`,`dominant_keys`.`index_columns` AS `dominant_index_columns`,`dominant_keys`.`non_unique` AS `dominant_index_non_unique`,if(((`redundant_keys`.`subpart_exists` <> 0) or (`dominant_keys`.`subpart_exists` <> 0)),1,0) AS `subpart_exists`,concat('ALTER TABLE `',`redundant_keys`.`TABLE_SCHEMA`,'`.`',`redundant_keys`.`TABLE_NAME`,'` DROP INDEX `',`redundant_keys`.`INDEX_NAME`,'`') AS `sql_drop_index` from (`common_schema`.`_flattened_keys` `redundant_keys` join `common_schema`.`_flattened_keys` `dominant_keys` on(((`redundant_keys`.`TABLE_SCHEMA` = `dominant_keys`.`TABLE_SCHEMA`) and (`redundant_keys`.`TABLE_NAME` = `dominant_keys`.`TABLE_NAME`)))) where ((`redundant_keys`.`INDEX_NAME` <> `dominant_keys`.`INDEX_NAME`) and (((`redundant_keys`.`index_columns` = `dominant_keys`.`index_columns`) and ((`redundant_keys`.`non_unique` > `dominant_keys`.`non_unique`) or ((`redundant_keys`.`non_unique` = `dominant_keys`.`non_unique`) and (if((`redundant_keys`.`INDEX_NAME` = 'PRIMARY'),'',`redundant_keys`.`INDEX_NAME`) > if((`dominant_keys`.`INDEX_NAME` = 'PRIMARY'),'',`dominant_keys`.`INDEX_NAME`))))) or ((locate(concat(`redundant_keys`.`index_columns`,','),`dominant_keys`.`index_columns`) = 1) and (`redundant_keys`.`non_unique` = 1)) or ((locate(concat(`dominant_keys`.`index_columns`,','),`redundant_keys`.`index_columns`) = 1) and (`dominant_keys`.`non_unique` = 0)))) */;

--
-- Final view structure for view `routine_privileges`
--

/*!50001 DROP TABLE IF EXISTS `routine_privileges`*/;
/*!50001 DROP VIEW IF EXISTS `routine_privileges`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `routine_privileges` AS select concat('\'',`mysql`.`procs_priv`.`User`,'\'@\'',`mysql`.`procs_priv`.`Host`,'\'') AS `GRANTEE`,NULL AS `ROUTINE_CATALOG`,`mysql`.`procs_priv`.`Db` AS `ROUTINE_SCHEMA`,`mysql`.`procs_priv`.`Routine_name` AS `ROUTINE_NAME`,`mysql`.`procs_priv`.`Routine_type` AS `ROUTINE_TYPE`,replace(ucase(substring_index(substring_index(`mysql`.`procs_priv`.`Proc_priv`,',',(`common_schema`.`numbers`.`n` + 1)),',',-(1))),'\0',' ') AS `PRIVILEGE_TYPE`,if((find_in_set('Grant',`mysql`.`procs_priv`.`Proc_priv`) > 0),'YES','NO') AS `IS_GRANTABLE` from (`mysql`.`procs_priv` join `common_schema`.`numbers`) where ((`common_schema`.`numbers`.`n` between 0 and (char_length(`mysql`.`procs_priv`.`Proc_priv`) - char_length(replace(`mysql`.`procs_priv`.`Proc_priv`,',','')))) and (ucase(substring_index(substring_index(`mysql`.`procs_priv`.`Proc_priv`,',',(`common_schema`.`numbers`.`n` + 1)),',',-(1))) <> 'GRANT')) */;

--
-- Final view structure for view `routines`
--

/*!50001 DROP TABLE IF EXISTS `routines`*/;
/*!50001 DROP VIEW IF EXISTS `routines`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `routines` AS select `information_schema`.`ROUTINES`.`SPECIFIC_NAME` AS `SPECIFIC_NAME`,`information_schema`.`ROUTINES`.`ROUTINE_CATALOG` AS `ROUTINE_CATALOG`,`information_schema`.`ROUTINES`.`ROUTINE_SCHEMA` AS `ROUTINE_SCHEMA`,`information_schema`.`ROUTINES`.`ROUTINE_NAME` AS `ROUTINE_NAME`,`information_schema`.`ROUTINES`.`ROUTINE_TYPE` AS `ROUTINE_TYPE`,`information_schema`.`ROUTINES`.`DATA_TYPE` AS `DATA_TYPE`,`information_schema`.`ROUTINES`.`CHARACTER_MAXIMUM_LENGTH` AS `CHARACTER_MAXIMUM_LENGTH`,`information_schema`.`ROUTINES`.`CHARACTER_OCTET_LENGTH` AS `CHARACTER_OCTET_LENGTH`,`information_schema`.`ROUTINES`.`NUMERIC_PRECISION` AS `NUMERIC_PRECISION`,`information_schema`.`ROUTINES`.`NUMERIC_SCALE` AS `NUMERIC_SCALE`,`information_schema`.`ROUTINES`.`DATETIME_PRECISION` AS `DATETIME_PRECISION`,`information_schema`.`ROUTINES`.`CHARACTER_SET_NAME` AS `CHARACTER_SET_NAME`,`information_schema`.`ROUTINES`.`COLLATION_NAME` AS `COLLATION_NAME`,`information_schema`.`ROUTINES`.`DTD_IDENTIFIER` AS `DTD_IDENTIFIER`,`information_schema`.`ROUTINES`.`ROUTINE_BODY` AS `ROUTINE_BODY`,`information_schema`.`ROUTINES`.`ROUTINE_DEFINITION` AS `ROUTINE_DEFINITION`,`information_schema`.`ROUTINES`.`EXTERNAL_NAME` AS `EXTERNAL_NAME`,`information_schema`.`ROUTINES`.`EXTERNAL_LANGUAGE` AS `EXTERNAL_LANGUAGE`,`information_schema`.`ROUTINES`.`PARAMETER_STYLE` AS `PARAMETER_STYLE`,`information_schema`.`ROUTINES`.`IS_DETERMINISTIC` AS `IS_DETERMINISTIC`,`information_schema`.`ROUTINES`.`SQL_DATA_ACCESS` AS `SQL_DATA_ACCESS`,`information_schema`.`ROUTINES`.`SQL_PATH` AS `SQL_PATH`,`information_schema`.`ROUTINES`.`SECURITY_TYPE` AS `SECURITY_TYPE`,`information_schema`.`ROUTINES`.`CREATED` AS `CREATED`,`information_schema`.`ROUTINES`.`LAST_ALTERED` AS `LAST_ALTERED`,`information_schema`.`ROUTINES`.`SQL_MODE` AS `SQL_MODE`,`information_schema`.`ROUTINES`.`ROUTINE_COMMENT` AS `ROUTINE_COMMENT`,`information_schema`.`ROUTINES`.`DEFINER` AS `DEFINER`,`information_schema`.`ROUTINES`.`CHARACTER_SET_CLIENT` AS `CHARACTER_SET_CLIENT`,`information_schema`.`ROUTINES`.`COLLATION_CONNECTION` AS `COLLATION_CONNECTION`,`information_schema`.`ROUTINES`.`DATABASE_COLLATION` AS `DATABASE_COLLATION`,`mysql`.`proc`.`param_list` AS `param_list` from (`INFORMATION_SCHEMA`.`ROUTINES` join `mysql`.`proc` on(((`mysql`.`proc`.`db` = `information_schema`.`ROUTINES`.`ROUTINE_SCHEMA`) and (`mysql`.`proc`.`name` = `information_schema`.`ROUTINES`.`ROUTINE_NAME`) and (`mysql`.`proc`.`type` = `information_schema`.`ROUTINES`.`ROUTINE_TYPE`)))) */;

--
-- Final view structure for view `similar_grants`
--

/*!50001 DROP TABLE IF EXISTS `similar_grants`*/;
/*!50001 DROP VIEW IF EXISTS `similar_grants`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `similar_grants` AS select min(`_bare_grantee_grants`.`GRANTEE`) AS `sample_grantee`,count(`_bare_grantee_grants`.`GRANTEE`) AS `count_grantees`,group_concat(`_bare_grantee_grants`.`GRANTEE` order by `_bare_grantee_grants`.`GRANTEE` ASC separator ',') AS `similar_grantees` from `common_schema`.`_bare_grantee_grants` group by `_bare_grantee_grants`.`sql_grants` order by count(0) desc */;

--
-- Final view structure for view `slave_hosts`
--

/*!50001 DROP TABLE IF EXISTS `slave_hosts`*/;
/*!50001 DROP VIEW IF EXISTS `slave_hosts`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `slave_hosts` AS select substring_index(`processlist_repl`.`HOST`,':',1) AS `host` from `common_schema`.`processlist_repl` where (`processlist_repl`.`is_slave` is true) */;

--
-- Final view structure for view `slave_status`
--

/*!50001 DROP TABLE IF EXISTS `slave_status`*/;
/*!50001 DROP VIEW IF EXISTS `slave_status`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `slave_status` AS select sum(if(`processlist_repl`.`is_io_thread`,`processlist_repl`.`TIME`,NULL)) AS `Slave_Connected_time`,(sum(`processlist_repl`.`is_io_thread`) is true) AS `Slave_IO_Running`,(sum(((`processlist_repl`.`is_sql_thread` <> 0) or ((`processlist_repl`.`is_system` <> 0) and (`processlist_repl`.`is_io_thread` = 0)))) is true) AS `Slave_SQL_Running`,((sum(`processlist_repl`.`is_system`) = 2) is true) AS `Slave_Running`,sum(if(((`processlist_repl`.`is_sql_thread` <> 0) or ((`processlist_repl`.`is_system` <> 0) and (`processlist_repl`.`is_io_thread` = 0))),`processlist_repl`.`TIME`,NULL)) AS `Seconds_Behind_Master` from `common_schema`.`processlist_repl` */;

--
-- Final view structure for view `sql_accounts`
--

/*!50001 DROP TABLE IF EXISTS `sql_accounts`*/;
/*!50001 DROP VIEW IF EXISTS `sql_accounts`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `sql_accounts` AS select `_sql_accounts_password`.`user` AS `user`,`_sql_accounts_password`.`host` AS `host`,`_sql_accounts_password`.`grantee` AS `grantee`,`_sql_accounts_password`.`password` AS `password`,`_sql_accounts_password`.`is_empty_password` AS `is_empty_password`,((`_sql_accounts_password`.`is_new_password` <> 0) or (`_sql_accounts_password`.`is_empty_password` <> 0)) AS `is_new_password`,`_sql_accounts_password`.`is_old_password` AS `is_old_password`,`_sql_accounts_password`.`is_blocked` AS `is_blocked`,concat('SET PASSWORD FOR ',`_sql_accounts_password`.`grantee`,' = \'',convert(`_sql_accounts_password`.`password_for_sql_block_account` using utf8),'\'') AS `sql_block_account`,concat('SET PASSWORD FOR ',`_sql_accounts_password`.`grantee`,' = \'',convert(`_sql_accounts_password`.`password_for_sql_release_account` using utf8),'\'') AS `sql_release_account` from `common_schema`.`_sql_accounts_password` */;

--
-- Final view structure for view `sql_alter_table`
--

/*!50001 DROP TABLE IF EXISTS `sql_alter_table`*/;
/*!50001 DROP VIEW IF EXISTS `sql_alter_table`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `sql_alter_table` AS select `information_schema`.`TABLES`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`TABLES`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`TABLES`.`ENGINE` AS `ENGINE`,group_concat(`sql_table_keys`.`sql_drop_key` order by `sql_table_keys`.`INDEX_NAME` ASC separator ', ') AS `sql_drop_keys`,group_concat(`sql_table_keys`.`sql_add_key` order by `sql_table_keys`.`INDEX_NAME` ASC separator ', ') AS `sql_add_keys`,concat('ENGINE=',`information_schema`.`TABLES`.`ENGINE`,' ',if((`information_schema`.`TABLES`.`CREATE_OPTIONS` = 'partitioned'),'',`information_schema`.`TABLES`.`CREATE_OPTIONS`)) AS `table_options`,concat('ALTER TABLE ',`mysql_qualify`(`information_schema`.`TABLES`.`TABLE_SCHEMA`),'.',`mysql_qualify`(`information_schema`.`TABLES`.`TABLE_NAME`),' ENGINE=',`information_schema`.`TABLES`.`ENGINE`,' ',if((`information_schema`.`TABLES`.`CREATE_OPTIONS` = 'partitioned'),'',`information_schema`.`TABLES`.`CREATE_OPTIONS`)) AS `alter_statement` from (`INFORMATION_SCHEMA`.`TABLES` join `common_schema`.`sql_table_keys` on(((`information_schema`.`TABLES`.`TABLE_SCHEMA` = `sql_table_keys`.`TABLE_SCHEMA`) and (`information_schema`.`TABLES`.`TABLE_NAME` = `sql_table_keys`.`TABLE_NAME`)))) where ((`information_schema`.`TABLES`.`TABLE_SCHEMA` not in ('mysql','INFORMATION_SCHEMA','performance_schema')) and (`information_schema`.`TABLES`.`ENGINE` is not null)) group by `information_schema`.`TABLES`.`TABLE_SCHEMA`,`information_schema`.`TABLES`.`TABLE_NAME`,`information_schema`.`TABLES`.`ENGINE`,`information_schema`.`TABLES`.`CREATE_OPTIONS` */;

--
-- Final view structure for view `sql_alter_table_tokudb`
--

/*!50001 DROP TABLE IF EXISTS `sql_alter_table_tokudb`*/;
/*!50001 DROP VIEW IF EXISTS `sql_alter_table_tokudb`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `sql_alter_table_tokudb` AS select `_sql_alter_table_tokudb_internal`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`_sql_alter_table_tokudb_internal`.`TABLE_NAME` AS `TABLE_NAME`,`_sql_alter_table_tokudb_internal`.`ENGINE` AS `ENGINE`,`_sql_alter_table_tokudb_internal`.`alter_fast_clause` AS `alter_fast_clause`,concat('alter table ',`mysql_qualify`(`_sql_alter_table_tokudb_internal`.`TABLE_SCHEMA`),'.',`mysql_qualify`(`_sql_alter_table_tokudb_internal`.`TABLE_NAME`),' ',`_sql_alter_table_tokudb_internal`.`alter_fast_clause`) AS `sql_alter_fast`,`_sql_alter_table_tokudb_internal`.`alter_small_clause` AS `alter_small_clause`,concat('alter table ',`mysql_qualify`(`_sql_alter_table_tokudb_internal`.`TABLE_SCHEMA`),'.',`mysql_qualify`(`_sql_alter_table_tokudb_internal`.`TABLE_NAME`),' ',`_sql_alter_table_tokudb_internal`.`alter_small_clause`) AS `sql_alter_small` from `common_schema`.`_sql_alter_table_tokudb_internal` */;

--
-- Final view structure for view `sql_foreign_keys`
--

/*!50001 DROP TABLE IF EXISTS `sql_foreign_keys`*/;
/*!50001 DROP VIEW IF EXISTS `sql_foreign_keys`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `sql_foreign_keys` AS select `information_schema`.`KEY_COLUMN_USAGE`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`KEY_COLUMN_USAGE`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`KEY_COLUMN_USAGE`.`CONSTRAINT_NAME` AS `CONSTRAINT_NAME`,concat('ALTER TABLE `',`information_schema`.`KEY_COLUMN_USAGE`.`TABLE_SCHEMA`,'`.`',`information_schema`.`KEY_COLUMN_USAGE`.`TABLE_NAME`,'` DROP FOREIGN KEY `',`information_schema`.`KEY_COLUMN_USAGE`.`CONSTRAINT_NAME`,'`') AS `drop_statement`,concat('ALTER TABLE `',`information_schema`.`KEY_COLUMN_USAGE`.`TABLE_SCHEMA`,'`.`',`information_schema`.`KEY_COLUMN_USAGE`.`TABLE_NAME`,'` ADD CONSTRAINT `',`information_schema`.`KEY_COLUMN_USAGE`.`CONSTRAINT_NAME`,'` FOREIGN KEY (',group_concat('`',`information_schema`.`KEY_COLUMN_USAGE`.`COLUMN_NAME`,'`' order by `information_schema`.`KEY_COLUMN_USAGE`.`ORDINAL_POSITION` ASC separator ','),')',' REFERENCES `',`information_schema`.`KEY_COLUMN_USAGE`.`REFERENCED_TABLE_SCHEMA`,'`.`',`information_schema`.`KEY_COLUMN_USAGE`.`REFERENCED_TABLE_NAME`,'` (',group_concat('`',`information_schema`.`KEY_COLUMN_USAGE`.`REFERENCED_COLUMN_NAME`,'`' order by `information_schema`.`KEY_COLUMN_USAGE`.`ORDINAL_POSITION` ASC separator ','),')',' ON DELETE ',min(`information_schema`.`REFERENTIAL_CONSTRAINTS`.`DELETE_RULE`),' ON UPDATE ',min(`information_schema`.`REFERENTIAL_CONSTRAINTS`.`UPDATE_RULE`)) AS `create_statement` from (`INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` join `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS` on(((`information_schema`.`KEY_COLUMN_USAGE`.`CONSTRAINT_SCHEMA` = `information_schema`.`REFERENTIAL_CONSTRAINTS`.`CONSTRAINT_SCHEMA`) and (`information_schema`.`KEY_COLUMN_USAGE`.`CONSTRAINT_NAME` = `information_schema`.`REFERENTIAL_CONSTRAINTS`.`CONSTRAINT_NAME`)))) where (`information_schema`.`KEY_COLUMN_USAGE`.`REFERENCED_TABLE_SCHEMA` is not null) group by `information_schema`.`KEY_COLUMN_USAGE`.`TABLE_SCHEMA`,`information_schema`.`KEY_COLUMN_USAGE`.`TABLE_NAME`,`information_schema`.`KEY_COLUMN_USAGE`.`CONSTRAINT_NAME`,`information_schema`.`KEY_COLUMN_USAGE`.`REFERENCED_TABLE_SCHEMA`,`information_schema`.`KEY_COLUMN_USAGE`.`REFERENCED_TABLE_NAME` */;

--
-- Final view structure for view `sql_grants`
--

/*!50001 DROP TABLE IF EXISTS `sql_grants`*/;
/*!50001 DROP VIEW IF EXISTS `sql_grants`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `sql_grants` AS select `_sql_grants_components`.`GRANTEE` AS `GRANTEE`,`mysql`.`user`.`User` AS `user`,`mysql`.`user`.`Host` AS `host`,`_sql_grants_components`.`priv_level` AS `priv_level`,`_sql_grants_components`.`priv_level_name` AS `priv_level_name`,`_sql_grants_components`.`object_schema` AS `object_schema`,`_sql_grants_components`.`object_name` AS `object_name`,`_sql_grants_components`.`current_privileges` AS `current_privileges`,`_sql_grants_components`.`IS_GRANTABLE` AS `IS_GRANTABLE`,concat('GRANT ',`_sql_grants_components`.`current_privileges`,' ON ',if((`_sql_grants_components`.`priv_level_name` = 'routine'),concat(`_sql_grants_components`.`object_type`,' '),''),`_sql_grants_components`.`priv_level`,' TO ',`_sql_grants_components`.`GRANTEE`,convert(if(((`_sql_grants_components`.`priv_level` = '*.*') and (`_sql_grants_components`.`current_privileges` = 'USAGE')),concat(' IDENTIFIED BY PASSWORD \'',`mysql`.`user`.`Password`,'\''),'') using utf8),if((`_sql_grants_components`.`IS_GRANTABLE` = 'YES'),' WITH GRANT OPTION','')) AS `sql_grant`,(case when ((`_sql_grants_components`.`current_privileges` = 'USAGE') and (`_sql_grants_components`.`priv_level` = '*.*')) then '' else concat('REVOKE ',`_sql_grants_components`.`current_privileges`,if((`_sql_grants_components`.`IS_GRANTABLE` = 'YES'),', GRANT OPTION',''),' ON ',`_sql_grants_components`.`priv_level`,' FROM ',`_sql_grants_components`.`GRANTEE`) end) AS `sql_revoke`,concat('DROP USER ',`_sql_grants_components`.`GRANTEE`) AS `sql_drop_user` from (`common_schema`.`_sql_grants_components` join `mysql`.`user` on((`_sql_grants_components`.`GRANTEE` = concat('\'',`mysql`.`user`.`User`,'\'@\'',`mysql`.`user`.`Host`,'\'')))) order by `_sql_grants_components`.`GRANTEE`,`_sql_grants_components`.`result_order` */;

--
-- Final view structure for view `sql_range_partitions`
--

/*!50001 DROP TABLE IF EXISTS `sql_range_partitions`*/;
/*!50001 DROP VIEW IF EXISTS `sql_range_partitions`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `sql_range_partitions` AS select `_sql_range_partitions_beautified`.`table_schema` AS `table_schema`,`_sql_range_partitions_beautified`.`table_name` AS `table_name`,`_sql_range_partitions_beautified`.`count_partitions` AS `count_partitions`,`_sql_range_partitions_beautified`.`count_past_partitions` AS `count_past_partitions`,`_sql_range_partitions_beautified`.`count_future_partitions` AS `count_future_partitions`,`_sql_range_partitions_beautified`.`has_maxvalue` AS `has_maxvalue`,concat('alter table ',`mysql_qualify`(`_sql_range_partitions_beautified`.`table_schema`),'.',`mysql_qualify`(`_sql_range_partitions_beautified`.`table_name`),' drop partition ',`mysql_qualify`(`_sql_range_partitions_beautified`.`first_partition_name_skipping_zero`)) AS `sql_drop_first_partition`,if(`_sql_range_partitions_beautified`.`has_maxvalue`,concat('alter table ',`mysql_qualify`(`_sql_range_partitions_beautified`.`table_schema`),'.',`mysql_qualify`(`_sql_range_partitions_beautified`.`table_name`),' reorganize partition ',`mysql_qualify`(`_sql_range_partitions_beautified`.`last_partition_name`),' into (partition ',`mysql_qualify`(`_sql_range_partitions_beautified`.`next_partition_name`),' values less than (',if(`is_datetime`(`_sql_range_partitions_beautified`.`next_partition_description`),quote(`_sql_range_partitions_beautified`.`next_partition_description`),`_sql_range_partitions_beautified`.`next_partition_description`),')',`_sql_range_partitions_beautified`.`next_partition_human_description_comment`,', partition p_maxvalue values less than MAXVALUE',')'),concat('alter table ',`mysql_qualify`(`_sql_range_partitions_beautified`.`table_schema`),'.',`mysql_qualify`(`_sql_range_partitions_beautified`.`table_name`),' add partition (partition ',`mysql_qualify`(`_sql_range_partitions_beautified`.`next_partition_name`),' values less than (',if(`is_datetime`(`_sql_range_partitions_beautified`.`next_partition_description`),quote(`_sql_range_partitions_beautified`.`next_partition_description`),`_sql_range_partitions_beautified`.`next_partition_description`),')',`_sql_range_partitions_beautified`.`next_partition_human_description_comment`,')')) AS `sql_add_next_partition` from `common_schema`.`_sql_range_partitions_beautified` */;

--
-- Final view structure for view `sql_show_grants`
--

/*!50001 DROP TABLE IF EXISTS `sql_show_grants`*/;
/*!50001 DROP VIEW IF EXISTS `sql_show_grants`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `sql_show_grants` AS select `sql_grants`.`GRANTEE` AS `GRANTEE`,`sql_grants`.`user` AS `user`,`sql_grants`.`host` AS `host`,group_concat(concat(`sql_grants`.`sql_grant`,';') separator '
') AS `sql_grants` from `common_schema`.`sql_grants` group by `sql_grants`.`GRANTEE`,`sql_grants`.`user`,`sql_grants`.`host` */;

--
-- Final view structure for view `sql_table_keys`
--

/*!50001 DROP TABLE IF EXISTS `sql_table_keys`*/;
/*!50001 DROP VIEW IF EXISTS `sql_table_keys`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `sql_table_keys` AS select `_sql_table_keys`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`_sql_table_keys`.`TABLE_NAME` AS `TABLE_NAME`,`_sql_table_keys`.`INDEX_NAME` AS `INDEX_NAME`,if((`_sql_table_keys`.`INDEX_NAME` = 'PRIMARY'),'DROP PRIMARY KEY',concat('DROP KEY ',`mysql_qualify`(`_sql_table_keys`.`INDEX_NAME`))) AS `sql_drop_key`,concat('ADD ',`_sql_table_keys`.`sql_index_definition`) AS `sql_add_key` from `common_schema`.`_sql_table_keys` */;

--
-- Final view structure for view `status`
--

/*!50001 DROP TABLE IF EXISTS `status`*/;
/*!50001 DROP VIEW IF EXISTS `status`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `status` AS select max(if((`metadata`.`attribute_name` = 'project_name'),`metadata`.`attribute_value`,NULL)) AS `project_name`,max(if((`metadata`.`attribute_name` = 'version'),`metadata`.`attribute_value`,NULL)) AS `version`,max(if((`metadata`.`attribute_name` = 'revision'),`metadata`.`attribute_value`,NULL)) AS `revision`,max(if((`metadata`.`attribute_name` = 'install_time'),`metadata`.`attribute_value`,NULL)) AS `install_time`,max(if((`metadata`.`attribute_name` = 'install_success'),`metadata`.`attribute_value`,NULL)) AS `install_success`,max(if((`metadata`.`attribute_name` = 'base_components_installed'),`metadata`.`attribute_value`,NULL)) AS `base_components_installed`,max(if((`metadata`.`attribute_name` = 'innodb_plugin_components_installed'),`metadata`.`attribute_value`,NULL)) AS `innodb_plugin_components_installed`,max(if((`metadata`.`attribute_name` = 'percona_server_components_installed'),`metadata`.`attribute_value`,NULL)) AS `percona_server_components_installed`,max(if((`metadata`.`attribute_name` = 'install_mysql_version'),`metadata`.`attribute_value`,NULL)) AS `install_mysql_version`,max(if((`metadata`.`attribute_name` = 'install_sql_mode'),`metadata`.`attribute_value`,NULL)) AS `install_sql_mode` from `metadata` */;

--
-- Final view structure for view `table_charset`
--

/*!50001 DROP TABLE IF EXISTS `table_charset`*/;
/*!50001 DROP VIEW IF EXISTS `table_charset`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `table_charset` AS select `information_schema`.`TABLES`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`TABLES`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`COLLATION_CHARACTER_SET_APPLICABILITY`.`CHARACTER_SET_NAME` AS `CHARACTER_SET_NAME`,`information_schema`.`TABLES`.`TABLE_COLLATION` AS `TABLE_COLLATION` from (`INFORMATION_SCHEMA`.`TABLES` join `INFORMATION_SCHEMA`.`COLLATION_CHARACTER_SET_APPLICABILITY` on((`information_schema`.`TABLES`.`TABLE_COLLATION` = `information_schema`.`COLLATION_CHARACTER_SET_APPLICABILITY`.`COLLATION_NAME`))) where (`information_schema`.`TABLES`.`TABLE_SCHEMA` not in ('mysql','INFORMATION_SCHEMA','performance_schema')) */;

--
-- Final view structure for view `text_columns`
--

/*!50001 DROP TABLE IF EXISTS `text_columns`*/;
/*!50001 DROP VIEW IF EXISTS `text_columns`*/;
/*!50001 CREATE ALGORITHM=MERGE */
/*!50013 DEFINER=`percona`@`localhost` SQL SECURITY INVOKER */
/*!50001 VIEW `text_columns` AS select `information_schema`.`COLUMNS`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`COLUMNS`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`COLUMNS`.`COLUMN_NAME` AS `COLUMN_NAME`,`information_schema`.`COLUMNS`.`COLUMN_TYPE` AS `COLUMN_TYPE`,`information_schema`.`COLUMNS`.`CHARACTER_SET_NAME` AS `CHARACTER_SET_NAME`,`information_schema`.`COLUMNS`.`COLLATION_NAME` AS `COLLATION_NAME` from `INFORMATION_SCHEMA`.`COLUMNS` where ((`information_schema`.`COLUMNS`.`TABLE_SCHEMA` not in ('mysql','INFORMATION_SCHEMA','performance_schema')) and (`information_schema`.`COLUMNS`.`CHARACTER_SET_NAME` is not null) and (`information_schema`.`COLUMNS`.`DATA_TYPE` <> 'enum') and (`information_schema`.`COLUMNS`.`DATA_TYPE` <> 'set')) */;

--
-- Current Database: `cr_debug`
--

USE `cr_debug`;

--
-- Current Database: `ftpusers`
--

USE `ftpusers`;

--
-- Current Database: `intranet`
--

USE `intranet`;

--
-- Current Database: `mainpress_network`
--

USE `mainpress_network`;

--
-- Final view structure for view `v_network`
--

/*!50001 DROP TABLE IF EXISTS `v_network`*/;
/*!50001 DROP VIEW IF EXISTS `v_network`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`dennis`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `v_network` AS (select `a`.`type` AS `type`,`a`.`brand` AS `brand`,`a`.`networkname` AS `networkname`,`a`.`model` AS `model`,concat(`w`.`panel`,'-',`w`.`port`) AS `wallport`,`w`.`panel` AS `panel`,`l`.`floor` AS `floor`,`l`.`name` AS `name`,`u`.`voornaam` AS `naam`,`a`.`assetId` AS `assetId`,`w`.`wallportId` AS `wallportId`,`l`.`locationId` AS `locationId`,`u`.`persId` AS `persId`,`s`.`switchId` AS `switchId`,`s`.`stack` AS `stack`,`s`.`port` AS `switchport`,`s`.`description` AS `switchportdescription`,concat(`s`.`stack`,'/g',`s`.`port`) AS `switchportstring`,`a`.`Active` AS `active`,`a`.`note` AS `assetNote`,`a`.`OS` AS `os` from (((((((`mainpress_network`.`asset` `a` left join `mainpress_network`.`asset_wallport` `aw` on((`a`.`assetId` = `aw`.`assetId`))) left join `mainpress_network`.`wallport` `w` on((`aw`.`wallportId` = `w`.`wallportId`))) left join `mainpress_network`.`location` `l` on((`w`.`locationId` = `l`.`locationId`))) left join `mainpress_network`.`user_asset` `ua` on((`ua`.`assetId` = `a`.`assetId`))) left join `Mainpress`.`personeel` `u` on((`ua`.`pId` = `u`.`persId`))) left join `mainpress_network`.`switch_wallport` `sw` on((`w`.`wallportId` = `sw`.`wallportId`))) left join `mainpress_network`.`switch` `s` on((`s`.`switchId` = `sw`.`switchId`)))) */;

--
-- Final view structure for view `v_wallport`
--

/*!50001 DROP TABLE IF EXISTS `v_wallport`*/;
/*!50001 DROP VIEW IF EXISTS `v_wallport`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`dennis`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `v_wallport` AS (select `wallport`.`wallportId` AS `wallportId`,`wallport`.`wallport` AS `wallport`,if((substr(`wallport`.`wallport`,-(2),1) = _utf8'-'),replace(`wallport`.`wallport`,_utf8'-',_utf8'-0'),if((substr(`wallport`.`wallport`,2,1) = _utf8'-'),concat(_utf8'0',`wallport`.`wallport`),`wallport`.`wallport`)) AS `wallportname`,`wallport`.`locationId` AS `locationId` from `wallport`) */;

--
-- Current Database: `mysql`
--

USE `mysql`;

--
-- Current Database: `northwind`
--

USE `northwind`;

--
-- Current Database: `percona`
--

USE `percona`;

--
-- Current Database: `php_sessions`
--

USE `php_sessions`;

--
-- Current Database: `sbtest`
--

USE `sbtest`;

--
-- Current Database: `test`
--

USE `test`;

--
-- Current Database: `tmp`
--

USE `tmp`;

--
-- Final view structure for view `jongbloed_abobestand_naw_tbv_import`
--

/*!50001 DROP TABLE IF EXISTS `jongbloed_abobestand_naw_tbv_import`*/;
/*!50001 DROP VIEW IF EXISTS `jongbloed_abobestand_naw_tbv_import`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`thijs`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `jongbloed_abobestand_naw_tbv_import` AS select `AAA`.`CID` AS `CID`,`AAA`.`KlantID` AS `KlantID`,`ADR`.`Bedrijfsnaam` AS `Bedrijfsnaam`,`ADR`.`Afdeling` AS `Afdeling`,`ADR`.`Straatnaam` AS `Straatnaam`,`ADR`.`Huisnummer` AS `Huisnummer`,`ADR`.`Huisnummertoevoeging` AS `Huisnummertoevoeging`,`ADR`.`Postcode` AS `Postcode`,`ADR`.`Plaats` AS `Plaats`,`ADR`.`Land` AS `Land`,`AAA`.`Factuur_klantid` AS `Factuur_klantid` from (`tmp`.`jongbloed_abo_klanten` `AAA` join `Managementboek_Klanten`.`Adres` `ADR` on(((`ADR`.`Klantid` = `AAA`.`KlantID`) and (`ADR`.`Adrestype` = 'factuur')))) */;


