~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/create.test

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
# Test of some CREATE TABLE'S that should fail
27
27
#
28
28
 
29
 
--error ER_NO_SUCH_TABLE
 
29
--error ER_TABLE_UNKNOWN
30
30
create temporary table t2 engine=MEMORY select * from t1;
31
 
--error ER_NO_SUCH_TABLE
 
31
--error ER_TABLE_UNKNOWN
32
32
create table t2 select auto+1 from t1;
33
33
drop table if exists t1,t2;
34
34
--error ER_WRONG_KEY_COLUMN
40
40
--error ER_WRONG_AUTO_KEY
41
41
create temporary table t1 (ordid int not null auto_increment, ord  varchar(50) not null, primary key (ord,ordid)) engine=MEMORY;
42
42
 
 
43
-- error ER_BAD_DB_ERROR
43
44
create table not_existing_database.test (a int);
44
45
create table `a/a` (a int);
45
46
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
162
162
INSERT INTO t1 values (1),(2),(1);
163
163
--error ER_DUP_ENTRY
164
164
CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
165
 
--error ER_NO_SUCH_TABLE
 
165
--error ER_TABLE_UNKNOWN
166
166
SELECT * from t2;
167
167
DROP TABLE t1;
168
168
DROP TABLE IF EXISTS t2;
247
247
create table if not exists t1 select 3 as 'a',3 as 'b';
248
248
show warnings;
249
249
--replace_column 3 # 4 # 5 #
250
 
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
 
250
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT AND TABLE_SCHEMA = SCHEMA() > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
251
251
select * from t1;
252
252
drop table t1;
253
253
 
314
314
create database mysqltest;
315
315
create table mysqltest.t3 like t1;
316
316
create temporary table t3 like mysqltest.t3;
 
317
 
317
318
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
318
319
show create table t3;
 
320
 
319
321
create table t2 like t3;
 
322
 
320
323
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
321
324
show create table t2;
322
325
select * from t2;
 
326
 
323
327
--error ER_TABLE_EXISTS_ERROR
324
328
create table t3 like t1;
 
329
 
325
330
--error ER_TABLE_EXISTS_ERROR
326
331
create table t3 like mysqltest.t3;
 
332
 
327
333
--error ER_BAD_DB_ERROR
328
334
create table non_existing_database.t1 like t1;
329
 
--error ER_NO_SUCH_TABLE
330
 
create table t3 like non_existing_table;
 
335
 
 
336
--error ER_TABLE_UNKNOWN
 
337
create table t4 like non_existing_table;
 
338
 
331
339
--error ER_TABLE_EXISTS_ERROR
332
340
create temporary table t3 like t1;
333
341
drop table t1, t2, t3;
382
390
drop table t1, t2;
383
391
 
384
392
create table t1 (a int, b int, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), j date, k timestamp, l datetime, m enum('a','b'), o char(10));
 
393
SHOW CREATE TABLE t1;
385
394
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(o,o) from t1;
386
395
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
387
396
show create table t2;
655
664
#  of error it is automatically dropped if it has not existed before.)
656
665
#
657
666
# Error during open_and_lock_tables() of tables
658
 
--error ER_NO_SUCH_TABLE
 
667
--error ER_TABLE_UNKNOWN
659
668
create table t1 select * from t2;
660
669
# Rather special error which also caught during open tables pahse
661
670
--error ER_UPDATE_TABLE_USED
706
715
create table if not exists t1 select 1;
707
716
select * from t1;
708
717
drop temporary table t1;
709
 
--error ER_NO_SUCH_TABLE
 
718
--error ER_TABLE_UNKNOWN
710
719
select * from t1;
711
720
--error ER_BAD_TABLE_ERROR
712
721
drop table t1;
1212
1221
#
1213
1222
# Bug#25629 CREATE TABLE LIKE does not work with INFORMATION_SCHEMA
1214
1223
#
1215
 
--error ER_CANT_CREATE_TABLE
 
1224
--error ER_CANT_CREATE_TABLE,ER_TABLE_PERMISSION_DENIED
1216
1225
create table t1 like data_dictionary.processlist;
1217
1226
create table t1 like data_dictionary.processlist engine=innodb;
1218
1227
show create table t1;
1219
1228
drop table t1;
1220
 
--error ER_CANT_CREATE_TABLE
 
1229
--error ER_CANT_CREATE_TABLE,ER_TABLE_PERMISSION_DENIED
1221
1230
create temporary table t1 like data_dictionary.processlist;
1222
1231
create temporary table t1 like data_dictionary.processlist engine=myisam;
1223
1232
show create table t1;