~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/include/varchar.inc

  • Committer: Brian Aker
  • Date: 2010-05-27 01:25:56 UTC
  • mfrom: (1567.1.4 new-staging)
  • Revision ID: brian@gaz-20100527012556-5zgkirkl7swbigd6
Merge of Brian, Paul. PBXT compile issue, and test framework cleanup. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# Simple basic test that endspace is saved
12
12
#
13
13
 
14
 
create table t1 (v varchar(10), c char(10), t text);
 
14
eval create $temp table t1 (v varchar(10), c char(10), t text);
15
15
insert into t1 values('+ ', '+ ', '+ ');
16
16
set @a=repeat(' ',20);
17
17
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
19
19
 
20
20
# Check how columns are copied
21
21
show create table t1;
22
 
create table t2 like t1;
 
22
eval create $temp table t2 like t1;
23
23
show create table t2;
24
 
create table t3 select * from t1;
 
24
eval create $temp table t3 select * from t1;
25
25
show create table t3;
26
26
alter table t1 modify c varchar(10);
27
27
show create table t1;
35
35
#
36
36
# Testing of keys
37
37
#
38
 
create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
 
38
eval create $temp table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
39
39
show create table t1;
40
40
disable_query_log;
 
41
begin;
41
42
let $1=10;
42
43
while ($1)
43
44
{
51
52
  }
52
53
  dec $1;
53
54
}
 
55
commit;
54
56
enable_query_log;
55
57
select count(*) from t1;
56
58
insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1)));
177
179
# Test unique keys
178
180
#
179
181
 
180
 
create table t1 (a char(10), unique (a));
 
182
eval create $temp table t1 (a char(10), unique (a));
181
183
insert into t1 values ('a   ');
182
184
--error ER_DUP_ENTRY
183
185
insert into t1 values ('a ');
205
207
# test show create table
206
208
#
207
209
 
208
 
create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
 
210
eval create $temp table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
209
211
show create table t1;
210
212
drop table t1;
211
 
create table t1 (v char(10) character set utf8);
 
213
eval create $temp table t1 (v char(10));
212
214
show create table t1;
213
215
drop table t1;
214
216
 
215
 
create table t1 (v varchar(10), c char(10)) row_format=fixed;
 
217
eval create $temp table t1 (v varchar(10), c char(10));
216
218
show create table t1;
217
219
insert into t1 values('a','a'),('a ','a ');
218
220
select concat('*',v,'*',c,'*') from t1;
221
223
#
222
224
# Test long varchars
223
225
#
224
 
 
225
 
create table t1 (v varchar(65530), key(v(10)));
226
 
insert into t1 values(repeat('a',65530));
227
 
select length(v) from t1 where v=repeat('a',65530);
228
 
drop table t1;
 
226
# @TODO The below fails because it assumes latin1
 
227
# as the charset.  Possibly re-enable a similar test
 
228
# for UTF8-only in future
 
229
#create $temp table t1 (v varchar(65530), key(v(10)));
 
230
#insert into t1 values(repeat('a',65530));
 
231
#select length(v) from t1 where v=repeat('a',65530);
 
232
#drop table t1;
229
233
 
230
234
#
231
235
# Bug #9489: problem with hash indexes
232
236
# Bug #10802: Index is not used if table using BDB engine on HP-UX
233
237
#
234
238
 
235
 
create table t1(a int, b varchar(12), key ba(b, a));
 
239
eval create $temp table t1(a int, b varchar(12), key ba(b, a));
236
240
insert into t1 values (1, 'A'), (20, NULL);
237
241
explain select * from t1 where a=20 and b is null;
238
242
select * from t1 where a=20 and b is null;