SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Table `zzzNodeWorksetT` -- ----------------------------------------------------- DROP TABLE IF EXISTS `zzzNodeWorksetT` ; CREATE TABLE IF NOT EXISTS `zzzNodeWorksetT` ( `nodeId` INT UNSIGNED NOT NULL, `connId` BIGINT UNSIGNED NOT NULL, `isMain` INT NOT NULL DEFAULT 1, `added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`nodeId`, `connId`), INDEX `added_idx` (`added` ASC), INDEX `connid_nodeid_ismain_idx` (`connId` ASC, `nodeId` ASC, `isMain` ASC), INDEX `ismain_idx` (`isMain` ASC)) ENGINE = MEMORY; -- ----------------------------------------------------- -- Placeholder table for view `zzzNodeWorksetV` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `zzzNodeWorksetV` (`nodeId` INT, `connId` INT, `isMain` INT, `added` INT); -- ----------------------------------------------------- -- View `zzzNodeWorksetV` -- ----------------------------------------------------- DROP VIEW IF EXISTS `zzzNodeWorksetV` ; DROP TABLE IF EXISTS `zzzNodeWorksetV`; CREATE OR REPLACE VIEW `zzzNodeWorksetV` AS select * from zzzNodeWorksetT where connId = connection_id(); SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;