-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 8.0.20 - MySQL Community Server - GPL -- Server OS: Linux -- HeidiSQL Version: 11.3.0.6295 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!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' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- Dumping structure for table date_bug.dates CREATE TABLE IF NOT EXISTS `dates` ( `currentdate` date NOT NULL, `datestart` datetime GENERATED ALWAYS AS (cast(`currentdate` as datetime)) STORED NOT NULL, `dateend` datetime GENERATED ALWAYS AS (cast((`currentdate` + interval 1 day) as datetime)) STORED NOT NULL, PRIMARY KEY (`currentdate`), UNIQUE KEY `datestart` (`datestart`,`dateend`), KEY `dateend` (`dateend`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- Dumping data for table date_bug.dates: ~4 rows (approximately) /*!40000 ALTER TABLE `dates` DISABLE KEYS */; INSERT INTO `dates` (`currentdate`) VALUES ('2021-11-27'), ('2021-11-28'), ('2021-11-29'), ('2021-11-30'); /*!40000 ALTER TABLE `dates` ENABLE KEYS */; -- Dumping structure for table date_bug.test CREATE TABLE IF NOT EXISTS `test` ( `from1` datetime NOT NULL, `dateto` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- Dumping data for table date_bug.test: ~2 rows (approximately) /*!40000 ALTER TABLE `test` DISABLE KEYS */; INSERT INTO `test` (`from1`, `dateto`) VALUES ('2021-11-28 00:00:00', '2021-11-29 00:00:00'), ('2021-11-27 00:00:00', '2021-11-30 00:00:00'); /*!40000 ALTER TABLE `test` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;