summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-07-17 17:10:52 +0200
committerunknown <guilhem@mysql.com>2004-07-17 17:10:52 +0200
commit474c2578c5db161aa201427982828e074a61559d (patch)
treee936d432d663b882efa13d67e59a7ce6804f9f4b /sql
parent139855210b9b1c8ce098ecc40bf66e0057d0c8df (diff)
parentcf8dbcc683b94b6e7f6c44d51b7241c45813decd (diff)
downloadmariadb-git-474c2578c5db161aa201427982828e074a61559d.tar.gz
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_table.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 1b956779832..9ab4859bc13 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -230,6 +230,17 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
wrong_tables.append(String(table->real_name));
}
}
+
+ error= 0;
+ if (wrong_tables.length())
+ {
+ if (!foreign_key_error)
+ my_error(ER_BAD_TABLE_ERROR,MYF(0),wrong_tables.c_ptr());
+ else
+ my_error(ER_ROW_IS_REFERENCED,MYF(0));
+ error= 1;
+ }
+
if (some_tables_deleted || tmp_table_deleted)
{
query_cache_invalidate3(thd, tables, 0);
@@ -238,7 +249,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- thd->clear_error();
+ if (!error)
+ thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length,
tmp_table_deleted && !some_tables_deleted);
mysql_bin_log.write(&qinfo);
@@ -247,15 +259,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
}
unlock_table_names(thd, tables);
- error= 0;
- if (wrong_tables.length())
- {
- if (!foreign_key_error)
- my_error(ER_BAD_TABLE_ERROR,MYF(0),wrong_tables.c_ptr());
- else
- my_error(ER_ROW_IS_REFERENCED,MYF(0));
- error= 1;
- }
DBUG_RETURN(error);
}