Commit 8cb6031d authored by unknown's avatar unknown
Browse files

Generate warning in ha_delete_table() if files is missing in handler



mysql-test/r/myisam.result:
  Test of DROP TABLE when .MYI or .MYD is missing
mysql-test/r/ndb_autodiscover.result:
  Update test results
mysql-test/r/rpl_EE_error.result:
  Change test to conform with new handling of drop table when handler file is missing
mysql-test/t/myisam.test:
  Test of DROP TABLE when .MYI or .MYD is missing
mysql-test/t/rpl_EE_error.test:
  Change test to conform with new handling of drop table when handler file is missing
sql/handler.cc:
  Generate a warning in ha_delete_table() if we get an error from 'delete_table()'
sql/handler.h:
  More parameters to ha_delete_table() so that we can generate better error messages
sql/sql_table.cc:
  Generate warning in ha_delete_table()
parent ac1852b4
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1150,3 +1150,15 @@ drop table t1;
set storage_engine=MyISAM;
create table t1 (v varchar(65535));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
create table t1 (a int) engine=myisam;
drop table if exists t1;
Warnings:
Error	2	Can't find file: 't1' (errno: 2)
create table t1 (a int) engine=myisam;
drop table t1;
ERROR 42S02: Unknown table 't1'
create table t1 (a int) engine=myisam;
drop table t1;
ERROR HY000: File './test/t1.MYD' not found (Errcode: 2)
drop table t1;
ERROR 42S02: Unknown table 't1'
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ select * from t4;
ERROR 42S02: Table 'test.t4' doesn't exist
drop table if exists t4;
Warnings:
Note	1051	Unknown table 't4'
Error	155	Table 'test.t4' doesn't exist
drop table t5;
ERROR 42S02: Unknown table 't5'
drop table if exists t5;
+3 −1
Original line number Diff line number Diff line
@@ -6,7 +6,9 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a int) engine=myisam;
flush tables;
drop table t1;
drop table if exists t1;
Warnings:
Error	2	Can't find file: 't1' (errno: 2)
create table t1 (a int, unique(a)) engine=myisam;
set sql_log_bin=0;
insert into t1 values(2);
+17 −0
Original line number Diff line number Diff line
@@ -539,3 +539,20 @@ eval set storage_engine=$default;
# MyISAM specific varchar tests
--error 1118
create table t1 (v varchar(65535));

#
# Test how DROP TABLE works if the index or data file doesn't exists

create table t1 (a int) engine=myisam;
system rm ./var/master-data/test/t1.MYI ;
drop table if exists t1;
create table t1 (a int) engine=myisam;
system rm ./var/master-data/test/t1.MYI ;
--error 1051
drop table t1;
create table t1 (a int) engine=myisam;
system rm ./var/master-data/test/t1.MYD ;
--error 1105
drop table t1;
--error 1051
drop table t1;
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ source include/master-slave.inc;
create table t1 (a int) engine=myisam;
flush tables;
system rm ./var/master-data/test/t1.MYI ;
drop table t1;
drop table if exists t1;
save_master_pos;
connection slave;
sync_with_master;
Loading