sql/slave.cc
fixed typo in the error message sql/sql_base.cc fixed bugs in reopen_name_locked_table() after talking to Monty added a test case for restore + select sql/slave.cc: fixed typo in the error message sql/sql_base.cc: fixed bugs in reopen_name_locked_table() after talking to Monty
This commit is contained in:
parent
de3381459b
commit
725bccc0fc
@ -921,7 +921,7 @@ static void safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi)
|
|||||||
mi->port, 0, 0))
|
mi->port, 0, 0))
|
||||||
{
|
{
|
||||||
sql_print_error(
|
sql_print_error(
|
||||||
"Slave thread: error connecting to slave:%s, retry in %d sec",
|
"Slave thread: error connecting to master:%s, retry in %d sec",
|
||||||
mc_mysql_error(mysql), mi->connect_retry);
|
mc_mysql_error(mysql), mi->connect_retry);
|
||||||
safe_sleep(thd, mi->connect_retry);
|
safe_sleep(thd, mi->connect_retry);
|
||||||
}
|
}
|
||||||
|
@ -866,13 +866,15 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
table->key_length=key_length;
|
table->key_length=key_length;
|
||||||
table->version=refresh_version;
|
table->version=0;
|
||||||
table->flush_version=flush_version;
|
table->flush_version=0;
|
||||||
if (!key_cache_inited)
|
if (!key_cache_inited)
|
||||||
ha_key_cache();
|
ha_key_cache();
|
||||||
table->in_use = thd;
|
table->in_use = thd;
|
||||||
check_unused();
|
check_unused();
|
||||||
pthread_mutex_unlock(&LOCK_open);
|
pthread_mutex_unlock(&LOCK_open);
|
||||||
|
table->next = thd->open_tables;
|
||||||
|
thd->open_tables = table;
|
||||||
table->tablenr=thd->current_tablenr++;
|
table->tablenr=thd->current_tablenr++;
|
||||||
table->used_fields=0;
|
table->used_fields=0;
|
||||||
table->const_table=0;
|
table->const_table=0;
|
||||||
|
63
tests/restore-lock.smack
Executable file
63
tests/restore-lock.smack
Executable file
@ -0,0 +1,63 @@
|
|||||||
|
#! /usr/local/bin/mysql-super-smack
|
||||||
|
|
||||||
|
query "select"
|
||||||
|
{
|
||||||
|
type "select";
|
||||||
|
query "select count(*) from w";
|
||||||
|
has_result_set "y";
|
||||||
|
parsed "n";
|
||||||
|
}
|
||||||
|
|
||||||
|
query "restore"
|
||||||
|
{
|
||||||
|
type "restore";
|
||||||
|
query "restore table w from '/tmp'";
|
||||||
|
has_result_set "y";
|
||||||
|
parsed "n";
|
||||||
|
}
|
||||||
|
|
||||||
|
query "drop"
|
||||||
|
{
|
||||||
|
type "drop";
|
||||||
|
query "drop table if exists w";
|
||||||
|
has_result_set "n";
|
||||||
|
parsed "n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
client "restorer"
|
||||||
|
{
|
||||||
|
user "root";
|
||||||
|
pass "";
|
||||||
|
host "localhost";
|
||||||
|
db "test";
|
||||||
|
query_barrel "1 drop 1 restore";
|
||||||
|
}
|
||||||
|
|
||||||
|
client "selector"
|
||||||
|
{
|
||||||
|
user "root";
|
||||||
|
pass "";
|
||||||
|
host "localhost";
|
||||||
|
db "test";
|
||||||
|
query_barrel "-3 1 select";
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
|
{
|
||||||
|
selector.init();
|
||||||
|
restorer.init();
|
||||||
|
selector.create_threads(1);
|
||||||
|
restorer.create_threads(1);
|
||||||
|
selector.set_num_rounds(1);
|
||||||
|
restorer.set_num_rounds(1);
|
||||||
|
selector.connect();
|
||||||
|
restorer.connect();
|
||||||
|
restorer.unload_query_barrel();
|
||||||
|
selector.unload_query_barrel();
|
||||||
|
restorer.collect_threads();
|
||||||
|
selector.collect_threads();
|
||||||
|
selector.disconnect();
|
||||||
|
restorer.disconnect();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user