func_concat.test
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:1k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. #
  2. # Test of problem with CONCAT_WS() and long separators.
  3. #
  4. --disable_warnings
  5. DROP TABLE IF EXISTS t1;
  6. --enable_warnings
  7. CREATE TABLE t1 ( number INT NOT NULL, alpha CHAR(6) NOT NULL );
  8. INSERT INTO t1 VALUES (1413006,'idlfmv'),
  9. (1413065,'smpsfz'),(1413127,'sljrhx'),(1413304,'qerfnd');
  10. SELECT number, alpha, CONCAT_WS('<---->',number,alpha) AS new
  11. FROM t1 GROUP BY number;
  12. SELECT CONCAT_WS('<---->',number,alpha) AS new
  13. FROM t1 GROUP BY new LIMIT 1;
  14. SELECT number, alpha, CONCAT_WS('<->',number,alpha) AS new
  15. FROM t1 GROUP BY new LIMIT 1;
  16. SELECT number, alpha, CONCAT_WS('-',number,alpha,alpha,alpha,alpha,alpha,alpha,alpha) AS new
  17. FROM t1 GROUP BY new LIMIT 1;
  18. SELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS new
  19. FROM t1 GROUP BY new LIMIT 1;
  20. drop table t1;
  21. #
  22. # Bug #5540: a problem with double type
  23. #
  24. create table t1 (a char(4), b double, c date, d tinyint(4));
  25. insert into t1 values ('AAAA', 105, '2003-03-01', 1);
  26. select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051';
  27. drop table t1;
  28. # BUG#6825 
  29. select 'a' union select concat('a', -4);
  30. select 'a' union select concat('a', -4.5);
  31. select 'a' union select concat('a', -(4 + 1));
  32. select 'a' union select concat('a', 4 - 5);
  33. select 'a' union select concat('a', -'3');
  34. select 'a' union select concat('a', -concat('3',4));
  35. select 'a' union select concat('a', -0);
  36. --replace_result 'a-0.0' good 'a0.0' good
  37. select 'a' union select concat('a', -0.0);
  38. # End of 4.1 tests