2
# Test of problem with CONCAT_WS() and long separators.
6
DROP TABLE IF EXISTS t1;
9
CREATE TABLE t1 ( number INT NOT NULL, alpha CHAR(6) NOT NULL );
10
INSERT INTO t1 VALUES (1413006,'idlfmv'),
11
(1413065,'smpsfz'),(1413127,'sljrhx'),(1413304,'qerfnd');
13
SELECT number, alpha, CONCAT_WS('<---->',number,alpha) AS new
14
FROM t1 GROUP BY number;
16
SELECT CONCAT_WS('<---->',number,alpha) AS new
17
FROM t1 GROUP BY new LIMIT 1;
19
SELECT number, alpha, CONCAT_WS('<->',number,alpha) AS new
20
FROM t1 GROUP BY new LIMIT 1;
22
SELECT number, alpha, CONCAT_WS('-',number,alpha,alpha,alpha,alpha,alpha,alpha,alpha) AS new
23
FROM t1 GROUP BY new LIMIT 1;
25
SELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS new
26
FROM t1 GROUP BY new LIMIT 1;
30
# Bug #5540: a problem with double type
33
create table t1 (a char(4), b double, c date, d tinyint(4));
34
insert into t1 values ('AAAA', 105, '2003-03-01', 1);
35
select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
39
select 'a' union select concat('a', -4);
40
select 'a' union select concat('a', -4.5);
42
select 'a' union select concat('a', -(4 + 1));
43
select 'a' union select concat('a', 4 - 5);
45
select 'a' union select concat('a', -'3');
46
select 'a' union select concat('a', -concat('3',4));
48
select 'a' union select concat('a', -0);
49
--replace_result a-0.0 a0.0
50
select 'a' union select concat('a', -0.0);
52
--replace_result a-0.0000 a0.0000
53
select 'a' union select concat('a', -0.0000);
56
# Bug#16716: subselect in concat() may lead to a wrong result
58
select concat((select x from (select 'a' as x) as t1 ),
59
(select y from (select 'b' as y) as t2 )) from (select 1 union select 2 )
65
# Bug#15962: CONCAT() in UNION may lead to a data trucation.
67
create table t1(f1 varchar(6)) charset=utf8;
68
insert into t1 values ("123456");
69
select concat(f1, 2) a from t1 union select 'x' a from t1;