~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/include/mix2.inc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
update t1 set parent_id=parent_id+100;
97
97
select * from t1 where parent_id=102;
98
98
update t1 set id=id+1000;
 
99
--error ER_DUP_ENTRY,  ER_DUP_KEY
99
100
update t1 set id=1024 where id=1009;
100
101
select * from t1;
101
102
update ignore t1 set id=id+1; # This will change all rows
179
179
select n, "after commit" from t1;
180
180
commit;
181
181
insert into t1 values (5);
 
182
--error ER_DUP_ENTRY
182
183
insert into t1 values (4);
183
184
commit;
184
185
select n, "after commit" from t1;
185
186
set autocommit=1;
186
187
insert into t1 values (6);
 
188
--error ER_DUP_ENTRY
187
189
insert into t1 values (4);
188
190
select n from t1;
189
191
set autocommit=0;
200
200
select n from t1;
201
201
savepoint savept3;
202
202
rollback to savepoint savept2;
203
 
--error 1305
 
203
--error ER_SP_DOES_NOT_EXIST
204
204
rollback to savepoint savept3;
205
205
rollback to savepoint savept2;
206
206
release savepoint `my_savepoint`;
207
207
select n from t1;
 
208
--error ER_SP_DOES_NOT_EXIST
208
209
rollback to savepoint `my_savepoint`;
209
 
--error 1305
 
210
--error ER_SP_DOES_NOT_EXIST
210
211
rollback to savepoint savept2;
211
212
insert into t1 values (8);
212
213
savepoint sv;
259
259
 
260
260
eval create $temp table t1 (id char(8) not null primary key, val int not null) engine=$engine_type;
261
261
insert into t1 values ('pippo', 12);
 
262
--error ER_DUP_ENTRY
262
263
insert into t1 values ('pippo', 12); # Gives error
263
264
delete from t1;
264
265
delete from t1 where id = 'pippo';
352
352
select * from t1;
353
353
update t1 set col2='7' where col1='4';
354
354
select * from t1;
355
 
alter table t1 add co3 int not null;
 
355
alter table t1 add co3 int DEFAULT 42 not null;
356
356
select * from t1;
357
357
update t1 set col2='9' where col1='2';
358
358
select * from t1;
390
390
 
391
391
insert into t1 (ggid,passwd) values ('test1','xxx');
392
392
insert into t1 (ggid,passwd) values ('test2','yyy');
 
393
--error ER_DUP_ENTRY
393
394
insert into t1 (ggid,passwd) values ('test2','this will fail');
 
395
--error ER_DUP_ENTRY
394
396
insert into t1 (ggid,id) values ('this will fail',1);
395
397
 
396
398
select * from t1 where ggid='test1';
401
401
 
402
402
replace into t1 (ggid,id) values ('this will work',1);
403
403
replace into t1 (ggid,passwd) values ('test2','this will work');
 
404
--error ER_DUP_ENTRY
404
405
update t1 set id=100,ggid='test2' where id=1;
405
406
select * from t1;
406
407
select * from t1 where id=1;
625
625
commit;
626
626
drop database mysqltest;
627
627
# Don't check error message
628
 
--error 1049
 
628
--error ER_BAD_DB_ERROR
629
629
show tables from mysqltest;
630
630
 
631
631
#
635
635
set autocommit=0;
636
636
eval create $temp table t1 (a int not null) engine= $engine_type;
637
637
insert into t1 values(1),(2);
 
638
commit;
638
639
truncate table t1;
639
640
commit;
640
641
truncate table t1;
894
895
insert into `t2`values ( 1 ) ;
895
896
eval create $temp table `t3` (`id` int not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = $engine_type;
896
897
insert into `t3`values ( 1 ) ;
897
 
--error 1451
 
898
--error ER_ROW_IS_REFERENCED_2
898
899
delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
899
 
--error 1451
 
900
--error ER_ROW_IS_REFERENCED_2
900
901
update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
901
 
--error 1054
 
902
--error ER_BAD_FIELD_ERROR
902
903
update t3 set  t3.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
903
904
drop table t3,t2,t1;
904
905
 
912
913
        foreign key(pid) references t1(id) on delete cascade) engine=$engine_type;
