~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/t/func_date_add.test

  • Committer: Monty Taylor
  • Date: 2008-07-02 14:35:48 UTC
  • mto: This revision was merged to the branch mainline in revision 51.
  • Revision ID: monty@inaugust.com-20080702143548-onj30ry0sugr01uw
Removed all references to THREAD.

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 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,
 
10
  visitor_id int(10) unsigned DEFAULT '0' NOT NULL,
 
11
  group_id int(10) unsigned DEFAULT '0' NOT NULL,
 
12
  hits int(10) unsigned DEFAULT '0' NOT NULL,
 
13
  sessions int(10) unsigned 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';
48
49
create table t1 (d date);
49
50
--error S22008
50
51
insert into t1 (d) select date_sub('2000-01-01', INTERVAL 2001 YEAR);
53
54
# No warnings/errors from the next two
54
55
insert into t1 values (date_add(NULL, INTERVAL 1 DAY));
55
56
insert into t1 values (date_add('2000-01-04', INTERVAL NULL DAY));
 
57
set sql_mode='';
56
58
# These will all work now, and we'll end up with some NULL entries in the
57
59
# table and some warnings.
58
 
--error 1441
59
60
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));