1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
mysys/my_alloc.c:
  Auto merged
sql/sql_table.cc:
  Auto merged
This commit is contained in:
unknown
2005-08-26 13:24:59 +04:00
6 changed files with 57 additions and 53 deletions

View File

@ -702,30 +702,28 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
if (!(query= thd->alloc(MAX_DROP_TABLE_Q_LEN)))
goto exit; /* not much else we can do */
query_pos= query_data_start= strmov(query,"drop table ");
query_pos= query_data_start= strmov(query,"drop table ");
query_end= query + MAX_DROP_TABLE_Q_LEN;
db_len= strlen(db);
for (tbl= dropped_tables; tbl; tbl= tbl->next_local)
{
uint tbl_name_len;
if (!tbl->was_dropped)
continue;
/* 3 for the quotes and the comma*/
tbl_name_len= strlen(tbl->table_name) + 3;
/* 3 for the quotes and the comma*/
tbl_name_len= strlen(tbl->real_name) + 3;
if (query_pos + tbl_name_len + 1 >= query_end)
{
write_to_binlog(thd, query, query_pos -1 - query, db, db_len);
query_pos= query_data_start;
}
}
*query_pos++ = '`';
query_pos= strmov(query_pos,tbl->table_name);
*query_pos++ = '`';
*query_pos++ = ',';
}
if (query_pos != query_data_start)
{
write_to_binlog(thd, query, query_pos -1 - query, db, db_len);