~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
drop table if exists t1, t2;
2
create table t1 (a date, b date, c date not null, d date);
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
3
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
4
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
1 by brian
clean slate
5
SELECT * from t1;
6
a	b	c	d
706 by Brian Aker
Fix loaddata test.
7
2003-02-03	2003-02-03	2003-02-03	NULL
1 by brian
clean slate
8
2003-03-03	2003-03-03	2003-03-03	NULL
9
truncate table t1;
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
10
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
1 by brian
clean slate
11
SELECT * from t1;
12
a	b	c	d
706 by Brian Aker
Fix loaddata test.
13
NULL	2003-02-03	2003-02-03	NULL
1 by brian
clean slate
14
NULL	2003-03-03	2003-03-03	NULL
15
drop table t1;
16
create table t1 (a text, b text);
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
17
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
1 by brian
clean slate
18
select concat('|',a,'|'), concat('|',b,'|') from t1;
19
concat('|',a,'|')	concat('|',b,'|')
20
|Field A|	|Field B|
21
|Field 1|	|Field 2' 
706 by Brian Aker
Fix loaddata test.
22
'Field 5' ,'Field 6|
1 by brian
clean slate
23
|Field 6|	| 'Field 7'|
24
drop table t1;
25
create table t1 (a int, b char(10));
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
26
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
1 by brian
clean slate
27
select * from t1;
28
a	b
706 by Brian Aker
Fix loaddata test.
29
1	row 1     
30
2	row 2     
31
3	row 3     
1 by brian
clean slate
32
truncate table t1;
33
select * from t1;
34
a	b
35
drop table t1;
36
create table t1 (a varchar(20), b varchar(20));
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
37
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
1 by brian
clean slate
38
select * from t1;
39
a	b
40
field1	field2
41
a"b	cd"ef
42
a"b	c"d"e
43
drop table t1;
44
CREATE TABLE t1 (
45
id INT AUTO_INCREMENT PRIMARY KEY,
46
c1 VARCHAR(255)
47
);
48
CREATE TABLE t2 (
49
id INT,
50
c2 VARCHAR(255)
51
);
52
INSERT INTO t1 (c1) VALUES
53
('r'),   ('rr'),   ('rrr'),   ('rrrr'),
54
('.r'),  ('.rr'),  ('.rrr'),  ('.rrrr'),
55
('r.'),  ('rr.'),  ('rrr.'),  ('rrrr.'),
56
('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.');
57
SELECT * FROM t1;
58
id	c1
59
1	r
60
2	rr
61
3	rrr
62
4	rrrr
63
5	.r
64
6	.rr
65
7	.rrr
66
8	.rrrr
67
9	r.
68
10	rr.
69
11	rrr.
70
12	rrrr.
71
13	.r.
72
14	.rr.
73
15	.rrr.
74
16	.rrrr.
1819.2.2 by patrick crews
Adjustments to tests to deal with the name changes. Also fixed passed/failed reporting post-run in test-run.pl
75
SELECT * INTO OUTFILE 'DRIZZLETEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1;
1 by brian
clean slate
76
r1r	rrrr
77
r2r	rrrrrr
78
r3r	rrrrrrrr
79
r4r	rrrrrrrrrr
80
r5r	r.rrr
81
r6r	r.rrrrr
82
r7r	r.rrrrrrr
83
r8r	r.rrrrrrrrr
84
r9r	rrr.r
85
r10r	rrrrr.r
86
r11r	rrrrrrr.r
87
r12r	rrrrrrrrr.r
88
r13r	r.rr.r
89
r14r	r.rrrr.r
90
r15r	r.rrrrrr.r
91
r16r	r.rrrrrrrr.r
1819.2.2 by patrick crews
Adjustments to tests to deal with the name changes. Also fixed passed/failed reporting post-run in test-run.pl
92
LOAD DATA INFILE 'DRIZZLETEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r';
1 by brian
clean slate
93
SELECT t1.id, c1, c2 FROM t1 LEFT  JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
94
id	c1	c2
95
SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
96
id	c1	c2
97
DROP TABLE t1,t2;
98
create table t1 (a int default 100, b int, c varchar(60));
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
99
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
1 by brian
clean slate
100
select * from t1;
101
a	b	c
102
NULL	20	b=10
103
NULL	25	b=15
104
truncate table t1;
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
105
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a);
1 by brian
clean slate
106
select * from t1;
107
a	b	c
108
NULL	NULL	oops
109
NULL	NULL	oops
110
truncate table t1;
111
set @c:=123;
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
112
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b);
1 by brian
clean slate
113
select * from t1;
114
a	b	c
115
100	10	123
116
100	15	123
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
117
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
1 by brian
clean slate
118
select * from t1;
119
a	b	c
120
100	10	123
121
100	15	123
122
100	NULL	NULL
123
100	NULL	NULL
124
select @a, @b;
125
@a	@b
126
NULL	15
127
truncate table t1;
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
128
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
1 by brian
clean slate
129
select * from t1;
130
a	b	c
131
1	2	Wow
132
3	4	Wow
133
5	6	Wow
134
truncate table t1;
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
135
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c));
1 by brian
clean slate
136
select * from t1;
137
a	b	c
138
1	2	1+2+123+2+NIL
139
3	4	3+4+123+4+NIL
140
5	6	5+6+123+6+NIL
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
141
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b);
1 by brian
clean slate
142
ERROR HY000: Can't load value from file with fixed size rows to variable
143
create table t2 (num int primary key, str varchar(10));
144
insert into t2 values (10,'Ten'), (15,'Fifteen');
145
truncate table t1;
1878.7.1 by patrick crews
Updated tests to use variable vardir rather than a hard-coded one
146
load data infile 'DRIZZLETEST_VARDIR/std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
1 by brian
clean slate
147
select * from t1;
148
a	b	c
149
10	NULL	Ten
706 by Brian Aker
Fix loaddata test.
150
15	NULL	Ten
1 by brian
clean slate
151
show variables like "secure_file_pri%";
152
Variable_name	Value
1825 by Brian Aker
Merge in Pcrew test framework
153
secure_file_priv	DRIZZLETEST_VARDIR
1 by brian
clean slate
154
select @@secure_file_priv;
155
@@secure_file_priv
1825 by Brian Aker
Merge in Pcrew test framework
156
DRIZZLETEST_VARDIR
1 by brian
clean slate
157
set @@secure_file_priv= 0;
158
ERROR HY000: Variable 'secure_file_priv' is a read only variable
159
truncate table t1;
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
160
load data infile 'DRIZZLE_TEST_DIR/t/loaddata.test' into table t1;
706 by Brian Aker
Fix loaddata test.
161
ERROR HY000: The Drizzle server is running with the --secure-file-priv option so it cannot execute this statement
1 by brian
clean slate
162
select * from t1;
163
a	b	c
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
164
select load_file("DRIZZLE_TEST_DIR/t/loaddata.test");
1813.2.11 by Monty Taylor
Throw an error on load_file() from outside the secure_file_priv locaiton.
165
ERROR HY000: The Drizzle server is running with the --secure-file-priv option so it cannot execute this statement
1 by brian
clean slate
166
drop table t1, t2;
167
create table t1(f1 int, f2 timestamp not null default current_timestamp);
168
create table t2(f1 int);
169
insert into t2 values(1),(2);
706 by Brian Aker
Fix loaddata test.
170
ERROR 01000: Row 1 doesn't contain data for all columns
873.1.8 by Jay Pipes
Fixes Arg_comparator::can_compare_as_dates to never, ever allow bad
171
select f1 from t1 where f2 IS NOT NULL order by f1;
1 by brian
clean slate
172
f1
173
delete from t1;
706 by Brian Aker
Fix loaddata test.
174
ERROR 01000: Row 1 doesn't contain data for all columns
873.1.8 by Jay Pipes
Fixes Arg_comparator::can_compare_as_dates to never, ever allow bad
175
select f1 from t1 where f2 IS NOT NULL order by f1;
1 by brian
clean slate
176
f1
177
drop table t1,t2;
178
CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
179
INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
180
SELECT * FROM t1;
181
c1	c2	c3	c4
182
10	1970-02-01 01:02:03	1.1e-100	1.1e100
1819.2.2 by patrick crews
Adjustments to tests to deal with the name changes. Also fixed passed/failed reporting post-run in test-run.pl
183
SELECT * INTO OUTFILE 'DRIZZLETEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
1 by brian
clean slate
184
EOF
185
TRUNCATE t1;
1819.2.2 by patrick crews
Adjustments to tests to deal with the name changes. Also fixed passed/failed reporting post-run in test-run.pl
186
LOAD DATA INFILE 'DRIZZLETEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
1 by brian
clean slate
187
SELECT * FROM t1;
188
c1	c2	c3	c4
189
10	1970-02-01 01:02:03	1.1e-100	1.1e100
190
DROP TABLE t1;