mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
84 lines
2.3 KiB
Text
84 lines
2.3 KiB
Text
--disable_warnings
|
|
DROP TABLE IF EXISTS t1;
|
|
--enable_warnings
|
|
|
|
--echo Start of 5.4 tests
|
|
|
|
--echo #
|
|
--echo # WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT
|
|
--echo #
|
|
|
|
SET NAMES utf8;
|
|
|
|
SET @@lc_time_names=109;
|
|
SELECT @@lc_time_names;
|
|
|
|
CREATE TABLE t1 (a DATE);
|
|
INSERT INTO t1 VALUES
|
|
('2006-01-01'),('2006-01-02'),('2006-01-03'),
|
|
('2006-01-04'),('2006-01-05'),('2006-01-06'),('2006-01-07');
|
|
SELECT a, date_format(a,'%a') as abday, dayname(a) as day FROM t1 ORDER BY a;
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (a DATE);
|
|
INSERT INTO t1 VALUES
|
|
('2006-01-01'),('2006-02-01'),('2006-03-01'),
|
|
('2006-04-01'),('2006-05-01'),('2006-06-01'),
|
|
('2006-07-01'),('2006-08-01'),('2006-09-01'),
|
|
('2006-10-01'),('2006-11-01'),('2006-12-01');
|
|
SELECT a, date_format(a,'%b') as abmon, monthname(a) as mon FROM t1 ORDER BY a;
|
|
|
|
SELECT format(123456.789, 3, 'el_GR');
|
|
DROP TABLE t1;
|
|
|
|
--echo #
|
|
--echo # Bug#46633 Obsolete Serbian locale name
|
|
--echo #
|
|
SET lc_messages=sr_YU;
|
|
SHOW VARIABLES LIKE 'lc_messages';
|
|
SET lc_messages=sr_RS;
|
|
SHOW VARIABLES LIKE 'lc_messages';
|
|
SET lc_time_names=sr_RS;
|
|
SELECT format(123456.789, 3, 'sr_RS');
|
|
|
|
--echo #
|
|
--echo # Bug#43207 wrong LC_TIME names for romanian locale
|
|
--echo #
|
|
SET NAMES utf8;
|
|
SET lc_time_names=ro_RO;
|
|
SELECT DATE_FORMAT('2001-01-01', '%w %a %W');
|
|
SELECT DATE_FORMAT('2001-01-02', '%w %a %W');
|
|
SELECT DATE_FORMAT('2001-01-03', '%w %a %W');
|
|
SELECT DATE_FORMAT('2001-01-04', '%w %a %W');
|
|
SELECT DATE_FORMAT('2001-01-05', '%w %a %W');
|
|
SELECT DATE_FORMAT('2001-01-06', '%w %a %W');
|
|
SELECT DATE_FORMAT('2001-01-07', '%w %a %W');
|
|
--echo End of 5.4 tests
|
|
|
|
#
|
|
# MDEV-9928 LC_TIME_NAMES=de_AT; unusual name for february
|
|
#
|
|
SET NAMES utf8;
|
|
SET lc_time_names=de_AT;
|
|
SELECT monthname('2001-01-01');
|
|
SELECT monthname('2001-02-01');
|
|
SELECT monthname('2001-03-01');
|
|
|
|
--echo #
|
|
--echo # MDEV-10052 Illegal mix of collations with DAYNAME(date_field)<>varchar_field
|
|
--echo #
|
|
SET NAMES utf8;
|
|
CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE);
|
|
INSERT INTO t1 VALUES ('test',now());
|
|
SET lc_time_names=ru_RU;
|
|
--error ER_CANT_AGGREGATE_2COLLATIONS
|
|
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
|
--error ER_CANT_AGGREGATE_2COLLATIONS
|
|
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
|
SET lc_time_names=en_US;
|
|
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
|
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
|
SET NAMES latin1;
|
|
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
|
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
|
DROP TABLE t1;
|