913
914
insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
914
915
        (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
 
916
--error ER_ROW_IS_REFERENCED_2
915
917
delete from t1 where id=0;
916
918
delete from t1 where id=15;
917
919
delete from t1 where id=0;
929
930
eval create $temp table t2 (col1 int,stamp TIMESTAMP,INDEX stamp_idx
930
931
(stamp))ENGINE=$engine_type;
931
932
insert into t1 values (1),(2),(3);
932
 
# Note that timestamp 3 is wrong
933
 
--error 1685 # Bad timestamp
934
 
insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
935
 
SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp <
936
 
'20020204120000' GROUP BY col1;
 
933
insert into t2 values (1, 20020204130000);
 
934
insert into t2 values (2, 20020204130000);
 
935
--error ER_INVALID_TIMESTAMP_VALUE # Bad timestamp
 
936
insert into t2 values (4, 20020204310000);
 
937
insert into t2 values (5, 20020204230000);
 
938
SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp < '20020204120000' GROUP BY col1;
937
939
drop table t1,t2;
938
940
 
939
941
#
1009
1011
# Bug#2160: Extra error message for create $temp table LIKE with InnoDB
1010
1012
#
1011
1013
eval create $temp table t1 (a int) engine=$engine_type;
1012
 
--error 1005
 
1014
--error ER_CANT_CREATE_TABLE
1013
1015
create table t2 like t1;
1014
1016
create table t2 like t1 engine=innodb;
1015
1017
show create table t2;
1030
1032
create index id2 on t2 (id);
1031
1033
show create table t2;
1032
1034
drop index id2 on t2;
1033
 
--error 1025,1025
 
1035
--error ER_ERROR_ON_RENAME, ER_ERROR_ON_RENAME
1034
1036
drop index id on t2;
1035
1037
show create table t2;
1036
1038
drop table t2;
1069
1071
# Clean up filename -- embedded server reports whole path without .frm,
1070
1072
# regular server reports relative path with .frm (argh!)
1071
1073
--replace_result \\ / $DRIZZLE_TEST_DIR . /var/master-data/ / t2.frm t2
1072
 
--error 1005
 
1074
--error ER_CANT_CREATE_TABLE
1073
1075
eval create $temp table t2 (id int not null, id2 int not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = $engine_type;
1074
1076
 
1075
1077
# bug#3749
1122
1124
#
1123
1125
# Bug #6126: Duplicate columns in keys gives misleading error message
1124
1126
#
1125
 
--error 1060
 
1127
--error ER_DUP_FIELDNAME
1126
1128
eval create $temp table t1 (c char(10), index (c,c)) engine=$engine_type;
1127
 
--error 1060
 
1129
--error ER_DUP_FIELDNAME
1128
1130
eval create $temp table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=$engine_type;
1129
 
--error 1060
 
1131
--error ER_DUP_FIELDNAME
1130
1132
eval create $temp table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=$engine_type;
1131
 
--error 1060
 
1133
--error ER_DUP_FIELDNAME
1132
1134
eval create $temp table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=$engine_type;
1133
1135
eval create $temp table t1 (c1 char(10), c2 char(10)) engine=$engine_type;
1134
 
--error 1060
 
1136
--error ER_DUP_FIELDNAME
1135
1137
alter table t1 add key (c1,c1);
1136
 
--error 1060
 
1138
--error ER_DUP_FIELDNAME
1137
1139
alter table t1 add key (c2,c1,c1);
1138
 
--error 1060
 
1140
--error ER_DUP_FIELDNAME
1139
1141
alter table t1 add key (c1,c2,c1);
1140
 
--error 1060
 
1142
--error ER_DUP_FIELDNAME
1141
1143
alter table t1 add key (c1,c1,c2);
1142
1144
drop table t1;
1143
1145
 
1158
1160
#
1159
1161
 
1160
1162
eval create $temp table t1 ( a char(10) ) ENGINE=$engine_type;
1161
 
--error 1214
 
1163
--error ER_TABLE_CANT_HANDLE_FT
1162
1164
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
1163
1165
DROP TABLE t1;
1164
1166
}
1227
1229
 
1228
1230
eval create $temp table t1 (x bigint not null primary key) engine=$engine_type;
1229
1231
# The below is out of range for a BIGINT (signed)
1230
 
--error 1264
 
1232
--error ER_WARN_DATA_OUT_OF_RANGE
1231
1233
insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
1232
1234
select * from t1;
1233
1235
select count(*) from t1 where x>0;
1433
1435
 id INT PRIMARY KEY
1434
1436
) ENGINE=$engine_type;
1435
1437
 
1436
 
--error 1005,1005
 
1438
--error ER_CANT_CREATE_TABLE, ER_CANT_CREATE_TABLE
1437
1439
eval CREATE TEMPORARY TABLE t2
1438
1440
(
1439
1441
 id INT NOT NULL PRIMARY KEY,
1507
1509
{
1508
1510
 
1509
1511
# these should be refused
1510
 
--error 1071
 
1512
--error ER_TOO_LONG_KEY
1511
1513
eval create $temp table t1 (col1 varchar(768) primary key)
1512
1514
 character set = latin1 engine = $engine_type;
1513
 
--error 1071
 
1515
--error ER_TOO_LONG_KEY
1514
1516
eval create $temp table t2 (col1 varbinary(768) primary key)
1515
1517
 character set = latin1 engine = $engine_type;
1516
 
--error 1071
 
1518
--error ER_TOO_LONG_KEY
1517
1519
eval create $temp table t3 (col1 text, primary key(col1(768)))
1518
1520
 character set = latin1 engine = $engine_type;
1519
 
--error 1071
 
1521
--error ER_TOO_LONG_KEY
1520
1522
eval create $temp table t4 (col1 blob, primary key(col1(768)))
1521
1523
 character set = latin1 engine = $engine_type;
1522
1524
 
1539
1541
 CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
1540
1542
) ENGINE=$engine_type;
1541
1543
 
1542
 
--error 1452
 
1544
--error ER_NO_REFERENCED_ROW_2
1543
1545
INSERT INTO t2 VALUES(2);
1544
1546
 
1545
1547
INSERT INTO t1 VALUES(1);
1546
1548
INSERT INTO t2 VALUES(1);
1547
1549
 
1548
 
--error 1451
 
1550
--error ER_ROW_IS_REFERENCED_2
1549
1551
DELETE FROM t1 WHERE id = 1;
1550
1552
 
1551
 
--error 1217
 
1553
--error ER_ROW_IS_REFERENCED
1552
1554
DROP TABLE t1;
1553
1555
 
1554
1556
SET FOREIGN_KEY_CHECKS=0;
1555
1557
DROP TABLE t1;
1556
1558
SET FOREIGN_KEY_CHECKS=1;
1557
1559
 
1558
 
--error 1452
 
1560
--error ER_NO_REFERENCED_ROW_2
1559
1561
INSERT INTO t2 VALUES(3);
1560
1562
 
1561
1563
DROP TABLE t2;
1571
1573
set foreign_key_checks=0;
1572
1574
eval create $temp table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = $engine_type;
1573
1575
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
 
1576
--error ER_CANT_CREATE_TABLE
1574
1577
eval create $temp table t1(a char(10) primary key, b varchar(20)) engine = $engine_type;
1575
1578
set foreign_key_checks=1;
1576
1579
drop table t2;
1582
1584
set foreign_key_checks=0;
1583
1585
eval create $temp table t1(a varchar(10) primary key) engine = $engine_type DEFAULT CHARSET=latin1;
1584
1586
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
 
1587
--error ER_CANT_CREATE_TABLE
1585
1588
eval create $temp table t2 (a varchar(10), foreign key (a) references t1(a)) engine = $engine_type DEFAULT CHARSET=utf8;
1586
1589
set foreign_key_checks=1;
1587
1590
drop table t1;
1592
1594
set foreign_key_checks=0;
1593
1595
eval create $temp table t2 (a varchar(10), foreign key (a) references t1(a)) engine = $engine_type;
1594
1596
eval create $temp table t1(a varchar(10) primary key) engine = $engine_type;
 
1597
--error ER_ERROR_ON_RENAME, ER_ERROR_ON_RENAME
1595
1598
alter table t1 modify column a int;
1596
1599
set foreign_key_checks=1;
1597
1600
drop table t2,t1;
1612
1614
eval create $temp table t2 (a varchar(10), foreign key (a) references t1(a)) engine = $engine_type DEFAULT CHARSET=latin1;
1613
1615
eval create $temp table t3(a varchar(10) primary key) engine = $engine_type DEFAULT CHARSET=utf8;
1614
1616
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
 
1617
--error ER_ERROR_ON_RENAME
1615
1618
rename table t3 to t1;
1616
1619
set foreign_key_checks=1;
1617
1620
drop table t2,t3;
1626
1628
 
1627
1629
insert into t1 values(1);
1628
1630
insert into t3 values(1);
 
1631
--error ER_NO_REFERENCED_ROW_2
1629
1632
insert into t2 values(2);
 
1633
--error ER_NO_REFERENCED_ROW_2
1630
1634
insert into t4 values(2);
1631
1635
insert into t2 values(1);
1632
1636
insert into t4 values(1);
 
1637
--error ER_ROW_IS_REFERENCED_2
1633
1638
update t1 set a=2;
 
1639
--error ER_NO_REFERENCED_ROW_2
1634
1640
update t2 set a=2;
 
1641
--error ER_ROW_IS_REFERENCED_2
1635
1642
update t3 set a=2;
 
1643
--error ER_NO_REFERENCED_ROW_2
1636
1644
update t4 set a=2;
 
1645
--error ER_ROW_IS_REFERENCED_2
1637
1646
truncate t1;
 
1647
--error ER_ROW_IS_REFERENCED_2
1638
1648
truncate t3;
1639
1649
truncate t2;
1640
1650
truncate t4;
1686
1688
eval create $temp table t4 (s1 char(2),primary key (s1)) engine=$engine_type;
1687
1689
 
1688
1690
insert into t1 values (0x41),(0x4120),(0x4100);
 
1691
--error ER_DUP_ENTRY
1689
1692
insert into t2 values (0x41),(0x4120),(0x4100);
1690
1693
insert into t2 values (0x41),(0x4120);
 
1694
--error ER_DUP_ENTRY
1691
1695
insert into t3 values (0x41),(0x4120),(0x4100);
1692
1696
insert into t3 values (0x41),(0x4100);
 
1697
--error ER_DUP_ENTRY
1693
1698
insert into t4 values (0x41),(0x4120),(0x4100);
1694
1699
insert into t4 values (0x41),(0x4100);
1695
1700
select hex(s1) from t1;
1708
1710
eval create $temp table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=$engine_type;
1709
1711
 
1710
1712
insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42);
 
