~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/innodb.test

  • Committer: Monty Taylor
  • Date: 2010-07-31 21:37:09 UTC
  • mto: (1680.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1681.
  • Revision ID: mordred@inaugust.com-20100731213709-p2tlj3txhwdi9339
Removed our unordered wrappers. We use Boost now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#                                                                     #
12
12
#######################################################################
13
13
 
14
 
SET @orig_lock_wait_timeout= @@innodb_lock_wait_timeout; 
15
 
SET GLOBAL innodb_lock_wait_timeout=2;
16
 
 
 
14
-- source include/have_innodb.inc
17
15
 
18
16
#
19
17
# Small basic test with ignore
156
154
select n from t1;
157
155
savepoint savept3;
158
156
rollback to savepoint savept2;
159
 
--error ER_SP_DOES_NOT_EXIST
 
157
--error 1305
160
158
rollback to savepoint savept3;
161
159
rollback to savepoint savept2;
162
160
release savepoint `my_savepoint`;
163
161
select n from t1;
164
 
--error 1305
 
162
-- error 1305
165
163
rollback to savepoint `my_savepoint`;
166
164
rollback to savepoint savept2;
167
165
insert into t1 values (8);
183
181
flush tables with read lock;
184
182
#
185
183
# Current code can't handle a read lock in middle of transaction
186
 
#--error ER_CANT_UPDATE_WITH_READLOCK
 
184
#--error 1223;
187
185
commit;
188
186
unlock tables;
189
187
commit;
304
302
select * from t1;
305
303
update t1 set col2='7' where col1='4';
306
304
select * from t1;
307
 
ALTER TABLE t1 ADD co3 INT DEFAULT 42 NOT NULL;
 
305
alter table t1 add co3 int not null;
308
306
select * from t1;
309
307
update t1 set col2='9' where col1='2';
310
308
select * from t1;
539
537
commit;
540
538
drop database mysqltest;
541
539
# Don't check error message
542
 
--error ER_BAD_DB_ERROR
 
540
--error 1049
543
541
show tables from mysqltest;
544
542
 
545
543
#
868
866
create index id2 on t2 (id);
869
867
show create table t2;
870
868
drop index id2 on t2;
871
 
--error ER_ERROR_ON_RENAME, ER_ERROR_ON_RENAME
 
869
--error 1025,1025
872
870
drop index id on t2;
873
871
show create table t2;
874
872
drop table t2;
905
903
# Test error handling
906
904
 
907
905
# Embedded server doesn't chdir to data directory
908
 
--replace_result $DRIZZLETEST_VARDIR . master-data/ ''
 
906
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
909
907
--error ER_WRONG_FK_DEF
910
908
create table t2 (id int not null, id2 int not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
911
909
 
922
920
#
923
921
# Bug #6126: Duplicate columns in keys gives misleading error message
924
922
#
925
 
--error ER_DUP_FIELDNAME
 
923
--error 1060
926
924
create table t1 (c char(10), index (c,c)) engine=innodb;
927
 
--error ER_DUP_FIELDNAME
 
925
--error 1060
928
926
create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
929
 
--error ER_DUP_FIELDNAME
 
927
--error 1060
930
928
create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
931
 
--error ER_DUP_FIELDNAME
 
929
--error 1060
932
930
create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
933
931
create table t1 (c1 char(10), c2 char(10)) engine=innodb;
934
 
--error ER_DUP_FIELDNAME
 
932
--error 1060
935
933
alter table t1 add key (c1,c1);
936
 
--error ER_DUP_FIELDNAME
 
934
--error 1060
937
935
alter table t1 add key (c2,c1,c1);
938
 
--error ER_DUP_FIELDNAME
 
936
--error 1060
939
937
alter table t1 add key (c1,c2,c1);
940
 
--error ER_DUP_FIELDNAME
 
938
--error 1060
941
939
alter table t1 add key (c1,c1,c2);
942
940
drop table t1;
943
941
 
1099
1097
#
1100
1098
 
1101
1099
# Embedded server doesn't chdir to data directory
1102
 
--replace_result $DRIZZLETEST_VARDIR . master-data/ ''
 
1100
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
1103
1101
create table t1 (v varchar(16383), key(v));
1104
1102
drop table t1;
1105
1103
create table t1 (v varchar(16383));
1196
1194
 id INT PRIMARY KEY
1197
1195
) ENGINE=InnoDB;
1198
1196
 
1199
 
--error ER_CANT_CREATE_TABLE, ER_CANT_CREATE_TABLE
 
1197
--error 1005,1005
1200
1198
CREATE TEMPORARY TABLE t2
1201
1199
(
1202
1200
 id INT NOT NULL PRIMARY KEY,
1250
1248
drop table t1, t2, t3, t4;
1251
1249
 
1252
1250
# these should be refused
1253
 
--error ER_TOO_LONG_KEY
 
1251
--error 1071
1254
1252
create table t1 (col1 varchar(768) primary key)
1255
1253
 engine = innodb;
1256
 
--error ER_TOO_LONG_KEY
 
1254
--error 1071
1257
1255
create table t2 (col1 varbinary(1024) primary key)
1258
1256
 engine = innodb;
1259
 
--error ER_TOO_LONG_KEY
 
1257
--error 1071
1260
1258
create table t3 (col1 text, primary key(col1(768)))
1261
1259
 engine = innodb;
1262
 
--error ER_TOO_LONG_KEY
 
1260
--error 1071
1263
1261
create table t4 (col1 blob, primary key(col1(1024)))
1264
1262
 engine = innodb;
1265
1263
 
1278
1276
 CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
1279
1277
) ENGINE=InnoDB;
1280
1278
 
1281
 
--error ER_NO_REFERENCED_ROW_2
 
1279
--error 1452
1282
1280
INSERT INTO t2 VALUES(2);
1283
1281
 
1284
1282
INSERT INTO t1 VALUES(1);
1285
1283
INSERT INTO t2 VALUES(1);
1286
1284
 
1287
 
--error ER_ROW_IS_REFERENCED_2
 
1285
--error 1451
1288
1286
DELETE FROM t1 WHERE id = 1;
1289
1287
 
1290
 
--error ER_ROW_IS_REFERENCED
 
1288
--error 1217
1291
1289
DROP TABLE t1;
1292
1290
 
1293
1291
SET FOREIGN_KEY_CHECKS=0;
1294
1292
DROP TABLE t1;
1295
1293
SET FOREIGN_KEY_CHECKS=1;
1296
1294
 
1297
 
--error ER_NO_REFERENCED_ROW_2
 
1295
--error 1452
1298
1296
INSERT INTO t2 VALUES(3);
1299
1297
 
1300
1298
DROP TABLE t2;
1306
1304
set foreign_key_checks=0;
1307
1305
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
1308
1306
# Embedded server doesn't chdir to data directory
1309
 
--replace_result $DRIZZLETEST_VARDIR . master-data/ ''
 
1307
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
1310
1308
-- error 1005
1311
1309
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
1312
1310
set foreign_key_checks=1;
1579
1577
#
1580
1578
# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
1581
1579
#
1582
 
--error ER_LOCK_WAIT_TIMEOUT
 
1580
--error 1205
1583
1581
select * from t1 where a = 2 and b = 2 for update;
1584
1582
#
1585
1583
# X-lock to record (1,1),(3,1),(5,1) should not be released in a update
1586
1584
#
1587
 
--error ER_LOCK_WAIT_TIMEOUT
 
1585
--error 1205
1588
1586
connection a;
1589
1587
commit;
1590
1588
connection b;
1714
1712
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
1715
1713
 
1716
1714
connection b;
1717
 
--error ER_LOCK_WAIT_TIMEOUT
 
1715
--error 1205
1718
1716
reap;
1719
1717
 
1720
1718
connection c;
1721
 
--error ER_LOCK_WAIT_TIMEOUT
 
1719
--error 1205
1722
1720
reap;
1723
1721
 
1724
1722
connection d;
1725
 
--error ER_LOCK_WAIT_TIMEOUT
 
1723
--error 1205
1726
1724
reap;
1727
1725
 
1728
1726
connection e;
1729
 
--error ER_LOCK_WAIT_TIMEOUT
 
1727
--error 1205
1730
1728
reap;
1731
1729
 
1732
1730
connection f;
1733
 
--error ER_LOCK_WAIT_TIMEOUT
 
1731
--error 1205
1734
1732
reap;
1735
1733
 
1736
1734
connection g;
1737
 
--error ER_LOCK_WAIT_TIMEOUT
 
1735
--error 1205
1738
1736
reap;
1739
1737
 
1740
1738
connection h;
1741
 
--error ER_LOCK_WAIT_TIMEOUT
 
1739
--error 1205
1742
1740
reap;
1743
1741
 
1744
1742
connection i;
1745
 
--error ER_LOCK_WAIT_TIMEOUT
 
1743
--error 1205
1746
1744
reap;
1747
1745
 
1748
1746
connection j;
1749
 
--error ER_LOCK_WAIT_TIMEOUT
 
1747
--error 1205
1750
1748
reap;
1751
1749
 
1752
1750
connection a;
1766
1764
drop table t1, t2, t3, t5, t6, t8, t9;
1767
1765
 
1768
1766
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
1769
 
--error ER_CANT_CREATE_TABLE,1166
 
1767
--error 1005
1770
1768
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
1771
1769
 
1772
1770
#
1842
1840
# mysqltest first does replace_regex, then replace_result
1843
1841
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
1844
1842
# Embedded server doesn't chdir to data directory
1845
 
--replace_result $DRIZZLETEST_VARDIR . master-data/ ''
1846
 
--error ER_ERROR_ON_RENAME
 
1843
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
 
1844
--error 1025
1847
1845
ALTER TABLE t2 MODIFY a INT NOT NULL;
1848
1846
DELETE FROM t1;
1849
1847
DROP TABLE t2,t1;
1899
1897
SELECT * FROM t1;
1900
1898
DROP TABLE t1;
1901
1899
 
1902
 
SET GLOBAL innodb_lock_wait_timeout=@orig_lock_wait_timeout ;
1903
 
 
1904
 
 
1905
1900
#######################################################################
1906
1901
#                                                                     #
1907
1902
# Please, DO NOT TOUCH this file as well as the innodb.result file.   #