~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/innodb.test

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#######################################################################
13
13
 
14
14
-- source include/have_innodb.inc
 
15
SET @orig_lock_wait_timeout= @@innodb_lock_wait_timeout; 
 
16
SET GLOBAL innodb_lock_wait_timeout=2;
 
17
 
15
18
 
16
19
#
17
20
# Small basic test with ignore
154
157
select n from t1;
155
158
savepoint savept3;
156
159
rollback to savepoint savept2;
157
 
--error 1305
 
160
--error ER_SP_DOES_NOT_EXIST
158
161
rollback to savepoint savept3;
159
162
rollback to savepoint savept2;
160
163
release savepoint `my_savepoint`;
161
164
select n from t1;
 
165
--error 1305
162
166
rollback to savepoint `my_savepoint`;
163
167
rollback to savepoint savept2;
164
168
insert into t1 values (8);
181
184
flush tables with read lock;
182
185
#
183
186
# Current code can't handle a read lock in middle of transaction
184
 
#--error 1223;
 
187
#--error ER_CANT_UPDATE_WITH_READLOCK
185
188
commit;
186
189
unlock tables;
187
190
commit;
537
540
commit;
538
541
drop database mysqltest;
539
542
# Don't check error message
540
 
--error 1049
 
543
--error ER_BAD_DB_ERROR
541
544
show tables from mysqltest;
542
545
 
543
546
#
834
837
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
835
838
insert t2 select * from t1;
836
839
insert t3 select * from t1;
837
 
checksum table t1, t2, t3, t4;
838
 
checksum table t1, t2, t3, t4;
839
 
checksum table t1, t2, t3, t4;
840
840
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
841
841
drop table t1,t2,t3;
842
842
 
869
869
create index id2 on t2 (id);
870
870
show create table t2;
871
871
drop index id2 on t2;
872
 
--error 1025,1025
 
872
--error ER_ERROR_ON_RENAME, ER_ERROR_ON_RENAME
873
873
drop index id on t2;
874
874
show create table t2;
875
875
drop table t2;
923
923
#
924
924
# Bug #6126: Duplicate columns in keys gives misleading error message
925
925
#
926
 
--error 1060
 
926
--error ER_DUP_FIELDNAME
927
927
create table t1 (c char(10), index (c,c)) engine=innodb;
928
 
--error 1060
 
928
--error ER_DUP_FIELDNAME
929
929
create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
930
 
--error 1060
 
930
--error ER_DUP_FIELDNAME
931
931
create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
932
 
--error 1060
 
932
--error ER_DUP_FIELDNAME
933
933
create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
934
934
create table t1 (c1 char(10), c2 char(10)) engine=innodb;
935
 
--error 1060
 
935
--error ER_DUP_FIELDNAME
936
936
alter table t1 add key (c1,c1);
937
 
--error 1060
 
937
--error ER_DUP_FIELDNAME
938
938
alter table t1 add key (c2,c1,c1);
939
 
--error 1060
 
939
--error ER_DUP_FIELDNAME
940
940
alter table t1 add key (c1,c2,c1);
941
 
--error 1060
 
941
--error ER_DUP_FIELDNAME
942
942
alter table t1 add key (c1,c1,c2);
943
943
drop table t1;
944
944
 
1152
1152
drop table t1;
1153
1153
 
1154
1154
#
1155
 
# Test that update does not change internal auto-increment value
1156
 
#
1157
 
 
1158
 
create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;
1159
 
insert into t1 (val) values (1);
1160
 
update t1 set a=2 where a=1;
1161
 
# We should get the following error because InnoDB does not update the counter
1162
 
--error ER_DUP_ENTRY
1163
 
insert into t1 (val) values (1);
1164
 
select * from t1;
1165
 
drop table t1;
1166
 
#
1167
1155
# Bug #10465
1168
1156
#
1169
1157
 
1209
1197
 id INT PRIMARY KEY
1210
1198
) ENGINE=InnoDB;
1211
1199
 
1212
 
--error 1005,1005
 
1200
--error ER_CANT_CREATE_TABLE, ER_CANT_CREATE_TABLE
1213
1201
CREATE TEMPORARY TABLE t2
1214
1202
(
1215
1203
 id INT NOT NULL PRIMARY KEY,
1263
1251
drop table t1, t2, t3, t4;
1264
1252
 
1265
1253
# these should be refused
1266
 
--error 1071
 
1254
--error ER_TOO_LONG_KEY
1267
1255
create table t1 (col1 varchar(768) primary key)
1268
1256
 engine = innodb;
1269
 
--error 1071
1270
 
create table t2 (col1 varbinary(768) primary key)
 
1257
--error ER_TOO_LONG_KEY
 
1258
create table t2 (col1 varbinary(1024) primary key)
1271
1259
 engine = innodb;
1272
 
--error 1071
 
1260
--error ER_TOO_LONG_KEY
1273
1261
create table t3 (col1 text, primary key(col1(768)))
1274
1262
 engine = innodb;
1275
 
--error 1071
1276
 
create table t4 (col1 blob, primary key(col1(768)))
 
1263
--error ER_TOO_LONG_KEY
 
1264
create table t4 (col1 blob, primary key(col1(1024)))
1277
1265
 engine = innodb;
1278
1266
 
1279
1267
#
1291
1279
 CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
1292
1280
) ENGINE=InnoDB;
1293
1281
 
1294
 
--error 1452
 
1282
--error ER_NO_REFERENCED_ROW_2
1295
1283
INSERT INTO t2 VALUES(2);
1296
1284
 
1297
1285
INSERT INTO t1 VALUES(1);
1298
1286
INSERT INTO t2 VALUES(1);
1299
1287
 
1300
 
--error 1451
 
