~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Date: 2010-11-03 03:28:23 UTC
  • mto: (1902.1.1 build) (1910.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1903.
  • Revision ID: stewart@flamingspork.com-20101103032823-44k21f0njmk97omr
fix docs warning: Title underline (and overline) is too short in brief_history_of_drizzle.rst

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
 
54
55
update t1 set parent_id=parent_id+100;
55
56
select * from t1 where parent_id=102;
56
57
update t1 set id=id+1000;
57
 
--error ER_DUP_ENTRY, ER_DUP_KEY
 
58
-- error ER_DUP_ENTRY,1022
58
59
update t1 set id=1024 where id=1009; 
59
60
select * from t1;
60
61
update ignore t1 set id=id+1; # This will change all rows
135
136
select n, "after commit" from t1;
136
137
commit;
137
138
insert into t1 values (5);
138
 
--error ER_DUP_ENTRY
 
139
-- error ER_DUP_ENTRY
139
140
insert into t1 values (4);
140
141
commit;
141
142
select n, "after commit" from t1;
142
143
set autocommit=1;
143
144
insert into t1 values (6);
144
 
--error ER_DUP_ENTRY
 
145
-- error ER_DUP_ENTRY
145
146
insert into t1 values (4);
146
147
select n from t1;
147
148
set autocommit=0;
161
162
rollback to savepoint savept2;
162
163
release savepoint `my_savepoint`;
163
164
select n from t1;
164
 
--error ER_SP_DOES_NOT_EXIST
 
165
--error 1305
165
166
rollback to savepoint `my_savepoint`;
166
167
rollback to savepoint savept2;
167
168
insert into t1 values (8);
214
215
 
215
216
CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb;
216
217
insert into t1 values ('pippo', 12);
217
 
--error ER_DUP_ENTRY
 
218
-- error ER_DUP_ENTRY
218
219
insert into t1 values ('pippo', 12); # Gives error
219
220
delete from t1;
220
221
delete from t1 where id = 'pippo';
228
229
delete from t1;
229
230
commit;
230
231
select * from t1;
231
 
commit;
232
232
drop table t1;
233
233
 
234
234
#
236
236
#
237
237
 
238
238
create table t1 (a integer) engine=innodb;
 
239
start transaction;
239
240
rename table t1 to t2;
240
241
create table t1 (b integer) engine=innodb;
241
 
start transaction;
242
242
insert into t1 values (1);
243
243
rollback;
244
244
drop table t1;
261
261
COMMIT;
262
262
SELECT * FROM t1;
263
263
SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk';
264
 
COMMIT;
265
264
drop table t1;
266
265
set autocommit=1;
267
266
 
306
305
select * from t1;
307
306
update t1 set col2='7' where col1='4';
308
307
select * from t1;
309
 
ALTER TABLE t1 ADD co3 INT DEFAULT 42 NOT NULL;
 
308
alter table t1 add co3 int not null;
310
309
select * from t1;
311
310
update t1 set col2='9' where col1='2';
312
311
select * from t1;
551
550
set autocommit=0;
552
551
create table t1 (a int not null) engine= innodb;
553
552
insert into t1 values(1),(2);
554
 
commit;
555
553
truncate table t1;
556
554
commit;
557
555
truncate table t1;
782
780
        foreign key(pid) references t1(id) on delete cascade) engine=innodb;
