~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/include/varchar.inc

  • Committer: Jay Pipes
  • Date: 2009-04-10 17:06:58 UTC
  • mto: (971.1.47 mordred)
  • mto: This revision was merged to the branch mainline in revision 990.
  • Revision ID: jpipes@serialcoder-20090410170658-d3azdnas1fn8v68l
Removal of log.cc (binlog), added Applier plugin and fixed up Replicator
plugin.  New transaction_services.cc class implementation of the API for
converting between internal formats and GPB Command Messages.

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
 
eval create $temp table t1 (v varchar(10), c char(10), t text);
 
14
create table t1 (v varchar(10), c char(10), t text);
15
15
insert into t1 values('+ ', '+ ', '+ ');
16
16
set @a=repeat(' ',20);
17
 
--error ER_DATA_TOO_LONG
18
 
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
19
 
set @a=repeat(' ',10);
20
 
--error ER_DATA_TOO_LONG
21
 
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
22
 
set @a=repeat(' ',9);
23
17
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
24
18
select concat('*',v,'*',c,'*',t,'*') from t1;
25
19
 
26
20
# Check how columns are copied
27
21
show create table t1;
28
 
eval create $temp table t2 like t1;
 
22
create table t2 like t1;
29
23
show create table t2;
30
 
eval create $temp table t3 select * from t1;
 
24
create table t3 select * from t1;
31
25
show create table t3;
32
26
alter table t1 modify c varchar(10);
33
27
show create table t1;
41
35
#
42
36
# Testing of keys
43
37
#
44
 
eval create $temp table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
 
38
create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
45
39
show create table t1;
46
40
disable_query_log;
47
41
begin;
185
179
# Test unique keys
186
180
#
187
181
 
188
 
eval create $temp table t1 (a char(10), unique (a));
 
182
create table t1 (a char(10), unique (a));
189
183
insert into t1 values ('a   ');
190
184
--error ER_DUP_ENTRY
191
185
insert into t1 values ('a ');
195
189
insert into t1 values ('a '),('a  '),('a   '),('a         ');
196
190
--error ER_DUP_ENTRY
197
191
insert into t1 values ('a     ');
198
 
--error ER_DATA_TOO_LONG
 
192
--error ER_DUP_ENTRY
199
193
insert into t1 values ('a          ');
200
194
--error ER_DUP_ENTRY
201
195
insert into t1 values ('a ');
213
207
# test show create table
214
208
#
215
209
 
216
 
eval create $temp table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
 
210
create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
217
211
show create table t1;
218
212
drop table t1;
219
 
eval create $temp table t1 (v char(10));
 
213
create table t1 (v char(10));
220
214
show create table t1;
221
215
drop table t1;
222
216
 
223
 
eval create $temp table t1 (v varchar(10), c char(10));
 
217
create table t1 (v varchar(10), c char(10)) row_format=fixed;
224
218
show create table t1;
225
219
insert into t1 values('a','a'),('a ','a ');
226
220
select concat('*',v,'*',c,'*') from t1;
232
226
# @TODO The below fails because it assumes latin1
233
227
# as the charset.  Possibly re-enable a similar test
234
228
# for UTF8-only in future
235
 
#create $temp table t1 (v varchar(65530), key(v(10)));
 
229
#create table t1 (v varchar(65530), key(v(10)));
236
230
#insert into t1 values(repeat('a',65530));
237
231
#select length(v) from t1 where v=repeat('a',65530);
238
232
#drop table t1;
242
236
# Bug #10802: Index is not used if table using BDB engine on HP-UX
243
237
#
244
238
 
245
 
eval create $temp table t1(a int, b varchar(12), key ba(b, a));
 
239
create table t1(a int, b varchar(12), key ba(b, a));
246
240
insert into t1 values (1, 'A'), (20, NULL);
247
241
explain select * from t1 where a=20 and b is null;
248
242
select * from t1 where a=20 and b is null;