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;
34
31
drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
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)
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;
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';
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';
569
565
UPDATE t2 SET a = 'us' WHERE a = 'uk';
570
566
SELECT * FROM t2 WHERE a = 'uk';
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;
580
# Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
583
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
584
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
586
CONNECT (c1,localhost,root,,);
587
CONNECT (c2,localhost,root,,);
589
--echo switch to connection c1
592
INSERT INTO t2 VALUES (1);
594
--echo switch to connection c2
597
--error ER_LOCK_WAIT_TIMEOUT
598
LOCK TABLES t1 READ, t2 READ;
600
--echo switch to connection c1
603
INSERT INTO t1 VALUES (1);
605
--echo switch to connection default
607
SET AUTOCOMMIT=default;
584
613
# Bug #25798: a query with forced index merge returns wrong result
653
682
CREATE TABLE t2 (a int, b int, primary key (a));
655
684
INSERT INTO t2 values(100,100);
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
745
# Bug#27296 Assertion in ALTER TABLE SET DEFAULT in Linux Debug build
746
# (possible deadlock).
748
# The bug is applicable only to a transactoinal table.
749
# Cover with tests behavior that no longer causes an
753
drop table if exists t1;
755
create table t1 (a int) engine=innodb;
756
alter table t1 alter a set default 1;
760
--echo Bug#24918 drop table and lock / inconsistent between
761
--echo perm and temp tables
763
--echo Check transactional tables under LOCK TABLES
766
drop table if exists t24918, t24918_tmp, t24918_trans, t24918_trans_tmp,
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;
775
lock table t24918 write, t24918_tmp write, t24918_trans write, t24918_trans_tmp write;
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;
790
drop table t24918_access;
717
792
# Bug #28591: MySQL need not sort the records in case of ORDER BY
718
793
# primary_key on InnoDB table
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';
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';
916
991
set global innodb_autoextend_increment=8;
917
992
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
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;
924
998
--echo End of 5.0 tests
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.
1059
drop table if exists t1, t2;
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;
1067
lock table t2 write;
1068
alter table t2 modify i int default 4, rename t1;
1074
# Some more tests for ALTER TABLE and LOCK TABLES for transactional tables.
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
1083
drop table if exists t1;
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 ();
1092
# And now full-blown ALTER TABLE
1093
alter table t1 change i c char(10) default "Two";
1094
insert into t1 values ();
980
1101
# Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
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;
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");
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");
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;