783
781
insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
784
782
        (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
785
 
--error ER_ROW_IS_REFERENCED_2
 
783
-- error 1451
786
784
delete from t1 where id=0;
787
785
delete from t1 where id=15;
788
786
delete from t1 where id=0;
1054
1052
show status like "Innodb_row_lock_time_avg";
1055
1053
 
1056
1054
# Test for innodb_sync_spin_loops variable
1057
 
set @my_innodb_sync_spin_loops = @@global.innodb_sync_spin_loops;
1058
1055
show variables like "innodb_sync_spin_loops";
1059
1056
set global innodb_sync_spin_loops=1000;
1060
1057
show variables like "innodb_sync_spin_loops";
1062
1059
show variables like "innodb_sync_spin_loops";
1063
1060
set global innodb_sync_spin_loops=20;
1064
1061
show variables like "innodb_sync_spin_loops";
1065
 
set @@global.innodb_sync_spin_loops = @my_innodb_sync_spin_loops;
1066
1062
 
1067
1063
# Test for innodb_thread_concurrency variable
1068
 
set @my_innodb_thread_concurrency = @@global.innodb_thread_concurrency;
1069
1064
show variables like "innodb_thread_concurrency";
1070
1065
set global innodb_thread_concurrency=1001;
1071
1066
show variables like "innodb_thread_concurrency";
1073
1068
show variables like "innodb_thread_concurrency";
1074
1069
set global innodb_thread_concurrency=16;
1075
1070
show variables like "innodb_thread_concurrency";
1076
 
set @@global.innodb_thread_concurrency = @my_innodb_thread_concurrency;
1077
1071
 
1078
1072
# Test for innodb_concurrency_tickets variable
1079
1073
show variables like "innodb_concurrency_tickets";
1314
1308
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
1315
1309
# Embedded server doesn't chdir to data directory
1316
1310
--replace_result $DRIZZLETEST_VARDIR . master-data/ ''
1317
 
--error ER_CANT_CREATE_TABLE
 
1311
-- error 1005
1318
1312
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
1319
1313
set foreign_key_checks=1;
1320
1314
drop table t2;
1324
1318
set foreign_key_checks=0;
1325
1319
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
1326
1320
create table t1(a varchar(10) primary key) engine = innodb;
1327
 
--error ER_ERROR_ON_RENAME, ER_ERROR_ON_RENAME
 
1321
-- error 1025,1025
1328
1322
alter table t1 modify column a int;
1329
1323
set foreign_key_checks=1;
1330
1324
drop table t2,t1;
1338
1332
 
1339
1333
insert into t1 values(1);
1340
1334
insert into t3 values(1);
1341
 
--error ER_NO_REFERENCED_ROW_2
 
1335
-- error 1452
1342
1336
insert into t2 values(2);
1343
 
--error ER_NO_REFERENCED_ROW_2
 
1337
-- error 1452
1344
1338
insert into t4 values(2);
1345
1339
insert into t2 values(1);
1346
1340
insert into t4 values(1);
1347
 
--error ER_ROW_IS_REFERENCED_2
 
1341
-- error 1451
1348
1342
update t1 set a=2;
1349
 
--error ER_NO_REFERENCED_ROW_2
 
1343
-- error 1452
1350
1344
update t2 set a=2;
1351
 
--error ER_ROW_IS_REFERENCED_2
 
1345
-- error 1451
1352
1346
update t3 set a=2;
1353
 
--error ER_NO_REFERENCED_ROW_2
 
1347
-- error 1452
1354
1348
update t4 set a=2;
1355
 
--error ER_ROW_IS_REFERENCED_2
 
1349
-- error 1451
1356
1350
truncate t1;
1357
 
--error ER_ROW_IS_REFERENCED_2
 
1351
-- error 1451
1358
1352
truncate t3;
1359
1353
truncate t2;
1360
1354
truncate t4;
1389
1383
create table t4 (s1 char(2) ,primary key (s1)) engine=innodb;
1390
1384
 
1391
1385
insert into t1 values (0x41),(0x4120),(0x4100);
1392
 
--error ER_DUP_ENTRY
 
1386
-- error ER_DUP_ENTRY
1393
1387
insert into t3 values (0x41),(0x4120),(0x4100);
1394
1388
insert into t3 values (0x41),(0x4100);
1395
 
--error ER_DUP_ENTRY
 
1389
-- error ER_DUP_ENTRY
1396
1390
insert into t4 values (0x41),(0x4120),(0x4100);
1397
1391
insert into t4 values (0x41),(0x4100);
1398
1392
select hex(s1) from t1;
1407
1401
insert into t2 values(0x42);
1408
1402
insert into t2 values(0x41);
1409
1403
select hex(s1) from t2;
1410
 
--error ER_ROW_IS_REFERENCED_2
 
1404
-- error 1451
1411
1405
update t1 set s1=0x123456 where a=2;
1412
1406
select hex(s1) from t2;
1413
1407
update t1 set s1=0x12 where a=1;
1414
 
--error ER_DATA_TOO_LONG
 
1408
-- error 1406
1415
1409
update t1 set s1=0x12345678 where a=1;
1416
1410
update t1 set s1=0x123457 where a=1;
1417
1411
update t1 set s1=0x1220 where a=1;
1422
1416
select hex(s1) from t2;
1423
1417
delete from t1 where a=1;
1424
1418
update t2 set s1=0x4120;
1425
 
--error ER_ROW_IS_REFERENCED_2
 
1419
-- error 1451
1426
1420
delete from t1;
1427
1421
delete from t1 where a!=3;
1428
1422
select a,hex(s1) from t1;
1441
1435
update t1 set s1=0x12 where a=2;
1442
1436
select hex(s1) from t2;
1443
1437
delete from t1 where a=1;
1444
 
--error ER_ROW_IS_REFERENCED_2
 
1438
-- error 1451
1445
1439
delete from t1 where a=2;
1446
1440
select a,hex(s1) from t1;
1447
1441
select hex(s1) from t2;
1623
1617
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
1624
1618
insert into t1 select * from t2;
1625
1619
update t1 set b = (select e from t2 where a = d);
1626
 
commit;
1627
1620
create table t3(d int not null, e int, primary key(d)) engine=innodb
1628
1621
select * from t2;
1629
1622
commit;
1774
1767
drop table t1, t2, t3, t5, t6, t8, t9;
1775
1768
 
1776
1769
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
1777
 
--error ER_CANT_CREATE_TABLE, ER_WRONG_COLUMN_NAME
 
1770
--error ER_CANT_CREATE_TABLE,1166
1778
1771
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
1779
1772
 
1780
1773
#
1818
1811
CREATE TABLE t1 ( a int ) ENGINE=innodb;
1819
1812
BEGIN;
1820
1813
INSERT INTO t1 VALUES (1);
1821
 
COMMIT;
1822
1814
ALTER TABLE t1 ENGINE=innodb;
1823
1815
DROP TABLE t1;
1824
1816