mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Remove usage of my_dup(), as this casued error 127 when reading MyISAM tables
New definition of WEEK(). Docs/manual.texi: Changelog myisam/mi_cache.c: Better logging on error myisam/mi_open.c: Remove usage of my_dup(), as this casued error 127 when reading tables mysql-test/r/func_time.result: More tests for the WEEK/YEARWEEK function mysql-test/t/func_time.test: More tests for the WEEK/YEARWEEK function sql/time.cc: New definition of WEEK
This commit is contained in:
@ -27,19 +27,35 @@ DAYOFYEAR("1997-03-03") WEEK("1998-03-03") QUARTER(980303)
|
||||
HOUR("1997-03-03 23:03:22") MINUTE("23:03:22") SECOND(230322)
|
||||
23 3 22
|
||||
week(19980101) week(19970101) week(19980101,1) week(19970101,1)
|
||||
0 1 1 1
|
||||
0 0 1 1
|
||||
week(19981231) week(19971231) week(19981231,1) week(19971231,1)
|
||||
52 53 53 53
|
||||
52 52 53 53
|
||||
week(19950101) week(19950101,1)
|
||||
1 0
|
||||
yearweek('1981-12-31',1) yearweek('1982-01-01',1) yearweek('1982-12-31',1) yearweek('1983-01-01',1)
|
||||
198153 198153 198252 198252
|
||||
yearweek('1987-01-01',1) yearweek('1987-01-01')
|
||||
198701 198652
|
||||
2000 2001 2002 2003 2004 2005 2006
|
||||
0 0 0 0 0 0 1
|
||||
2000 2001 2002 2003 2004 2005 2006
|
||||
1 0 1 1 1 1 1
|
||||
2000 2001 2002 2003 2004 2005 2006
|
||||
0 1 1 1 1 0 0
|
||||
2000 2001 2002 2003 2004 2005 2006
|
||||
1 1 1 2 2 1 1
|
||||
2000 2001 2002 2003 2004 2005 2006
|
||||
199952 200053 200152 200252 200352 200452 200601
|
||||
2000 2001 2002 2003 2004 2005 2006
|
||||
200001 200053 200201 200301 200401 200501 200601
|
||||
2000 2001 2002 2003 2004 2005 2006
|
||||
199952 200101 200201 200301 200401 200453 200552
|
||||
2000 2001 2002 2003 2004 2005 2006
|
||||
200001 200101 200201 200302 200402 200501 200601
|
||||
date_format('1998-12-31','%x-%v') date_format('1999-01-01','%x-%v')
|
||||
1998-53 1998-53
|
||||
date_format('1999-12-31','%x-%v') date_format('2000-01-01','%x-%v')
|
||||
1999-52 1999-52
|
||||
yearweek('1987-01-01',1) yearweek('1987-01-01')
|
||||
198701 198653
|
||||
dayname("1962-03-03") dayname("1962-03-03")+0
|
||||
Saturday 5
|
||||
monthname("1972-03-04") monthname("1972-03-04")+0
|
||||
|
@ -17,13 +17,23 @@ select month("1997-01-02"),year("98-02-03"),dayofyear("1997-12-31");
|
||||
select month("2001-02-00"),year("2001-00-00");
|
||||
select DAYOFYEAR("1997-03-03"), WEEK("1998-03-03"), QUARTER(980303);
|
||||
select HOUR("1997-03-03 23:03:22"), MINUTE("23:03:22"), SECOND(230322);
|
||||
|
||||
# Test of week and yearweek
|
||||
select week(19980101),week(19970101),week(19980101,1),week(19970101,1);
|
||||
select week(19981231),week(19971231),week(19981231,1),week(19971231,1);
|
||||
select week(19950101),week(19950101,1);
|
||||
select yearweek('1981-12-31',1),yearweek('1982-01-01',1),yearweek('1982-12-31',1),yearweek('1983-01-01',1);
|
||||
select yearweek('1987-01-01',1),yearweek('1987-01-01');
|
||||
select week("2000-01-01",0) as '2000', week("2001-01-01",0) as '2001', week("2002-01-01",0) as '2002',week("2003-01-01",0) as '2003', week("2004-01-01",0) as '2004', week("2005-01-01",0) as '2005', week("2006-01-01",0) as '2006';
|
||||
select week("2000-01-06",0) as '2000', week("2001-01-06",0) as '2001', week("2002-01-06",0) as '2002',week("2003-01-06",0) as '2003', week("2004-01-06",0) as '2004', week("2005-01-06",0) as '2005', week("2006-01-06",0) as '2006';
|
||||
select week("2000-01-01",1) as '2000', week("2001-01-01",1) as '2001', week("2002-01-01",1) as '2002',week("2003-01-01",1) as '2003', week("2004-01-01",1) as '2004', week("2005-01-01",1) as '2005', week("2006-01-01",1) as '2006';
|
||||
select week("2000-01-06",1) as '2000', week("2001-01-06",1) as '2001', week("2002-01-06",1) as '2002',week("2003-01-06",1) as '2003', week("2004-01-06",1) as '2004', week("2005-01-06",1) as '2005', week("2006-01-06",1) as '2006';
|
||||
select yearweek("2000-01-01",0) as '2000', yearweek("2001-01-01",0) as '2001', yearweek("2002-01-01",0) as '2002',yearweek("2003-01-01",0) as '2003', yearweek("2004-01-01",0) as '2004', yearweek("2005-01-01",0) as '2005', yearweek("2006-01-01",0) as '2006';
|
||||
select yearweek("2000-01-06",0) as '2000', yearweek("2001-01-06",0) as '2001', yearweek("2002-01-06",0) as '2002',yearweek("2003-01-06",0) as '2003', yearweek("2004-01-06",0) as '2004', yearweek("2005-01-06",0) as '2005', yearweek("2006-01-06",0) as '2006';
|
||||
select yearweek("2000-01-01",1) as '2000', yearweek("2001-01-01",1) as '2001', yearweek("2002-01-01",1) as '2002',yearweek("2003-01-01",1) as '2003', yearweek("2004-01-01",1) as '2004', yearweek("2005-01-01",1) as '2005', yearweek("2006-01-01",1) as '2006';
|
||||
select yearweek("2000-01-06",1) as '2000', yearweek("2001-01-06",1) as '2001', yearweek("2002-01-06",1) as '2002',yearweek("2003-01-06",1) as '2003', yearweek("2004-01-06",1) as '2004', yearweek("2005-01-06",1) as '2005', yearweek("2006-01-06",1) as '2006';
|
||||
select date_format('1998-12-31','%x-%v'),date_format('1999-01-01','%x-%v');
|
||||
select date_format('1999-12-31','%x-%v'),date_format('2000-01-01','%x-%v');
|
||||
select yearweek('1987-01-01',1),yearweek('1987-01-01');
|
||||
|
||||
select dayname("1962-03-03"),dayname("1962-03-03")+0;
|
||||
select monthname("1972-03-04"),monthname("1972-03-04")+0;
|
||||
|
Reference in New Issue
Block a user