~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/include/mix1.inc

  • Committer: Stewart Smith
  • Date: 2009-03-11 06:37:19 UTC
  • mto: (910.4.19 sparc) (937.2.1 sparc)
  • mto: This revision was merged to the branch mainline in revision 931.
  • Revision ID: stewart@flamingspork.com-20090311063719-v9iqjd00ts6260vv
batch up more INSERTs into transactions to help tests run quicker.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#
27
27
 
28
28
eval SET SESSION STORAGE_ENGINE = $engine_type;
29
 
SET @orig_lock_wait_timeout= @@innodb_lock_wait_timeout; 
30
 
SET GLOBAL innodb_lock_wait_timeout=2;
31
 
 
32
29
 
33
30
--disable_warnings
34
31
drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
207
204
#
208
205
 
209
206
--disable_warnings
210
 
eval create temporary table t1m (a int) engine = $other_engine_type;
 
207
eval create table t1m (a int) engine = $other_engine_type;
211
208
create table t1i (a int);
212
 
eval create temporary table t2m (a int) engine = $other_engine_type;
 
209
eval create table t2m (a int) engine = $other_engine_type;
213
210
create table t2i (a int);
214
211
--enable_warnings
215
212
insert into t2m values (5);
242
239
# (was part of group_min_max.test)
243
240
#
244
241
 
245
 
eval create TEMPORARY table t1 (
 
242
eval create table t1 (
246
243
  a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
247
244
) ENGINE = $other_engine_type;
248
245
 
317
314
 
318
315
DELETE IGNORE FROM t1 WHERE i = 1;
319
316
 
320
 
SELECT * FROM t1 CROSS JOIN t2;
 
317
SELECT * FROM t1, t2;
321
318
 
322
319
DROP TABLE t2, t1;
323
320
 
408
405
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
409
406
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
410
407
DELETE FROM t1;
411
 
--replace_column 9 #
412
408
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
413
409
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
414
410
 
545
541
# Bug #28652: assert when alter innodb table operation
546
542
#
547
543
create table t1(a int) engine=innodb;
548
 
alter table t1 comment='123';
 
544
alter table t1 comment '123';
549
545
show create table t1;
550
546
drop table t1;
551
547
 
569
565
UPDATE t2 SET a = 'us' WHERE a = 'uk';
570
566
SELECT * FROM t2 WHERE a = 'uk';
571
567
 
572
 
CREATE TEMPORARY TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
 
568
CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
573
569
INSERT INTO t3 VALUES ('uk'),('bg');
574
570
SELECT * FROM t3 WHERE a = 'uk';
575
571
DELETE FROM t3 WHERE a = 'uk';
581
577
DROP TABLE t1,t2,t3;
582
578
 
583
579
#
 
580
# Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
 
581
#
 
582
 
 
583
CREATE TABLE t1 (a INT) ENGINE=InnoDB; 
 
584
CREATE TABLE t2 (a INT) ENGINE=InnoDB; 
 
585
 
 
586
CONNECT (c1,localhost,root,,);
 
587
CONNECT (c2,localhost,root,,);
 
588
 
 
589
--echo switch to connection c1
 
590
CONNECTION c1;
 
591
SET AUTOCOMMIT=0;
 
592
INSERT INTO t2 VALUES (1);
 
593
 
 
594
--echo switch to connection c2
 
595
CONNECTION c2;
 
596
SET AUTOCOMMIT=0;
 
597
--error ER_LOCK_WAIT_TIMEOUT
 
598
LOCK TABLES t1 READ, t2 READ;
 
599
 
 
600
--echo switch to connection c1
 
601
CONNECTION c1;
 
602
COMMIT;
 
603
INSERT INTO t1 VALUES (1);
 
604
 
 
605
--echo switch to connection default
 
606
CONNECTION default;
 
607
SET AUTOCOMMIT=default;
 
608
DISCONNECT c1;
 
609
DISCONNECT c2;
 
610
DROP TABLE t1,t2;
 
611
 
 
612
#
584
613
# Bug #25798: a query with forced index merge returns wrong result 
585
614
#
586
615
 
595
624
CREATE TABLE t2 (
596
625
  b int NOT NULL auto_increment PRIMARY KEY,
597
626
  c datetime NOT NULL
598
 
) ENGINE= InnoDB;
 
627
) ENGINE= MyISAM;
599
628
 
600
629
INSERT INTO t2(c) VALUES ('2007-01-01');
601
630
INSERT INTO t2(c) SELECT c FROM t2;
653
682
CREATE TABLE t2 (a int, b int, primary key (a));
654
683
BEGIN;
655
684
INSERT INTO t2 values(100,100);
656
 
COMMIT;
657
685
--error ER_DUP_ENTRY
658
686
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
659
687
SELECT * from t2;
714
742
--source include/innodb_rollback_on_timeout.inc
715
743
 
716
744
#
 
745
# Bug#27296 Assertion in ALTER TABLE SET DEFAULT in Linux Debug build
 
746
# (possible deadlock).
 
747
#
 
748
# The bug is applicable only to a transactoinal table.
 
749
# Cover with tests behavior that no longer causes an
 
750
# assertion.
 
751
#
 
752
--disable_warnings
 
753
drop table if exists t1;
 
754
--enable_warnings
 
755
create table t1 (a int) engine=innodb;
 
756
alter table t1 alter a set default 1;
 
757
drop table t1;
 
758
 
 
759
--echo
 
760
--echo Bug#24918 drop table and lock / inconsistent between 
 
761
--echo perm and temp tables
 
762
--echo
 
763
--echo Check transactional tables under LOCK TABLES
 
764
--echo
 
765
--disable_warnings
 
766
drop table if exists t24918, t24918_tmp, t24918_trans, t24918_trans_tmp, 
 
