diff options
author | serg@sergbook.mysql.com <> | 2005-08-22 13:20:02 +0400 |
---|---|---|
committer | serg@sergbook.mysql.com <> | 2005-08-22 13:20:02 +0400 |
commit | eadb86d56f0fe01b7ad69199530e3b19f8e93027 (patch) | |
tree | b42d4d6b404427d94f224df3644c23cddfa0f84b /sql/sql_db.cc | |
parent | d9e3ad09e5d2bc72e1457588d4ef80c0d9a75bab (diff) | |
download | mariadb-git-eadb86d56f0fe01b7ad69199530e3b19f8e93027.tar.gz |
after pull cleanup
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 21 |
1 files changed, 9 insertions, 12 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: |