summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-06-05 03:38:10 +0300
committerunknown <monty@hundin.mysql.fi>2001-06-05 03:38:10 +0300
commitfe1842d9ee1a7e51f74ca192d3181968f16a0b29 (patch)
tree0630af7b21e80e56fc1ef68e9c7d0fa7233958a1 /vio
parentc866beb5132157903765327fef1c71693d2204ae (diff)
downloadmariadb-git-fe1842d9ee1a7e51f74ca192d3181968f16a0b29.tar.gz
Symlinking of tables should not work.
Fixed error number handling bug in mysqltest. Fixed that error number from insert delayed is reported correctly. merged new vio code with old violite code. client/mysqltest.c: Fixed bug that error numbers wasn't tested properly. myisam/mi_check.c: Moved initialization of variables to avoid a bug. myisam/mi_create.c: Fixed bug in symlink handling. myisam/mi_test_all.sh: Fixed script so that it works. myisam/myisamchk.c: Removed --no-symlinks option mysql-test/mysql-test-run.sh: Cleaned up error message mysql-test/t/bdb.test: Fixed wrong error numbers mysql-test/t/err000001.test: Fixed wrong error numbers mysql-test/t/innodb.test: Fixed wrong error numbers mysql-test/t/overflow.test: Fixed wrong error numbers mysql-test/t/status.test: Ensure that we are using myisam tables for the lock test. mysys/my_delete.c: cleanup mysys/my_symlink2.c: Added option to not overwrite files when using symlinks. sql/Makefile.am: Moved vio to avoid link error. sql/ha_myisam.cc: Fixed symlink handling. sql/mysqld.cc: Changed --skip-symlinks to --skip-symlink sql/sql_insert.cc: Fixed that error number from insert delayed is reported correctly sql/sql_parse.cc: Fixed symlink handling. sql/sql_table.cc: Fixed symlink handling. vio/vio.c: cleanup vio/viosocket.c: c
Diffstat (limited to 'vio')
-rw-r--r--vio/vio.c58
-rw-r--r--vio/viosocket.c10
2 files changed, 33 insertions, 35 deletions
diff --git a/vio/vio.c b/vio/vio.c
index 689a01f4475..c47671d0e23 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -66,38 +66,40 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
my_socket sd, HANDLE hPipe,
my_bool localhost)
{
- bzero((char*) vio, sizeof(Vio));
+ bzero((char*) vio, sizeof(*vio));
vio->type = type;
vio->sd = sd;
vio->hPipe = hPipe;
vio->localhost= localhost;
#ifdef HAVE_VIO
-if(type == VIO_TYPE_SSL){
- vio->viodelete =vio_ssl_delete;
- vio->vioerrno =vio_ssl_errno;
- vio->read =vio_ssl_read;
- vio->write =vio_ssl_write;
- vio->fastsend =vio_ssl_fastsend;
- vio->viokeepalive=vio_ssl_keepalive;
- vio->should_retry=vio_ssl_should_retry;
- vio->vioclose =vio_ssl_close;
- vio->peer_addr =vio_ssl_peer_addr;
- vio->in_addr =vio_ssl_in_addr;
- vio->poll_read =vio_ssl_poll_read;
-} else { /* default is VIO_TYPE_TCPIP */
- vio->viodelete =vio_delete;
- vio->vioerrno =vio_errno;
- vio->read =vio_read;
- vio->write =vio_write;
- vio->fastsend =vio_fastsend;
- vio->viokeepalive=vio_keepalive;
- vio->should_retry=vio_should_retry;
- vio->vioclose =vio_close;
- vio->peer_addr =vio_peer_addr;
- vio->in_addr =vio_in_addr;
- vio->poll_read =vio_poll_read;
-}
-
+ if (type == VIO_TYPE_SSL)
+ {
+ vio->viodelete =vio_ssl_delete;
+ vio->vioerrno =vio_ssl_errno;
+ vio->read =vio_ssl_read;
+ vio->write =vio_ssl_write;
+ vio->fastsend =vio_ssl_fastsend;
+ vio->viokeepalive =vio_ssl_keepalive;
+ vio->should_retry =vio_ssl_should_retry;
+ vio->vioclose =vio_ssl_close;
+ vio->peer_addr =vio_ssl_peer_addr;
+ vio->in_addr =vio_ssl_in_addr;
+ vio->poll_read =vio_ssl_poll_read;
+ }
+ else /* default is VIO_TYPE_TCPIP */
+ {
+ vio->viodelete =vio_delete;
+ vio->vioerrno =vio_errno;
+ vio->read =vio_read;
+ vio->write =vio_write;
+ vio->fastsend =vio_fastsend;
+ vio->viokeepalive =vio_keepalive;
+ vio->should_retry =vio_should_retry;
+ vio->vioclose =vio_close;
+ vio->peer_addr =vio_peer_addr;
+ vio->in_addr =vio_in_addr;
+ vio->poll_read =vio_poll_read;
+ }
#endif /* HAVE_VIO */
}
@@ -148,5 +150,3 @@ Vio *vio_new_win32pipe(HANDLE hPipe)
}
#endif
-
-
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 16260f92596..bf151c19928 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -101,7 +101,7 @@ int vio_read(Vio * vio, gptr buf, int size)
#ifndef DBUG_OFF
if (r < 0)
{
- DBUG_PRINT("error", ("Got error %d during read",errno));
+ DBUG_PRINT("vio_error", ("Got error %d during read",errno));
}
#endif /* DBUG_OFF */
DBUG_PRINT("exit", ("%d", r));
@@ -129,7 +129,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
#ifndef DBUG_OFF
if (r < 0)
{
- DBUG_PRINT("error", ("Got error on write: %d",errno));
+ DBUG_PRINT("vio_error", ("Got error on write: %d",errno));
}
#endif /* DBUG_OFF */
DBUG_PRINT("exit", ("%d", r));
@@ -268,7 +268,7 @@ int vio_close(Vio * vio)
}
if (r)
{
- DBUG_PRINT("error", ("close() failed, error: %d",errno));
+ DBUG_PRINT("vio_error", ("close() failed, error: %d",errno));
/* FIXME: error handling (not critical for MySQL) */
}
vio->type= VIO_CLOSED;
@@ -310,8 +310,7 @@ my_bool vio_peer_addr(Vio * vio, char *buf)
DBUG_PRINT("exit", ("getpeername, error: %d", errno));
DBUG_RETURN(1);
}
- /* FIXME */
-/* my_inet_ntoa(vio->remote.sin_addr,buf); */
+ my_inet_ntoa(vio->remote.sin_addr,buf);
}
DBUG_PRINT("exit", ("addr=%s", buf));
DBUG_RETURN(0);
@@ -349,4 +348,3 @@ my_bool vio_poll_read(Vio *vio,uint timeout)
DBUG_RETURN(fds.revents & POLLIN ? 0 : 1);
#endif
}
-