diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_db.cc | 21 | ||||
-rw-r--r-- | sql/sql_table.cc | 3 | ||||
-rw-r--r-- | sql/table.h | 3 |
3 files changed, 9 insertions, 18 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 6dcc7be0904..cf49617e74f 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -697,41 +697,38 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) else if (mysql_bin_log.is_open()) { char* query= thd->alloc(MAX_DROP_TABLE_Q_LEN); - + if (!query) goto exit; /* not much else we can do */ - char* p= strmov(query,"drop table "); + char* p= strmov(query,"drop table "); char* p_end= query + MAX_DROP_TABLE_Q_LEN; TABLE_LIST* tbl; bool last_query_needs_write= 0; uint db_len= strlen(db); - + for (tbl= dropped_tables;tbl;tbl= tbl->next) { - if (!tbl->was_dropped) - continue; - - /* 3 for the quotes and the comma*/ - uint tbl_name_len= strlen(tbl->real_name) + 3; + /* 3 for the quotes and the comma*/ + uint tbl_name_len= strlen(tbl->real_name) + 3; if (p + tbl_name_len + 1 >= p_end) { *--p= 0; /* kill , */ write_to_binlog(thd, query, p - query, db, db_len); p= query + 11; /* reuse the initial "drop table" */ - } - + } + *p++ = '`'; p= strmov(p,tbl->real_name); *p++ = '`'; *p++ = ','; last_query_needs_write= 1; } - + if (last_query_needs_write) { *--p= 0; write_to_binlog(thd, query, p - query, db, db_len); - } + } } exit: diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 80ac9e007b9..87b864c73fa 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -220,7 +220,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, for (table=tables ; table ; table=table->next) { char *db=table->db; - table->was_dropped= 0; mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL); if (!close_temporary_table(thd, db, table->real_name)) { @@ -281,8 +280,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, wrong_tables.append(','); wrong_tables.append(String(table->real_name,system_charset_info)); } - else - table->was_dropped= 1; } thd->tmp_table_used= tmp_table_deleted; error= 0; diff --git a/sql/table.h b/sql/table.h index fb742acf804..77153e5d8cd 100644 --- a/sql/table.h +++ b/sql/table.h @@ -235,9 +235,6 @@ typedef struct st_table_list bool cacheable_table; /* stop PS caching */ /* used in multi-upd privelege check */ bool table_in_update_from_clause; - - /* used for proper partially successful DROP DATABASE binlogging */ - bool was_dropped; } TABLE_LIST; typedef struct st_changed_table_list |