summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore3
-rw-r--r--libmysql/libmysql.c15
-rw-r--r--mysql-test/r/innodb_mysql.result8
-rw-r--r--mysql-test/t/innodb_mysql.test14
-rw-r--r--sql/ha_innodb.cc2
5 files changed, 41 insertions, 1 deletions
diff --git a/.bzrignore b/.bzrignore
index 8c632f8f890..e7a7a1c27dc 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1341,3 +1341,6 @@ win/vs71cache.txt
win/vs8cache.txt
zlib/*.ds?
zlib/*.vcproj
+debian/control
+debian/defs.mk
+include/abi_check
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index e426d2c549e..121167763ed 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -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()
{
+ if (!mysql_client_init)
+ return;
+
#ifdef EMBEDDED_LIBRARY
end_embedded_server();
#endif
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 34eb831e7db..4720c7c2e2e 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -625,4 +625,12 @@ t1 CREATE TABLE `t1` (
`a` int(11) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='123'
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
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index e6d94fe1627..578a81f355e 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -605,4 +605,18 @@ alter table t1 comment '123';
show create 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
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 455c0968050..a3676bd7e1b 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -504,7 +504,7 @@ convert_error_code_to_mysql(
} 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) {