1713
--error ER_NO_REFERENCED_ROW_2
1711
1714
insert into t2 values(0x42);
1712
1715
insert into t2 values(0x41);
1713
1716
select hex(s1) from t2;
1714
1717
update t1 set s1=0x123456 where a=2;
1715
1718
select hex(s1) from t2;
 
1719
--error ER_ROW_IS_REFERENCED_2
1716
1720
update t1 set s1=0x12 where a=1;
 
1721
--error ER_ROW_IS_REFERENCED_2
1717
1722
update t1 set s1=0x12345678 where a=1;
 
1723
--error ER_ROW_IS_REFERENCED_2
1718
1724
update t1 set s1=0x123457 where a=1;
1719
1725
update t1 set s1=0x1220 where a=1;
1720
1726
select hex(s1) from t2;
1726
1728
select hex(s1) from t2;
1727
1729
update t1 set s1=0x4200 where a=1;
1728
1730
select hex(s1) from t2;
 
1731
--error ER_ROW_IS_REFERENCED_2
1729
1732
delete from t1 where a=1;
1730
1733
delete from t1 where a=2;
1731
1734
update t2 set s1=0x4120;
 
1735
--error ER_ROW_IS_REFERENCED_2
1732
1736
delete from t1;
1733
1737
delete from t1 where a!=3;
1734
1738
select a,hex(s1) from t1;
1749
1751
update t1 set s1=0x12 where a=2;
1750
1752
select hex(s1) from t2;
1751
1753
delete from t1 where a=1;
 
