~drizzle-pbxt/drizzle/drizzle-pbxt-2

« back to all changes in this revision

Viewing changes to tests/include/varchar.inc

  • Committer: Paul McCullagh
  • Date: 2009-11-10 14:18:39 UTC
  • mfrom: (1038.1.7 drizzle-pbxt-pre-merge)
  • Revision ID: paul.mccullagh@primebase.org-20091110141839-2j3k43b17ag6f605
Merged Drizzle trunk and PBXT 1.0.09

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
41
begin;
179
179
# Test unique keys
180
180
#
181
181
 
182
 
create table t1 (a char(10), unique (a));
 
182
eval create $temp table t1 (a char(10), unique (a));
183
183
insert into t1 values ('a   ');
184
184
--error ER_DUP_ENTRY
185
185
insert into t1 values ('a ');
207
207
# test show create table
208
208
#
209
209
 
210
 
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)));
211
211
show create table t1;
212
212
drop table t1;
213
 
create table t1 (v char(10));
 
213
eval create $temp table t1 (v char(10));
214
214
show create table t1;
215
215
drop table t1;
216
216
 
217
 
create table t1 (v varchar(10), c char(10)) row_format=fixed;
 
217
eval create $temp table t1 (v varchar(10), c char(10)) row_format=fixed;
218
218
show create table t1;
219
219
insert into t1 values('a','a'),('a ','a ');
220
220
select concat('*',v,'*',c,'*') from t1;
226
226
# @TODO The below fails because it assumes latin1
227
227
# as the charset.  Possibly re-enable a similar test
228
228
# for UTF8-only in future
229
 
#create table t1 (v varchar(65530), key(v(10)));
 
229
#create $temp table t1 (v varchar(65530), key(v(10)));
230
230
#insert into t1 values(repeat('a',65530));
231
231
#select length(v) from t1 where v=repeat('a',65530);
232
232
#drop table t1;
236
236
# Bug #10802: Index is not used if table using BDB engine on HP-UX
237
237
#
238
238
 
239
 
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));
240
240
insert into t1 values (1, 'A'), (20, NULL);
241
241
explain select * from t1 where a=20 and b is null;
242
242
select * from t1 where a=20 and b is null;