1connect  con1,localhost,root,,;
2connect  con2,localhost,root,,;
3connection con1;
4drop table if exists t1,t2;
5drop view if exists v1;
6create table t1(n int not null, key(n), key(n), key(n), key(n));
7Warnings:
8Note	1831	Duplicate index `n_2`. This is deprecated and will be disallowed in a future release
9Note	1831	Duplicate index `n_3`. This is deprecated and will be disallowed in a future release
10Note	1831	Duplicate index `n_4`. This is deprecated and will be disallowed in a future release
11check table t1 extended;
12connection con2;
13insert into t1 values (200000);
14connection con1;
15Table	Op	Msg_type	Msg_text
16test.t1	check	status	OK
17connection default;
18disconnect con1;
19disconnect con2;
20drop table t1;
21Create table t1(f1 int);
22Create table t2(f1 int);
23Create view v1 as Select * from t1;
24Check Table v1,t2;
25Table	Op	Msg_type	Msg_text
26test.v1	check	status	OK
27test.t2	check	status	OK
28drop view v1;
29drop table t1, t2;
30CREATE TEMPORARY TABLE t1(a INT);
31CHECK TABLE t1;
32Table	Op	Msg_type	Msg_text
33test.t1	check	status	OK
34REPAIR TABLE t1;
35Table	Op	Msg_type	Msg_text
36test.t1	repair	status	OK
37DROP TABLE t1;
38#
39# Bug#56422 CHECK TABLE run when the table is locked reports corruption
40#           along with timeout
41#
42DROP TABLE IF EXISTS t1;
43CREATE TABLE t1(a INT);
44LOCK TABLE t1 WRITE;
45connect con1, localhost, root;
46SET lock_wait_timeout= 1;
47CHECK TABLE t1;
48Table	Op	Msg_type	Msg_text
49test.t1	check	Error	Lock wait timeout exceeded; try restarting transaction
50test.t1	check	status	Operation failed
51connection default;
52UNLOCK TABLES;
53DROP TABLE t1;
54disconnect con1;
55#
56# MDEV-15338
57# Assertion `!table || (!table->read_set ||
58# bitmap_is_set(table->read_set, field_index))'
59# failed on dropping column with CHECK
60#
61CREATE TABLE t1 (a INT, b INT, CHECK (a>0)) ENGINE=MyISAM;
62INSERT INTO t1 VALUES (1,2),(3,4);
63ALTER TABLE t1 DROP COLUMN a;
64CREATE OR REPLACE TABLE t1 (a INT, b INT, CHECK (a>0)) ENGINE=MyISAM;
65ALTER TABLE t1 DROP COLUMN b;
66CREATE OR REPLACE TABLE t1 (a INT, b INT, c INT, CHECK (a+b>0)) ENGINE=MyISAM;
67ALTER TABLE t1 DROP COLUMN b;
68ERROR 42S22: Unknown column 'b' in 'CHECK'
69ALTER TABLE t1 DROP COLUMN a, DROP COLUMN b;
70CREATE OR REPLACE TABLE t1 (a INT, b INT, c INT, CHECK (a+b>0)) ENGINE=MyISAM;
71ALTER TABLE t1 DROP CONSTRAINT `CONSTRAINT_1`;
72SHOW CREATE TABLE t1;
73Table	Create Table
74t1	CREATE TABLE `t1` (
75  `a` int(11) DEFAULT NULL,
76  `b` int(11) DEFAULT NULL,
77  `c` int(11) DEFAULT NULL
78) ENGINE=MyISAM DEFAULT CHARSET=latin1
79CREATE OR REPLACE TABLE t1 (a INT, b INT, c INT, CHECK (a+b>0)) ENGINE=MyISAM;
80ALTER TABLE t1 DROP COLUMN b, DROP CONSTRAINT `CONSTRAINT_1`;
81SHOW CREATE TABLE t1;
82Table	Create Table
83t1	CREATE TABLE `t1` (
84  `a` int(11) DEFAULT NULL,
85  `c` int(11) DEFAULT NULL
86) ENGINE=MyISAM DEFAULT CHARSET=latin1
87DROP TABLE t1;
88create temporary table t1 (
89id int not null auto_increment primary key,
90f int not null default 0
91);
92insert into t1 () values ();
93alter ignore table t1 add constraint check (f > 0);
94Warnings:
95Warning	4025	CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
96alter table t1;
97drop table t1;
98create temporary table t1 (a int default 0, check (a > 0));
99alter table t1 drop constraint if exists non_existing_constraint;
100Warnings:
101Note	1091	Can't DROP CONSTRAINT `non_existing_constraint`; check that it exists
102insert into t1 () values ();
103ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
104drop table t1;
105