Commit 409a3138 authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com

Merge work:/home/bk/mysql-4.0

into mysql.sashanet.com:/home/sasha/src/bk/mysql-4.0
parents 007cebd2 d5fe1db8
...@@ -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/}
...@@ -8979,7 +8903,13 @@ version 4.0; ...@@ -8979,7 +8903,13 @@ version 4.0;
@item @item
The old C API functions @code{mysql_drop_db}, @code{mysql_create_db} and The old C API functions @code{mysql_drop_db}, @code{mysql_create_db} and
@code{mysql_connect} are not supported anymore, unless one compiles @code{mysql_connect} are not supported anymore, unless one compiles
MySQL with @code{USE_OLD_FUNCTIONS}. MySQL with @code{USE_OLD_FUNCTIONS}. Instead of doing this, one should
change the client to use the new 4.0 API.
@item
In the @code{MYSQL_FIELD} structure, @code{length} and @code{max_length} has
changed from @code{unsigned int} to @code{unsigned long}. This should not
cause any other problems than some warnings if you use these to
@code{printf()} type function.
@item @item
You should use @code{TRUNCATE TABLE} when you want to delete all rows You should use @code{TRUNCATE TABLE} when you want to delete all rows
from a table and you don't care of how many rows where deleted. from a table and you don't care of how many rows where deleted.
...@@ -45801,8 +45731,6 @@ support MySQL} ...@@ -45801,8 +45731,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}
...@@ -928,7 +928,7 @@ static void print_header(MYSQL_RES *result) ...@@ -928,7 +928,7 @@ static void print_header(MYSQL_RES *result)
putchar('|'); putchar('|');
while ((field = mysql_fetch_field(result))) while ((field = mysql_fetch_field(result)))
{ {
printf(" %-*s|",field->max_length+1,field->name); printf(" %-*s|",(int) field->max_length+1,field->name);
} }
putchar('\n'); putchar('\n');
print_top(result); print_top(result);
...@@ -983,11 +983,11 @@ static void print_relative_row(MYSQL_RES *result, MYSQL_ROW cur, uint row) ...@@ -983,11 +983,11 @@ static void print_relative_row(MYSQL_RES *result, MYSQL_ROW cur, uint row)
mysql_field_seek(result, 0); mysql_field_seek(result, 0);
field = mysql_fetch_field(result); field = mysql_fetch_field(result);
printf("| %-*s|", field->max_length + 1, cur[0]); printf("| %-*s|", (int) field->max_length + 1, cur[0]);
field = mysql_fetch_field(result); field = mysql_fetch_field(result);
tmp = cur[1] ? strtoull(cur[1], NULL, 0) : (ulonglong) 0; tmp = cur[1] ? strtoull(cur[1], NULL, 0) : (ulonglong) 0;
printf(" %-*s|\n", field->max_length + 1, printf(" %-*s|\n", (int) field->max_length + 1,
llstr((tmp - last_values[row]), buff)); llstr((tmp - last_values[row]), buff));
last_values[row] = tmp; last_values[row] = tmp;
} }
......
...@@ -713,7 +713,7 @@ static void print_res_header(MYSQL_RES *result) ...@@ -713,7 +713,7 @@ static void print_res_header(MYSQL_RES *result)
putchar('|'); putchar('|');
while ((field = mysql_fetch_field(result))) while ((field = mysql_fetch_field(result)))
{ {
printf(" %-*s|",field->max_length+1,field->name); printf(" %-*s|",(int) field->max_length+1,field->name);
} }
putchar('\n'); putchar('\n');
print_res_top(result); print_res_top(result);
......
...@@ -20,16 +20,11 @@ ...@@ -20,16 +20,11 @@
#define RESOLVE_VERSION "2.0" #define RESOLVE_VERSION "2.0"
#include <my_global.h> #include <my_global.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifndef HAVE_BROKEN_NETINET_INCLUDES
#include <netinet/in.h>
#endif
#include <arpa/inet.h>
#include <netdb.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <my_net.h>
#include <my_sys.h> #include <my_sys.h>
#include <m_string.h> #include <m_string.h>
#include <netdb.h>
#include <getopt.h> #include <getopt.h>
#if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno) #if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno)
......
...@@ -653,6 +653,7 @@ typedef off_t os_off_t; ...@@ -653,6 +653,7 @@ typedef off_t os_off_t;
#define socket_errno WSAGetLastError() #define socket_errno WSAGetLastError()
#define SOCKET_EINTR WSAEINTR #define SOCKET_EINTR WSAEINTR
#define SOCKET_EAGAIN WSAEINPROGRESS #define SOCKET_EAGAIN WSAEINPROGRESS
#define SOCKET_EWOULDBLOCK WSAEINPROGRESS
#define SOCKET_ENFILE ENFILE #define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE #define SOCKET_EMFILE EMFILE
#elif defined(OS2) #elif defined(OS2)
......
...@@ -15,14 +15,20 @@ ...@@ -15,14 +15,20 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */ MA 02111-1307, USA */
/* thread safe version of some common functions */ /*
thread safe version of some common functions:
my_inet_ntoa
/* for thread safe my_inet_ntoa */ This file is also used to make handling of sockets and ioctl()
#ifdef __cplusplus portable accross systems.
extern "C" {
#endif /* __cplusplus */
#if !defined(MSDOS) && !defined(__WIN__) && !defined(__BEOS__) */
#ifndef _my_net_h
#define _my_net_h
C_MODE_START
#include <errno.h>
#ifdef HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
...@@ -32,10 +38,35 @@ extern "C" { ...@@ -32,10 +38,35 @@ extern "C" {
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
#endif /* !defined(MSDOS) && !defined(__WIN__) */ #ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#if !defined(alpha_linux_port)
#include <netinet/tcp.h>
#endif
#endif
#if defined(__EMX__)
#include <sys/ioctl.h>
#define ioctlsocket(A,B,C) ioctl((A),(B),(void *)(C),sizeof(*(C)))
#undef HAVE_FCNTL
#endif /* defined(__EMX__) */
#if defined(MSDOS) || defined(__WIN__)
#define O_NONBLOCK 1 /* For emulation of fcntl() */
#endif
/* Thread safe or portable version of some functions */
void my_inet_ntoa(struct in_addr in, char *buf); void my_inet_ntoa(struct in_addr in, char *buf);
#ifdef __cplusplus C_MODE_END
}
#endif #endif
...@@ -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;
...@@ -203,7 +203,7 @@ typedef struct st_udf_init ...@@ -203,7 +203,7 @@ typedef struct st_udf_init
{ {
my_bool maybe_null; /* 1 if function can return NULL */ my_bool maybe_null; /* 1 if function can return NULL */
unsigned int decimals; /* for real functions */ unsigned int decimals; /* for real functions */
unsigned int max_length; /* For string functions */ unsigned long max_length; /* For string functions */
char *ptr; /* free pointer for function data */ char *ptr; /* free pointer for function data */
my_bool const_item; /* 0 if result is independent of arguments */ my_bool const_item; /* 0 if result is independent of arguments */
} UDF_INIT; } UDF_INIT;
......
...@@ -31,16 +31,16 @@ ...@@ -31,16 +31,16 @@
#include <winsock.h> #include <winsock.h>
#endif #endif
#include <my_global.h> #include <my_global.h>
#include "mysql_embed.h" #include <mysql.h>
#include <mysql_embed.h>
#include <mysql_com.h> #include <mysql_com.h>
#include <violite.h> #include <mysqld_error.h>
#include <my_sys.h> #include <my_sys.h>
#include <m_string.h> #include <m_string.h>
#include "mysql.h" #include <my_net.h>
#include "mysqld_error.h" #include <violite.h>
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
#include <sys/types.h>
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
ulong max_allowed_packet=65536; ulong max_allowed_packet=65536;
...@@ -60,20 +60,9 @@ ulong net_write_timeout= NET_WRITE_TIMEOUT; ...@@ -60,20 +60,9 @@ ulong net_write_timeout= NET_WRITE_TIMEOUT;
#endif #endif
ulong net_buffer_length=8192; /* Default length. Enlarged if necessary */ ulong net_buffer_length=8192; /* Default length. Enlarged if necessary */
#if !defined(__WIN__) && !defined(MSDOS) #if defined(__WIN__) || defined(MSDOS)
#include <sys/socket.h>
#else
#undef MYSQL_SERVER /* Win32 can't handle interrupts */ #undef MYSQL_SERVER /* Win32 can't handle interrupts */
#endif #endif
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#if !defined(alpha_linux_port)
#include <netinet/tcp.h>
#endif
#endif
#include "mysqld_error.h"
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
#include "my_pthread.h" #include "my_pthread.h"
#include "thr_alarm.h" #include "thr_alarm.h"
......
...@@ -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
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "mysql_embed.h" #include "mysql_embed.h"
#include "mysql.h" #include "mysql.h"
#ifndef HAVE_VIO /* is Vio suppored by the Vio lib ? */ #ifndef HAVE_VIO /* is Vio enabled */
#include <errno.h> #include <errno.h>
#include <my_sys.h> #include <my_sys.h>
...@@ -37,27 +37,6 @@ ...@@ -37,27 +37,6 @@
#include <dbug.h> #include <dbug.h>
#include <assert.h> #include <assert.h>
#if defined(__EMX__)
#include <sys/ioctl.h>
#define ioctlsocket(A,B,C) ioctl((A),(B),(void *)(C),sizeof(*(C)))
#undef HAVE_FCNTL
#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
#ifndef __WIN__ #ifndef __WIN__
#define HANDLE void * #define HANDLE void *
#endif #endif
...@@ -72,14 +51,11 @@ struct st_vio ...@@ -72,14 +51,11 @@ struct st_vio
struct sockaddr_in remote; /* Remote internet address */ struct sockaddr_in remote; /* Remote internet address */
enum enum_vio_type type; /* Type of connection */ enum enum_vio_type type; /* Type of connection */
char desc[30]; /* String description */ char desc[30]; /* String description */
/* #ifdef EMBEDDED_LIBRARY */
/* void *dest_net; */
void *dest_thd; void *dest_thd;
char *packets, **last_packet; char *packets, **last_packet;
char *where_in_packet, *end_of_packet; char *where_in_packet, *end_of_packet;
my_bool reading; my_bool reading;
MEM_ROOT root; MEM_ROOT root;
/* #endif */
}; };
/* Initialize the communication buffer */ /* Initialize the communication buffer */
...@@ -90,7 +66,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) ...@@ -90,7 +66,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost)
vio = (Vio *) my_malloc (sizeof(*vio),MYF(MY_WME|MY_ZEROFILL)); vio = (Vio *) my_malloc (sizeof(*vio),MYF(MY_WME|MY_ZEROFILL));
if (vio) if (vio)
{ {
init_alloc_root(&vio->root, 8192, 1024); init_alloc_root(&vio->root, 8192, 8192);
vio->root.min_malloc = sizeof(char *) + 4; vio->root.min_malloc = sizeof(char *) + 4;
vio->last_packet = &vio->packets; vio->last_packet = &vio->packets;
} }
...@@ -126,7 +102,7 @@ void vio_reset(Vio *vio) ...@@ -126,7 +102,7 @@ void vio_reset(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() */
} }
int vio_read(Vio * vio, gptr buf, int size) int vio_read(Vio * vio, gptr buf, int size)
...@@ -198,8 +174,9 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) ...@@ -198,8 +174,9 @@ 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);
} }
......
...@@ -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
......
...@@ -31,16 +31,16 @@ ...@@ -31,16 +31,16 @@
#include <winsock.h> #include <winsock.h>
#endif #endif
#include <my_global.h> #include <my_global.h>
#include "mysql_embed.h" #include <mysql.h>
#include <mysql_embed.h>
#include <mysql_com.h> #include <mysql_com.h>
#include <violite.h> #include <mysqld_error.h>
#include <my_sys.h> #include <my_sys.h>
#include <m_string.h> #include <m_string.h>
#include "mysql.h" #include <my_net.h>
#include "mysqld_error.h" #include <violite.h>
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
#include <sys/types.h>
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
ulong max_allowed_packet=65536; ulong max_allowed_packet=65536;
...@@ -60,20 +60,9 @@ ulong net_write_timeout= NET_WRITE_TIMEOUT; ...@@ -60,20 +60,9 @@ ulong net_write_timeout= NET_WRITE_TIMEOUT;
#endif #endif
ulong net_buffer_length=8192; /* Default length. Enlarged if necessary */ ulong net_buffer_length=8192; /* Default length. Enlarged if necessary */
#if !defined(__WIN__) && !defined(MSDOS) #if defined(__WIN__) || defined(MSDOS)
#include <sys/socket.h>
#else
#undef MYSQL_SERVER /* Win32 can't handle interrupts */ #undef MYSQL_SERVER /* Win32 can't handle interrupts */
#endif #endif
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#if !defined(alpha_linux_port)
#include <netinet/tcp.h>
#endif
#endif
#include "mysqld_error.h"
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
#include "my_pthread.h" #include "my_pthread.h"
#include "thr_alarm.h" #include "thr_alarm.h"
......
...@@ -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");
......
...@@ -25,38 +25,10 @@ ...@@ -25,38 +25,10 @@
#include <my_global.h> #include <my_global.h>
#include <mysql_com.h> #include <mysql_com.h>
#include <violite.h> #include <violite.h>
#include <errno.h> #include <errno.h>
#include <assert.h>
#include <my_sys.h> #include <my_sys.h>
#include <my_net.h> #include <my_net.h>
#include <m_string.h> #include <m_string.h>
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#if defined(__EMX__)
#define ioctlsocket ioctl
#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.
......
...@@ -27,36 +27,10 @@ ...@@ -27,36 +27,10 @@
#include <mysql_com.h> #include <mysql_com.h>
#include <errno.h> #include <errno.h>
#include <assert.h>
#include <violite.h> #include <violite.h>
#include <my_sys.h> #include <my_sys.h>
#include <my_net.h> #include <my_net.h>
#include <m_string.h> #include <m_string.h>
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#if defined(__EMX__)
#define ioctlsocket ioctl
#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
#ifndef __WIN__ #ifndef __WIN__
#define HANDLE void * #define HANDLE void *
...@@ -76,7 +50,7 @@ void vio_delete(Vio* vio) ...@@ -76,7 +50,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 +103,7 @@ int vio_write(Vio * vio, const gptr buf, int size) ...@@ -129,7 +103,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 +216,9 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) ...@@ -242,8 +216,9 @@ 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 +246,7 @@ int vio_close(Vio * vio) ...@@ -271,7 +246,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 +285,7 @@ my_bool vio_peer_addr(Vio * vio, char *buf) ...@@ -310,7 +285,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);
......
...@@ -34,31 +34,6 @@ ...@@ -34,31 +34,6 @@
#include <my_sys.h> #include <my_sys.h>
#include <my_net.h> #include <my_net.h>
#include <m_string.h> #include <m_string.h>
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#if defined(__EMX__)
#define ioctlsocket ioctl
#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
#ifndef __WIN__ #ifndef __WIN__
#define HANDLE void * #define HANDLE void *
...@@ -83,7 +58,7 @@ report_errors() ...@@ -83,7 +58,7 @@ report_errors()
if (!any_ssl_error) { if (!any_ssl_error) {
DBUG_PRINT("info", ("No OpenSSL errors.")); DBUG_PRINT("info", ("No OpenSSL errors."));
} }
DBUG_PRINT("info", ("BTW, errno=%d", errno)); DBUG_PRINT("info", ("BTW, errno=%d", scoket_errno));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -102,7 +77,7 @@ void vio_ssl_delete(Vio * vio) ...@@ -102,7 +77,7 @@ void vio_ssl_delete(Vio * vio)
int vio_ssl_errno(Vio *vio __attribute__((unused))) int vio_ssl_errno(Vio *vio __attribute__((unused)))
{ {
return errno; /* On Win32 this mapped to WSAGetLastError() */ return socket_errno; /* On Win32 this mapped to WSAGetLastError() */
} }
...@@ -195,8 +170,9 @@ int vio_ssl_keepalive(Vio* vio, my_bool set_keep_alive) ...@@ -195,8 +170,9 @@ int vio_ssl_keepalive(Vio* vio, my_bool set_keep_alive)
my_bool my_bool
vio_ssl_should_retry(Vio * vio __attribute__((unused))) vio_ssl_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);
} }
...@@ -217,7 +193,7 @@ int vio_ssl_close(Vio * vio) ...@@ -217,7 +193,7 @@ int vio_ssl_close(Vio * vio)
r= -1; r= -1;
if (r) if (r)
{ {
DBUG_PRINT("error", ("close() failed, error: %d",errno)); DBUG_PRINT("error", ("close() failed, error: %d",socket_errno));
report_errors(); report_errors();
/* FIXME: error handling (not critical for MySQL) */ /* FIXME: error handling (not critical for MySQL) */
} }
...@@ -257,7 +233,7 @@ my_bool vio_ssl_peer_addr(Vio * vio, char *buf) ...@@ -257,7 +233,7 @@ my_bool vio_ssl_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);
} }
/* FIXME */ /* FIXME */
......
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