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
parent c20208d9
......@@ -921,7 +921,7 @@ static void safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi)
mi->port, 0, 0))
{
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);
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->version=refresh_version;
table->flush_version=flush_version;
table->version=0;
table->flush_version=0;
if (!key_cache_inited)
ha_key_cache();
table->in_use = thd;
check_unused();
pthread_mutex_unlock(&LOCK_open);
table->next = thd->open_tables;
thd->open_tables = table;
table->tablenr=thd->current_tablenr++;
table->used_fields=0;
table->const_table=0;
......
#! /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();
}
\ No newline at end of file
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