1754
--error ER_ROW_IS_REFERENCED_2
1752
1755
delete from t1 where a=2;
1753
1756
select a,hex(s1) from t1;
1754
1757
select hex(s1) from t2;
1907
1909
#
1908
1910
# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
1909
1911
#
1910
 
--error 1205
 
1912
--error ER_XXXLOCK_WAIT_TIMEOUTTTT
1911
1913
select * from t1 where a = 2 and b = 2 for update;
1912
1914
#
1913
1915
# X-lock to record (1,1),(3,1),(5,1) should not be released in a update
1914
1916
#
1915
 
--error 1205
 
1917
--error ER_LOCK_WAIT_TIMEOUT
1916
1918
connection a;
1917
1919
commit;
1918
1920
connection b;
2052
2054
create $temp table t10(a int not null, b int, primary key(a)) select * from t2 for update;
2053
2055
 
2054
2056
connection b;
2055
 
--error 1205
 
2057
--error ER_LOCK_WAIT_TIMEOUT
2056
2058
reap;
2057
2059
 
2058
2060
connection c;
2059
 
--error 1205
 
2061
--error ER_LOCK_WAIT_TIMEOUT
2060
2062
reap;
2061
2063
 
2062
2064
connection d;
2063
 
--error 1205
 
2065
--error ER_LOCK_WAIT_TIMEOUT
2064
2066
reap;
2065
2067
 
2066
2068
connection e;
2067
 
--error 1205
 
2069
--error ER_LOCK_WAIT_TIMEOUT
2068
2070
reap;
2069
2071
 
2070
2072
connection f;
2071
 
--error 1205
 
2073
--error ER_LOCK_WAIT_TIMEOUT
2072
2074
reap;
2073
2075
 
2074
2076
connection g;
2075
 
--error 1205
 
2077
--error ER_LOCK_WAIT_TIMEOUT
2076
2078
reap;
2077
2079
 
2078
2080
connection h;
2079
 
--error 1205
 
2081
--error ER_LOCK_WAIT_TIMEOUT
2080
2082
reap;
2081
2083
 
2082
2084
connection i;
2083
 
--error 1205
 
2085
--error ER_LOCK_WAIT_TIMEOUT
2084
2086
reap;
2085
2087
 
2086
2088
connection j;
2087
 
--error 1205
 
2089
--error ER_LOCK_WAIT_TIMEOUT
2088
2090
reap;
2089
2091
 
2090
2092
connection a;
2108
2110
if (test_foreign_keys)
2109
2111
{
2110
2112
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
2111
 
--error 1005
 
2113
--error ER_CANT_CREATE_TABLE
2112
2114
eval create $temp table t1 (DB_ROW_ID int) engine=$engine_type;
2113
2115
 
2114
2116
#
2162
2164
eval create $temp table t1 ( a int ) ENGINE=$engine_type;
2163
2165
BEGIN;
2164
2166
INSERT INTO t1 VALUES (1);
 
2167
COMMIT;
2165
2168
eval ALTER TABLE t1 ENGINE=$engine_type;
2166
2169
DROP TABLE t1;
2167
2170