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
34
drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
182
185
CREATE TABLE t1 (
183
186
a1 decimal(10,0) DEFAULT NULL,
185
a3 time DEFAULT NULL,
187
189
a5 char(175) DEFAULT NULL,
188
a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
190
a6 timestamp NOT NULL DEFAULT NOW(),
190
192
INDEX idx (a6,a7(239),a5)
207
209
--disable_warnings
208
eval create table t1m (a int) engine = $other_engine_type;
210
eval create temporary table t1m (a int) engine = $other_engine_type;
209
211
create table t1i (a int);
210
eval create table t2m (a int) engine = $other_engine_type;
212
eval create temporary table t2m (a int) engine = $other_engine_type;
211
213
create table t2i (a int);
212
214
--enable_warnings
213
215
insert into t2m values (5);
240
242
# (was part of group_min_max.test)
243
eval create table t1 (
245
eval create TEMPORARY table t1 (
244
246
a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
245
247
) ENGINE = $other_engine_type;
406
408
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
407
409
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
409
412
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
410
413
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
566
569
UPDATE t2 SET a = 'us' WHERE a = 'uk';
567
570
SELECT * FROM t2 WHERE a = 'uk';
569
CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
572
CREATE TEMPORARY TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
570
573
INSERT INTO t3 VALUES ('uk'),('bg');
571
574
SELECT * FROM t3 WHERE a = 'uk';
572
575
DELETE FROM t3 WHERE a = 'uk';
578
581
DROP TABLE t1,t2,t3;
581
# Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
584
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
585
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
587
CONNECT (c1,localhost,root,,);
588
CONNECT (c2,localhost,root,,);
590
--echo switch to connection c1
593
INSERT INTO t2 VALUES (1);
595
--echo switch to connection c2
598
--error ER_LOCK_WAIT_TIMEOUT
599
LOCK TABLES t1 READ, t2 READ;
601
--echo switch to connection c1
604
INSERT INTO t1 VALUES (1);
606
--echo switch to connection default
608
SET AUTOCOMMIT=default;
614
584
# Bug #25798: a query with forced index merge returns wrong result
743
713
--source include/innodb_rollback_on_timeout.inc
746
# Bug#27296 Assertion in ALTER TABLE SET DEFAULT in Linux Debug build
747
# (possible deadlock).
749
# The bug is applicable only to a transactoinal table.
750
# Cover with tests behavior that no longer causes an
754
drop table if exists t1;
756
create table t1 (a int) engine=innodb;
757
alter table t1 alter a set default 1;
761
--echo Bug#24918 drop table and lock / inconsistent between
762
--echo perm and temp tables
764
--echo Check transactional tables under LOCK TABLES
767
drop table if exists t24918, t24918_tmp, t24918_trans, t24918_trans_tmp,
770
create table t24918_access (id int);
771
create table t24918 (id int) engine=myisam;
772
create temporary table t24918_tmp (id int) engine=myisam;
773
create table t24918_trans (id int) engine=innodb;
774
create temporary table t24918_trans_tmp (id int) engine=innodb;
776
lock table t24918 write, t24918_tmp write, t24918_trans write, t24918_trans_tmp write;
778
--error ER_TABLE_NOT_LOCKED
779
select * from t24918_access;
780
drop table t24918_trans;
781
--error ER_TABLE_NOT_LOCKED
782
select * from t24918_access;
783
drop table t24918_trans_tmp;
784
--error ER_TABLE_NOT_LOCKED
785
select * from t24918_access;
786
drop table t24918_tmp;
787
--error ER_TABLE_NOT_LOCKED
788
select * from t24918_access;
791
drop table t24918_access;
793
716
# Bug #28591: MySQL need not sort the records in case of ORDER BY
794
717
# primary_key on InnoDB table
940
863
SELECT table_schema, table_name, row_format
941
FROM INFORMATION_SCHEMA.TABLES
864
FROM data_dictionary.TABLES
942
865
WHERE table_schema = DATABASE() AND table_name = 't1';
952
875
SELECT table_schema, table_name, row_format
953
FROM INFORMATION_SCHEMA.TABLES
876
FROM data_dictionary.TABLES
954
877
WHERE table_schema = DATABASE() AND table_name = 't1';
1055
# Tests for bug #28415 "Some ALTER TABLE statements no longer work
1056
# under LOCK TABLES" and some aspects of fast ALTER TABLE behaviour
1057
# for transactional tables.
1060
drop table if exists t1, t2;
1062
create table t1 (i int);
1063
alter table t1 modify i int default 1;
1064
alter table t1 modify i int default 2, rename t2;
1065
lock table t2 write;
1066
alter table t2 modify i int default 3;
1068
lock table t2 write;
1069
alter table t2 modify i int default 4, rename t1;
1075
# Some more tests for ALTER TABLE and LOCK TABLES for transactional tables.
1077
# Table which is altered under LOCK TABLES should stay in list of locked
1078
# tables and be available after alter takes place unless ALTER contains
1079
# RENAME clause. We should see the new definition of table, of course.
1080
# Before 5.1 this behavior was inconsistent across the platforms and
1081
# different engines. See also tests in alter_table.test
1084
drop table if exists t1;
1086
create table t1 (i int);
1087
insert into t1 values ();
1088
lock table t1 write;
1089
# Example of so-called 'fast' ALTER TABLE
1090
alter table t1 modify i int default 1;
1091
insert into t1 values ();
1093
# And now full-blown ALTER TABLE
1094
alter table t1 change i c char(10) default "Two";
1095
insert into t1 values ();
1102
978
# Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
1104
980
create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT
1106
982
insert into t1(f1) values(1);
1107
983
--replace_column 1 #
1108
984
select @a:=f2 from t1;
1110
985
update t1 set f1=1;
1111
986
--replace_column 1 #
1112
987
select @b:=f2 from t1;
1113
988
select if(@a=@b,"ok","wrong");
1115
989
insert into t1(f1) values (1) on duplicate key update f1="1";
1116
990
--replace_column 1 #
1117
991
select @b:=f2 from t1;
1118
992
select if(@a=@b,"ok","wrong");
1120
993
insert into t1(f1) select f1 from t1 on duplicate key update f1="1";
1121
994
--replace_column 1 #
1122
995
select @b:=f2 from t1;