Commit 196f620e authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Portability fixes + a couple of bug fixes introduced by last push.

parent 46a660f4
...@@ -1756,13 +1756,6 @@ PHP: A server-side HTML-embedded scripting language. ...@@ -1756,13 +1756,6 @@ PHP: A server-side HTML-embedded scripting language.
The Midgard Application Server; a powerful Web development environment The Midgard Application Server; a powerful Web development environment
based on MySQL and PHP. based on MySQL and PHP.
@item @uref{http://www.smartworker.org}
SmartWorker is a platform for Web application development.
@item @uref{http://xsp.lentus.se/}
XSP: e(X)tendible (S)erver (P)ages and is a HTML embedded tag language
written in Java (previously known as XTAGS).
@cindex dbServ @cindex dbServ
@item @uref{http://www.dbServ.de/} @item @uref{http://www.dbServ.de/}
dbServ is an extension to a web server to integrate database output into dbServ is an extension to a web server to integrate database output into
...@@ -1784,28 +1777,12 @@ ForwardSQL: HTML interface to manipulate MySQL databases. ...@@ -1784,28 +1777,12 @@ ForwardSQL: HTML interface to manipulate MySQL databases.
@item @uref{http://www.daa.com.au/~james/www-sql/} @item @uref{http://www.daa.com.au/~james/www-sql/}
WWW-SQL: Display database information. WWW-SQL: Display database information.
@item @uref{http://www.minivend.com/minivend/}
Minivend: A Web shopping cart.
@item @uref{http://www.heitml.com/} @item @uref{http://www.heitml.com/}
HeiTML: A server-side extension of HTML and a 4GL language at the same time. HeiTML: A server-side extension of HTML and a 4GL language at the same time.
@item @uref{http://www.metahtml.com/}
Metahtml: A Dynamic Programming Language for WWW Applications.
@item @uref{http://www.binevolve.com/}
VelocityGen for Perl and Tcl.
@item @uref{http://hawkeye.net/} @item @uref{http://hawkeye.net/}
Hawkeye Internet Server Suite. Hawkeye Internet Server Suite.
@item @uref{http://www.fastflow.com/}
Network Database Connection For Linux
@item @uref{http://www.wdbi.net/}
WDBI: Web browser as a universal front end to databases which supports
MySQL well.
@item @uref{http://www.webgroove.com/} @item @uref{http://www.webgroove.com/}
WebGroove Script: HTML compiler and server-side scripting language. WebGroove Script: HTML compiler and server-side scripting language.
...@@ -1818,18 +1795,9 @@ How to use MySQL with ColdFusion on Solaris. ...@@ -1818,18 +1795,9 @@ How to use MySQL with ColdFusion on Solaris.
@item @uref{http://calistra.com/MySQL/} @item @uref{http://calistra.com/MySQL/}
Calistra's ODBC MySQL Administrator. Calistra's ODBC MySQL Administrator.
@cindex Webmerger
@item @uref{http://www.webmerger.com}
Webmerger - This CGI tool interprets files and generates dynamic output
based on a set of simple tags. Ready-to-run drivers for MySQL and
PostgreSQL through ODBC.
@item @uref{http://phpclub.net/} @item @uref{http://phpclub.net/}
PHPclub - Tips and tricks for PHP. PHPclub - Tips and tricks for PHP.
@item @uref{http://www.penguinservices.com/scripts}
MySQL and Perl Scripts.
@item @uref{http://www.widgetchuck.com} @item @uref{http://www.widgetchuck.com}
The Widgetchuck; Web Site Tools and Gadgets The Widgetchuck; Web Site Tools and Gadgets
...@@ -1846,12 +1814,6 @@ and selectable table content reviewing. ...@@ -1846,12 +1814,6 @@ and selectable table content reviewing.
@item @uref{http://www.omnis-software.com/products/studio/studio.html} @item @uref{http://www.omnis-software.com/products/studio/studio.html}
OMNIS Studio is a rapid application development (RAD) tool. OMNIS Studio is a rapid application development (RAD) tool.
@cindex Web+
@item @uref{http://www.webplus.com}
talentsoft Web+ 4.6 - a powerful and comprehensive development language for
use in creating web-based client/server applications without writing
complicated, low-level, and time-consuming CGI programs.
@end table @end table
@subheading Database Design Tools with MySQL Support @subheading Database Design Tools with MySQL Support
...@@ -1921,9 +1883,6 @@ qpopmysql - A patch to allow POP3 authentication from a MySQL ...@@ -1921,9 +1883,6 @@ qpopmysql - A patch to allow POP3 authentication from a MySQL
database. There's also a link to Paul Khavkine's patch for Procmail to database. There's also a link to Paul Khavkine's patch for Procmail to
allow any MTA to deliver to users in a MySQL database. allow any MTA to deliver to users in a MySQL database.
@item @uref{http://www.pbc.ottawa.on.ca}
Visual Basic class generator for Active X.
@item @uref{http://www.essencesw.com/Software/mysqllib.html} @item @uref{http://www.essencesw.com/Software/mysqllib.html}
New Client libraries for the Mac OS Classic (Macintosh). New Client libraries for the Mac OS Classic (Macintosh).
...@@ -1986,9 +1945,6 @@ A consulting company which mentions MySQL in the right company. ...@@ -1986,9 +1945,6 @@ A consulting company which mentions MySQL in the right company.
PMP Computer Solutions. Database developers using MySQL and PMP Computer Solutions. Database developers using MySQL and
@code{mSQL}. @code{mSQL}.
@item @uref{http://www.aewa.org/}
Airborne Early Warning Association.
@item @uref{http://www.dedserius.com/y2kmatrix/} @item @uref{http://www.dedserius.com/y2kmatrix/}
Y2K tester. Y2K tester.
@end table @end table
...@@ -2008,11 +1964,11 @@ EasySQL: An ODBC-like driver manager. ...@@ -2008,11 +1964,11 @@ EasySQL: An ODBC-like driver manager.
@item @uref{http://www.lightlink.com/hessling/rexxsql.html} @item @uref{http://www.lightlink.com/hessling/rexxsql.html}
A REXX interface to SQL databases. A REXX interface to SQL databases.
@item @uref{http://www.mytcl.cx/} @c @item @uref{http://www.mytcl.cx/}
Tcl interface based on tcl-sql with many bugfixes. @c Tcl interface based on tcl-sql with many bugfixes.
@item @uref{http://www.binevolve.com/~tdarugar/tcl-sql/} @item @uref{http://www.binevolve.com/~tdarugar/tcl-sql/}
Tcl interface. Tcl interface for MySQL.
@item @uref{http://www.contrib.andrew.cmu.edu/~shadow/sql.html} @item @uref{http://www.contrib.andrew.cmu.edu/~shadow/sql.html}
SQL Reference Page with a lot of interesting links. SQL Reference Page with a lot of interesting links.
...@@ -2028,12 +1984,6 @@ SQL Reference Page with a lot of interesting links. ...@@ -2028,12 +1984,6 @@ SQL Reference Page with a lot of interesting links.
Little6 Inc., An online contract and job finding site that is powered by Little6 Inc., An online contract and job finding site that is powered by
MySQL, PHP3, and Linux. MySQL, PHP3, and Linux.
@c Added 990521
@c EMAIL: nh@delec.com (Hillbrecht Nicole)
@item @uref{http://www.delec.com/is/products/prep/examples/BookShelf/index.html}
DELECis - A tool that makes it very easy to create an automatically generated
table documentation. They have used MySQL as an example.
@c Added 990521 @c Added 990521
@c EMAIL: info@worldrecords.com (Jim Rota) @c EMAIL: info@worldrecords.com (Jim Rota)
@item @uref{http://www.worldrecords.com} @item @uref{http://www.worldrecords.com}
...@@ -2056,32 +2006,13 @@ Basic telephone database using @code{DBI}/@code{DBD}. ...@@ -2056,32 +2006,13 @@ Basic telephone database using @code{DBI}/@code{DBD}.
@item @uref{http://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break} @item @uref{http://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break}
JDBC examples by Daniel K. Schneider. JDBC examples by Daniel K. Schneider.
@item @uref{http://www.spade.com/linux/howto/PostgreSQL-HOWTO-41.html}
SQL BNF
@item @uref{http://www.ooc.com/} @item @uref{http://www.ooc.com/}
Object Oriented Concepts Inc; CORBA applications with examples in source. Object Oriented Concepts Inc; CORBA applications with examples in source.
@item @uref{http://www.pbc.ottawa.on.ca/}
DBWiz; Includes an example of how to manage cursors in VB.
@cindex Pluribus
@item @uref{http://keilor.cs.umass.edu/pluribus/}
Pluribus is a free search engine that learns to improve
the quality of its results over time. Pluribus works by recording
which pages a user prefers among those returned for a query. A user
votes for a page by selecting it; Pluribus then uses that knowledge
to improve the quality of the results when someone else submits the
same (or similar) query. Uses PHP and MySQL.
@c EMAIL: paul@sword.damocles.com (Paul Bannister) @c EMAIL: paul@sword.damocles.com (Paul Bannister)
@item @uref{http://www.stopbit.com/} @item @uref{http://www.stopbit.com/}
Stopbit - A technology news site using MySQL and PHP. Stopbit - A technology news site using MySQL and PHP.
@item @uref{http://www.linuxsupportline.com/~kalendar/}
KDE based calendar manager - The calendar manager has both single user
(file based) and multi-user (MySQL database) support.
@item @uref{http://www.penguinservices.com/scripts} @item @uref{http://www.penguinservices.com/scripts}
Online shopping cart system. Online shopping cart system.
...@@ -2099,9 +2030,6 @@ as BLOBs. All other information is stored on the shared MySQL server. ...@@ -2099,9 +2030,6 @@ as BLOBs. All other information is stored on the shared MySQL server.
@subheading General Database Links @subheading General Database Links
@table @asis @table @asis
@item @uref{http://www.pcslink.com/~ej/dbweb.html}
Database Jump Site
@item @uref{http://black.hole-in-the.net/guy/webdb/} @item @uref{http://black.hole-in-the.net/guy/webdb/}
Homepage of the webdb-l (Web Databases) mailing list. Homepage of the webdb-l (Web Databases) mailing list.
...@@ -2111,10 +2039,6 @@ Perl @code{DBI}/@code{DBD} modules homepage. ...@@ -2111,10 +2039,6 @@ Perl @code{DBI}/@code{DBD} modules homepage.
@item @uref{http://www.student.uni-koeln.de/cygwin/} @item @uref{http://www.student.uni-koeln.de/cygwin/}
Cygwin tools. Unix on top of Windows. Cygwin tools. Unix on top of Windows.
@item @uref{http://dbasecentral.com/}
dbasecentral.com; Development and distribution of powerful and easy-to-use
database applications and systems.
@cindex Tek-Tips forums @cindex Tek-Tips forums
@cindex forums, Tek-Tips @cindex forums, Tek-Tips
@item @uref{http://www.tek-tips.com/} @item @uref{http://www.tek-tips.com/}
...@@ -45801,8 +45725,6 @@ support MySQL} ...@@ -45801,8 +45725,6 @@ support MySQL}
@item @uref{http://online.dn.ru, Internet information server} @item @uref{http://online.dn.ru, Internet information server}
@item @uref{http://www.stopbit.com, A technology news site}
@item @uref{http://www.worldnetla.net, WorldNet Communications - An Internet Services Provider} @item @uref{http://www.worldnetla.net, WorldNet Communications - An Internet Services Provider}
@item @uref{http://www.netizen.com.au/, Netizen: Australian-based Web consultancy} @item @uref{http://www.netizen.com.au/, Netizen: Australian-based Web consultancy}
...@@ -172,8 +172,8 @@ unsigned long my_net_read(NET *net); ...@@ -172,8 +172,8 @@ unsigned long my_net_read(NET *net);
/* The following function is not meant for normal usage */ /* The following function is not meant for normal usage */
struct sockaddr; struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, uint namelen, int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
uint timeout); unsigned int timeout);
struct rand_struct { struct rand_struct {
unsigned long seed1,seed2,max_value; unsigned long seed1,seed2,max_value;
......
...@@ -57,6 +57,7 @@ sqlsources = convert.cc derror.cc field.cc field_conv.cc filesort.cc \ ...@@ -57,6 +57,7 @@ sqlsources = convert.cc derror.cc field.cc field_conv.cc filesort.cc \
EXTRA_DIST = lib_vio.c EXTRA_DIST = lib_vio.c
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
libmysqld_a_SOURCES=
# automake misses these # automake misses these
sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
......
...@@ -83,7 +83,7 @@ char *convert_dirname(char *to, const char *from, const char *from_end) ...@@ -83,7 +83,7 @@ char *convert_dirname(char *to, const char *from, const char *from_end)
#if FN_LIBCHAR != '/' || defined(FN_C_BEFORE_DIR_2) #if FN_LIBCHAR != '/' || defined(FN_C_BEFORE_DIR_2)
{ {
while (*from && *from != end) for (; *from && from != from_end; from++)
{ {
if (*from == '/') if (*from == '/')
*to++= FN_LIBCHAR; *to++= FN_LIBCHAR;
...@@ -94,8 +94,9 @@ char *convert_dirname(char *to, const char *from, const char *from_end) ...@@ -94,8 +94,9 @@ char *convert_dirname(char *to, const char *from, const char *from_end)
*to++= FN_C_AFTER_DIR; *to++= FN_C_AFTER_DIR;
#endif #endif
else else
*to++= *from++; *to++= *from;
} }
*to=0;
} }
#else #else
/* This is ok even if to == from, becasue we need to cut the string */ /* This is ok even if to == from, becasue we need to cut the string */
......
...@@ -279,7 +279,7 @@ sub RunQuery { ...@@ -279,7 +279,7 @@ sub RunQuery {
if (defined $row->{$_}) { if (defined $row->{$_}) {
#if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) { #if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) {
if ($row->{type} eq 'ALL') { if ($row->{type} eq 'ALL') {
push (@{$Param->{ALL}}, "$row->{$_} $_ $Param->{DB} $Param->{Query}"); push (@{$Param->{ALL}}, "$Param->{Query}");
#print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n"; #print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n";
} }
$Param->{IdxUseCount} ++; $Param->{IdxUseCount} ++;
......
...@@ -232,14 +232,14 @@ then ...@@ -232,14 +232,14 @@ then
c_u="$c_u )" c_u="$c_u )"
c_u="$c_u comment='Users and global privileges';" c_u="$c_u comment='Users and global privileges';"
i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','');
INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','');
REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','');
REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','');
INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE',NULL,NULL,NULL); INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','','');
INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE',NULL,NULL,NULL);" INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','','');"
fi fi
if test ! -f $mdata/func.frm if test ! -f $mdata/func.frm
......
...@@ -633,6 +633,7 @@ pthread_handler_decl(handle_bootstrap,arg) ...@@ -633,6 +633,7 @@ pthread_handler_decl(handle_bootstrap,arg)
length--; length--;
buff[length]=0; buff[length]=0;
thd->current_tablenr=0; thd->current_tablenr=0;
thd->query_length=length;
thd->query= thd->memdup(buff,length+1); thd->query= thd->memdup(buff,length+1);
thd->query_id=query_id++; thd->query_id=query_id++;
mysql_parse(thd,thd->query,length); mysql_parse(thd,thd->query,length);
...@@ -692,7 +693,8 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd) ...@@ -692,7 +693,8 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
thd->free_list = 0; thd->free_list = 0;
thd->query = tbl_name; thd->query = tbl_name;
if((error = mysqld_dump_create_info(thd, table, -1))) thd->query_length=strlen(tbl_name);
if ((error = mysqld_dump_create_info(thd, table, -1)))
{ {
my_error(ER_GET_ERRNO, MYF(0)); my_error(ER_GET_ERRNO, MYF(0));
goto err; goto err;
...@@ -702,9 +704,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd) ...@@ -702,9 +704,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
my_error(ER_GET_ERRNO, MYF(0)); my_error(ER_GET_ERRNO, MYF(0));
err: err:
close_thread_tables(thd); close_thread_tables(thd);
DBUG_RETURN(error); DBUG_RETURN(error);
} }
...@@ -872,6 +872,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -872,6 +872,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->free_list=0; thd->free_list=0;
table_list.name=table_list.real_name=thd->strdup(packet); table_list.name=table_list.real_name=thd->strdup(packet);
thd->query=fields=thd->strdup(strend(packet)+1); thd->query=fields=thd->strdup(strend(packet)+1);
thd->query_length=strlen(thd->query);
mysql_log.write(thd,command,"%s %s",table_list.real_name,fields); mysql_log.write(thd,command,"%s %s",table_list.real_name,fields);
remove_escape(table_list.real_name); // This can't have wildcards remove_escape(table_list.real_name); // This can't have wildcards
...@@ -2052,9 +2053,9 @@ mysql_execute_command(void) ...@@ -2052,9 +2053,9 @@ mysql_execute_command(void)
goto error; goto error;
res = mysql_table_grant(thd,tables,lex->users_list, lex->columns, res = mysql_table_grant(thd,tables,lex->users_list, lex->columns,
lex->grant, lex->sql_command == SQLCOM_REVOKE); lex->grant, lex->sql_command == SQLCOM_REVOKE);
if(!res) if (!res)
{ {
mysql_update_log.write(thd, thd->query,thd->query_length); mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query); Query_log_event qinfo(thd, thd->query);
...@@ -2074,7 +2075,7 @@ mysql_execute_command(void) ...@@ -2074,7 +2075,7 @@ mysql_execute_command(void)
lex->sql_command == SQLCOM_REVOKE); lex->sql_command == SQLCOM_REVOKE);
if (!res) if (!res)
{ {
mysql_update_log.write(thd, thd->query,thd->query_length); mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query); Query_log_event qinfo(thd, thd->query);
......
...@@ -759,17 +759,16 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd) ...@@ -759,17 +759,16 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd)
convert->convert((char*) packet->ptr(), packet->length()); convert->convert((char*) packet->ptr(), packet->length());
if (fd < 0) if (fd < 0)
{ {
if(my_net_write(&thd->net, (char*)packet->ptr(), packet->length())) if (my_net_write(&thd->net, (char*)packet->ptr(), packet->length()))
DBUG_RETURN(-1); DBUG_RETURN(-1);
VOID(net_flush(&thd->net)); VOID(net_flush(&thd->net));
} }
else else
{ {
if(my_write(fd, (const byte*) packet->ptr(), packet->length(), if (my_write(fd, (const byte*) packet->ptr(), packet->length(),
MYF(MY_WME))) MYF(MY_WME)))
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
...@@ -3335,7 +3335,7 @@ require_list_element: SUBJECT_SYM TEXT_STRING ...@@ -3335,7 +3335,7 @@ require_list_element: SUBJECT_SYM TEXT_STRING
} }
| CIPHER_SYM TEXT_STRING | CIPHER_SYM TEXT_STRING
{ {
LEX *lex=lex; LEX *lex=Lex;
if (lex->ssl_cipher) if (lex->ssl_cipher)
{ {
net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "CHIPER"); net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "CHIPER");
......
...@@ -38,26 +38,10 @@ ...@@ -38,26 +38,10 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#if defined(__EMX__) #if defined(__EMX__) || defined(OS2)
#define ioctlsocket ioctl #define ioctlsocket ioctl
#endif /* defined(__EMX__) */ #endif /* defined(__EMX__) */
#if defined(MSDOS) || defined(__WIN__)
#ifdef __WIN__
#undef errno
#undef EINTR
#undef EAGAIN
#define errno WSAGetLastError()
#define EINTR WSAEINTR
#define EAGAIN WSAEINPROGRESS
#endif /* __WIN__ */
#define O_NONBLOCK 1 /* For emulation of fcntl() */
#endif
#ifndef EWOULDBLOCK
#define EWOULDBLOCK EAGAIN
#endif
/* /*
* Helper to fill most of the Vio* with defaults. * Helper to fill most of the Vio* with defaults.
*/ */
......
...@@ -39,23 +39,23 @@ ...@@ -39,23 +39,23 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#if defined(__EMX__)
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
#include <netinet/ip.h>
#if !defined(alpha_linux_port)
#include <netinet/tcp.h>
#endif
#endif
#if defined(__EMX__) || defined(OS2)
#define ioctlsocket ioctl #define ioctlsocket ioctl
#endif /* defined(__EMX__) */ #endif /* defined(__EMX__) */
#if defined(MSDOS) || defined(__WIN__) #if defined(MSDOS) || defined(__WIN__)
#ifdef __WIN__
#undef errno
#undef EINTR
#undef EAGAIN
#define errno WSAGetLastError()
#define EINTR WSAEINTR
#define EAGAIN WSAEINPROGRESS
#endif /* __WIN__ */
#define O_NONBLOCK 1 /* For emulation of fcntl() */ #define O_NONBLOCK 1 /* For emulation of fcntl() */
#endif #endif
#ifndef EWOULDBLOCK #ifndef EWOULDBLOCK
#define EWOULDBLOCK EAGAIN #define SOCKET_EWOULDBLOCK SOCKET_EAGAIN
#endif #endif
#ifndef __WIN__ #ifndef __WIN__
...@@ -76,7 +76,7 @@ void vio_delete(Vio* vio) ...@@ -76,7 +76,7 @@ void vio_delete(Vio* vio)
int vio_errno(Vio *vio __attribute__((unused))) int vio_errno(Vio *vio __attribute__((unused)))
{ {
return errno; /* On Win32 this mapped to WSAGetLastError() */ return socket_errno; /* On Win32 this mapped to WSAGetLastError() */
} }
...@@ -129,7 +129,7 @@ int vio_write(Vio * vio, const gptr buf, int size) ...@@ -129,7 +129,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
#ifndef DBUG_OFF #ifndef DBUG_OFF
if (r < 0) if (r < 0)
{ {
DBUG_PRINT("vio_error", ("Got error on write: %d",errno)); DBUG_PRINT("vio_error", ("Got error on write: %d",socket_errno));
} }
#endif /* DBUG_OFF */ #endif /* DBUG_OFF */
DBUG_PRINT("exit", ("%d", r)); DBUG_PRINT("exit", ("%d", r));
...@@ -242,8 +242,8 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) ...@@ -242,8 +242,8 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive)
my_bool my_bool
vio_should_retry(Vio * vio __attribute__((unused))) vio_should_retry(Vio * vio __attribute__((unused)))
{ {
int en = errno; int en = socket_errno;
return en == EAGAIN || en == EINTR || en == EWOULDBLOCK; return en == SOCKET_EAGAIN || en == SOCKET_EINTR || en == SOCKET_EWOULDBLOCK;
} }
...@@ -271,7 +271,7 @@ int vio_close(Vio * vio) ...@@ -271,7 +271,7 @@ int vio_close(Vio * vio)
} }
if (r) if (r)
{ {
DBUG_PRINT("vio_error", ("close() failed, error: %d",errno)); DBUG_PRINT("vio_error", ("close() failed, error: %d",socket_errno));
/* FIXME: error handling (not critical for MySQL) */ /* FIXME: error handling (not critical for MySQL) */
} }
vio->type= VIO_CLOSED; vio->type= VIO_CLOSED;
...@@ -310,7 +310,7 @@ my_bool vio_peer_addr(Vio * vio, char *buf) ...@@ -310,7 +310,7 @@ my_bool vio_peer_addr(Vio * vio, char *buf)
if (getpeername(vio->sd, (struct sockaddr *) (& (vio->remote)), if (getpeername(vio->sd, (struct sockaddr *) (& (vio->remote)),
&addrLen) != 0) &addrLen) != 0)
{ {
DBUG_PRINT("exit", ("getpeername, error: %d", errno)); DBUG_PRINT("exit", ("getpeername, error: %d", socket_errno));
DBUG_RETURN(1); DBUG_RETURN(1);
} }
my_inet_ntoa(vio->remote.sin_addr,buf); my_inet_ntoa(vio->remote.sin_addr,buf);
......
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