~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blitzdb/tests/t/blitzdb-basic.test

  • Committer: Monty Taylor
  • Date: 2010-07-19 05:06:59 UTC
  • mto: (1662.1.2 rollup)
  • mto: This revision was merged to the branch mainline in revision 1663.
  • Revision ID: mordred@inaugust.com-20100719050659-if3thz0k66m1jkaf
Backed out two bits that snuck in to the merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
create table t1 (a int, b double, c float) engine = blitzdb;
9
9
create table t2 (a int, b text, c blob) engine = blitzdb;
10
10
 
11
 
--error ER_TABLE_EXISTS_ERROR
 
11
--error 1050
12
12
create table t1 (a int, b double, c float) engine = blitzdb;
13
 
--error ER_TABLE_EXISTS_ERROR
 
13
--error 1050
14
14
create table t2 (a int, b text, c blob) engine = blitzdb;
15
 
--error ER_TABLE_EXISTS_ERROR
 
15
--error 1050
16
16
create table t1 (a int) engine = blitzdb;
17
 
--error ER_TABLE_EXISTS_ERROR
 
17
--error 1050
18
18
create table t2 (a int) engine = blitzdb;
19
19
 
20
20
show tables;
136
136
insert into t1 values (1, NULL), (2, NULL), (3, NULL), (4, NULL);
137
137
insert into t1 values (5, NULL), (6, NULL), (7, NULL), (8, NULL);
138
138
 
139
 
--error ER_BAD_NULL_ERROR # NOT NULL Violation
 
139
--error 1048 # NOT NULL Violation
140
140
insert into t1 values (NULL, 1);
141
141
 
142
142
select * from t1;
162
162
 
163
163
# Test(12): Boundary Check
164
164
create table t1 (a int) engine = blitzdb;
165
 
--error ER_WARN_DATA_OUT_OF_RANGE
 
165
--error 1264
166
166
insert into t1 values(2147483649);
167
 
--error ER_WARN_DATA_OUT_OF_RANGE
 
167
--error 1264
168
168
insert into t1 values(-2147483649);
169
169
insert into t1 values(2147483647);
170
170
select * from t1;
177
177
insert into t1 select repeat('x', 8);
178
178
insert into t1 select repeat('x', 16);
179
179
insert into t1 select repeat('x', 32);
180
 
--error ER_DATA_TOO_LONG
 
180
--error 1406
181
181
insert into t1 select repeat('x', 33);
182
182
select * from t1;
183
183
 
184
184
create table t2 (a varchar(16383)) engine = blitzdb; # Theoretical Max
185
185
insert into t2 select repeat('x', 16383);
186
 
--error ER_DATA_TOO_LONG
 
186
--error 1406
187
187
insert into t2 select repeat('x', 16384);
188
188
select count(*) from t2;
189
189
drop table t1, t2;
192
192
create table t1 (a varchar(32)) engine = blitzdb; 
193
193
insert into t1 select repeat('あ', 8);
194
194
insert into t1 select repeat('あ', 32);
195
 
--error ER_DATA_TOO_LONG
 
195
--error 1406
196
196
insert into t1 select repeat('あ', 33);
197
197
select * from t1;
198
198
 
199
199
create table t2 (a varchar(16383)) engine = blitzdb;
200
200
insert into t2 select repeat('値', 16383);
201
 
--error ER_DATA_TOO_LONG
 
201
--error 1406
202
202
insert into t2 select repeat('値', 16384);
203
203
select count(*) from t2;
204
204
drop table t1, t2;
217
217
insert into t2 (a, b) select * from t1;
218
218
select * from t2;
219
219
drop table t1;
220
 
 
221
 
# Large VARCHAR type (exceeds BlitzDB's stack space).
222
 
create table t1 (a int, b varchar(2048)) engine = blitzdb;
223
 
insert into t1 values (1, 'abcdefghijklmn');
224
 
insert into t1 values (1, 'abcdefghijklmn');
225
 
insert into t1 values (1, 'abcdefghijklmn');
226
 
insert into t1 values (1, 'abcdefghijklmn');
227
 
select * from t1;
228
 
drop table t1;