1288
--error ER_ROW_IS_REFERENCED_2
1301
1289
DELETE FROM t1 WHERE id = 1;
1302
1290
 
1303
 
--error 1217
 
1291
--error ER_ROW_IS_REFERENCED
1304
1292
DROP TABLE t1;
1305
1293
 
1306
1294
SET FOREIGN_KEY_CHECKS=0;
1307
1295
DROP TABLE t1;
1308
1296
SET FOREIGN_KEY_CHECKS=1;
1309
1297
 
1310
 
--error 1452
 
1298
--error ER_NO_REFERENCED_ROW_2
1311
1299
INSERT INTO t2 VALUES(3);
1312
1300
 
1313
1301
DROP TABLE t2;
1314
 
#
1315
 
# Test that checksum table uses a consistent read Bug #12669
1316
 
#
1317
 
connect (a,localhost,root,,);
1318
 
connect (b,localhost,root,,);
1319
 
connection a;
1320
 
create table t1(a int not null) engine=innodb;
1321
 
insert into t1 values (1),(2);
1322
 
set autocommit=0;
1323
 
checksum table t1;
1324
 
connection b;
1325
 
insert into t1 values(3);
1326
 
connection a;
1327
 
#
1328
 
# Here checksum should not see insert
1329
 
#
1330
 
checksum table t1;
1331
 
connection a;
1332
 
commit;
1333
 
checksum table t1;
1334
 
commit;
1335
 
drop table t1;
1336
 
#
1337
 
# autocommit = 1
1338
 
#
1339
 
connection a;
1340
 
create table t1(a int not null) engine=innodb;
1341
 
insert into t1 values (1),(2);
1342
 
set autocommit=1;
1343
 
checksum table t1;
1344
 
connection b;
1345
 
set autocommit=1;
1346
 
insert into t1 values(3);
1347
 
connection a;
1348
 
#
1349
 
# Here checksum sees insert
1350
 
#
1351
 
checksum table t1;
1352
 
drop table t1;
1353
 
 
1354
 
connection default;
1355
 
disconnect a;
1356
 
disconnect b;
1357
1302
 
1358
1303
# tests for bugs #9802 and #13778
1359
1304
 
1420
1365
                 b varchar(255),
1421
1366
                 c varchar(255),
1422
1367
                 d varchar(255),
1423
 
                 key (a,b,c,d)) engine=innodb;
 
1368
                 key (a(200),b(200),c(200),d(200))) engine=innodb;
1424
1369
drop table t1;
1425
1370
--error ER_TOO_LONG_KEY
1426
1371
create table t1 (a varchar(255),
1635
1580
#
1636
1581
# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
1637
1582
#
1638
 
--error 1205
 
1583
--error ER_LOCK_WAIT_TIMEOUT
1639
1584
select * from t1 where a = 2 and b = 2 for update;
1640
1585
#
1641
1586
# X-lock to record (1,1),(3,1),(5,1) should not be released in a update
1642
1587
#
1643
 
--error 1205
 
1588
--error ER_LOCK_WAIT_TIMEOUT
1644
1589
connection a;
1645
1590
commit;
1646
1591
connection b;
1770
1715
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
1771
1716
 
1772
1717
connection b;
1773
 
--error 1205
 
1718
--error ER_LOCK_WAIT_TIMEOUT
1774
1719
reap;
1775
1720
 
1776
1721
connection c;
1777
 
--error 1205
 
1722
--error ER_LOCK_WAIT_TIMEOUT
1778
1723
reap;
1779
1724
 
1780
1725
connection d;
1781
 
--error 1205
 
1726
--error ER_LOCK_WAIT_TIMEOUT
1782
1727
reap;
1783
1728
 
1784
1729
connection e;
1785
 
--error 1205
 
1730
--error ER_LOCK_WAIT_TIMEOUT
1786
1731
reap;
1787
1732
 
1788
1733
connection f;
1789
 
--error 1205
 
1734
--error ER_LOCK_WAIT_TIMEOUT
1790
1735
reap;
1791
1736
 
1792
1737
connection g;
1793
 
--error 1205
 
1738
--error ER_LOCK_WAIT_TIMEOUT
1794
1739
reap;
1795
1740
 
1796
1741
connection h;
1797
 
--error 1205
 
1742
--error ER_LOCK_WAIT_TIMEOUT
1798
1743
reap;
1799
1744
 
1800
1745
connection i;
1801
 
--error 1205
 
1746
--error ER_LOCK_WAIT_TIMEOUT
1802
1747
reap;
1803
1748
 
1804
1749
connection j;
1805
 
--error 1205
 
1750
--error ER_LOCK_WAIT_TIMEOUT
1806
1751
reap;
1807
1752
 
1808
1753
connection a;
1822
1767
drop table t1, t2, t3, t5, t6, t8, t9;
1823
1768
 
1824
1769
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
1825
 
--error 1005
 
1770
--error ER_CANT_CREATE_TABLE
1826
1771
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
1827
1772
 
1828
1773
#
1899
1844
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
1900
1845
# Embedded server doesn't chdir to data directory
1901
1846
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
1902
 
--error 1025
 
1847
--error ER_ERROR_ON_RENAME
1903
1848
ALTER TABLE t2 MODIFY a INT NOT NULL;
1904
1849
DELETE FROM t1;
1905
1850
DROP TABLE t2,t1;
1955
1900
SELECT * FROM t1;
1956
1901
DROP TABLE t1;
1957
1902
 
 
1903
SET GLOBAL innodb_lock_wait_timeout=@orig_lock_wait_timeout ;
 
1904
 
 
1905
 
1958
1906
#######################################################################
1959
1907
#                                                                     #
1960
1908
# Please, DO NOT TOUCH this file as well as the innodb.result file.   #