diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-08-15 15:57:47 -0600 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-08-15 15:57:47 -0600 |
commit | abb2aaa2792183168b11479a9b99d5d700667e1e (patch) | |
tree | a77300d361c4ea8556793f6c691e3b2812accf0c | |
parent | aaf71625ea95f8163eb66a095ed00ea1953e3e7e (diff) | |
parent | 2b8614210d1db003a6827f301dad0321b1a7478e (diff) | |
download | mariadb-git-abb2aaa2792183168b11479a9b99d5d700667e1e.tar.gz |
merged replication fixes from 3.23
BitKeeper/etc/logging_ok:
auto-union
Docs/manual.texi:
merged
sql/mini_client.cc:
merged
sql/mysqld.cc:
merged
sql/sql_repl.cc:
merged
-rw-r--r-- | BitKeeper/etc/logging_ok | 1 | ||||
-rw-r--r-- | innobase/row/row0sel.c | 1 | ||||
-rw-r--r-- | innobase/srv/srv0start.c | 10 | ||||
-rw-r--r-- | innobase/sync/sync0sync.c | 2 | ||||
-rw-r--r-- | sql/ha_innobase.cc | 13 | ||||
-rw-r--r-- | sql/mini_client.cc | 16 | ||||
-rw-r--r-- | sql/mysqld.cc | 6 | ||||
-rw-r--r-- | sql/sql_repl.cc | 22 |
8 files changed, 57 insertions, 14 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index c8e74a50186..81a2ba694f7 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -18,6 +18,7 @@ paul@teton.kitebird.com root@x3.internalnet sasha@mysql.sashanet.com serg@serg.mysql.com +tfr@sarvik.tfr.cafe.ee tim@bitch.mysql.fi tim@black.box tim@hundin.mysql.fi diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index b74bd29a89e..0ad6b7084e2 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2103,6 +2103,7 @@ row_sel_store_mysql_rec( if (extern_field_heap) { mem_heap_free(extern_field_heap); + extern_field_heap = NULL; } } else { mysql_rec[templ->mysql_null_byte_offset] |= diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index a79a808ba2e..b3f5dbb28b5 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -141,21 +141,21 @@ srv_normalize_path_for_win( } /************************************************************************* -Adds a slash or a backslash to the end of a string if it is missing. */ +Adds a slash or a backslash to the end of a string if it is missing +and the string is not empty. */ static char* srv_add_path_separator_if_needed( /*=============================*/ - /* out, own: string which has the separator */ + /* out, own: string which has the separator if the + string is not empty */ char* str) /* in: null-terminated character string */ { char* out_str; if (ut_strlen(str) == 0) { - out_str = ut_malloc(2); - sprintf(out_str, "%s", SRV_PATH_SEPARATOR); - return(out_str); + return(str); } if (str[ut_strlen(str) - 1] == SRV_PATH_SEPARATOR[0]) { diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c index a125f65be41..f0dbe145098 100644 --- a/innobase/sync/sync0sync.c +++ b/innobase/sync/sync0sync.c @@ -167,7 +167,7 @@ struct sync_level_struct{ }; -#if defined(__GNUC__) && defined(UNIV_INTEL_X86) +#if defined(notdefined) && defined(__GNUC__) && defined(UNIV_INTEL_X86) ulint sync_gnuc_intelx86_test_and_set( diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 7bd71363915..d0cb8af906a 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -259,12 +259,15 @@ innobase_parse_data_file_paths_and_sizes(void) str = innobase_data_file_path; /* First calculate the number of data files and check syntax: - path:size[M];path:size[M]... */ + path:size[M];path:size[M]... . Note that a Windows path may + contain a drive name and a ':'. */ while (*str != '\0') { path = str; - while (*str != ':' && *str != '\0') { + while ((*str != ':' && *str != '\0') + || (*str == ':' + && (*(str + 1) == '\\' || *(str + 1) == '/'))) { str++; } @@ -335,7 +338,11 @@ innobase_parse_data_file_paths_and_sizes(void) while (*str != '\0') { path = str; - while (*str != ':' && *str != '\0') { + /* Note that we must ignore the ':' in a Windows path */ + + while ((*str != ':' && *str != '\0') + || (*str == ':' + && (*(str + 1) == '\\' || *(str + 1) == '/'))) { str++; } diff --git a/sql/mini_client.cc b/sql/mini_client.cc index 8966b303000..261b1d03f78 100644 --- a/sql/mini_client.cc +++ b/sql/mini_client.cc @@ -40,6 +40,8 @@ #include "mysqld_error.h" #include "errmsg.h" +extern ulong net_read_timeout; + extern "C" { // Because of SCO 3.2V4.2 #include <sys/stat.h> #include <signal.h> @@ -63,6 +65,7 @@ extern "C" { // Because of SCO 3.2V4.2 #endif #if defined(THREAD) && !defined(__WIN__) #include <my_pthread.h> /* because of signal() */ +#include <thr_alarm.h> #endif #ifndef INADDR_NONE #define INADDR_NONE -1 @@ -493,18 +496,25 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, struct sockaddr_in sock_addr; uint pkt_length; NET *net= &mysql->net; + thr_alarm_t alarmed; +#if !defined(__WIN__) + ALARM alarm_buff; +#endif + #ifdef __WIN__ HANDLE hPipe=INVALID_HANDLE_VALUE; #endif #ifdef HAVE_SYS_UN_H struct sockaddr_un UNIXaddr; #endif - DBUG_ENTER("mysql_real_connect"); + DBUG_ENTER("mc_mysql_connect"); DBUG_PRINT("enter",("host: %s db: %s user: %s", 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 */ @@ -639,8 +649,12 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, DBUG_PRINT("error",("Got error %d on connect to '%s'",ERRNO,host)); net->last_errno= CR_CONN_HOST_ERROR; sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, 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 5efeb59c17e..cf0a61d3606 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -500,6 +500,7 @@ static void close_connections(void) } #endif end_thr_alarm(); // Don't allow alarms + end_slave(); /* First signal all threads that it's time to die */ @@ -716,8 +717,8 @@ void clean_up(bool print_message) x_free(opt_bin_logname); bitmap_free(&temp_pool); free_max_user_conn(); - end_slave(); end_slave_list(); + #ifndef __WIN__ if (!opt_bootstrap) (void) my_delete(pidfile_name,MYF(0)); // This may not always exist @@ -1405,7 +1406,8 @@ static void *signal_hand(void *arg __attribute__((unused))) } break; case SIGHUP: - reload_acl_and_cache((THD*) 0,~0, (TABLE_LIST*) 0); // Flush everything + reload_acl_and_cache((THD*) 0,REFRESH_LOG, + (TABLE_LIST*) 0); // Flush logs mysql_print_status((THD*) 0); // Send debug some info break; #ifdef USE_ONE_SIGNAL_HAND diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index cda1a8531df..84a7bc7315a 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -688,8 +688,26 @@ int stop_slave(THD* thd, bool net_report ) // do not abort the slave in the middle of a query, so we do not set // thd->killed for the slave thread thd->proc_info = "waiting for slave to die"; - while (slave_running) - pthread_cond_wait(&COND_slave_stopped, &LOCK_slave); + while(slave_running) + { + /* there is a small change that slave thread might miss the first + alarm. To protect againts it, resend the signal until it reacts + */ + + struct timespec abstime; +#ifdef HAVE_TIMESPEC_TS_SEC + abstime.ts_sec=time(NULL)+2; + abstime.ts_nsec=0; +#else + struct timeval tv; + gettimeofday(&tv,0); + abstime.tv_sec=tv.tv_sec+2; + abstime.tv_nsec=tv.tv_usec*1000; +#endif + pthread_cond_timedwait(&COND_slave_stopped, &LOCK_slave, &abstime); + if (slave_running) + thr_alarm_kill(slave_real_id); + } } else slave_errno = ER_SLAVE_NOT_RUNNING; |