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

     1  use `row_format`;
     2  
     3  INSERT INTO multi_data_type( t_boolean, t_bigint, t_double, t_decimal, t_bit
     4                             , t_date, t_datetime, t_timestamp, t_time, t_year
     5                             , t_char, t_varchar, t_blob, t_text, t_enum
     6                             , t_set, t_json)
     7  VALUES ( true, 9223372036875807, 153.123, 123456669012.123456789012, b'1010001'
     8         , '2000-01-01', '9999-12-31 23:59:59', '19731230153000', '23:59:59', 1970
     9         , '测', '测试', 'blob', '测试text', 'enum1'
    10         , 'a,b', '{
    11      "key1": "value1",
    12      "key2": "value2"
    13    }');
    14  
    15  UPDATE multi_data_type
    16  SET t_bigint = 888,
    17      t_json   = '{
    18        "key0": "value0",
    19        "key2": "value2"
    20      }'
    21  WHERE id = 2;
    22  
    23  create table tp_int
    24  (
    25      id          int auto_increment,
    26      c_tinyint   tinyint   null,
    27      c_smallint  smallint  null,
    28      c_mediumint mediumint null,
    29      c_int       int       null,
    30      c_bigint    bigint    null,
    31      constraint pk
    32          primary key (id)
    33  );
    34  
    35  insert into tp_int()
    36  values ();
    37  
    38  insert into tp_int(c_tinyint, c_smallint, c_mediumint, c_int, c_bigint)
    39  values (1, 2, 3, 4, 5);
    40  
    41  -- insert max value
    42  insert into tp_int(c_tinyint, c_smallint, c_mediumint, c_int, c_bigint)
    43  values (127, 32767, 8388607, 2147483647, 9223372036854775807);
    44  
    45  -- insert min value
    46  insert into tp_int(c_tinyint, c_smallint, c_mediumint, c_int, c_bigint)
    47  values (-128, -32768, -8388608, -2147483648, -9223372036854775808);
    48  
    49  update tp_int set c_int = 0, c_tinyint = 0 where c_smallint = 2;
    50  delete from tp_int where c_int = 0;
    51  
    52  create table tp_unsigned_int (
    53       id          int auto_increment,
    54       c_unsigned_tinyint   tinyint   unsigned null,
    55       c_unsigned_smallint  smallint  unsigned null,
    56       c_unsigned_mediumint mediumint unsigned null,
    57       c_unsigned_int       int       unsigned null,
    58       c_unsigned_bigint    bigint    unsigned null,
    59       constraint pk
    60           primary key (id)
    61  );
    62  
    63  insert into tp_unsigned_int()
    64  values ();
    65  
    66  insert into tp_unsigned_int(c_unsigned_tinyint, c_unsigned_smallint, c_unsigned_mediumint,
    67                              c_unsigned_int, c_unsigned_bigint)
    68  values (1, 2, 3, 4, 5);
    69  
    70  -- insert max value
    71  insert into tp_unsigned_int(c_unsigned_tinyint, c_unsigned_smallint, c_unsigned_mediumint,
    72                              c_unsigned_int, c_unsigned_bigint)
    73  values (255, 65535, 16777215, 4294967295, 18446744073709551615);
    74  
    75  -- insert signed max value
    76  insert into tp_unsigned_int(c_unsigned_tinyint, c_unsigned_smallint, c_unsigned_mediumint,
    77                              c_unsigned_int, c_unsigned_bigint)
    78  values (127, 32767, 8388607, 2147483647, 9223372036854775807);
    79  
    80  insert into tp_unsigned_int(c_unsigned_tinyint, c_unsigned_smallint, c_unsigned_mediumint,
    81                              c_unsigned_int, c_unsigned_bigint)
    82  values (128, 32768, 8388608, 2147483648, 9223372036854775808);
    83  
    84  update tp_unsigned_int set c_unsigned_int = 0, c_unsigned_tinyint = 0 where c_unsigned_smallint = 65535;
    85  delete from tp_unsigned_int where c_unsigned_int = 0;
    86  
    87  create table tp_text
    88  (
    89      id           int auto_increment,
    90      c_tinytext   tinytext      null,
    91      c_text       text          null,
    92      c_mediumtext mediumtext    null,
    93      c_longtext   longtext      null,
    94      constraint pk
    95          primary key (id)
    96  );
    97  
    98  insert into tp_text()
    99  values ();
   100  
   101  insert into tp_text(c_tinytext, c_text, c_mediumtext, c_longtext)
   102  values ('89504E470D0A1A0A', '89504E470D0A1A0A', '89504E470D0A1A0A', '89504E470D0A1A0A'),
   103         ('', '', '', '');
   104  
   105  create table tp_char_binary
   106  (
   107      id           int auto_increment,
   108      c_char       char(16)      null,
   109      c_varchar    varchar(16)   null,
   110      c_binary     binary(16)    null,
   111      c_varbinary  varbinary(16) null,
   112      constraint pk
   113          primary key (id)
   114  );
   115  
   116  insert into tp_char_binary()
   117  values ();
   118  
   119  insert into tp_char_binary(c_char, c_varchar, c_binary, c_varbinary)
   120  values ('89504E470D0A1A0A', '89504E470D0A1A0A', x'89504E470D0A1A0A', x'89504E470D0A1A0A'),
   121         ('', '', x'89504E470D0A1A0A', x'89504E470D0A1A0A'),
   122         ('89504E470D0A1A0A', '89504E470D0A1A0A', x'', x'');
   123  
   124  create table tp_blob
   125  (
   126      id           int auto_increment,
   127      c_tinyblob   tinyblob      null,
   128      c_blob       blob          null,
   129      c_mediumblob mediumblob    null,
   130      c_longblob   longblob      null,
   131      constraint pk
   132          primary key (id)
   133  );
   134  
   135  insert into tp_blob()
   136  values ();
   137  
   138  insert into tp_blob(c_tinyblob, c_blob, c_mediumblob, c_longblob)
   139  values (x'89504E470D0A1A0A', x'89504E470D0A1A0A', x'89504E470D0A1A0A', x'89504E470D0A1A0A'),
   140         (x'', x'', x'', x'');
   141  
   142  create table tp_text2
   143  (
   144      id           int auto_increment,
   145      c_tinytext   tinytext      null,
   146      c_text       text          null,
   147      c_mediumtext mediumtext    null,
   148      c_longtext   longtext      null,
   149      c_varchar    varchar(16)   default "a",
   150      c_char       char(16)      default "a",
   151      c_tinyblob   tinyblob      null,
   152      c_blob       blob          null,
   153      c_mediumblob mediumblob    null,
   154      c_longblob   longblob      null,
   155      c_binary     binary(16)    default '0xa',
   156      c_varbinary  varbinary(16) default '0xa',
   157      constraint pk
   158          primary key (id)
   159  );
   160  
   161  create table tp_time
   162  (
   163      id          int auto_increment,
   164      c_date      date      null,
   165      c_datetime  datetime  null,
   166      c_timestamp timestamp null,
   167      c_time      time      null,
   168      c_year      year      null,
   169      constraint pk
   170          primary key (id)
   171  );
   172  
   173  create table tp_real
   174  (
   175      id        int auto_increment,
   176      c_float   float   null,
   177      c_double  double  null,
   178      c_decimal decimal null,
   179      c_decimal_2 decimal(10, 4) null,
   180      constraint pk
   181          primary key (id)
   182  );
   183  
   184  insert into tp_real()
   185  values ();
   186  
   187  insert into tp_real(c_float, c_double, c_decimal, c_decimal_2)
   188  values (2020.0202, 2020.0303, 2020.0404, 2021.1208);
   189  
   190  insert into tp_real(c_float, c_double, c_decimal, c_decimal_2)
   191  values (-2.7182818284, -3.1415926, -8000, -179394.233);
   192  
   193  create table tp_unsigned_real (
   194      id                   int auto_increment,
   195      c_unsigned_float     float unsigned   null,
   196      c_unsigned_double    double unsigned  null,
   197      c_unsigned_decimal   decimal unsigned null,
   198      c_unsigned_decimal_2 decimal(10, 4) unsigned null,
   199      constraint pk
   200          primary key (id)
   201  );
   202  
   203  insert into tp_unsigned_real()
   204  values ();
   205  
   206  insert into tp_unsigned_real(c_unsigned_float, c_unsigned_double, c_unsigned_decimal, c_unsigned_decimal_2)
   207  values (2020.0202, 2020.0303, 2020.0404, 2021.1208);
   208  
   209  create table tp_other
   210  (
   211      id     int auto_increment,
   212      c_enum enum ('a','b','c') null,
   213      c_set  set ('a','b','c')  null,
   214      c_bit  bit(64)            null,
   215      c_json json               null,
   216      constraint pk
   217          primary key (id)
   218  );
   219  
   220  insert into tp_text2() values();
   221  
   222  insert into tp_time()
   223  values ();
   224  
   225  insert into tp_time(c_date, c_datetime, c_timestamp, c_time, c_year)
   226  values ('2020-02-20', '2020-02-20 02:20:20', '2020-02-20 02:20:20', '02:20:20', '2020');
   227  
   228  insert into tp_other()
   229  values ();
   230  
   231  insert into tp_other(c_enum, c_set, c_bit, c_json)
   232  values ('a', 'a,b', b'1000001', '{
   233    "key1": "value1",
   234    "key2": "value2"
   235  }');