github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/tests/integration_tests/ddl_attributes/data/prepare.sql (about) 1 DROP DATABASE IF EXISTS `ddl_attributes`; 2 CREATE DATABASE `ddl_attributes`; 3 USE `ddl_attributes`; 4 5 CREATE TABLE attributes_t1 (id INT PRIMARY KEY, name VARCHAR(50)); 6 ALTER TABLE attributes_t1 ATTRIBUTES='merge_option=deny'; 7 INSERT INTO attributes_t1 (id, name) VALUES (1, "test1"); 8 INSERT INTO attributes_t1 (id) VALUES (2); 9 10 CREATE TABLE attributes_t2 (id INT PRIMARY KEY, name VARCHAR(50)) PARTITION BY RANGE (id) (PARTITION p0 VALUES LESS THAN (10000), PARTITION p1 VALUES LESS THAN (MAXVALUE)); 11 ALTER TABLE attributes_t2 ATTRIBUTES='merge_option=deny'; 12 ALTER TABLE attributes_t2 PARTITION p0 ATTRIBUTES='merge_option=allow'; 13 INSERT INTO attributes_t2 (id, name) VALUES (2, "test2"); 14 INSERT INTO attributes_t2 (id) VALUES (3); 15 16 DROP TABLE attributes_t1; 17 RECOVER TABLE attributes_t1; 18 TRUNCATE TABLE attributes_t1; 19 FLASHBACK TABLE attributes_t1 TO attributes_t1_back; 20 RENAME TABLE attributes_t1_back TO attributes_t1_new; 21 ALTER TABLE attributes_t2 DROP PARTITION p0; 22 ALTER TABLE attributes_t2 TRUNCATE PARTITION p1; 23 24 DROP PLACEMENT POLICY IF EXISTS placement1; 25 CREATE PLACEMENT POLICY placement1 followers=2; 26 CREATE TABLE placement_t1 (id BIGINT NOT NULL PRIMARY KEY auto_increment, b varchar(255)) PLACEMENT POLICY=placement1; 27 CREATE TABLE `placement_t2` (id BIGINT NOT NULL PRIMARY KEY auto_increment) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`placement1` */; 28 29 DROP TABLE IF EXISTS ttl_t1, ttl_t2, ttl_t3, ttl_t4; 30 CREATE TABLE ttl_t1(id BIGINT NOT NULL PRIMARY KEY auto_increment, t datetime) TTL=`t` + INTERVAL 1 DAY; 31 CREATE TABLE ttl_t2(id BIGINT NOT NULL PRIMARY KEY auto_increment, t datetime); 32 CREATE TABLE ttl_t3(id BIGINT NOT NULL PRIMARY KEY auto_increment, t datetime) TTL=`t` + INTERVAL 1 DAY TTL_ENABLE='OFF'; 33 CREATE TABLE ttl_t4(id BIGINT NOT NULL PRIMARY KEY auto_increment, t datetime) TTL=`t` + INTERVAL 1 DAY; 34 CREATE TABLE ttl_t5(id BIGINT NOT NULL PRIMARY KEY auto_increment, t datetime) TTL=`t` + INTERVAL 1 DAY; 35 ALTER TABLE ttl_t2 TTL=`t` + INTERVAL 1 DAY; 36 ALTER TABLE ttl_t3 TTL_ENABLE='ON'; 37 ALTER TABLE ttl_t4 REMOVE TTL; 38 ALTER TABLE ttl_t5 TTL_JOB_INTERVAL='7h'; 39 40 CREATE TABLE finish_mark(a INT PRIMARY KEY);