~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-12-25 00:28:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2031.
  • Revision ID: brian@tangent.org-20101225002849-g73mg6ihulajis0o
First pass in refactoring of the name of my_decimal.

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;
1054
1051
show status like "Innodb_row_lock_time_avg";
1055
1052
 
1056
1053
# Test for innodb_sync_spin_loops variable
1057
 
set @my_innodb_sync_spin_loops = @@global.innodb_sync_spin_loops;
1058
1054
show variables like "innodb_sync_spin_loops";
1059
1055
set global innodb_sync_spin_loops=1000;
1060
1056
show variables like "innodb_sync_spin_loops";
1062
1058
show variables like "innodb_sync_spin_loops";
1063
1059
set global innodb_sync_spin_loops=20;
1064
1060
show variables like "innodb_sync_spin_loops";
1065
 
set @@global.innodb_sync_spin_loops = @my_innodb_sync_spin_loops;
1066
1061
 
1067
1062
# Test for innodb_thread_concurrency variable
1068
 
set @my_innodb_thread_concurrency = @@global.innodb_thread_concurrency;
1069
1063
show variables like "innodb_thread_concurrency";
1070
1064
set global innodb_thread_concurrency=1001;
1071
1065
show variables like "innodb_thread_concurrency";
1073
1067
show variables like "innodb_thread_concurrency";
1074
1068
set global innodb_thread_concurrency=16;
1075
1069
show variables like "innodb_thread_concurrency";
1076
 
set @@global.innodb_thread_concurrency = @my_innodb_thread_concurrency;
1077
1070
 
1078
1071
# Test for innodb_concurrency_tickets variable
1079
1072
show variables like "innodb_concurrency_tickets";
1314
1307
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
1315
1308
# Embedded server doesn't chdir to data directory
1316
1309
--replace_result $DRIZZLETEST_VARDIR . master-data/ ''
1317
 
--error ER_CANT_CREATE_TABLE
 
1310
-- error 1005
1318
1311
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
1319
1312
set foreign_key_checks=1;
1320
1313
drop table t2;
1324
1317
set foreign_key_checks=0;
1325
1318
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
1326
1319
create table t1(a varchar(10) primary key) engine = innodb;
1327
 
--error ER_ERROR_ON_RENAME, ER_ERROR_ON_RENAME
 
1320
-- error 1025,1025
1328
1321
alter table t1 modify column a int;
1329
1322
set foreign_key_checks=1;
1330
1323
drop table t2,t1;
1338
1331
 
1339
1332
insert into t1 values(1);
1340
1333
insert into t3 values(1);
1341
 
--error ER_NO_REFERENCED_ROW_2
 
1334
-- error 1452
1342
1335
insert into t2 values(2);
1343
 
--error ER_NO_REFERENCED_ROW_2
 
1336
-- error 1452
1344
1337
insert into t4 values(2);
1345
1338
insert into t2 values(1);
1346
1339
insert into t4 values(1);
1347
 
--error ER_ROW_IS_REFERENCED_2
 
1340
-- error 1451
1348
1341
update t1 set a=2;
1349
 
--error ER_NO_REFERENCED_ROW_2
 
1342
-- error 1452
1350
1343
update t2 set a=2;
1351
 
--error ER_ROW_IS_REFERENCED_2
 
1344
-- error 1451
1352
1345
update t3 set a=2;
1353
 
--error ER_NO_REFERENCED_ROW_2
 
1346
-- error 1452
1354
1347
update t4 set a=2;
1355
 
--error ER_ROW_IS_REFERENCED_2
 
1348
-- error 1451
1356
1349
truncate t1;
1357
 
--error ER_ROW_IS_REFERENCED_2
 
1350
-- error 1451
1358
1351
truncate t3;
1359
1352
truncate t2;
1360
1353
truncate t4;
1389
1382
create table t4 (s1 char(2) ,primary key (s1)) engine=innodb;
1390
1383
 
1391
1384
insert into t1 values (0x41),(0x4120),(0x4100);
1392
 
--error ER_DUP_ENTRY
 
1385
-- error ER_DUP_ENTRY
1393
1386
insert into t3 values (0x41),(0x4120),(0x4100);
1394
1387
insert into t3 values (0x41),(0x4100);
1395
 
--error ER_DUP_ENTRY
 
1388
-- error ER_DUP_ENTRY
1396
1389
insert into t4 values (0x41),(0x4120),(0x4100);
1397
1390
insert into t4 values (0x41),(0x4100);
1398
1391
select hex(s1) from t1;
1407
1400
insert into t2 values(0x42);
1408
1401
insert into t2 values(0x41);
1409
1402
select hex(s1) from t2;
1410
 
--error ER_ROW_IS_REFERENCED_2
 
1403
-- error 1451
1411
1404
update t1 set s1=0x123456 where a=2;
1412
1405
select hex(s1) from t2;
1413
1406
update t1 set s1=0x12 where a=1;
1414
 
--error ER_DATA_TOO_LONG
 
1407
-- error 1406
1415
1408
update t1 set s1=0x12345678 where a=1;
1416
1409
update t1 set s1=0x123457 where a=1;
1417
1410
update t1 set s1=0x1220 where a=1;
1422
1415
select hex(s1) from t2;
1423
1416
delete from t1 where a=1;
1424
1417
update t2 set s1=0x4120;
1425
 
--error ER_ROW_IS_REFERENCED_2
 
1418
-- error 1451
1426
1419
delete from t1;
1427
1420
delete from t1 where a!=3;
1428
1421
select a,hex(s1) from t1;
1441
1434
update t1 set s1=0x12 where a=2;
1442
1435
select hex(s1) from t2;
1443
1436
delete from t1 where a=1;
1444
 
--error ER_ROW_IS_REFERENCED_2
 
1437
-- error 1451
1445
1438
delete from t1 where a=2;
1446
1439
select a,hex(s1) from t1;
1447
1440
select hex(s1) from t2;
1623
1616
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
1624
1617
insert into t1 select * from t2;
1625
1618
update t1 set b = (select e from t2 where a = d);
1626
 
commit;
1627
1619
create table t3(d int not null, e int, primary key(d)) engine=innodb
1628
1620
select * from t2;
1629
1621
commit;
1774
1766
drop table t1, t2, t3, t5, t6, t8, t9;
1775
1767
 
1776
1768
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
1777
 
--error ER_CANT_CREATE_TABLE, ER_WRONG_COLUMN_NAME
 
1769
--error ER_CANT_CREATE_TABLE,1166
1778
1770
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
1779
1771
 
1780
1772
#
1818
1810
CREATE TABLE t1 ( a int ) ENGINE=innodb;
1819
1811
BEGIN;
1820
1812
INSERT INTO t1 VALUES (1);
1821
 
COMMIT;
1822
1813
ALTER TABLE t1 ENGINE=innodb;
1823
1814
DROP TABLE t1;
1824
1815