summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-04-07 21:37:25 +0300
committerunknown <monty@mashka.mysql.fi>2003-04-07 21:37:25 +0300
commita312e13795d772af8edc3ba4a089e138b30e1b21 (patch)
tree24cd9d514c957dae27801d2bbc7c87d6cc939aa6
parent654d1026e4517c760372b828fe3c9457aa86972b (diff)
parentda68e3d69ff23aa89322bc4460a214aa57798c5b (diff)
downloadmariadb-git-a312e13795d772af8edc3ba4a089e138b30e1b21.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-3.23
into mashka.mysql.fi:/home/my/mysql-3.23 sql/slave.cc: Auto merged
-rw-r--r--mysql-test/t/rpl_alter.test22
-rw-r--r--sql/ha_innobase.cc2
-rw-r--r--sql/mini_client.cc12
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/slave.cc5
5 files changed, 24 insertions, 25 deletions
diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/t/rpl_alter.test
index a65605f703e..61ac55843cf 100644
--- a/mysql-test/t/rpl_alter.test
+++ b/mysql-test/t/rpl_alter.test
@@ -1,21 +1,21 @@
source include/master-slave.inc;
connection master;
use test;
-drop database if exists d1;
-create database d1;
-create table d1.t1 ( n int);
-alter table d1.t1 add m int;
-insert into d1.t1 values (1,2);
-create table d1.t2 (n int);
-insert into d1.t2 values (45);
-rename table d1.t2 to d1.t3, d1.t1 to d1.t2;
+drop database if exists test_$1;
+create database test_$1;
+create table test_$1.t1 ( n int);
+alter table test_$1.t1 add m int;
+insert into test_$1.t1 values (1,2);
+create table test_$1.t2 (n int);
+insert into test_$1.t2 values (45);
+rename table test_$1.t2 to test_$1.t3, test_$1.t1 to test_$1.t2;
save_master_pos;
connection slave;
sync_with_master;
-select * from d1.t2;
-select * from d1.t3;
+select * from test_$1.t2;
+select * from test_$1.t3;
connection master;
-drop database d1;
+drop database test_$1;
save_master_pos;
connection slave;
sync_with_master;
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index c0aea197b1f..b8a794a61a0 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -113,7 +113,7 @@ my_bool innobase_fast_shutdown = TRUE;
2 : write to the log file at each commit, but flush to disk only once per
second */
-long innobase_flush_log_at_trx_commit = 0;
+long innobase_flush_log_at_trx_commit = 1;
/* The following counter is used to convey information to InnoDB
about server activity: in selects it is not sensible to call
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index 453f27822d9..2c74eb96bf9 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -515,8 +515,6 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
host ? host : "(Null)",
db ? db : "(Null)",
user ? user : "(Null)"));
- thr_alarm_init(&alarmed);
- thr_alarm(&alarmed,(uint) net_read_timeout,&alarm_buff);
bzero((char*) &mysql->options,sizeof(mysql->options));
net->vio = 0; /* If something goes wrong */
@@ -598,7 +596,11 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
host=LOCAL_HOST;
sprintf(host_info=buff,ER(CR_TCP_CONNECTION),host);
DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host,port));
- if ((sock = socket(AF_INET,SOCK_STREAM,0)) == SOCKET_ERROR)
+ thr_alarm_init(&alarmed);
+ thr_alarm(&alarmed, net_read_timeout, &alarm_buff);
+ sock = (my_socket) socket(AF_INET,SOCK_STREAM,0);
+ thr_end_alarm(&alarmed);
+ if (sock == SOCKET_ERROR)
{
net->last_errno=CR_IPSOCK_ERROR;
sprintf(net->last_error,ER(net->last_errno),socket_errno);
@@ -641,12 +643,8 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
socket_errno,host));
net->last_errno= CR_CONN_HOST_ERROR;
sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, socket_errno);
- if (thr_alarm_in_use(&alarmed))
- thr_end_alarm(&alarmed);
goto error;
}
- if (thr_alarm_in_use(&alarmed))
- thr_end_alarm(&alarmed);
}
if (!net->vio || my_net_init(net, net->vio))
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 9a227ef5034..a10ad60a3e7 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1433,8 +1433,12 @@ static void *signal_hand(void *arg __attribute__((unused)))
my_thread_init(); // Init new thread
DBUG_ENTER("signal_hand");
- /* Setup alarm handler */
- init_thr_alarm(max_connections+max_insert_delayed_threads);
+ /*
+ Setup alarm handler
+ This should actually be '+ max_number_of_slaves' instead of +10,
+ but the +10 should be quite safe.
+ */
+ init_thr_alarm(max_connections+max_insert_delayed_threads+10);
#if SIGINT != THR_KILL_SIGNAL
(void) sigemptyset(&set); // Setup up SIGINT for debug
(void) sigaddset(&set,SIGINT); // For debugging
diff --git a/sql/slave.cc b/sql/slave.cc
index acc443b2296..39c3d31ee66 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -784,10 +784,7 @@ static int safe_sleep(THD* thd, int sec)
*/
thr_alarm(&alarmed, 2 * nap_time,&alarm_buff);
sleep(nap_time);
- // if we wake up before the alarm goes off, hit the button
- // so it will not wake up the wife and kids :-)
- if (thr_alarm_in_use(&alarmed))
- thr_end_alarm(&alarmed);
+ thr_end_alarm(&alarmed);
if (slave_killed(thd))
return 1;