github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/tests/integration_tests/canal_json_adapter_compatibility/data/data_gbk.sql (about)

     1  -- This sql file is encoded in GBK by the 'iconv' command.
     2  -- DO NOT EDIT. 
     3  
     4  SET NAMES gbk;
     5  USE test;
     6  
     7  DROP TABLE IF EXISTS multi_data_type;
     8  
     9  CREATE TABLE multi_data_type
    10  (
    11      id                   INT AUTO_INCREMENT,
    12      t_tinyint            TINYINT,
    13      t_tinyint_unsigned   TINYINT UNSIGNED,
    14      t_smallint           SMALLINT,
    15      t_smallint_unsigned  SMALLINT UNSIGNED,
    16      t_mediumint          MEDIUMINT,
    17      t_mediumint_unsigned MEDIUMINT UNSIGNED,
    18      t_int                INT,
    19      t_int_unsigned       INT UNSIGNED,
    20      t_bigint             BIGINT,
    21      t_bigint_unsigned    BIGINT UNSIGNED,
    22      t_boolean            BOOLEAN,
    23      t_float              FLOAT(6, 2),
    24      t_double             DOUBLE(6, 2),
    25      t_decimal            DECIMAL(38, 19),
    26      t_char               CHAR,
    27      t_varchar            VARCHAR(10),
    28      c_binary             binary(16),
    29      c_varbinary          varbinary(16),
    30      t_tinytext           TINYTEXT,
    31      t_text               TEXT,
    32      t_mediumtext         MEDIUMTEXT,
    33      t_longtext           LONGTEXT,
    34      t_tinyblob           TINYBLOB,
    35      t_blob               BLOB,
    36      t_mediumblob         MEDIUMBLOB,
    37      t_longblob           LONGBLOB,
    38      t_date               DATE,
    39      t_datetime           DATETIME,
    40      t_timestamp          TIMESTAMP NULL,
    41      t_time               TIME,
    42  --  FIXME: Currently canal-adapter does not handle year types correctly.
    43  --  t_year               YEAR,
    44      t_enum               ENUM ('enum1', 'enum2', 'enum3'),
    45      t_set                SET ('a', 'b', 'c'),
    46  --  FIXME: Currently there will be data inconsistencies.
    47  --  t_bit                BIT(64),
    48      t_json               JSON,
    49      PRIMARY KEY (id)
    50  );
    51  
    52  -- make sure `nullable` can be handled by the mounter and mq encoding protocol
    53  INSERT INTO multi_data_type() VALUES ();
    54  
    55  INSERT INTO multi_data_type( t_tinyint, t_tinyint_unsigned, t_smallint, t_smallint_unsigned, t_mediumint
    56                             , t_mediumint_unsigned, t_int, t_int_unsigned, t_bigint, t_bigint_unsigned
    57                             , t_boolean, t_float, t_double, t_decimal
    58                             , t_char, t_varchar, c_binary, c_varbinary, t_tinytext, t_text, t_mediumtext, t_longtext
    59                             , t_tinyblob, t_blob, t_mediumblob, t_longblob
    60                             , t_date, t_datetime, t_timestamp, t_time
    61                             , t_enum
    62                             , t_set, t_json)
    63  VALUES ( -1, 1, -129, 129, -65536, 65536, -16777216, 16777216, -2147483649, 2147483649
    64         , true, 123.456, 123.123, 123456789012.123456789012
    65         , '测', '测试', x'89504E470D0A1A0A', x'89504E470D0A1A0A', '测试tinytext', '测试text', '测试mediumtext', '测试longtext'
    66         , 'tinyblob', 'blob', 'mediumblob', 'longblob'
    67         , '1977-01-01', '9999-12-31 23:59:59', '19731230153000', '23:59:59'
    68         , 'enum2'
    69         , 'a,b', NULL);
    70  
    71  INSERT INTO multi_data_type( t_tinyint, t_tinyint_unsigned, t_smallint, t_smallint_unsigned, t_mediumint
    72                             , t_mediumint_unsigned, t_int, t_int_unsigned, t_bigint, t_bigint_unsigned
    73                             , t_boolean, t_float, t_double, t_decimal
    74                             , t_char, t_varchar, c_binary, c_varbinary, t_tinytext, t_text, t_mediumtext, t_longtext
    75                             , t_tinyblob, t_blob, t_mediumblob, t_longblob
    76                             , t_date, t_datetime, t_timestamp, t_time
    77                             , t_enum
    78                             , t_set, t_json)
    79  VALUES ( -2, 2, -130, 130, -65537, 65537, -16777217, 16777217, -2147483650, 2147483650
    80         , false, 123.4567, 123.1237, 123456789012.1234567890127
    81         , '2', '测试2', x'89504E470D0A1A0B', x'89504E470D0A1A0B', '测试2tinytext', '测试2text', '测试2mediumtext', '测试longtext'
    82         , 'tinyblob2', 'blob2', 'mediumblob2', 'longblob2'
    83         , '2021-01-01', '2021-12-31 23:59:59', '19731230153000', '22:59:59'
    84         , 'enum1'
    85         , 'a,b,c', '{
    86      "id": 1,
    87      "name": "hello"
    88    }');
    89  
    90  UPDATE multi_data_type
    91  SET t_boolean = false
    92  WHERE id = 1;
    93  
    94  DELETE
    95  FROM multi_data_type
    96  WHERE id = 2;
    97  
    98  DROP TABLE IF EXISTS multi_charset;
    99  
   100  CREATE TABLE multi_charset (
   101  	id INT,
   102  	name varchar(128) CHARACTER SET gbk,
   103  	country char(32) CHARACTER SET gbk,
   104  	city varchar(64),
   105  	description text CHARACTER SET gbk,
   106  	image tinyblob,
   107  	PRIMARY KEY (id)
   108  ) ENGINE = InnoDB CHARSET = utf8mb4;
   109  
   110  INSERT INTO multi_charset
   111  VALUES (1, '测试', "中国", "上海", "你好,世界"
   112  	, 0xC4E3BAC3CAC0BDE7);
   113  
   114  INSERT INTO multi_charset
   115  VALUES (2, '部署', "美国", "纽约", "世界,你好"
   116  	, 0xCAC0BDE7C4E3BAC3);
   117  
   118  UPDATE multi_charset
   119  SET name = '开发'
   120  WHERE name = '测试';
   121  
   122  DELETE FROM multi_charset
   123  WHERE name = '部署'
   124  	AND country = '美国'
   125  	AND city = '纽约'
   126  	AND description = '世界,你好';
   127  
   128  DROP TABLE IF EXISTS test_ddl1;
   129  
   130  CREATE TABLE test_ddl1
   131  (
   132      id INT AUTO_INCREMENT,
   133      c1 INT,
   134      PRIMARY KEY (id)
   135  );
   136  
   137  DROP TABLE IF EXISTS test_ddl2;
   138  
   139  CREATE TABLE test_ddl2
   140  (
   141      id INT AUTO_INCREMENT,
   142      c1 INT,
   143      PRIMARY KEY (id)
   144  );
   145  
   146  DROP TABLE IF EXISTS test_ddl;
   147  
   148  RENAME TABLE test_ddl1 TO test_ddl;
   149  
   150  ALTER TABLE test_ddl
   151      ADD INDEX test_add_index (c1);
   152  
   153  DROP INDEX test_add_index ON test_ddl;
   154  
   155  ALTER TABLE test_ddl
   156      ADD COLUMN c2 INT NOT NULL;
   157  
   158  TRUNCATE TABLE test_ddl;
   159  
   160  DROP TABLE test_ddl2;
   161  
   162  CREATE TABLE test_ddl2
   163  (
   164      id INT AUTO_INCREMENT,
   165      c1 INT,
   166      PRIMARY KEY (id)
   167  );
   168  
   169  DROP TABLE IF EXISTS test_ddl3;
   170  
   171  CREATE TABLE test_ddl3 (
   172  	id INT,
   173  	名称 varchar(128),
   174  	PRIMARY KEY (id)
   175  ) ENGINE = InnoDB;
   176  
   177  ALTER TABLE test_ddl3
   178  	ADD COLUMN 城市 char(32);
   179  
   180  ALTER TABLE test_ddl3
   181  	MODIFY COLUMN 城市 varchar(32);
   182  
   183  ALTER TABLE test_ddl3
   184  	DROP COLUMN 城市;
   185  
   186  DROP TABLE IF EXISTS 表1;
   187  
   188  DROP TABLE IF EXISTS 表2;
   189  
   190  CREATE TABLE 表1 (
   191  	id INT,
   192  	name varchar(128),
   193  	PRIMARY KEY (id)
   194  ) ENGINE = InnoDB;
   195  
   196  RENAME TABLE 表1 TO 表2;
   197  
   198  DROP TABLE IF EXISTS binary_columns;
   199  
   200  CREATE TABLE binary_columns
   201  (
   202      id                   INT AUTO_INCREMENT,
   203      c_binary             binary(255),
   204      c_varbinary          varbinary(255),
   205      t_tinyblob           TINYBLOB,
   206      t_blob               BLOB,
   207      t_mediumblob         MEDIUMBLOB,
   208      t_longblob           LONGBLOB,
   209      PRIMARY KEY (id)
   210  );
   211  
   212  INSERT INTO binary_columns (c_binary, c_varbinary, t_tinyblob, t_blob, t_mediumblob, t_longblob)
   213  VALUES (
   214      x'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF',
   215      x'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF',
   216      x'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF',
   217      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF',
   218      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF',
   219      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'
   220  );
   221  
   222  INSERT INTO binary_columns (c_binary, c_varbinary, t_tinyblob, t_blob, t_mediumblob, t_longblob)
   223  VALUES (
   224      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F',
   225      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F',
   226      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F',
   227      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF',
   228      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF',
   229      x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'
   230  );