~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/tests/t/innodb.test

edit

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
update t1 set parent_id=parent_id+100;
55
55
select * from t1 where parent_id=102;
56
56
update t1 set id=id+1000;
57
 
--error ER_DUP_ENTRY, ER_DUP_KEY
 
57
-- error ER_DUP_ENTRY,1022
58
58
update t1 set id=1024 where id=1009; 
59
59
select * from t1;
60
60
update ignore t1 set id=id+1; # This will change all rows
135
135
select n, "after commit" from t1;
136
136
commit;
137
137
insert into t1 values (5);
138
 
--error ER_DUP_ENTRY
 
138
-- error ER_DUP_ENTRY
139
139
insert into t1 values (4);
140
140
commit;
141
141
select n, "after commit" from t1;
142
142
set autocommit=1;
143
143
insert into t1 values (6);
144
 
--error ER_DUP_ENTRY
 
144
-- error ER_DUP_ENTRY
145
145
insert into t1 values (4);
146
146
select n from t1;
147
147
set autocommit=0;
161
161
rollback to savepoint savept2;
162
162
release savepoint `my_savepoint`;
163
163
select n from t1;
164
 
--error ER_SP_DOES_NOT_EXIST
 
164
--error 1305
165
165
rollback to savepoint `my_savepoint`;
166
166
rollback to savepoint savept2;
167
167
insert into t1 values (8);
214
214
 
215
215
CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb;
216
216
insert into t1 values ('pippo', 12);
217
 
--error ER_DUP_ENTRY
 
217
-- error ER_DUP_ENTRY
218
218
insert into t1 values ('pippo', 12); # Gives error
219
219
delete from t1;
220
220
delete from t1 where id = 'pippo';
228
228
delete from t1;
229
229
commit;
230
230
select * from t1;
231
 
commit;
232
231
drop table t1;
233
232
 
234
233
#
236
235
#
237
236
 
238
237
create table t1 (a integer) engine=innodb;
 
238
start transaction;
239
239
rename table t1 to t2;
240
240
create table t1 (b integer) engine=innodb;
241
 
start transaction;
242
241
insert into t1 values (1);
243
242
rollback;
244
243
drop table t1;
261
260
COMMIT;
262
261
SELECT * FROM t1;
263
262
SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk';
264
 
COMMIT;
265
263
drop table t1;
266
264
set autocommit=1;
267
265
 
551
549
set autocommit=0;
552
550
create table t1 (a int not null) engine= innodb;
553
551
insert into t1 values(1),(2);
554
 
commit;
555
552
truncate table t1;
556
553
commit;
557
554
truncate table t1;
782
779
        foreign key(pid) references t1(id) on delete cascade) engine=innodb;
