~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/innodb.test

  • Committer: Monty Taylor
  • Date: 2010-08-27 15:35:00 UTC
  • mto: (1758.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1759.
  • Revision ID: mordred@inaugust.com-20100827153500-ljbs9nqp9e49li87
Added sphinx infrastructure

Show diffs side-by-side

added added

removed removed

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