577
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;
613
580
# Bug #25798: a query with forced index merge returns wrong result
742
709
--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;
792
712
# Bug #28591: MySQL need not sort the records in case of ORDER BY
793
713
# primary_key on InnoDB table
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 ();
1101
974
# Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
1103
976
create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT