~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/r/func_date_add.result

Renamed more stuff to drizzle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
drop table if exists t1;
2
 
CREATE TEMPORARY TABLE t1 (
3
 
visitor_id int DEFAULT '0' NOT NULL,
4
 
group_id int DEFAULT '0' NOT NULL,
5
 
hits int DEFAULT '0' NOT NULL,
6
 
sessions int DEFAULT '0' NOT NULL,
 
2
CREATE TABLE t1 (
 
3
visitor_id int(10) unsigned DEFAULT '0' NOT NULL,
 
4
group_id int(10) unsigned DEFAULT '0' NOT NULL,
 
5
hits int(10) unsigned DEFAULT '0' NOT NULL,
 
6
sessions int(10) unsigned DEFAULT '0' NOT NULL,
7
7
ts timestamp,
8
8
PRIMARY KEY (visitor_id,group_id)
9
9
)/*! engine=MyISAM */;
45
45
465931136       2000-03-18 16:09:53
46
46
1092858576      2000-03-19 01:34:45
47
47
drop table t1;
 
48
set sql_mode='traditional';
48
49
create table t1 (d date);
49
50
insert into t1 (d) select date_sub('2000-01-01', INTERVAL 2001 YEAR);
50
51
ERROR 22008: Datetime function: datetime field overflow
52
53
ERROR 22008: Datetime function: datetime field overflow
53
54
insert into t1 values (date_add(NULL, INTERVAL 1 DAY));
54
55
insert into t1 values (date_add('2000-01-04', INTERVAL NULL DAY));
 
56
set sql_mode='';
55
57
insert into t1 (d) select date_sub('2000-01-01', INTERVAL 2001 YEAR);
56
 
ERROR 22008: Datetime function: datetime field overflow
 
58
Warnings:
 
59
Warning 1441    Datetime function: datetime field overflow
57
60
insert into t1 (d) select date_add('2000-01-01',interval 8000 year);
58
 
ERROR 22008: Datetime function: datetime field overflow
 
61
Warnings:
 
62
Warning 1441    Datetime function: datetime field overflow
59
63
insert into t1 values (date_add(NULL, INTERVAL 1 DAY));
60
64
insert into t1 values (date_add('2000-01-04', INTERVAL NULL DAY));
61
65
select * from t1;
64
68
NULL
65
69
NULL
66
70
NULL
 
71
NULL
 
72
NULL
67
73
drop table t1;
68
74
End of 4.1 tests
69
75
SELECT CAST('2006-09-26' AS DATE) + INTERVAL 1 DAY;
81
87
create table t1 (a int, b varchar(10));
82
88
insert into t1 values (1, '2001-01-01'),(2, '2002-02-02');
83
89
select '2007-01-01' + interval a day from t1;
84
 
'2007-01-01' + interval a day 
 
90
'2007-01-01' + interval a day
85
91
2007-01-02
86
92
2007-01-03
87
93
select b + interval a day from t1;
88
 
b + interval a day 
 
94
b + interval a day
89
95
2001-01-02
90
96
2002-02-04
91
97
drop table t1;