Commit 9b8b0000 authored by unknown's avatar unknown

Allow multiple calls to mysql_server_end()

(Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit)
Give correct error message if InnoDB table is not found
(This allows us to drop a an innodb table that is not in the InnoDB registery)


BitKeeper/etc/ignore:
  added include/abi_check
libmysql/libmysql.c:
  Allow multiple calls to mysql_server_end()
  (Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit)
mysql-test/r/innodb_mysql.result:
  Test case for drop of table that only has a .frm file
mysql-test/t/innodb_mysql.test:
  Test case for drop of table that only has a .frm file
sql/ha_innodb.cc:
  Give correct error message if InnoDB table is not found.
  (This allows us to drop a an innodb table that is not in the InnoDB registery)
parent f5bc5381
...@@ -1341,3 +1341,6 @@ win/vs71cache.txt ...@@ -1341,3 +1341,6 @@ win/vs71cache.txt
win/vs8cache.txt win/vs8cache.txt
zlib/*.ds? zlib/*.ds?
zlib/*.vcproj zlib/*.vcproj
debian/control
debian/defs.mk
include/abi_check
...@@ -168,8 +168,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), ...@@ -168,8 +168,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
} }
/*
Free all memory and resources used by the client library
NOTES
When calling this there should not be any other threads using
the library.
To make things simpler when used with windows dll's (which calls this
function automaticly), it's safe to call this function multiple times.
*/
void STDCALL mysql_server_end() void STDCALL mysql_server_end()
{ {
if (!mysql_client_init)
return;
#ifdef EMBEDDED_LIBRARY #ifdef EMBEDDED_LIBRARY
end_embedded_server(); end_embedded_server();
#endif #endif
......
...@@ -625,4 +625,12 @@ t1 CREATE TABLE `t1` ( ...@@ -625,4 +625,12 @@ t1 CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='123' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='123'
drop table t1; drop table t1;
create table t1 (a int) engine=innodb;
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
drop table t2;
ERROR 42S02: Unknown table 't2'
create table t2 (a int);
drop table t2;
End of 5.0 tests End of 5.0 tests
...@@ -605,4 +605,18 @@ alter table t1 comment '123'; ...@@ -605,4 +605,18 @@ alter table t1 comment '123';
show create table t1; show create table t1;
drop table t1; drop table t1;
#
# Test bug when trying to drop data file which no InnoDB directory entry
#
create table t1 (a int) engine=innodb;
copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t2.frm;
--error 1146
select * from t2;
drop table t1;
--error 1051
drop table t2;
create table t2 (a int);
drop table t2;
--echo End of 5.0 tests --echo End of 5.0 tests
...@@ -504,7 +504,7 @@ convert_error_code_to_mysql( ...@@ -504,7 +504,7 @@ convert_error_code_to_mysql(
} else if (error == (int) DB_TABLE_NOT_FOUND) { } else if (error == (int) DB_TABLE_NOT_FOUND) {
return(HA_ERR_KEY_NOT_FOUND); return(HA_ERR_NO_SUCH_TABLE);
} else if (error == (int) DB_TOO_BIG_RECORD) { } else if (error == (int) DB_TOO_BIG_RECORD) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment