github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/dml/insert/insert_with_function.result (about)

     1  CREATE TABLE char_test(
     2  str1 CHAR(50),
     3  str2 VARCHAR(50)
     4  );
     5  INSERT INTO char_test(str1, str2) VALUES('ABCED', 'MESSI');
     6  INSERT INTO char_test(str1) VALUES(CONCAT_WS(' ', ' I have ', '  a dream'));
     7  INSERT INTO char_test(str1) VALUES(CONCAT_WS(',', ',I have ', ',a dream'));
     8  INSERT INTO char_test(str1) VALUES(CONCAT_WS('x', ' I have x', 'x a dream'));
     9  INSERT INTO char_test(str1) SELECT CONCAT_WS('.', 'MESSI is a ', '. aloha bumda.');
    10  DELETE FROM char_test;
    11  INSERT INTO char_test(str2) VALUES(FIND_IN_SET('a', 'b,d,c,a'));
    12  INSERT INTO char_test(str2) VALUES(FIND_IN_SET('a', 'if i were a boy'));
    13  INSERT INTO char_test(str2) VALUES(FIND_IN_SET('A', CONCAT_WS(',', 'The english Union',', have a king.')));
    14  SELECT * FROM char_test;
    15  str1    str2
    16  null    4
    17  null    0
    18  null    0
    19  DELETE FROM char_test;
    20  INSERT INTO char_test(str2) VALUES(OCT(FIND_IN_SET('a', 'b,c,d,e,f,g,h,a')));
    21  INSERT INTO char_test(str2) VALUES(OCT(NULL));
    22  INSERT INTO char_test(str2) VALUES(OCT(LENGTH('JFKLD;AJKFLD;AJFKDL;ASJFKDLSA;FJDKSAL;FJDKSAL;FJDKA;')));
    23  SELECT * FROM char_test;
    24  str1    str2
    25  null    10
    26  null    null
    27  null    64
    28  DELETE FROM char_test;
    29  INSERT INTO char_test(str1) VALUES(SPACE(100));
    30  internal error: Can't cast '                                                                                                    ' from VARCHAR type to CHAR type. Src length 100 is larger than Dest length 50
    31  INSERT INTO char_test(str1) VALUES('RONALDOSHOOTGOAL');
    32  INSERT INTO char_test(str2) VALUES(EMPTY(""));
    33  INSERT INTO char_test(str2) VALUES(EMPTY(null));
    34  INSERT INTO char_test(str2) VALUES(EMPTY(CONCAT_WS(' ', 'ABCDE','JKFL;JDK','FDAFD')));
    35  INSERT INTO char_test(str2) VALUES(EMPTY(SPACE(100)));
    36  INSERT INTO char_test(str2) VALUES(EMPTY(OCT(4564123156)));
    37  select * from char_test;
    38  str1    str2
    39  RONALDOSHOOTGOAL    null
    40  null    1
    41  null    null
    42  null    0
    43  null    0
    44  null    0
    45  DROP TABLE IF EXISTS date_test;
    46  CREATE TABLE date_test(
    47  d2 DATE,
    48  d3 DATETIME,
    49  d4 TIMESTAMP,
    50  d5 BIGINT
    51  );
    52  INSERT INTO date_test(d2,d3) VALUES('2022-08-07', '2018-09-13 13:45:13');
    53  INSERT INTO date_test(d2,d3) VALUES('2015-11-07', '2013-09-14 13:45:13');
    54  INSERT INTO date_test(d2,d3) VALUES('2013-08-07', '2006-05-23 13:23:13');
    55  INSERT INTO date_test(d2,d3) VALUES('2011-08-07', '2018-07-08 23:59:59');
    56  INSERT INTO date_test(d5) SELECT UNIX_TIMESTAMP("2021-02-29");
    57  INSERT INTO date_test(d3) VALUES(DATE_ADD('2008-13-26 23:59:59', NULL));
    58  SELECT * FROM date_test;
    59  d2    d3    d4    d5
    60  2022-08-07    2018-09-13 13:45:13    null    null
    61  2015-11-07    2013-09-14 13:45:13    null    null
    62  2013-08-07    2006-05-23 13:23:13    null    null
    63  2011-08-07    2018-07-08 23:59:59    null    null
    64  null    null    null    null
    65  null    null    null    null
    66  DELETE FROM date_test;
    67  CREATE TABLE math_test(
    68  tiny TINYINT,
    69  small SMALLINT,
    70  int_test INT,
    71  big BIGINT,
    72  tiny_un TINYINT UNSIGNED,
    73  small_un SMALLINT UNSIGNED,
    74  int_un INT UNSIGNED,
    75  big_un BIGINT UNSIGNED,
    76  float_32 FLOAT,
    77  float_64 DOUBLE
    78  );
    79  INSERT INTO math_test(tiny,small,int_test,big) VALUES(32, 2432, 54354, 543324324);
    80  INSERT INTO math_test(tiny_un, small_un, int_un) VALUES(127, 32768, 2147483648);
    81  SELECT * FROM math_test;
    82  tiny    small    int_test    big    tiny_un    small_un    int_un    big_un    float_32    float_64
    83  32    2432    54354    543324324    null    null    null    null    null    null
    84  null    null    null    null    127    32768    2147483648    null    null    null
    85  DROP TABLE IF EXISTS test1;
    86  CREATE TABLE test1(
    87  num1 FLOAT(6,2),
    88  num2 DOUBLE(6,2),
    89  num3 DECIMAL(6,2)
    90  );
    91  INSERT INTO test1(num1, num2, num3) VALUES(12.21, 43.43, 999.899);
    92  INSERT INTO test1 VALUES(3.1415, 3.1415, 3.1415);
    93  SELECT * FROM test1;
    94  num1    num2    num3
    95  12.21    43.43    999.90
    96  3.14    3.14    3.14
    97  DROP TABLE char_test;
    98  DROP TABLE date_test;
    99  DROP TABLE math_test;
   100  DROP TABLE test1;