2
# Tests for the WEEKDAY() function
4
# The Drizzle WEEKDAY() function differs from the MySQL WEEKDAY()
5
# function in these ways:
7
# * Does not accept invalid parameters. This results in an error
11
# WEEKDAY() on a NULL should produce
16
# Test improper argument list
19
--error 1582 # Wrong parameter count...
21
--error 1582 # Wrong parameter count...
25
# Test invalid dates passed to WEEKDAY
26
# produce an error, not a NULL or anything
30
SELECT WEEKDAY("xxx");
34
SELECT WEEKDAY("0000-00-00"); # No 0000-00-00 dates!...
36
SELECT WEEKDAY("0000-01-01"); # No zero year parts
38
SELECT WEEKDAY("0001-00-01"); # No zero month parts
40
SELECT WEEKDAY("0001-01-00"); # No zero day parts
42
SELECT WEEKDAY("2000-02-30"); # No Feb 30th!
44
SELECT WEEKDAY("1900-02-29"); # Not a leap YEAR since not divisible evenly by 400...
46
SELECT WEEKDAY('1976-15-15'); # No 15th month!
48
# A good date, which should output 0
49
SELECT WEEKDAY("2009-01-12");
51
# A good date, which should output 3
52
# Test of 2 digit year conversion...shouldn't mess with weekday functionality
53
SELECT WEEKDAY("70-12-31");
55
# A good date, which should output 4
56
SELECT WEEKDAY("99-12-31");
58
# A good date, which should output 1
59
SELECT WEEKDAY("69-12-31");
61
# A good date, which should output 0
62
SELECT WEEKDAY("0001-12-31");
64
# A good date, which should output 4
65
SELECT WEEKDAY("9999-12-31");
67
# A good date in the common USA format, should output 4
68
SELECT WEEKDAY('07/31/2009');