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

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_function_defaults.result

  • 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
#
 
2
# Test of function defaults on replicated tables.
 
3
#
 
4
include/master-slave.inc
 
5
Warnings:
 
6
Note    ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
 
7
Note    ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
 
8
[connection master]
 
9
connection master
 
10
SET TIME_ZONE="+10:30";
 
11
SET TIMESTAMP=123456.789123;
 
12
SELECT CURRENT_TIMESTAMP;
 
13
CURRENT_TIMESTAMP
 
14
1970-01-02 20:47:36
 
15
connection slave
 
16
SET TIME_ZONE="+00:00";
 
17
SET TIMESTAMP=987654321.123456;
 
18
SELECT CURRENT_TIMESTAMP;
 
19
CURRENT_TIMESTAMP
 
20
2001-04-19 04:25:21
 
21
connection master
 
22
CREATE TABLE t1 (
 
23
a TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP,
 
24
b TIMESTAMP(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1),
 
25
c TIMESTAMP(2) NOT NULL DEFAULT CURRENT_TIMESTAMP(2),
 
26
d TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
 
27
e TIMESTAMP(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4),
 
28
f TIMESTAMP(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5),
 
29
g TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
 
30
h DATETIME     DEFAULT CURRENT_TIMESTAMP,
 
31
i DATETIME(1)  DEFAULT CURRENT_TIMESTAMP(1),
 
32
j DATETIME(2)  DEFAULT CURRENT_TIMESTAMP(2),
 
33
k DATETIME(3)  DEFAULT CURRENT_TIMESTAMP(3),
 
34
l DATETIME(4)  DEFAULT CURRENT_TIMESTAMP(4),
 
35
m DATETIME(5)  DEFAULT CURRENT_TIMESTAMP(5),
 
36
n DATETIME(6)  DEFAULT CURRENT_TIMESTAMP(6),
 
37
o INT
 
38
);
 
39
INSERT INTO t1 ( o ) VALUES ( 1 );
 
40
CREATE TABLE t2 (
 
41
a TIMESTAMP    NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
 
42
b TIMESTAMP(1) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP(1),
 
43
c TIMESTAMP(2) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP(2),
 
44
d TIMESTAMP(3) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP(3),
 
45
e TIMESTAMP(4) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP(4),
 
46
f TIMESTAMP(5) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP(5),
 
47
g TIMESTAMP(6) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP(6),
 
48
h DATETIME     ON UPDATE CURRENT_TIMESTAMP,
 
49
i DATETIME(1)  ON UPDATE CURRENT_TIMESTAMP(1),
 
50
j DATETIME(2)  ON UPDATE CURRENT_TIMESTAMP(2),
 
51
k DATETIME(3)  ON UPDATE CURRENT_TIMESTAMP(3),
 
52
l DATETIME(4)  ON UPDATE CURRENT_TIMESTAMP(4),
 
53
m DATETIME(5)  ON UPDATE CURRENT_TIMESTAMP(5),
 
54
n DATETIME(6)  ON UPDATE CURRENT_TIMESTAMP(6),
 
55
o INT
 
56
);
 
57
INSERT INTO t2 ( o ) VALUES ( 1 );
 
58
sync_slave_with_master
 
59
connection slave
 
60
SELECT * FROM t1;
 
61
a       1970-01-02 10:17:36
 
62
b       1970-01-02 10:17:36.7
 
63
c       1970-01-02 10:17:36.78
 
64
d       1970-01-02 10:17:36.789
 
65
e       1970-01-02 10:17:36.7891
 
66
f       1970-01-02 10:17:36.78912
 
67
g       1970-01-02 10:17:36.789123
 
68
h       1970-01-02 20:47:36
 
69
i       1970-01-02 20:47:36.7
 
70
j       1970-01-02 20:47:36.78
 
71
k       1970-01-02 20:47:36.789
 
72
l       1970-01-02 20:47:36.7891
 
73
m       1970-01-02 20:47:36.78912
 
74
n       1970-01-02 20:47:36.789123
 
75
o       1
 
76
SELECT * FROM t2;
 
77
a       0000-00-00 00:00:00
 
78
b       0000-00-00 00:00:00.0
 
79
c       0000-00-00 00:00:00.00
 
80
d       0000-00-00 00:00:00.000
 
81
e       0000-00-00 00:00:00.0000
 
82
f       0000-00-00 00:00:00.00000
 
83
g       0000-00-00 00:00:00.000000
 
84
h       NULL
 
85
i       NULL
 
86
j       NULL
 
87
k       NULL
 
88
l       NULL
 
89
m       NULL
 
90
n       NULL
 
91
o       1
 
92
connection master
 
93
SET TIMESTAMP=1234567890.123456;
 
94
SELECT CURRENT_TIMESTAMP;
 
95
CURRENT_TIMESTAMP
 
96
2009-02-14 10:01:30
 
97
UPDATE t1 SET o = 2;
 
98
UPDATE t2 SET o = 2;
 
99
sync_slave_with_master
 
100
connection slave
 
101
SELECT * FROM t1;
 
102
a       1970-01-02 10:17:36
 
103
b       1970-01-02 10:17:36.7
 
104
c       1970-01-02 10:17:36.78
 
105
d       1970-01-02 10:17:36.789
 
106
e       1970-01-02 10:17:36.7891
 
107
f       1970-01-02 10:17:36.78912
 
108
g       1970-01-02 10:17:36.789123
 
109
h       1970-01-02 20:47:36
 
110
i       1970-01-02 20:47:36.7
 
111
j       1970-01-02 20:47:36.78
 
112
k       1970-01-02 20:47:36.789
 
113
l       1970-01-02 20:47:36.7891
 
114
m       1970-01-02 20:47:36.78912
 
115
n       1970-01-02 20:47:36.789123
 
116
o       2
 
117
SELECT * FROM t2;
 
118
a       2009-02-13 23:31:30
 
119
b       2009-02-13 23:31:30.1
 
120
c       2009-02-13 23:31:30.12
 
121
d       2009-02-13 23:31:30.123
 
122
e       2009-02-13 23:31:30.1234
 
123
f       2009-02-13 23:31:30.12345
 
124
g       2009-02-13 23:31:30.123456
 
125
h       2009-02-14 10:01:30
 
126
i       2009-02-14 10:01:30.1
 
127
j       2009-02-14 10:01:30.12
 
128
k       2009-02-14 10:01:30.123
 
129
l       2009-02-14 10:01:30.1234
 
130
m       2009-02-14 10:01:30.12345
 
131
n       2009-02-14 10:01:30.123456
 
132
o       2
 
133
connection master
 
134
DROP TABLE t1, t2;
 
135
include/rpl_end.inc