@@ -173,6 +173,13 @@ func (s *testSuite6) TestCreateTable(c *C) {
173173 tk .MustExec ("insert into create_auto_increment_test (name) values ('aa')" )
174174 r = tk .MustQuery ("select * from create_auto_increment_test;" )
175175 r .Check (testkit .Rows ("1000 aa" ))
176+
177+ // Test for `drop table if exists`.
178+ tk .MustExec ("drop table if exists t_if_exists;" )
179+ tk .MustQuery ("show warnings;" ).Check (testkit .Rows ("Note 1051 Unknown table 'test.t_if_exists'" ))
180+ tk .MustExec ("create table if not exists t1_if_exists(c int)" )
181+ tk .MustExec ("drop table if exists t1_if_exists,t2_if_exists,t3_if_exists" )
182+ tk .MustQuery ("show warnings" ).Check (testutil .RowsWithSep ("|" , "Note|1051|Unknown table 'test.t2_if_exists'" , "Note|1051|Unknown table 'test.t3_if_exists'" ))
176183}
177184
178185func (s * testSuite6 ) TestCreateView (c * C ) {
@@ -253,6 +260,13 @@ func (s *testSuite6) TestCreateView(c *C) {
253260 tk .MustExec ("drop view v" )
254261 tk .MustExec ("create view v as (select * from t1 union select * from t2)" )
255262 tk .MustExec ("drop view v" )
263+
264+ // Test for `drop view if exists`.
265+ tk .MustExec ("drop view if exists v_if_exists;" )
266+ tk .MustQuery ("show warnings;" ).Check (testkit .Rows ("Note 1051 Unknown table 'test.v_if_exists'" ))
267+ tk .MustExec ("create view v1_if_exists as (select * from t1)" )
268+ tk .MustExec ("drop view if exists v1_if_exists,v2_if_exists,v3_if_exists" )
269+ tk .MustQuery ("show warnings" ).Check (testutil .RowsWithSep ("|" , "Note|1051|Unknown table 'test.v2_if_exists'" , "Note|1051|Unknown table 'test.v3_if_exists'" ))
256270}
257271
258272func (s * testSuite6 ) TestCreateDropDatabase (c * C ) {
0 commit comments