767
t24918_access;
 
768
--enable_warnings
 
769
create table t24918_access (id int);
 
770
create table t24918 (id int) engine=myisam;
 
771
create temporary table t24918_tmp (id int) engine=myisam;
 
772
create table t24918_trans (id int) engine=innodb;
 
773
create temporary table t24918_trans_tmp (id int) engine=innodb;
 
774
 
 
775
lock table t24918 write, t24918_tmp write, t24918_trans write, t24918_trans_tmp write;
 
776
drop table t24918;
 
777
--error ER_TABLE_NOT_LOCKED
 
778
select * from t24918_access;
 
779
drop table t24918_trans;
 
780
--error ER_TABLE_NOT_LOCKED
 
781
select * from t24918_access;
 
782
drop table t24918_trans_tmp;
 
783
--error ER_TABLE_NOT_LOCKED
 
784
select * from t24918_access;
 
785
drop table t24918_tmp;
 
786
--error ER_TABLE_NOT_LOCKED
 
787
select * from t24918_access;
 
788
unlock tables;
 
789
 
 
790
drop table t24918_access;
 
791
#
717
792
# Bug #28591: MySQL need not sort the records in case of ORDER BY
718
793
# primary_key on InnoDB table
719
794
#
862
937
--echo
863
938
 
864
939
SELECT table_schema, table_name, row_format
865
 
FROM data_dictionary.TABLES
 
940
FROM INFORMATION_SCHEMA.TABLES
866
941
WHERE table_schema = DATABASE() AND table_name = 't1';
867
942
 
868
943
--echo
874
949
--echo
875
950
 
876
951
SELECT table_schema, table_name, row_format
877
 
FROM data_dictionary.TABLES
 
952
FROM INFORMATION_SCHEMA.TABLES
878
953
WHERE table_schema = DATABASE() AND table_name = 't1';
879
954
 
880
955
--echo
916
991
set global innodb_autoextend_increment=8;
917
992
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
918
993
 
919
 
# BUG: 
920
 
# set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
921
 
# set global innodb_commit_concurrency=0;
922
 
# set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
 
994
set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
 
995
set global innodb_commit_concurrency=0;
 
996
set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
923
997
 
924
998
--echo End of 5.0 tests
925
999
 
977
1051
 
978
1052
 
979
1053
#
 
1054
# Tests for bug #28415 "Some ALTER TABLE statements no longer work
 
1055
# under LOCK TABLES" and some aspects of fast ALTER TABLE behaviour
 
1056
# for transactional tables.
 
1057
#
 
1058
--disable_warnings
 
1059
drop table if exists t1, t2;
 
1060
--enable_warnings
 
1061
create table t1 (i int);
 
1062
alter table t1 modify i int default 1;
 
1063
alter table t1 modify i int default 2, rename t2;
 
1064
lock table t2 write;
 
1065
alter table t2 modify i int default 3;
 
1066
unlock tables;
 
1067
lock table t2 write;
 
1068
alter table t2 modify i int default 4, rename t1;
 
1069
unlock tables;
 
1070
drop table t1;
 
1071
 
 
1072
 
 
1073
 
1074
# Some more tests for ALTER TABLE and LOCK TABLES for transactional tables.
 
1075
#
 
1076
# Table which is altered under LOCK TABLES should stay in list of locked
 
1077
# tables and be available after alter takes place unless ALTER contains
 
1078
# RENAME clause. We should see the new definition of table, of course.
 
1079
# Before 5.1 this behavior was inconsistent across the platforms and
 
1080
# different engines. See also tests in alter_table.test
 
1081
#
 
1082
--disable_warnings
 
1083
drop table if exists t1;
 
1084
--enable_warnings
 
1085
create table t1 (i int);
 
1086
insert into t1 values ();
 
1087
lock table t1 write;
 
1088
# Example of so-called 'fast' ALTER TABLE
 
1089
alter table t1 modify i int default 1;
 
1090
insert into t1 values ();
 
1091
select * from t1;
 
1092
# And now full-blown ALTER TABLE
 
1093
alter table t1 change i c char(10) default "Two";
 
1094
insert into t1 values ();
 
1095
select * from t1;
 
1096
unlock tables;
 
1097
select * from t1;
 
1098
drop tables t1;
 
1099
 
 
1100
#
980
1101
# Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
981
1102
#
982
1103
create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT
984
1105
insert into t1(f1) values(1);
985
1106
--replace_column 1 #
986
1107
select @a:=f2 from t1;
 
1108
--sleep 5
987
1109
update t1 set f1=1;
988
1110
--replace_column 1 #
989
1111
select @b:=f2 from t1;
990
1112
select if(@a=@b,"ok","wrong");
 
1113
--sleep 5
991
1114
insert into t1(f1) values (1) on duplicate key update f1="1";
992
1115
--replace_column 1 #
993
1116
select @b:=f2 from t1;
994
1117
select if(@a=@b,"ok","wrong");
 
1118
--sleep 5
995
1119
insert into t1(f1) select f1 from t1 on duplicate key update f1="1";
996
1120
--replace_column 1 #
997
1121
select @b:=f2 from t1;
1036
1160
#             auto_increment keys
1037
1161
#
1038
1162
create table t1 (a int auto_increment primary key) engine=innodb;
1039
 
--error ER_UNKNOWN_ERROR
 
1163
--error 1105
1040
1164
alter table t1 order by a;
1041
1165
drop table t1;
1042
1166
 
1097
1221
DROP TABLE t2;
1098
1222
DROP TABLE t1;
1099
1223
 
1100
 
SET GLOBAL innodb_lock_wait_timeout=@orig_lock_wait_timeout ;
1101
 
 
1102
1224
--echo End of 5.1 tests