diff options
author | monty@mashka.mysql.fi <> | 2002-08-08 03:12:02 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-08-08 03:12:02 +0300 |
commit | 2c4fa340cccbf11dc7b7f944cf7ca30af48edf4f (patch) | |
tree | c44ce89903320c9d19cd6fe9767f75d997d2a1d0 /vio | |
parent | bc035c71f1d94649253e4dac5fb8e5c981c7d834 (diff) | |
download | mariadb-git-2c4fa340cccbf11dc7b7f944cf7ca30af48edf4f.tar.gz |
Lots of code fixes to the replication code (especially the binary logging and index log file handling)
Fixed bugs in my last changeset that made MySQL hard to compile.
Added mutex around some data that could cause table cache corruptions when using OPTIMIZE TABLE / REPAIR TABLE or automatic repair of MyISAM tables.
Added mutex around some data in the slave start/stop code that could cause THD linked list corruptions
Extended my_chsize() to allow one to specify a filler character.
Extend vio_blocking to return the old state (This made some usage of this function much simpler)
Added testing for some functions that they caller have got the required mutexes before calling the function.
Use setrlimit() to ensure that we can write core file if one specifies --core-file.
Added --slave-compressed-protocol
Made 2 the minimum length for ft_min_word_len
Added variables foreign_key_checks & unique_checks.
Less logging from replication code (if not started with --log-warnings)
Changed that SHOW INNODB STATUS requre the SUPER privilege
More DBUG statements and a lot of new code comments
Diffstat (limited to 'vio')
-rw-r--r-- | vio/vio.c | 3 | ||||
-rw-r--r-- | vio/viosocket.c | 8 | ||||
-rw-r--r-- | vio/viossl.c | 9 |
3 files changed, 16 insertions, 4 deletions
diff --git a/vio/vio.c b/vio/vio.c index 67cb7ec95cd..bb97f195110 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -83,6 +83,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type, DBUG_VOID_RETURN; } + /* Open the socket or TCP/IP connection and read the fnctl() status */ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) @@ -102,12 +103,14 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) #elif defined(HAVE_SYS_IOCTL_H) /* hpux */ /* Non blocking sockets doesn't work good on HPUX 11.0 */ (void) ioctl(sd,FIOSNBIO,0); + vio->fcntl_mode &= ~O_NONBLOCK; #endif #else /* !defined(__WIN__) && !defined(__EMX__) */ { /* set to blocking mode by default */ ulong arg=0, r; r = ioctlsocket(sd,FIONBIO,(void*) &arg, sizeof(arg)); + vio->fcntl_mode &= ~O_NONBLOCK; } #endif } diff --git a/vio/viosocket.c b/vio/viosocket.c index dc2bfaa6e0c..176af25b395 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -110,11 +110,15 @@ int vio_write(Vio * vio, const gptr buf, int size) } -int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode) +int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode, + my_bool *old_mode) { int r=0; DBUG_ENTER("vio_blocking"); - DBUG_PRINT("enter", ("set_blocking_mode: %d", (int) set_blocking_mode)); + + *old_mode= test(!(vio->fcntl_mode & O_NONBLOCK)); + DBUG_PRINT("enter", ("set_blocking_mode: %d old_mode: %d", + (int) set_blocking_mode, (int) *old_mode)); #if !defined(HAVE_OPENSSL) #if !defined(___WIN__) && !defined(__EMX__) diff --git a/vio/viossl.c b/vio/viossl.c index 6d85b119f20..7365bdc3daf 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -259,8 +259,10 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout) char *str; char buf[1024]; X509* client_cert; + my_bool unused; DBUG_ENTER("sslaccept"); DBUG_PRINT("enter", ("sd=%d ptr=%p", vio->sd,ptr)); + vio_reset(vio,VIO_TYPE_SSL,vio->sd,0,FALSE); vio->ssl_=0; vio->open_=FALSE; @@ -272,7 +274,7 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout) } DBUG_PRINT("info", ("ssl_=%p timeout=%ld",vio->ssl_, timeout)); SSL_clear(vio->ssl_); - vio_blocking(vio, FALSE); + vio_blocking(vio, FALSE, &unused); SSL_SESSION_set_timeout(SSL_get_session(vio->ssl_), timeout); SSL_set_fd(vio->ssl_,vio->sd); SSL_set_accept_state(vio->ssl_); @@ -310,12 +312,15 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout) DBUG_VOID_RETURN; } + void sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout) { char *str; X509* server_cert; + my_bool unused; DBUG_ENTER("sslconnect"); DBUG_PRINT("enter", ("sd=%d ptr=%p ctx: %p", vio->sd,ptr,ptr->ssl_context_)); + vio_reset(vio,VIO_TYPE_SSL,vio->sd,0,FALSE); vio->ssl_=0; vio->open_=FALSE; @@ -327,7 +332,7 @@ void sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout) } DBUG_PRINT("info", ("ssl_=%p timeout=%ld",vio->ssl_, timeout)); SSL_clear(vio->ssl_); - vio_blocking(vio, FALSE); + vio_blocking(vio, FALSE, &unused); SSL_SESSION_set_timeout(SSL_get_session(vio->ssl_), timeout); SSL_set_fd (vio->ssl_, vio->sd); SSL_set_connect_state(vio->ssl_); |