~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/engines/funcs/t/in_calendar_unique_constraint_error.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--disable_warnings
 
2
DROP TABLE IF EXISTS t1;
 
3
--enable_warnings
 
4
# Set Correct timezone to match result
 
5
SET TIME_ZONE="+03:00";
 
6
CREATE TABLE t1(c1 DATE NULL UNIQUE);
 
7
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
 
8
INSERT INTO t1 (c1) VALUES(NOW());
 
9
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
 
10
--error ER_DUP_ENTRY
 
11
INSERT INTO t1 (c1) VALUES(NOW());
 
12
SELECT * FROM t1;
 
13
DROP TABLE t1;
 
14
CREATE TABLE t1(c1 YEAR NULL UNIQUE);
 
15
INSERT INTO t1 (c1) VALUES(1999);
 
16
INSERT INTO t1 (c1) VALUES(2000);
 
17
--error ER_DUP_ENTRY
 
18
INSERT INTO t1 (c1) VALUES(1999);
 
19
SELECT * FROM t1;
 
20
DROP TABLE t1;
 
21
CREATE TABLE t1(c1 TIME NULL UNIQUE);
 
22
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
 
23
INSERT INTO t1 (c1) VALUES(NOW());
 
24
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
 
25
--error ER_DUP_ENTRY
 
26
INSERT INTO t1 (c1) VALUES(NOW());
 
27
SELECT * FROM t1;
 
28
DROP TABLE t1;
 
29
CREATE TABLE t1(c1 YEAR NULL UNIQUE);
 
30
INSERT INTO t1 (c1) VALUES(1999);
 
31
INSERT INTO t1 (c1) VALUES(2000);
 
32
--error ER_DUP_ENTRY
 
33
INSERT INTO t1 (c1) VALUES(1999);
 
34
SELECT * FROM t1;
 
35
DROP TABLE t1;
 
36
CREATE TABLE t1(c1 DATETIME NULL UNIQUE);
 
37
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
 
38
INSERT INTO t1 (c1) VALUES(NOW());
 
39
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
 
40
--error ER_DUP_ENTRY
 
41
INSERT INTO t1 (c1) VALUES(NOW());
 
42
SELECT * FROM t1;
 
43
DROP TABLE t1;
 
44
CREATE TABLE t1(c1 YEAR NULL UNIQUE);
 
45
INSERT INTO t1 (c1) VALUES(1999);
 
46
INSERT INTO t1 (c1) VALUES(2000);
 
47
--error ER_DUP_ENTRY
 
48
INSERT INTO t1 (c1) VALUES(1999);
 
49
SELECT * FROM t1;
 
50
DROP TABLE t1;
 
51
CREATE TABLE t1(c1 TIMESTAMP NULL UNIQUE);
 
52
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
 
53
INSERT INTO t1 (c1) VALUES(NOW());
 
54
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
 
55
--error ER_DUP_ENTRY
 
56
INSERT INTO t1 (c1) VALUES(NOW());
 
57
SELECT * FROM t1;
 
58
DROP TABLE t1;
 
59
CREATE TABLE t1(c1 YEAR NULL UNIQUE);
 
60
INSERT INTO t1 (c1) VALUES(1999);
 
61
INSERT INTO t1 (c1) VALUES(2000);
 
62
--error ER_DUP_ENTRY
 
63
INSERT INTO t1 (c1) VALUES(1999);
 
64
SELECT * FROM t1;
 
65
DROP TABLE t1;
 
66
# Restore timezone to default
 
67
SET TIME_ZONE= @@global.time_zone;