783
780
insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
784
781
        (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
785
 
--error ER_ROW_IS_REFERENCED_2
 
782
-- error 1451
786
783
delete from t1 where id=0;
787
784
delete from t1 where id=15;
788
785
delete from t1 where id=0;
1314
1311
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
1315
1312
# Embedded server doesn't chdir to data directory
1316
1313
--replace_result $DRIZZLETEST_VARDIR . master-data/ ''
1317
 
--error ER_CANT_CREATE_TABLE
 
1314
-- error 1005
1318
1315
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
1319
1316
set foreign_key_checks=1;
1320
1317
drop table t2;
1324
1321
set foreign_key_checks=0;
1325
1322
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
1326
1323
create table t1(a varchar(10) primary key) engine = innodb;
1327
 
--error ER_ERROR_ON_RENAME, ER_ERROR_ON_RENAME
 
1324
-- error 1025,1025
1328
1325
alter table t1 modify column a int;
1329
1326
set foreign_key_checks=1;
1330
1327
drop table t2,t1;
1338
1335
 
1339
1336
insert into t1 values(1);
1340
1337
insert into t3 values(1);
1341
 
--error ER_NO_REFERENCED_ROW_2
 
1338
-- error 1452
1342
1339
insert into t2 values(2);
1343
 
--error ER_NO_REFERENCED_ROW_2
 
1340
-- error 1452
1344
1341
insert into t4 values(2);
1345
1342
insert into t2 values(1);
1346
1343
insert into t4 values(1);
1347
 
--error ER_ROW_IS_REFERENCED_2
 
1344
-- error 1451
1348
1345
update t1 set a=2;
1349
 
--error ER_NO_REFERENCED_ROW_2
 
1346
-- error 1452
1350
1347
update t2 set a=2;
1351
 
--error ER_ROW_IS_REFERENCED_2
 
1348
-- error 1451
1352
1349
update t3 set a=2;
1353
 
--error ER_NO_REFERENCED_ROW_2
 
1350
-- error 1452
1354
1351
update t4 set a=2;
1355
 
--error ER_ROW_IS_REFERENCED_2
 
1352
-- error 1451
1356
1353
truncate t1;
1357
 
--error ER_ROW_IS_REFERENCED_2
 
1354
-- error 1451
1358
1355
truncate t3;
1359
1356
truncate t2;
1360
1357
truncate t4;
1389
1386
create table t4 (s1 char(2) ,primary key (s1)) engine=innodb;
1390
1387
 
1391
1388
insert into t1 values (0x41),(0x4120),(0x4100);
1392
 
--error ER_DUP_ENTRY
 
1389
-- error ER_DUP_ENTRY
1393
1390
insert into t3 values (0x41),(0x4120),(0x4100);
1394
1391
insert into t3 values (0x41),(0x4100);
1395
 
--error ER_DUP_ENTRY
 
1392
-- error ER_DUP_ENTRY
1396
1393
insert into t4 values (0x41),(0x4120),(0x4100);
1397
1394
insert into t4 values (0x41),(0x4100);
1398
1395
select hex(s1) from t1;
1407
1404
insert into t2 values(0x42);
1408
1405
insert into t2 values(0x41);
1409
1406
select hex(s1) from t2;
1410
 
--error ER_ROW_IS_REFERENCED_2
 
1407
-- error 1451
1411
1408
update t1 set s1=0x123456 where a=2;
1412
1409
select hex(s1) from t2;
1413
1410
update t1 set s1=0x12 where a=1;
1414
 
--error ER_DATA_TOO_LONG
 
1411
-- error 1406
1415
1412
update t1 set s1=0x12345678 where a=1;
1416
1413
update t1 set s1=0x123457 where a=1;
1417
1414
update t1 set s1=0x1220 where a=1;
1422
1419
select hex(s1) from t2;
1423
1420
delete from t1 where a=1;
1424
1421
update t2 set s1=0x4120;
1425
 
--error ER_ROW_IS_REFERENCED_2
 
1422
-- error 1451
1426
1423
delete from t1;
1427
1424
delete from t1 where a!=3;
1428
1425
select a,hex(s1) from t1;
1441
1438
update t1 set s1=0x12 where a=2;
1442
1439
select hex(s1) from t2;
1443
1440
delete from t1 where a=1;
1444
 
--error ER_ROW_IS_REFERENCED_2
 
1441
-- error 1451
1445
1442
delete from t1 where a=2;
1446
1443
select a,hex(s1) from t1;
1447
1444
select hex(s1) from t2;
1623
1620
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
1624
1621
insert into t1 select * from t2;
1625
1622
update t1 set b = (select e from t2 where a = d);
1626
 
commit;
1627
1623
create table t3(d int not null, e int, primary key(d)) engine=innodb
1628
1624
select * from t2;
1629
1625
commit;
1774
1770
drop table t1, t2, t3, t5, t6, t8, t9;
1775
1771
 
1776
1772
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
1777
 
--error ER_CANT_CREATE_TABLE, ER_WRONG_COLUMN_NAME
 
1773
--error ER_CANT_CREATE_TABLE,1166
1778
1774
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
1779
1775
 
1780
1776
#
1818
1814
CREATE TABLE t1 ( a int ) ENGINE=innodb;
1819
1815
BEGIN;
1820
1816
INSERT INTO t1 VALUES (1);
1821
 
COMMIT;
1822
1817
ALTER TABLE t1 ENGINE=innodb;
1823
1818
DROP TABLE t1;
1824
1819