Commit 9e796abb authored by unknown's avatar unknown

merged

parents e0f9b8a8 961abf79
...@@ -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
......
...@@ -4,29 +4,29 @@ reset master; ...@@ -4,29 +4,29 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop database if exists mysqltest; drop database if exists mysqltest1;
create database mysqltest; create database mysqltest1;
create table mysqltest.t1 (n int); create table mysqltest1.t1 (n int);
insert into mysqltest.t1 values (1); insert into mysqltest1.t1 values (1);
select * from mysqltest.t1 into outfile 'mysqltest/f1.txt'; select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest.t2 (n int); create table mysqltest1.t2 (n int);
create table mysqltest.t3 (n int); create table mysqltest1.t3 (n int);
drop database mysqltest; drop database mysqltest1;
ERROR HY000: Error dropping database (can't rmdir './mysqltest/', errno: 17) ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17)
use mysqltest; use mysqltest1;
show tables; show tables;
Tables_in_mysqltest Tables_in_mysqltest1
drop database mysqltest; drop database mysqltest1;
ERROR HY000: Error dropping database (can't rmdir './mysqltest/', errno: 17) ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17)
use mysqltest; use mysqltest1;
show tables; show tables;
Tables_in_mysqltest Tables_in_mysqltest1
use test; use test;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1234); insert into t1 values (1234);
use mysqltest; use mysqltest1;
show tables; show tables;
Tables_in_mysqltest Tables_in_mysqltest1
use test; use test;
select * from t1; select * from t1;
n n
......
...@@ -5,32 +5,33 @@ ...@@ -5,32 +5,33 @@
connection master; connection master;
--disable_warnings --disable_warnings
drop database if exists mysqltest; drop database if exists mysqltest1;
--enable_warnings --enable_warnings
create database mysqltest; create database mysqltest1;
create table mysqltest.t1 (n int); create table mysqltest1.t1 (n int);
insert into mysqltest.t1 values (1); insert into mysqltest1.t1 values (1);
select * from mysqltest.t1 into outfile 'mysqltest/f1.txt'; select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest.t2 (n int); create table mysqltest1.t2 (n int);
create table mysqltest.t3 (n int); create table mysqltest1.t3 (n int);
--error 1010 --error 1010
drop database mysqltest; drop database mysqltest1;
use mysqltest; 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; --disable_query_log
let $1=50; let $1=1000;
while ($1) while ($1)
{ {
eval create table mysqltest.mysql_test_long_table_name$1 (n int); eval create table mysqltest1.t$1(n int);
dec $1; dec $1;
} }
enable_query_log; --enable_query_log
--error 1010 --error 1010
drop database mysqltest; drop database mysqltest1;
use mysqltest; use mysqltest1;
show tables; show tables;
use test; use test;
create table t1 (n int); create table t1 (n int);
...@@ -38,7 +39,7 @@ insert into t1 values (1234); ...@@ -38,7 +39,7 @@ insert into t1 values (1234);
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
use mysqltest; use mysqltest1;
show tables; show tables;
use test; use test;
select * from t1; select * from t1;
...@@ -50,7 +51,5 @@ sync_slave_with_master; ...@@ -50,7 +51,5 @@ sync_slave_with_master;
#cleanup #cleanup
connection slave; connection slave;
stop slave; stop slave;
system rm -rf var/master-data/mysqltest; system rm -rf var/master-data/mysqltest1;
# End of 4.1 tests
...@@ -217,6 +217,12 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) ...@@ -217,6 +217,12 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
#endif #endif
} }
#ifdef SAFEMALLOC
#define TRASH(X) bfill(((char*)(X) + ((X)->size-(X)->left)), (X)->left, 0xa5)
#else
#define TRASH /* no-op */
#endif
/* Mark all data in blocks free for reusage */ /* Mark all data in blocks free for reusage */
static inline void mark_blocks_free(MEM_ROOT* root) static inline void mark_blocks_free(MEM_ROOT* root)
...@@ -227,14 +233,20 @@ static inline void mark_blocks_free(MEM_ROOT* root) ...@@ -227,14 +233,20 @@ static inline void mark_blocks_free(MEM_ROOT* root)
/* iterate through (partially) free blocks, mark them free */ /* iterate through (partially) free blocks, mark them free */
last= &root->free; last= &root->free;
for (next= root->free; next; next= *(last= &next->next)) for (next= root->free; next; next= *(last= &next->next))
{
next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM)); next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM));
TRASH(next);
}
/* Combine the free and the used list */ /* Combine the free and the used list */
*last= next=root->used; *last= next=root->used;
/* now go through the used blocks and mark them free */ /* now go through the used blocks and mark them free */
for (; next; next= next->next) for (; next; next= next->next)
{
next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM)); next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM));
TRASH(next);
}
/* Now everything is set; Indicate that nothing is used anymore */ /* Now everything is set; Indicate that nothing is used anymore */
root->used= 0; root->used= 0;
...@@ -280,6 +292,7 @@ void free_root(MEM_ROOT *root, myf MyFlags) ...@@ -280,6 +292,7 @@ void free_root(MEM_ROOT *root, myf MyFlags)
{ {
root->free=root->pre_alloc; root->free=root->pre_alloc;
root->free->left=root->pre_alloc->size-ALIGN_SIZE(sizeof(USED_MEM)); root->free->left=root->pre_alloc->size-ALIGN_SIZE(sizeof(USED_MEM));
TRASH(root->pre_alloc);
root->free->next=0; root->free->next=0;
} }
root->block_num= 4; root->block_num= 4;
......
...@@ -708,8 +708,6 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) ...@@ -708,8 +708,6 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
for (tbl= dropped_tables; tbl; tbl= tbl->next) for (tbl= dropped_tables; tbl; tbl= tbl->next)
{ {
uint tbl_name_len; uint tbl_name_len;
if (!tbl->was_dropped)
continue;
/* 3 for the quotes and the comma*/ /* 3 for the quotes and the comma*/
tbl_name_len= strlen(tbl->real_name) + 3; tbl_name_len= strlen(tbl->real_name) + 3;
......
...@@ -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