-- MySQL Administrator dump 1.4 -- -- ------------------------------------------------------ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -- -- Create schema tablenamebug -- DROP DATABASE IF EXISTS tablenamebug; CREATE DATABASE IF NOT EXISTS tablenamebug; USE tablenamebug; -- -- Definition of table `mcastsenders` -- DROP TABLE IF EXISTS `mcastsenders`; CREATE TABLE `mcastsenders` ( `SENDER_GUID` varchar(100) NOT NULL, `SENDER_NAME` varchar(512) NOT NULL, `MODIFIED_TIME` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`SENDER_GUID`), UNIQUE KEY `multicast_agent_name` (`SENDER_NAME`), KEY `by_name` (`SENDER_NAME`), KEY `by_modified` (`MODIFIED_TIME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `mcastsenders` -- /*!40000 ALTER TABLE `mcastsenders` DISABLE KEYS */; INSERT INTO `mcastsenders` (`SENDER_GUID`,`SENDER_NAME`,`MODIFIED_TIME`) VALUES ('1','1','2018-08-20 16:29:35'), ('2','2','2018-08-20 16:29:35'), ('3','3','2018-08-20 16:29:35'), ('4','4','2018-08-20 16:29:35'), ('5','5','2018-08-20 16:29:12'), ('6','6','2018-08-20 16:27:10'), ('7','7','2018-08-20 16:27:10'), ('8','8','2018-08-20 16:27:10'); /*!40000 ALTER TABLE `mcastsenders` ENABLE KEYS */; -- -- Definition of table `sender_ha_cluster_map` -- DROP TABLE IF EXISTS `sender_ha_cluster_map`; CREATE TABLE `sender_ha_cluster_map` ( `sender_guid` varchar(100) NOT NULL, `cluster_id` varchar(255) NOT NULL, `ha_priority` int(11) DEFAULT '0', `ha_group` int(11) DEFAULT '0', `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`sender_guid`,`cluster_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `sender_ha_cluster_map` -- /*!40000 ALTER TABLE `sender_ha_cluster_map` DISABLE KEYS */; /*!40000 ALTER TABLE `sender_ha_cluster_map` ENABLE KEYS */; -- -- Definition of view `sender_ha_cluster` -- DROP TABLE IF EXISTS `sender_ha_cluster`; DROP VIEW IF EXISTS `sender_ha_cluster`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `sender_ha_cluster` AS (select (select `y`.`sender_guid` from `sender_ha_cluster_map` `y` where (`y`.`cluster_id` = `x`.`cluster_id`) order by `y`.`ha_priority`,`y`.`sender_guid` limit 1) AS `primary_guid`,`x`.`sender_guid` AS `sender_guid`,`x`.`cluster_id` AS `cluster_id`,`x`.`ha_priority` AS `ha_priority`,`x`.`ha_group` AS `ha_group`,`x`.`modified_time` AS `modified_time` from `sender_ha_cluster_map` `x`); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;