1
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
2
drop table if exists tb3 ;
3
drop table if exists tb3;
4
f118 char not null DEFAULT 'a',
5
f119 char binary not null DEFAULT b'101',
6
f120 char ascii not null DEFAULT b'101',
10
f124 longtext unicode,
15
f129 binary not null DEFAULT b'101',
16
f130 tinyint not null DEFAULT 99,
17
f131 tinyint unsigned not null DEFAULT 99,
18
f132 tinyint zerofill not null DEFAULT 99,
19
f133 tinyint unsigned zerofill not null DEFAULT 99,
20
f134 smallint not null DEFAULT 999,
21
f135 smallint unsigned not null DEFAULT 999,
22
f136 smallint zerofill not null DEFAULT 999,
23
f137 smallint unsigned zerofill not null DEFAULT 999,
24
f138 mediumint not null DEFAULT 9999,
25
f139 mediumint unsigned not null DEFAULT 9999,
26
f140 mediumint zerofill not null DEFAULT 9999,
27
f141 mediumint unsigned zerofill not null DEFAULT 9999,
28
f142 int not null DEFAULT 99999,
29
f143 int unsigned not null DEFAULT 99999,
30
f144 int zerofill not null DEFAULT 99999,
31
f145 int unsigned zerofill not null DEFAULT 99999,
32
f146 bigint not null DEFAULT 999999,
33
f147 bigint unsigned not null DEFAULT 999999,
34
f148 bigint zerofill not null DEFAULT 999999,
35
f149 bigint unsigned zerofill not null DEFAULT 999999,
36
f150 decimal not null DEFAULT 999.999,
37
f151 decimal unsigned not null DEFAULT 999.17,
38
f152 decimal zerofill not null DEFAULT 999.999,
39
f153 decimal unsigned zerofill,
42
f156 decimal (0) unsigned,
43
f157 decimal (64) unsigned,
44
f158 decimal (0) zerofill,
45
f159 decimal (64) zerofill,
46
f160 decimal (0) unsigned zerofill,
47
f161 decimal (64) unsigned zerofill,
50
f164 decimal (0,0) unsigned,
51
f165 decimal (63,30) unsigned,
52
f166 decimal (0,0) zerofill,
53
f167 decimal (63,30) zerofill,
54
f168 decimal (0,0) unsigned zerofill,
55
f169 decimal (63,30) unsigned zerofill,
57
f171 numeric unsigned,
58
f172 numeric zerofill,
59
f173 numeric unsigned zerofill,
5
f118 char not null DEFAULT 'a',
6
f119 char binary not null DEFAULT b'101',
7
f120 char ascii not null DEFAULT b'101',
10
f129 binary not null DEFAULT b'101',
11
f130 tinyint not null DEFAULT 99,
12
f131 tinyint unsigned not null DEFAULT 99,
13
f132 tinyint zerofill not null DEFAULT 99,
14
f133 tinyint unsigned zerofill not null DEFAULT 99,
15
f134 smallint not null DEFAULT 999,
16
f135 smallint unsigned not null DEFAULT 999,
17
f136 smallint zerofill not null DEFAULT 999,
18
f137 smallint unsigned zerofill not null DEFAULT 999,
19
f138 mediumint not null DEFAULT 9999,
20
f139 mediumint unsigned not null DEFAULT 9999,
21
f140 mediumint zerofill not null DEFAULT 9999,
22
f141 mediumint unsigned zerofill not null DEFAULT 9999,
23
f142 int not null DEFAULT 99999,
24
f143 int unsigned not null DEFAULT 99999,
25
f144 int zerofill not null DEFAULT 99999,
26
f145 int unsigned zerofill not null DEFAULT 99999,
27
f146 bigint not null DEFAULT 999999,
28
f147 bigint unsigned not null DEFAULT 999999,
29
f148 bigint zerofill not null DEFAULT 999999,
30
f149 bigint unsigned zerofill not null DEFAULT 999999,
31
f150 decimal not null DEFAULT 999.999,
32
f151 decimal unsigned not null DEFAULT 999.17,
33
f152 decimal zerofill not null DEFAULT 999.999,
34
f153 decimal unsigned zerofill,
37
f156 decimal (0) unsigned,
38
f157 decimal (64) unsigned,
39
f158 decimal (0) zerofill,
40
f159 decimal (64) zerofill,
41
f160 decimal (0) unsigned zerofill,
42
f161 decimal (64) unsigned zerofill,
45
f164 decimal (0,0) unsigned,
46
f165 decimal (63,30) unsigned,
47
f166 decimal (0,0) zerofill,
48
f167 decimal (63,30) zerofill,
49
f168 decimal (0,0) unsigned zerofill,
50
f169 decimal (63,30) unsigned zerofill,
52
f171 numeric unsigned,
53
f172 numeric zerofill,
54
f173 numeric unsigned zerofill,
57
) engine = <engine_to_be_used>;
64
59
Note 1265 Data truncated for column 'f150' at row 1
65
60
Note 1265 Data truncated for column 'f151' at row 1
66
61
Note 1265 Data truncated for column 'f152' at row 1
67
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
72
Create trigger trg1_1 BEFORE INSERT
66
Create trigger trg1_1 BEFORE INSERT
73
67
on tb3 for each row set @test_before = 2, new.f142 = @test_before;
74
Create trigger trg1_2 AFTER INSERT
68
Create trigger trg1_2 AFTER INSERT
75
69
on tb3 for each row set @test_after = 6;
76
Create trigger trg1_4 BEFORE UPDATE
77
on tb3 for each row set @test_before = 27,
78
new.f142 = @test_before,
70
Create trigger trg1_4 BEFORE UPDATE
71
on tb3 for each row set @test_before = 27,
72
new.f142 = @test_before,
79
73
new.f122 = 'Before Update Trigger';
80
Create trigger trg1_3 AFTER UPDATE
74
Create trigger trg1_3 AFTER UPDATE
81
75
on tb3 for each row set @test_after = '15';
82
Create trigger trg1_5 BEFORE DELETE on tb3 for each row
83
select count(*) into @test_before from tb3 as tr_tb3
76
Create trigger trg1_5 BEFORE DELETE on tb3 for each row
77
select count(*) into @test_before from tb3 as tr_tb3
84
78
where f121 = 'Test 3.5.1.1';
85
Create trigger trg1_6 AFTER DELETE on tb3 for each row
86
select count(*) into @test_after from tb3 as tr_tb3
79
Create trigger trg1_6 AFTER DELETE on tb3 for each row
80
select count(*) into @test_after from tb3 as tr_tb3
87
81
where f121 = 'Test 3.5.1.1';
88
82
set @test_before = 1;
89
83
set @test_after = 5;
90
84
select @test_before, @test_after;
91
85
@test_before @test_after
93
Insert into tb3 (f121, f122, f142, f144, f134)
87
Insert into tb3 (f121, f122, f142, f144, f134)
94
88
values ('Test 3.5.1.1', 'First Row', @test_before, @test_after, 1);
95
89
select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
96
90
f121 f122 f142 f144 f134