~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_date_add.test

  • Committer: Brian Aker
  • Date: 2008-10-13 20:24:22 UTC
  • Revision ID: brian@tangent.org-20081013202422-hjbv31zsnov5arq4
Adding back more test cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
--enable_warnings
8
8
 
9
9
CREATE TABLE t1 (
10
 
  visitor_id int(10) DEFAULT '0' NOT NULL,
11
 
  group_id int(10) DEFAULT '0' NOT NULL,
12
 
  hits int(10) DEFAULT '0' NOT NULL,
13
 
  sessions int(10) DEFAULT '0' NOT NULL,
 
10
  visitor_id int DEFAULT '0' NOT NULL,
 
11
  group_id int DEFAULT '0' NOT NULL,
 
12
  hits int DEFAULT '0' NOT NULL,
 
13
  sessions int DEFAULT '0' NOT NULL,
14
14
  ts timestamp,
15
15
  PRIMARY KEY (visitor_id,group_id)
16
16
)/*! engine=MyISAM */;
45
45
# Bug #10627: Invalid date turned to NULL from date_sub/date_add in
46
46
# traditional mode
47
47
#
48
 
set sql_mode='traditional';
49
48
create table t1 (d date);
50
49
--error S22008
51
50
insert into t1 (d) select date_sub('2000-01-01', INTERVAL 2001 YEAR);
54
53
# No warnings/errors from the next two
55
54
insert into t1 values (date_add(NULL, INTERVAL 1 DAY));
56
55
insert into t1 values (date_add('2000-01-04', INTERVAL NULL DAY));
57
 
set sql_mode='';
58
56
# These will all work now, and we'll end up with some NULL entries in the
59
57
# table and some warnings.
 
58
--error 1441
60
59
insert into t1 (d) select date_sub('2000-01-01', INTERVAL 2001 YEAR);
 
60
--error 1441
61
61
insert into t1 (d) select date_add('2000-01-01',interval 8000 year);
62
62
insert into t1 values (date_add(NULL, INTERVAL 1 DAY));
63
63
insert into t1 values (date_add('2000-01-04', INTERVAL NULL DAY));