Commit e2c29343 authored by unknown's avatar unknown

after pull cleanup


configure.in:
  don't be too restrictive
mysql-test/r/rpl_drop_db.result:
  test case cleanup
mysql-test/t/rpl_drop_db.test:
  test case cleanup
parent 9df32ec8
...@@ -118,7 +118,7 @@ AC_SUBST(SAVE_LDFLAGS) ...@@ -118,7 +118,7 @@ AC_SUBST(SAVE_LDFLAGS)
AC_SUBST(SAVE_CXXLDFLAGS) AC_SUBST(SAVE_CXXLDFLAGS)
AC_SUBST(CXXLDFLAGS) AC_SUBST(CXXLDFLAGS)
AC_PREREQ(2.57)dnl Minimum Autoconf version required. AC_PREREQ(2.52)dnl Minimum Autoconf version required.
#AC_ARG_PROGRAM # Automaticly invoked by AM_INIT_AUTOMAKE #AC_ARG_PROGRAM # Automaticly invoked by AM_INIT_AUTOMAKE
AM_SANITY_CHECK AM_SANITY_CHECK
......
This diff is collapsed.
...@@ -5,30 +5,33 @@ ...@@ -5,30 +5,33 @@
connection master; connection master;
--disable_warnings --disable_warnings
drop database if exists d1; drop database if exists mysqltest1;
--enable_warnings --enable_warnings
create database d1; create database mysqltest1;
create table d1.t1 (n int); create table mysqltest1.t1 (n int);
insert into d1.t1 values (1); insert into mysqltest1.t1 values (1);
select * from d1.t1 into outfile 'd1/f1.txt'; select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table d1.t2 (n int); create table mysqltest1.t2 (n int);
create table d1.t3 (n int); create table mysqltest1.t3 (n int);
--error 1010 --error 1010
drop database d1; drop database mysqltest1;
use d1; use mysqltest1;
show tables; show tables;
# test the branch of the code that deals with the query buffer overflow # test the branch of the code that deals with the query buffer overflow
--disable_query_log
let $1=1000; let $1=1000;
while ($1) while ($1)
{ {
eval create table d1.t$1(n int); eval create table mysqltest1.t$1(n int);
dec $1; dec $1;
} }
--enable_query_log
--error 1010 --error 1010
drop database d1; drop database mysqltest1;
use d1; use mysqltest1;
show tables; show tables;
use test; use test;
create table t1 (n int); create table t1 (n int);
...@@ -36,7 +39,7 @@ insert into t1 values (1234); ...@@ -36,7 +39,7 @@ insert into t1 values (1234);
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
use d1; use mysqltest1;
show tables; show tables;
use test; use test;
select * from t1; select * from t1;
...@@ -48,5 +51,5 @@ sync_slave_with_master; ...@@ -48,5 +51,5 @@ sync_slave_with_master;
#cleanup #cleanup
connection slave; connection slave;
stop slave; stop slave;
system rm -rf var/master-data/d1; system rm -rf var/master-data/mysqltest1;
...@@ -697,41 +697,38 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) ...@@ -697,41 +697,38 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
else if (mysql_bin_log.is_open()) else if (mysql_bin_log.is_open())
{ {
char* query= thd->alloc(MAX_DROP_TABLE_Q_LEN); char* query= thd->alloc(MAX_DROP_TABLE_Q_LEN);
if (!query) if (!query)
goto exit; /* not much else we can do */ 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; char* p_end= query + MAX_DROP_TABLE_Q_LEN;
TABLE_LIST* tbl; TABLE_LIST* tbl;
bool last_query_needs_write= 0; bool last_query_needs_write= 0;
uint db_len= strlen(db); uint db_len= strlen(db);
for (tbl= dropped_tables;tbl;tbl= tbl->next) for (tbl= dropped_tables;tbl;tbl= tbl->next)
{ {
if (!tbl->was_dropped) /* 3 for the quotes and the comma*/
continue; 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) if (p + tbl_name_len + 1 >= p_end)
{ {
*--p= 0; /* kill , */ *--p= 0; /* kill , */
write_to_binlog(thd, query, p - query, db, db_len); write_to_binlog(thd, query, p - query, db, db_len);
p= query + 11; /* reuse the initial "drop table" */ p= query + 11; /* reuse the initial "drop table" */
} }
*p++ = '`'; *p++ = '`';
p= strmov(p,tbl->real_name); p= strmov(p,tbl->real_name);
*p++ = '`'; *p++ = '`';
*p++ = ','; *p++ = ',';
last_query_needs_write= 1; last_query_needs_write= 1;
} }
if (last_query_needs_write) if (last_query_needs_write)
{ {
*--p= 0; *--p= 0;
write_to_binlog(thd, query, p - query, db, db_len); write_to_binlog(thd, query, p - query, db, db_len);
} }
} }
exit: exit:
......
...@@ -220,7 +220,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, ...@@ -220,7 +220,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
for (table=tables ; table ; table=table->next) for (table=tables ; table ; table=table->next)
{ {
char *db=table->db; char *db=table->db;
table->was_dropped= 0;
mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL); mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL);
if (!close_temporary_table(thd, db, table->real_name)) 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, ...@@ -281,8 +280,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
wrong_tables.append(','); wrong_tables.append(',');
wrong_tables.append(String(table->real_name,system_charset_info)); wrong_tables.append(String(table->real_name,system_charset_info));
} }
else
table->was_dropped= 1;
} }
thd->tmp_table_used= tmp_table_deleted; thd->tmp_table_used= tmp_table_deleted;
error= 0; error= 0;
......
...@@ -235,9 +235,6 @@ typedef struct st_table_list ...@@ -235,9 +235,6 @@ typedef struct st_table_list
bool cacheable_table; /* stop PS caching */ bool cacheable_table; /* stop PS caching */
/* used in multi-upd privelege check */ /* used in multi-upd privelege check */
bool table_in_update_from_clause; bool table_in_update_from_clause;
/* used for proper partially successful DROP DATABASE binlogging */
bool was_dropped;
} TABLE_LIST; } TABLE_LIST;
typedef struct st_changed_table_list typedef struct st_changed_table_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment