github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_string_format.result (about)

     1  SELECT FORMAT(12332.123456, 4);
     2  format(12332.123456, 4)
     3  12,332.1235
     4  SELECT FORMAT(12332.1,4);
     5  format(12332.1, 4)
     6  12,332.1000
     7  SELECT FORMAT(12332.2,0);
     8  format(12332.2, 0)
     9  12,332
    10  SELECT FORMAT(19999999.999999999,4);
    11  format(19999999.999999999, 4)
    12  20,000,000.0000
    13  SELECT FORMAT(4545456,9);
    14  format(4545456, 9)
    15  4,545,456.000000000
    16  SELECT format(73829324324,0);
    17  format(73829324324, 0)
    18  73,829,324,324
    19  SELECT FORMAT("-.12334.2",2);
    20  format(-.12334.2, 2)
    21  -0.12
    22  SELECT FORMAT("12332.123456", 4);
    23  format(12332.123456, 4)
    24  12,332.1235
    25  SELECT FORMAT("12332.1",4);
    26  format(12332.1, 4)
    27  12,332.1000
    28  SELECT FORMAT("12332.2",0);
    29  format(12332.2, 0)
    30  12,332
    31  SELECT FORMAT("19999999.999999999",4);
    32  format(19999999.999999999, 4)
    33  20,000,000.0000
    34  SELECT FORMAT(12332.123456, "4");
    35  format(12332.123456, 4)
    36  12,332.1235
    37  SELECT FORMAT(12332.1,"4");
    38  format(12332.1, 4)
    39  12,332.1000
    40  SELECT FORMAT(12332.2,"0");
    41  format(12332.2, 0)
    42  12,332
    43  SELECT FORMAT(19999999.999999999,"4");
    44  format(19999999.999999999, 4)
    45  20,000,000.0000
    46  SELECT FORMAT("-.12334.2","2");
    47  format(-.12334.2, 2)
    48  -0.12
    49  SELECT FORMAT("12332.123456", "4");
    50  format(12332.123456, 4)
    51  12,332.1235
    52  SELECT FORMAT("12332.1","4");
    53  format(12332.1, 4)
    54  12,332.1000
    55  SELECT FORMAT("12332.2","0");
    56  format(12332.2, 0)
    57  12,332
    58  SELECT FORMAT("19999999.999999999","4");
    59  format(19999999.999999999, 4)
    60  20,000,000.0000
    61  SELECT FORMAT("-.12334.2","2", "en_US");
    62  format(-.12334.2, 2, en_US)
    63  -0.12
    64  SELECT FORMAT("12332.123456", "4", "en_US");
    65  format(12332.123456, 4, en_US)
    66  12,332.1235
    67  SELECT FORMAT("12332.1","4",  "en_US");
    68  format(12332.1, 4, en_US)
    69  12,332.1000
    70  SELECT FORMAT("12332.2","0",  "en_US");
    71  format(12332.2, 0, en_US)
    72  12,332
    73  SELECT FORMAT("19999999.999999999","4", "en_US");
    74  format(19999999.999999999, 4, en_US)
    75  20,000,000.0000
    76  SELECT FORMAT("-.12334.2","2", "ar_SA");
    77  format(-.12334.2, 2, ar_SA)
    78  -0.12
    79  SELECT FORMAT("12332.123456", "4",  "ar_SA");
    80  format(12332.123456, 4, ar_SA)
    81  12332.1235
    82  SELECT FORMAT("12332.1","4",  "ar_SA");
    83  format(12332.1, 4, ar_SA)
    84  12332.1000
    85  SELECT FORMAT("12332.2","0",  "ar_SA");
    86  format(12332.2, 0, ar_SA)
    87  12332
    88  SELECT FORMAT("19999999.999999999","4",  "ar_SA");
    89  format(19999999.999999999, 4, ar_SA)
    90  20000000.0000
    91  SELECT FORMAT("-.12334.2","2", "be_BY");
    92  format(-.12334.2, 2, be_BY)
    93  -0,12
    94  SELECT FORMAT("12332.123456", "4",  "be_BY");
    95  format(12332.123456, 4, be_BY)
    96  12.332,1235
    97  SELECT FORMAT("12332.1","4",  "be_BY");
    98  format(12332.1, 4, be_BY)
    99  12.332,1000
   100  SELECT FORMAT("12332.2","0",  "be_BY");
   101  format(12332.2, 0, be_BY)
   102  12.332
   103  SELECT FORMAT("19999999.999999999","4",  "be_BY");
   104  format(19999999.999999999, 4, be_BY)
   105  20.000.000,0000
   106  SELECT FORMAT("-.12334.2","2", "bg_BG");
   107  format(-.12334.2, 2, bg_BG)
   108  -0,12
   109  SELECT FORMAT("12332.123456", "4",  "bg_BG");
   110  format(12332.123456, 4, bg_BG)
   111  12 332,1235
   112  SELECT FORMAT("12332.1","4",  "bg_BG");
   113  format(12332.1, 4, bg_BG)
   114  12 332,1000
   115  SELECT FORMAT("12332.2","0",  "bg_BG");
   116  format(12332.2, 0, bg_BG)
   117  12 332
   118  SELECT FORMAT("19999999.999999999","4",  "bg_BG");
   119  format(19999999.999999999, 4, bg_BG)
   120  20 000 000,0000
   121  SELECT FORMAT("-.12334.2","2", "de_CH");
   122  format(-.12334.2, 2, de_CH)
   123  -0.12
   124  SELECT FORMAT("12332.123456", "4",  "de_CH");
   125  format(12332.123456, 4, de_CH)
   126  12'332.1235
   127  SELECT FORMAT("12332.1","4",  "de_CH");
   128  format(12332.1, 4, de_CH)
   129  12'332.1000
   130  SELECT FORMAT("12332.2","0",  "de_CH");
   131  format(12332.2, 0, de_CH)
   132  12'332
   133  SELECT FORMAT("19999999.999999999","4",  "de_CH");
   134  format(19999999.999999999, 4, de_CH)
   135  20'000'000.0000
   136  create table test(a varchar(100), b varchar(100));
   137  insert into test values("-.12334.2","2");
   138  insert into test values("12332.123456", "4");
   139  insert into test values("12332.1","4");
   140  insert into test values("12332.2","0");
   141  insert into test values("19999999.999999999");
   142  Column count doesn't match value count at row 1
   143  SELECT FORMAT(a, b) from test;
   144  format(a, b)
   145  -0.12
   146  12,332.1235
   147  12,332.1000
   148  12,332
   149  SELECT FORMAT(a, b, null) from test;
   150  format(a, b, null)
   151  -0.12
   152  12,332.1235
   153  12,332.1000
   154  12,332
   155  SELECT FORMAT(a, b, "en_US") from test;
   156  format(a, b, en_US)
   157  -0.12
   158  12,332.1235
   159  12,332.1000
   160  12,332
   161  SELECT FORMAT(a, b, "ar_SA") from test;
   162  format(a, b, ar_SA)
   163  -0.12
   164  12332.1235
   165  12332.1000
   166  12332
   167  SELECT FORMAT(a, b, "be_BY") from test;
   168  format(a, b, be_BY)
   169  -0,12
   170  12.332,1235
   171  12.332,1000
   172  12.332
   173  SELECT FORMAT(a, b, "bg_BG") from test;
   174  format(a, b, bg_BG)
   175  -0,12
   176  12 332,1235
   177  12 332,1000
   178  12 332
   179  SELECT FORMAT(a, b, "de_CH") from test;
   180  format(a, b, de_CH)
   181  -0.12
   182  12'332.1235
   183  12'332.1000
   184  12'332
   185  drop table test;
   186  create table test(a varchar(100), b varchar(100), c varchar(20));
   187  insert into test values("-.12334.2","2", "en_US");
   188  insert into test values("12332.123456", "4", "en_US");
   189  insert into test values("12332.1","4", "en_US");
   190  insert into test values("12332.2","0", "en_US");
   191  insert into test values("19999999.999999999","en_US");
   192  Column count doesn't match value count at row 1
   193  create table test(a varchar(100), b varchar(100), c varchar(20));
   194  table test already exists
   195  insert into test values("-.12334.2","2", "de_CH");
   196  insert into test values("12332.123456", "4", "de_CH");
   197  insert into test values("12332.1","4", "de_CH");
   198  insert into test values("12332.2","0", "de_CH");
   199  insert into test values("19999999.999999999","de_CH");
   200  Column count doesn't match value count at row 1
   201  drop table test;
   202  DROP TABLE IF EXISTS format_01;
   203  CREATE TABLE format_01(id INT, d1 tinyint, d2 smallint unsigned, d3 int, d4 bigint unsigned, PRIMARY KEY (id));
   204  INSERT INTO format_01 VALUES(1, -3, 46382, 46787698, 454987456415);
   205  INSERT INTO format_01 VALUES(2, 126, NULL, 743482 , 938256415);
   206  INSERT INTO format_01 VALUES(3, 21, 37821, 3782, 0);
   207  INSERT INTO format_01 VALUES(4, 0, 0, 0, 0);
   208  INSERT INTO format_01 VALUES(5, 127, 3892, 743482 , 938256415);
   209  INSERT INTO format_01 VALUES(6, 22, 3, 4, 184467440737095516152);
   210  Data truncation: data out of range: data type uint64, value '184467440737095516152'
   211  SELECT format(d1, id) from format_01;
   212  format(d1, id)
   213  -3.0
   214  126.00
   215  21.000
   216  0.0000
   217  127.00000
   218  SELECT format(d1, id, NULL) from format_01;
   219  format(d1, id, null)
   220  -3.0
   221  126.00
   222  21.000
   223  0.0000
   224  127.00000
   225  SELECT format(d1, id, "en_US") from format_01;
   226  format(d1, id, en_US)
   227  -3.0
   228  126.00
   229  21.000
   230  0.0000
   231  127.00000
   232  SELECT format(d1, id, "ar_SA") from format_01;
   233  format(d1, id, ar_SA)
   234  -3.0
   235  126.00
   236  21.000
   237  0.0000
   238  127.00000
   239  SELECT format(d1, id, "be_BY") from format_01;
   240  format(d1, id, be_BY)
   241  -3,0
   242  126,00
   243  21,000
   244  0,0000
   245  127,00000
   246  SELECT format(d1, id, "bg_BG") from format_01;
   247  format(d1, id, bg_BG)
   248  -3,0
   249  126,00
   250  21,000
   251  0,0000
   252  127,00000
   253  SELECT * FROM format_01 WHERE format(d1,0) = 126;
   254  id    d1    d2    d3    d4
   255  2    126    null    743482    938256415
   256  SELECT id FROM (SELECT * FROM format_01 WHERE format(d1,0) = 126) as a;
   257  id
   258  2
   259  SELECT format(d1, id) FROM format_01 WHERE d3 % 2 = 0;
   260  format(d1, id)
   261  -3.0
   262  126.00
   263  21.000
   264  0.0000
   265  127.00000
   266  SELECT format(d3, 4) FROM format_01 WHERE ABS(d3) > 1000;
   267  format(d3, 4)
   268  46,787,698.0000
   269  743,482.0000
   270  3,782.0000
   271  743,482.0000
   272  SELECT COUNT(format(d1, 2)) FROM format_01 GROUP BY d1;
   273  count(format(d1, 2))
   274  1
   275  1
   276  1
   277  1
   278  1
   279  SELECT * FROM format_01 ORDER BY format(id, 0) DESC;
   280  id    d1    d2    d3    d4
   281  5    127    3892    743482    938256415
   282  4    0    0    0    0
   283  3    21    37821    3782    0
   284  2    126    null    743482    938256415
   285  1    -3    46382    46787698    454987456415
   286  SELECT SIN(format(d1,2)), TAN(format(id, 0)), COS(format(id,0)) from format_01;
   287  sin(format(d1, 2))    tan(format(id, 0))    cos(format(id, 0))
   288  -0.1411200080598672    1.557407724654902    0.5403023058681398
   289  0.3299908256737821    -2.185039863261519    -0.4161468365471424
   290  0.836655638536056    -0.1425465430742778    -0.9899924966004454
   291  0.0    1.1578212823495775    -0.6536436208636119
   292  0.9726300672424079    -3.3805150062465854    0.2836621854632263
   293  SELECT cot(format(45, 0)), ATAN(format(75, 0)), SINH(format(90, 1));
   294  cot(format(45, 0))    atan(format(75, 0))    sinh(format(90, 1))
   295  0.6173696237835573    1.557463783500751    6.102016471589204E38
   296  SELECT EXP(format(4, 2));
   297  exp(format(4, 2))
   298  54.598150033144236
   299  SELECT MAX(format(d1, id)), MIN(format(d3, 0)) from format_01;
   300  max(format(d1, id))    min(format(d3, 0))
   301  21.000    0
   302  SELECT power(format(2,1), 2);
   303  power(format(2, 1), 2)
   304  4.0
   305  SELECT COUNT(format(d3,2)) FROM format_01;
   306  count(format(d3, 2))
   307  5
   308  SELECT ABS(format(d3,0)) FROM format_01;
   309  invalid argument cast to int, bad value 46,787,698
   310  SELECT SUM(format(id,2)) FROM format_01;
   311  invalid argument aggregate function sum, bad value [VARCHAR]
   312  SELECT CEIL(format(d3, 4))FROM format_01;
   313  strconv.ParseFloat: parsing "46,787,698.0000": invalid syntax
   314  SELECT ROUND(format(d4, 0)) FROM format_01;
   315  invalid argument cast to int, bad value 454,987,456,415
   316  DROP TABLE format_01;
   317  DROP TABLE IF EXISTS format_02;
   318  CREATE TABLE format_02(id INT, d1 FLOAT, d2 DOUBLE NOT NULL);
   319  INSERT INTO format_02 VALUES(1, 1.2, 47832.434);
   320  INSERT INTO format_02 VALUES(2, -3283.33, 73.32);
   321  INSERT INTO format_02 VALUES(3, NULL, 32789.33);
   322  INSERT INTO format_02 VALUES(4, 0, -38902093.4324);
   323  INSERT INTO format_02 VALUES(5, 323232.0, 0);
   324  INSERT INTO format_02 VALUES(6, 323, 37827329.43432);
   325  INSERT INTO format_02 VALUES(6, -1.8976931348623157E+308, 0);
   326  SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 56 near "1.8976931348623157E+308, 0);";
   327  INSERT INTO format_02 VALUES(7, 328739232, NULL);
   328  constraint violation: Column 'd2' cannot be null
   329  INSERT INTO format_02 VALUES(8, 7382,3923404.2132421);
   330  SELECT d1, d2 FROM format_02 WHERE format(d2,0) IS NOT NULL;
   331  d1    d2
   332  1.2    47832.434
   333  -3283.33    73.32
   334  null    32789.33
   335  0.0    -3.89020934324E7
   336  323232.0    0.0
   337  323.0    3.782732943432E7
   338  7382.0    3923404.2132421
   339  SELECT * from format_02 WHERE format(d2, 3) NOT LIKE '47832.43%';
   340  id    d1    d2
   341  1    1.2    47832.434
   342  2    -3283.33    73.32
   343  3    null    32789.33
   344  4    0.0    -3.89020934324E7
   345  5    323232.0    0.0
   346  6    323.0    3.782732943432E7
   347  8    7382.0    3923404.2132421
   348  SELECT format(d2, id) FROM format_02;
   349  format(d2, id)
   350  47,832.4
   351  73.32
   352  32,789.330
   353  -38,902,093.4324
   354  0.00000
   355  37,827,329.434320
   356  3,923,404.21324210
   357  SELECT format(d2, id, NULL) from format_02;
   358  format(d2, id, null)
   359  47,832.4
   360  73.32
   361  32,789.330
   362  -38,902,093.4324
   363  0.00000
   364  37,827,329.434320
   365  3,923,404.21324210
   366  SELECT format(d2, id, "en_US") from format_02;
   367  format(d2, id, en_US)
   368  47,832.4
   369  73.32
   370  32,789.330
   371  -38,902,093.4324
   372  0.00000
   373  37,827,329.434320
   374  3,923,404.21324210
   375  SELECT format(d2,0)FROM format_02;
   376  format(d2, 0)
   377  47,832
   378  73
   379  32,789
   380  -38,902,093
   381  0
   382  37,827,329
   383  3,923,404
   384  SELECT format(d1, id) FROM format_02 WHERE d2 % 2 = 0;
   385  format(d1, id)
   386  323,232.00000
   387  SELECT format(d2, 4) FROM format_02 WHERE ABS(d2) > 1000;
   388  format(d2, 4)
   389  47,832.4340
   390  32,789.3300
   391  -38,902,093.4324
   392  37,827,329.4343
   393  3,923,404.2132
   394  SELECT any_value(format(id,2)) FROM format_02;
   395  any_value(format(id, 2))
   396  1.00
   397  SELECT d1, d2 FROM format_02 WHERE cast(format(id,0) as bigint) BETWEEN 0 AND 400;
   398  d1    d2
   399  1.2    47832.434
   400  -3283.33    73.32
   401  null    32789.33
   402  0.0    -3.89020934324E7
   403  323232.0    0.0
   404  323.0    3.782732943432E7
   405  7382.0    3923404.2132421
   406  SELECT * from format_02 WHERE format(id, 1) like '1.2';
   407  id    d1    d2
   408  SELECT format(FLOOR(d2),4) FROM format_02;
   409  format(floor(d2), 4)
   410  47,832.0000
   411  73.0000
   412  32,789.0000
   413  -38,902,094.0000
   414  0.0000
   415  37,827,329.0000
   416  3,923,404.0000
   417  SELECT format(CEIL(d2),6) FROM format_02;
   418  format(ceil(d2), 6)
   419  47,833.000000
   420  74.000000
   421  32,790.000000
   422  -38,902,093.000000
   423  0.000000
   424  37,827,330.000000
   425  3,923,405.000000
   426  SELECT * FROM format_02 WHERE format(d2,0) IN ('73', '32789');
   427  id    d1    d2
   428  2    -3283.33    73.32
   429  SELECT * FROM format_02 WHERE format(d2,0) NOT IN ('73', '32789');
   430  id    d1    d2
   431  1    1.2    47832.434
   432  3    null    32789.33
   433  4    0.0    -3.89020934324E7
   434  5    323232.0    0.0
   435  6    323.0    3.782732943432E7
   436  8    7382.0    3923404.2132421
   437  SELECT * from format_02 WHERE format(d2, 2) >= 0;
   438  invalid argument cast to int, bad value 47,832.43
   439  SELECT * FROM format_02 WHERE format(d2, 0) NOT BETWEEN 0 AND 100;
   440  invalid argument cast to int, bad value 47,832
   441  SELECT * FROM format_02 WHERE format(d2, 2) MOD 2 = 0;
   442  invalid argument cast to int, bad value 47,832.43
   443  SELECT concat_ws(format(d2,3),'abc') from format_02;
   444  concat_ws(format(d2, 3), abc)
   445  abc
   446  abc
   447  abc
   448  abc
   449  abc
   450  abc
   451  abc
   452  SELECT LENGTH(format(d2,3)) from format_02;
   453  length(format(d2, 3))
   454  10
   455  6
   456  10
   457  15
   458  5
   459  14
   460  13
   461  SELECT LPAD(format(d2,3),20,'**') from format_02;
   462  lpad(format(d2, 3), 20, **)
   463  **********47,832.434
   464  **************73.320
   465  **********32,789.330
   466  *****-38,902,093.432
   467  ***************0.000
   468  ******37,827,329.434
   469  *******3,923,404.213
   470  SELECT RPAD(format(d1,2),20,'-') from format_02;
   471  rpad(format(d1, 2), 20, -)
   472  1.20----------------
   473  -3,283.33-----------
   474  null
   475  0.00----------------
   476  323,232.00----------
   477  323.00--------------
   478  7,382.00------------
   479  SELECT format(d2,3) from format_02;
   480  format(d2, 3)
   481  47,832.434
   482  73.320
   483  32,789.330
   484  -38,902,093.432
   485  0.000
   486  37,827,329.434
   487  3,923,404.213
   488  SELECT startswith(format(d2,1),'47823') from format_02 WHERE id = 1;
   489  startswith(format(d2, 1), 47823)
   490  false
   491  SELECT endswith(format(d2,1),'32.4') from format_02 WHERE id = 1;
   492  endswith(format(d2, 1), 32.4)
   493  true
   494  SELECT substring(format(d1,3),3,5) from format_02;
   495  substring(format(d1, 3), 3, 5)
   496  200
   497  ,283.
   498  null
   499  000
   500  3,232
   501  3.000
   502  382.0
   503  SELECT REVERSE(format(d1,5)) from format_02;
   504  reverse(format(d1, 5))
   505  00002.1
   506  00033.382,3-
   507  null
   508  00000.0
   509  00000.232,323
   510  00000.323
   511  00000.283,7
   512  DROP TABLE format_02;
   513  DROP TABLE IF EXISTS format_04;
   514  CREATE TABLE format_04(a varchar(100), b varchar(100), c varchar(20));
   515  INSERT INTO format_04 VALUES("-0.12334","2", "en_US");
   516  INSERT INTO format_04 VALUES("12332.123456", "4", "en_US");
   517  INSERT INTO format_04 VALUES("12332.1","4", "en_US");
   518  INSERT INTO format_04 VALUES("12332.2","0", "en_US");
   519  SELECT format(a, 4) from format_04;
   520  format(a, 4)
   521  -0.1233
   522  12,332.1235
   523  12,332.1000
   524  12,332.2000
   525  SELECT format(a, 2),format(b, 3) FROM format_04 WHERE b > 0;
   526  format(a, 2)    format(b, 3)
   527  -0.12    2.000
   528  12,332.12    4.000
   529  12,332.10    4.000
   530  SELECT a,b,c FROM format_04 WHERE format(b,0) = 4;
   531  a    b    c
   532  12332.123456    4    en_US
   533  12332.1    4    en_US
   534  DROP table format_04;
   535  DROP TABLE if exists format_05;
   536  DROP TABLE if exists format_06;
   537  CREATE TABLE format_05(
   538  c1 int,
   539  c2 bigint,
   540  primary key (c1)
   541  );
   542  create TABLE format_06(
   543  i int,
   544  b bigint,
   545  primary key (i)
   546  );
   547  INSERT INTO format_05 values ('111', '222'), ('000', '111'), ('-111', null);
   548  INSERT INTO format_06 values (111, 999999), (0,0000000), (-1, null), (11111, 1);
   549  SELECT c1, format(c1,1), i, format(i,1) from format_05 inner join format_06 on format_05.c1 = format_06.i order by c1 desc;
   550  c1    format(c1, 1)    i    format(i, 1)
   551  111    111.0    111    111.0
   552  0    0.0    0    0.0
   553  SELECT format(c2, 5) FROM format_05 join format_06 ON format_05.c1 = format_06.i;
   554  format(c2, 5)
   555  222.00000
   556  111.00000
   557  SELECT format_05.c1 from format_05 join format_06 ON format(format_05.c1,1) = format(format_06.i,1);
   558  c1
   559  111
   560  0
   561  SELECT format_06.i,format_06.b from format_05 left join format_06 ON format(format_05.c1,1) = format(format_06.i,1);
   562  i    b
   563  111    999999
   564  0    0
   565  null    null
   566  DROP TABLE format_05;
   567  DROP TABLE format_06;
   568  drop table if exists t;
   569  create table t(
   570  d date,
   571  dt datetime,
   572  primary key (d)
   573  );
   574  insert into t values ('2022-12-04', '2022-12-04 00:03:36');
   575  insert into t values ('2023-11-11', '2023-11-11 03:00:48');
   576  select d, format(d, 1) from t order by d desc;
   577  invalid argument function format, bad value [DATE BIGINT]
   578  select d, format(d, 0) from t order by d desc;
   579  invalid argument function format, bad value [DATE BIGINT]
   580  select d, format(d, -1) from t order by d desc;
   581  invalid argument function format, bad value [DATE BIGINT]
   582  select d, format(d, length("123456789")) from t order by d desc;
   583  invalid argument function format, bad value [DATE BIGINT]
   584  select dt, format(dt, 1) from t order by dt desc;
   585  invalid argument function format, bad value [DATETIME BIGINT]
   586  select dt, format(dt, 0) from t order by dt desc;
   587  invalid argument function format, bad value [DATETIME BIGINT]
   588  select dt, format(dt, -1) from t order by dt desc;
   589  invalid argument function format, bad value [DATETIME BIGINT]
   590  select dt, format(dt, length("123456789")) from t order by dt desc;
   591  invalid argument function format, bad value [DATETIME BIGINT]
   592  drop table t;
   593  drop table if exists t;
   594  create table t(
   595  i int,
   596  b bigint,
   597  primary key (i)
   598  );
   599  insert into t values (-1, null), (0000000000000000, 1);
   600  select b, format(b, 1) from t order by b desc;
   601  b    format(b, 1)
   602  1    1.0
   603  null    null
   604  select b, format(b, 0) from t order by b desc;
   605  b    format(b, 0)
   606  1    1
   607  null    null
   608  select b, format(b, -1) from t order by b desc;
   609  b    format(b, -1)
   610  1    1
   611  null    null
   612  select b, format(b, '1') from t order by b desc;
   613  b    format(b, 1)
   614  1    1.0
   615  null    null
   616  select b, format(b, '-1') from t order by b desc;
   617  b    format(b, -1)
   618  1    1
   619  null    null
   620  select b, format(b, '0') from t order by b desc;
   621  b    format(b, 0)
   622  1    1
   623  null    null
   624  select b, format(b, 'x') from t order by b desc;
   625  b    format(b, x)
   626  1    1
   627  null    null
   628  drop table t;
   629  drop table if exists t1;
   630  drop table if exists t2;
   631  create table t1(
   632  c1 int,
   633  c2 bigint,
   634  primary key (c1)
   635  );
   636  create table t2(
   637  i int,
   638  b bigint,
   639  primary key (i)
   640  );
   641  insert into t1 values ('111', '222'), ('000', '111'), ('-111', null);
   642  insert into t2 values (111, 999999), (0,0000000), (-1, null), (11111, 1);
   643  select c1, format(c1,1), i, format(i,1) from t1 left join t2 on t1.c1 = t2.i order by c1 desc;
   644  c1    format(c1, 1)    i    format(i, 1)
   645  111    111.0    111    111.0
   646  0    0.0    0    0.0
   647  -111    -111.0    null    null
   648  select c1, format(c1,1), i, format(i,1) from t1 right join t2 on t1.c1 = t2.i order by c1 desc;
   649  c1    format(c1, 1)    i    format(i, 1)
   650  111    111.0    111    111.0
   651  0    0.0    0    0.0
   652  null    null    -1    -1.0
   653  null    null    11111    11,111.0
   654  drop table t1;
   655  drop table t2;
   656  SELECT FORMAT("12332.2", "2","ca_ES");
   657  format(12332.2, 2, ca_ES)
   658  12332,20
   659  SELECT FORMAT("12332.2", "2","de_AT");
   660  format(12332.2, 2, de_AT)
   661  12332,20
   662  SELECT FORMAT("12332.2", "2","el_GR");
   663  format(12332.2, 2, el_GR)
   664  12332,20
   665  SELECT FORMAT("12332.2", "2","eu_ES");
   666  format(12332.2, 2, eu_ES)
   667  12332,20
   668  SELECT FORMAT("12332.2", "2","fr_BE");
   669  format(12332.2, 2, fr_BE)
   670  12332,20
   671  SELECT FORMAT("12332.2", "2","fr_CA");
   672  format(12332.2, 2, fr_CA)
   673  12332,20
   674  SELECT FORMAT("12332.2", "2","fr_CH");
   675  format(12332.2, 2, fr_CH)
   676  12332,20
   677  SELECT FORMAT("12332.2", "2","fr_FR");
   678  format(12332.2, 2, fr_FR)
   679  12332,20
   680  SELECT FORMAT("12332.2", "2","fr_LU");
   681  format(12332.2, 2, fr_LU)
   682  12332,20
   683  SELECT FORMAT("12332.2", "2","gl_ES");
   684  format(12332.2, 2, gl_ES)
   685  12332,20
   686  SELECT FORMAT("12332.2", "2","hr_HR");
   687  format(12332.2, 2, hr_HR)
   688  12332,20
   689  SELECT FORMAT("12332.2", "2","it_IT");
   690  format(12332.2, 2, it_IT)
   691  12332,20
   692  SELECT FORMAT("12332.2", "2","nl_BE");
   693  format(12332.2, 2, nl_BE)
   694  12332,20
   695  SELECT FORMAT("12332.2", "2","nl_NL");
   696  format(12332.2, 2, nl_NL)
   697  12332,20
   698  SELECT FORMAT("12332.2", "2","pl_PL");
   699  format(12332.2, 2, pl_PL)
   700  12332,20
   701  SELECT FORMAT("12332.2", "2","pt_BR");
   702  format(12332.2, 2, pt_BR)
   703  12332,20
   704  SELECT FORMAT("12332.2", "2","pt_PT");
   705  format(12332.2, 2, pt_PT)
   706  12332,20
   707  SELECT FORMAT("12332.2", "2","sl_SI");
   708  format(12332.2, 2, sl_SI)
   709  12332,20
   710  SELECT FORMAT("12332.2", "2","it_CH");
   711  format(12332.2, 2, it_CH)
   712  12'332,20
   713  SELECT FORMAT("12332.2", "2","rm_CH");
   714  format(12332.2, 2, rm_CH)
   715  12'332,20
   716  SELECT FORMAT("12332.2", "2","ro_RO");
   717  format(12332.2, 2, ro_RO)
   718  12.332,20