Added an update by ALZ. Refer to changelog.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6079 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
c926706d40
commit
a71840da35
@ -3,6 +3,10 @@ Date Added
|
||||
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||
|
||||
2006/04/15
|
||||
* Updated libs, Updated vc project files, And deleted uneeded DLLs.
|
||||
Credits to ALZ. [Zido]
|
||||
|
||||
2006/04/14
|
||||
* Updated sql-files/mob_db.sql to current. [Skotlex]
|
||||
* Fixed being able to do all the stuff you shouldn't be able to during the
|
||||
|
BIN
lib/libmysql.lib
BIN
lib/libmysql.lib
Binary file not shown.
BIN
lib/pcre.lib
BIN
lib/pcre.lib
Binary file not shown.
BIN
libmysql.dll
BIN
libmysql.dll
Binary file not shown.
@ -1,434 +1,470 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Defines for Win32 to make it compatible for MySQL */
|
||||
|
||||
#ifdef __WIN2000__
|
||||
/* We have to do this define before including windows.h to get the AWE API
|
||||
functions */
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#endif
|
||||
|
||||
#include <sys/locking.h>
|
||||
#include <windows.h>
|
||||
#include <math.h> /* Because of rint() */
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#define HAVE_SMEM 1
|
||||
|
||||
#if defined(_WIN64) || defined(WIN64)
|
||||
#define SYSTEM_TYPE "Win64"
|
||||
#elif defined(_WIN32) || defined(WIN32)
|
||||
#define SYSTEM_TYPE "Win32"
|
||||
#else
|
||||
#define SYSTEM_TYPE "Windows"
|
||||
#endif
|
||||
|
||||
#if defined(_M_IA64)
|
||||
#define MACHINE_TYPE "ia64"
|
||||
#elif defined(_M_IX86)
|
||||
#define MACHINE_TYPE "ia32"
|
||||
#elif defined(_M_ALPHA)
|
||||
#define MACHINE_TYPE "axp"
|
||||
#else
|
||||
#define MACHINE_TYPE "unknown" /* Define to machine type name */
|
||||
#endif
|
||||
|
||||
#if !(defined(_WIN64) || defined(WIN64))
|
||||
#ifndef _WIN32
|
||||
#define _WIN32 /* Compatible with old source */
|
||||
#endif
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#endif
|
||||
#endif /* _WIN64 */
|
||||
#ifndef __WIN__
|
||||
#define __WIN__ /* To make it easier in VC++ */
|
||||
#endif
|
||||
|
||||
/* File and lock constants */
|
||||
#define O_SHARE 0x1000 /* Open file in sharing mode */
|
||||
#ifdef __BORLANDC__
|
||||
#define F_RDLCK LK_NBLCK /* read lock */
|
||||
#define F_WRLCK LK_NBRLCK /* write lock */
|
||||
#define F_UNLCK LK_UNLCK /* remove lock(s) */
|
||||
#else
|
||||
#define F_RDLCK _LK_NBLCK /* read lock */
|
||||
#define F_WRLCK _LK_NBRLCK /* write lock */
|
||||
#define F_UNLCK _LK_UNLCK /* remove lock(s) */
|
||||
#endif
|
||||
|
||||
#define F_EXCLUSIVE 1 /* We have only exclusive locking */
|
||||
#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */
|
||||
#define F_OK 0 /* parameter to access() */
|
||||
#define W_OK 2
|
||||
|
||||
#define S_IROTH S_IREAD /* for my_lib */
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
|
||||
#define O_TEMPORARY 0
|
||||
#define O_SHORT_LIVED 0
|
||||
#define SH_DENYNO _SH_DENYNO
|
||||
#else
|
||||
#define O_BINARY _O_BINARY /* compability with MSDOS */
|
||||
#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */
|
||||
#define O_TEMPORARY _O_TEMPORARY
|
||||
#define O_SHORT_LIVED _O_SHORT_LIVED
|
||||
#define SH_DENYNO _SH_DENYNO
|
||||
#endif
|
||||
#define NO_OPEN_3 /* For my_create() */
|
||||
|
||||
#define SIGQUIT SIGTERM /* No SIGQUIT */
|
||||
|
||||
#undef _REENTRANT /* Crashes something for win32 */
|
||||
#undef SAFE_MUTEX /* Can't be used on windows */
|
||||
|
||||
#define LONGLONG_MIN ((__int64) 0x8000000000000000)
|
||||
#define LONGLONG_MAX ((__int64) 0x7FFFFFFFFFFFFFFF)
|
||||
#define ULONGLONG_MAX ((unsigned __int64) 0xFFFFFFFFFFFFFFFF)
|
||||
#define LL(A) ((__int64) A)
|
||||
#define ULL(A) ((unsigned __int64) A)
|
||||
|
||||
/* Type information */
|
||||
|
||||
#if defined(__EMX__) || !defined(HAVE_UINT)
|
||||
#undef HAVE_UINT
|
||||
#define HAVE_UINT
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned int uint;
|
||||
#endif /* defined(__EMX__) || !defined(HAVE_UINT) */
|
||||
|
||||
typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */
|
||||
typedef __int64 longlong;
|
||||
#ifndef HAVE_SIGSET_T
|
||||
typedef int sigset_t;
|
||||
#endif
|
||||
#define longlong_defined
|
||||
/*
|
||||
off_t should not be __int64 because of conflicts in header files;
|
||||
Use my_off_t or os_off_t instead
|
||||
*/
|
||||
#ifndef HAVE_OFF_T
|
||||
typedef long off_t;
|
||||
#endif
|
||||
typedef __int64 os_off_t;
|
||||
#ifdef _WIN64
|
||||
typedef UINT_PTR rf_SetTimer;
|
||||
#else
|
||||
#ifndef HAVE_SIZE_T
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
typedef uint rf_SetTimer;
|
||||
#endif
|
||||
|
||||
#define Socket_defined
|
||||
#define my_socket SOCKET
|
||||
#define bool BOOL
|
||||
#define SIGPIPE SIGINT
|
||||
#define RETQSORTTYPE void
|
||||
#define QSORT_TYPE_IS_VOID
|
||||
#define RETSIGTYPE void
|
||||
#define SOCKET_SIZE_TYPE int
|
||||
#define my_socket_defined
|
||||
#define bool_defined
|
||||
#define byte_defined
|
||||
#define HUGE_PTR
|
||||
#define STDCALL __stdcall /* Used by libmysql.dll */
|
||||
#define isnan(X) _isnan(X)
|
||||
#define finite(X) _finite(X)
|
||||
|
||||
#ifndef UNDEF_THREAD_HACK
|
||||
#define THREAD
|
||||
#endif
|
||||
#define VOID_SIGHANDLER
|
||||
#define SIZEOF_CHAR 1
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF_OFF_T 8
|
||||
#ifdef _WIN64
|
||||
#define SIZEOF_CHARP 8
|
||||
#else
|
||||
#define SIZEOF_CHARP 4
|
||||
#endif
|
||||
#define HAVE_BROKEN_NETINET_INCLUDES
|
||||
#ifdef __NT__
|
||||
#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
|
||||
#endif
|
||||
|
||||
/* ERROR is defined in wingdi.h */
|
||||
#undef ERROR
|
||||
|
||||
/* We need to close files to break connections on shutdown */
|
||||
#ifndef SIGNAL_WITH_VIO_CLOSE
|
||||
#define SIGNAL_WITH_VIO_CLOSE
|
||||
#endif
|
||||
|
||||
/* Use all character sets in MySQL */
|
||||
#define USE_MB 1
|
||||
#define USE_MB_IDENT 1
|
||||
#define USE_STRCOLL 1
|
||||
|
||||
/* All windows servers should support .sym files */
|
||||
#undef USE_SYMDIR
|
||||
#define USE_SYMDIR
|
||||
|
||||
/* If LOAD DATA LOCAL INFILE should be enabled by default */
|
||||
#define ENABLED_LOCAL_INFILE 1
|
||||
|
||||
/* Convert some simple functions to Posix */
|
||||
|
||||
#define my_sigset(A,B) signal((A),(B))
|
||||
#define finite(A) _finite(A)
|
||||
#define sleep(A) Sleep((A)*1000)
|
||||
#define popen(A) popen(A,B) _popen((A),(B))
|
||||
#define pclose(A) _pclose(A)
|
||||
|
||||
#ifndef __BORLANDC__
|
||||
#define access(A,B) _access(A,B)
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus)
|
||||
#define inline __inline
|
||||
#endif /* __cplusplus */
|
||||
|
||||
inline double rint(double nr)
|
||||
{
|
||||
double f = floor(nr);
|
||||
double c = ceil(nr);
|
||||
return (((c-nr) >= (nr-f)) ? f :c);
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
||||
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
||||
|
||||
#else
|
||||
inline double ulonglong2double(ulonglong value)
|
||||
{
|
||||
longlong nr=(longlong) value;
|
||||
if (nr >= 0)
|
||||
return (double) nr;
|
||||
return (18446744073709551616.0 + (double) nr);
|
||||
}
|
||||
#define my_off_t2double(A) ulonglong2double(A)
|
||||
#endif /* _WIN64 */
|
||||
|
||||
#if SIZEOF_OFF_T > 4
|
||||
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
|
||||
#define tell(A) _telli64(A)
|
||||
#endif
|
||||
|
||||
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
|
||||
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Optimized store functions for Intel x86 */
|
||||
|
||||
#ifndef _WIN64
|
||||
#define sint2korr(A) (*((int16 *) (A)))
|
||||
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
|
||||
(((uint32) 255L << 24) | \
|
||||
(((uint32) (uchar) (A)[2]) << 16) |\
|
||||
(((uint32) (uchar) (A)[1]) << 8) | \
|
||||
((uint32) (uchar) (A)[0])) : \
|
||||
(((uint32) (uchar) (A)[2]) << 16) |\
|
||||
(((uint32) (uchar) (A)[1]) << 8) | \
|
||||
((uint32) (uchar) (A)[0])))
|
||||
#define sint4korr(A) (*((long *) (A)))
|
||||
#define uint2korr(A) (*((uint16 *) (A)))
|
||||
/*
|
||||
ATTENTION !
|
||||
|
||||
Please, note, uint3korr reads 4 bytes (not 3) !
|
||||
It means, that you have to provide enough allocated space !
|
||||
*/
|
||||
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
|
||||
#define uint4korr(A) (*((unsigned long *) (A)))
|
||||
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
|
||||
(((uint32) ((uchar) (A)[1])) << 8) +\
|
||||
(((uint32) ((uchar) (A)[2])) << 16) +\
|
||||
(((uint32) ((uchar) (A)[3])) << 24)) +\
|
||||
(((ulonglong) ((uchar) (A)[4])) << 32))
|
||||
#define uint8korr(A) (*((ulonglong *) (A)))
|
||||
#define sint8korr(A) (*((longlong *) (A)))
|
||||
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
|
||||
#define int3store(T,A) { *(T)= (uchar) ((A));\
|
||||
*(T+1)=(uchar) (((uint) (A) >> 8));\
|
||||
*(T+2)=(uchar) (((A) >> 16)); }
|
||||
#define int4store(T,A) *((long *) (T))= (long) (A)
|
||||
#define int5store(T,A) { *(T)= (uchar)((A));\
|
||||
*((T)+1)=(uchar) (((A) >> 8));\
|
||||
*((T)+2)=(uchar) (((A) >> 16));\
|
||||
*((T)+3)=(uchar) (((A) >> 24)); \
|
||||
*((T)+4)=(uchar) (((A) >> 32)); }
|
||||
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
|
||||
|
||||
#define doubleget(V,M) { *((long *) &V) = *((long*) M); \
|
||||
*(((long *) &V)+1) = *(((long*) M)+1); }
|
||||
#define doublestore(T,V) { *((long *) T) = *((long*) &V); \
|
||||
*(((long *) T)+1) = *(((long*) &V)+1); }
|
||||
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
|
||||
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
|
||||
#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float))
|
||||
#define float8get(V,M) doubleget((V),(M))
|
||||
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
|
||||
#define float8store(V,M) doublestore((V),(M))
|
||||
#endif /* _WIN64 */
|
||||
|
||||
#define HAVE_PERROR
|
||||
#define HAVE_VFPRINT
|
||||
#define HAVE_RENAME /* Have rename() as function */
|
||||
#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */
|
||||
#define HAVE_LONG_JMP /* Have long jump function */
|
||||
#define HAVE_LOCKING /* have locking() call */
|
||||
#define HAVE_ERRNO_AS_DEFINE /* errno is a define */
|
||||
#define HAVE_STDLIB /* everything is include in this file */
|
||||
#define HAVE_MEMCPY
|
||||
#define HAVE_MEMMOVE
|
||||
#define HAVE_GETCWD
|
||||
#define HAVE_TELL
|
||||
#define HAVE_TZNAME
|
||||
#define HAVE_PUTENV
|
||||
#define HAVE_SELECT
|
||||
#define HAVE_SETLOCALE
|
||||
#define HAVE_SOCKET /* Giangi */
|
||||
#define HAVE_FLOAT_H
|
||||
#define HAVE_LIMITS_H
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_RINT /* defined in this file */
|
||||
#define NO_FCNTL_NONBLOCK /* No FCNTL */
|
||||
#define HAVE_ALLOCA
|
||||
#define HAVE_STRPBRK
|
||||
#define HAVE_STRSTR
|
||||
#define HAVE_COMPRESS
|
||||
#define HAVE_CREATESEMAPHORE
|
||||
#define HAVE_ISNAN
|
||||
#define HAVE_FINITE
|
||||
#define HAVE_QUERY_CACHE
|
||||
#define SPRINTF_RETURNS_INT
|
||||
#define HAVE_SETFILEPOINTER
|
||||
#define HAVE_VIO_READ_BUFF
|
||||
|
||||
#ifdef NOT_USED
|
||||
#define HAVE_SNPRINTF /* Gave link error */
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */
|
||||
#define HAVE_ANSI_INCLUDE
|
||||
#define HAVE_SYS_UTIME_H
|
||||
#define HAVE_STRTOUL
|
||||
#endif
|
||||
#define my_reinterpret_cast(A) reinterpret_cast <A>
|
||||
#define my_const_cast(A) const_cast<A>
|
||||
|
||||
|
||||
/* MYSQL OPTIONS */
|
||||
|
||||
#ifdef _CUSTOMCONFIG_
|
||||
#include <custom_conf.h>
|
||||
#else
|
||||
#define DEFAULT_MYSQL_HOME "c:\\mysql"
|
||||
#define PACKAGE "mysql"
|
||||
#define DEFAULT_BASEDIR "C:\\"
|
||||
#define SHAREDIR "share"
|
||||
#define DEFAULT_CHARSET_HOME "C:/mysql/"
|
||||
#endif
|
||||
#ifndef DEFAULT_HOME_ENV
|
||||
#define DEFAULT_HOME_ENV MYSQL_HOME
|
||||
#endif
|
||||
#ifndef DEFAULT_GROUP_SUFFIX_ENV
|
||||
#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX
|
||||
#endif
|
||||
|
||||
/* File name handling */
|
||||
|
||||
#define FN_LIBCHAR '\\'
|
||||
#define FN_ROOTDIR "\\"
|
||||
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
||||
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
|
||||
#define OS_FILE_LIMIT 2048
|
||||
|
||||
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
||||
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
||||
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
|
||||
/* The following is only used for statistics, so it should be good enough */
|
||||
#ifdef __NT__ /* This should also work on Win98 but .. */
|
||||
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
|
||||
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
|
||||
#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
|
||||
#else
|
||||
#define thread_safe_add(V,C,L) \
|
||||
pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L));
|
||||
#define thread_safe_sub(V,C,L) \
|
||||
pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L));
|
||||
#define statistic_add(V,C,L) (V)+=(C)
|
||||
#endif
|
||||
#define statistic_increment(V,L) thread_safe_increment((V),(L))
|
||||
#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
|
||||
|
||||
#define shared_memory_buffer_length 16000
|
||||
#define default_shared_memory_base_name "MYSQL"
|
||||
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
|
||||
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
|
||||
|
||||
#define HAVE_SPATIAL 1
|
||||
#define HAVE_RTREE_KEYS 1
|
||||
|
||||
/* #undef HAVE_OPENSSL */
|
||||
/* #undef HAVE_YASSL */
|
||||
|
||||
/* Define charsets you want */
|
||||
/* #undef HAVE_CHARSET_armscii8 */
|
||||
/* #undef HAVE_CHARSET_ascii */
|
||||
#define HAVE_CHARSET_big5 1
|
||||
#define HAVE_CHARSET_cp1250 1
|
||||
/* #undef HAVE_CHARSET_cp1251 */
|
||||
/* #undef HAVE_CHARSET_cp1256 */
|
||||
/* #undef HAVE_CHARSET_cp1257 */
|
||||
/* #undef HAVE_CHARSET_cp850 */
|
||||
/* #undef HAVE_CHARSET_cp852 */
|
||||
/* #undef HAVE_CHARSET_cp866 */
|
||||
#define HAVE_CHARSET_cp932 1
|
||||
/* #undef HAVE_CHARSET_dec8 */
|
||||
#define HAVE_CHARSET_eucjpms 1
|
||||
#define HAVE_CHARSET_euckr 1
|
||||
#define HAVE_CHARSET_gb2312 1
|
||||
#define HAVE_CHARSET_gbk 1
|
||||
/* #undef HAVE_CHARSET_greek */
|
||||
/* #undef HAVE_CHARSET_hebrew */
|
||||
/* #undef HAVE_CHARSET_hp8 */
|
||||
/* #undef HAVE_CHARSET_keybcs2 */
|
||||
/* #undef HAVE_CHARSET_koi8r */
|
||||
/* #undef HAVE_CHARSET_koi8u */
|
||||
#define HAVE_CHARSET_latin1 1
|
||||
#define HAVE_CHARSET_latin2 1
|
||||
/* #undef HAVE_CHARSET_latin5 */
|
||||
/* #undef HAVE_CHARSET_latin7 */
|
||||
/* #undef HAVE_CHARSET_macce */
|
||||
/* #undef HAVE_CHARSET_macroman */
|
||||
#define HAVE_CHARSET_sjis 1
|
||||
/* #undef HAVE_CHARSET_swe7 */
|
||||
#define HAVE_CHARSET_tis620 1
|
||||
#define HAVE_CHARSET_ucs2 1
|
||||
#define HAVE_CHARSET_ujis 1
|
||||
#define HAVE_CHARSET_utf8 1
|
||||
#define HAVE_UCA_COLLATIONS 1
|
||||
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Defines for Win32 to make it compatible for MySQL */
|
||||
|
||||
#ifdef __WIN2000__
|
||||
/* We have to do this define before including windows.h to get the AWE API
|
||||
functions */
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
/* Avoid endless warnings about sprintf() etc. being unsafe. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
#include <sys/locking.h>
|
||||
#include <windows.h>
|
||||
#include <math.h> /* Because of rint() */
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#define HAVE_SMEM 1
|
||||
|
||||
#if defined(_WIN64) || defined(WIN64)
|
||||
#define SYSTEM_TYPE "Win64"
|
||||
#elif defined(_WIN32) || defined(WIN32)
|
||||
#define SYSTEM_TYPE "Win32"
|
||||
#else
|
||||
#define SYSTEM_TYPE "Windows"
|
||||
#endif
|
||||
|
||||
#if defined(_M_IA64)
|
||||
#define MACHINE_TYPE "ia64"
|
||||
#elif defined(_M_IX86)
|
||||
#define MACHINE_TYPE "ia32"
|
||||
#elif defined(_M_ALPHA)
|
||||
#define MACHINE_TYPE "axp"
|
||||
#else
|
||||
#define MACHINE_TYPE "unknown" /* Define to machine type name */
|
||||
#endif
|
||||
|
||||
#if !(defined(_WIN64) || defined(WIN64))
|
||||
#ifndef _WIN32
|
||||
#define _WIN32 /* Compatible with old source */
|
||||
#endif
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#endif
|
||||
#endif /* _WIN64 */
|
||||
#ifndef __WIN__
|
||||
#define __WIN__ /* To make it easier in VC++ */
|
||||
#endif
|
||||
|
||||
#ifndef MAX_INDEXES
|
||||
#define MAX_INDEXES 64
|
||||
#endif
|
||||
|
||||
/* File and lock constants */
|
||||
#define O_SHARE 0x1000 /* Open file in sharing mode */
|
||||
#ifdef __BORLANDC__
|
||||
#define F_RDLCK LK_NBLCK /* read lock */
|
||||
#define F_WRLCK LK_NBRLCK /* write lock */
|
||||
#define F_UNLCK LK_UNLCK /* remove lock(s) */
|
||||
#else
|
||||
#define F_RDLCK _LK_NBLCK /* read lock */
|
||||
#define F_WRLCK _LK_NBRLCK /* write lock */
|
||||
#define F_UNLCK _LK_UNLCK /* remove lock(s) */
|
||||
#endif
|
||||
|
||||
#define F_EXCLUSIVE 1 /* We have only exclusive locking */
|
||||
#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */
|
||||
#define F_OK 0 /* parameter to access() */
|
||||
#define W_OK 2
|
||||
|
||||
#define S_IROTH S_IREAD /* for my_lib */
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
|
||||
#define O_TEMPORARY 0
|
||||
#define O_SHORT_LIVED 0
|
||||
#define SH_DENYNO _SH_DENYNO
|
||||
#else
|
||||
#define O_BINARY _O_BINARY /* compability with MSDOS */
|
||||
#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */
|
||||
#define O_TEMPORARY _O_TEMPORARY
|
||||
#define O_SHORT_LIVED _O_SHORT_LIVED
|
||||
#define SH_DENYNO _SH_DENYNO
|
||||
#endif
|
||||
#define NO_OPEN_3 /* For my_create() */
|
||||
|
||||
#define SIGQUIT SIGTERM /* No SIGQUIT */
|
||||
|
||||
#undef _REENTRANT /* Crashes something for win32 */
|
||||
#undef SAFE_MUTEX /* Can't be used on windows */
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1310
|
||||
#define LL(A) A##ll
|
||||
#define ULL(A) A##ull
|
||||
#else
|
||||
#define LL(A) ((__int64) A)
|
||||
#define ULL(A) ((unsigned __int64) A)
|
||||
#endif
|
||||
|
||||
#define LONGLONG_MIN LL(0x8000000000000000)
|
||||
#define LONGLONG_MAX LL(0x7FFFFFFFFFFFFFFF)
|
||||
#define ULONGLONG_MAX ULL(0xFFFFFFFFFFFFFFFF)
|
||||
|
||||
/* Type information */
|
||||
|
||||
#if defined(__EMX__) || !defined(HAVE_UINT)
|
||||
#undef HAVE_UINT
|
||||
#define HAVE_UINT
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned int uint;
|
||||
#endif /* defined(__EMX__) || !defined(HAVE_UINT) */
|
||||
|
||||
typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */
|
||||
typedef __int64 longlong;
|
||||
#ifndef HAVE_SIGSET_T
|
||||
typedef int sigset_t;
|
||||
#endif
|
||||
#define longlong_defined
|
||||
/*
|
||||
off_t should not be __int64 because of conflicts in header files;
|
||||
Use my_off_t or os_off_t instead
|
||||
*/
|
||||
#ifndef HAVE_OFF_T
|
||||
typedef long off_t;
|
||||
#endif
|
||||
typedef __int64 os_off_t;
|
||||
#ifdef _WIN64
|
||||
typedef UINT_PTR rf_SetTimer;
|
||||
#else
|
||||
#ifndef HAVE_SIZE_T
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
typedef uint rf_SetTimer;
|
||||
#endif
|
||||
|
||||
#define Socket_defined
|
||||
#define my_socket SOCKET
|
||||
#define bool BOOL
|
||||
#define SIGPIPE SIGINT
|
||||
#define RETQSORTTYPE void
|
||||
#define QSORT_TYPE_IS_VOID
|
||||
#define RETSIGTYPE void
|
||||
#define SOCKET_SIZE_TYPE int
|
||||
#define my_socket_defined
|
||||
#define bool_defined
|
||||
#define byte_defined
|
||||
#define HUGE_PTR
|
||||
#define STDCALL __stdcall /* Used by libmysql.dll */
|
||||
#define isnan(X) _isnan(X)
|
||||
#define finite(X) _finite(X)
|
||||
|
||||
#ifndef UNDEF_THREAD_HACK
|
||||
#define THREAD
|
||||
#endif
|
||||
#define VOID_SIGHANDLER
|
||||
#define SIZEOF_CHAR 1
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF_OFF_T 8
|
||||
#ifdef _WIN64
|
||||
#define SIZEOF_CHARP 8
|
||||
#else
|
||||
#define SIZEOF_CHARP 4
|
||||
#endif
|
||||
#define HAVE_BROKEN_NETINET_INCLUDES
|
||||
#ifdef __NT__
|
||||
#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
|
||||
#endif
|
||||
|
||||
/* ERROR is defined in wingdi.h */
|
||||
#undef ERROR
|
||||
|
||||
/* We need to close files to break connections on shutdown */
|
||||
#ifndef SIGNAL_WITH_VIO_CLOSE
|
||||
#define SIGNAL_WITH_VIO_CLOSE
|
||||
#endif
|
||||
|
||||
/* Use all character sets in MySQL */
|
||||
#define USE_MB 1
|
||||
#define USE_MB_IDENT 1
|
||||
#define USE_STRCOLL 1
|
||||
|
||||
/* All windows servers should support .sym files */
|
||||
#undef USE_SYMDIR
|
||||
#define USE_SYMDIR
|
||||
|
||||
/* If LOAD DATA LOCAL INFILE should be enabled by default */
|
||||
#define ENABLED_LOCAL_INFILE 1
|
||||
|
||||
/* Convert some simple functions to Posix */
|
||||
|
||||
#define my_sigset(A,B) signal((A),(B))
|
||||
#define finite(A) _finite(A)
|
||||
#define sleep(A) Sleep((A)*1000)
|
||||
#define popen(A,B) _popen((A),(B))
|
||||
#define pclose(A) _pclose(A)
|
||||
|
||||
#ifndef __BORLANDC__
|
||||
#define access(A,B) _access(A,B)
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus)
|
||||
#define inline __inline
|
||||
#endif /* __cplusplus */
|
||||
|
||||
inline double rint(double nr)
|
||||
{
|
||||
double f = floor(nr);
|
||||
double c = ceil(nr);
|
||||
return (((c-nr) >= (nr-f)) ? f :c);
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
||||
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
||||
|
||||
#else
|
||||
inline double ulonglong2double(ulonglong value)
|
||||
{
|
||||
longlong nr=(longlong) value;
|
||||
if (nr >= 0)
|
||||
return (double) nr;
|
||||
return (18446744073709551616.0 + (double) nr);
|
||||
}
|
||||
#define my_off_t2double(A) ulonglong2double(A)
|
||||
#endif /* _WIN64 */
|
||||
|
||||
#if SIZEOF_OFF_T > 4
|
||||
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
|
||||
#define tell(A) _telli64(A)
|
||||
#endif
|
||||
|
||||
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
|
||||
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Optimized store functions for Intel x86 */
|
||||
|
||||
#ifndef _WIN64
|
||||
#define sint2korr(A) (*((int16 *) (A)))
|
||||
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
|
||||
(((uint32) 255L << 24) | \
|
||||
(((uint32) (uchar) (A)[2]) << 16) |\
|
||||
(((uint32) (uchar) (A)[1]) << 8) | \
|
||||
((uint32) (uchar) (A)[0])) : \
|
||||
(((uint32) (uchar) (A)[2]) << 16) |\
|
||||
(((uint32) (uchar) (A)[1]) << 8) | \
|
||||
((uint32) (uchar) (A)[0])))
|
||||
#define sint4korr(A) (*((long *) (A)))
|
||||
#define uint2korr(A) (*((uint16 *) (A)))
|
||||
/*
|
||||
ATTENTION !
|
||||
|
||||
Please, note, uint3korr reads 4 bytes (not 3) !
|
||||
It means, that you have to provide enough allocated space !
|
||||
*/
|
||||
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
|
||||
#define uint4korr(A) (*((unsigned long *) (A)))
|
||||
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
|
||||
(((uint32) ((uchar) (A)[1])) << 8) +\
|
||||
(((uint32) ((uchar) (A)[2])) << 16) +\
|
||||
(((uint32) ((uchar) (A)[3])) << 24)) +\
|
||||
(((ulonglong) ((uchar) (A)[4])) << 32))
|
||||
#define uint8korr(A) (*((ulonglong *) (A)))
|
||||
#define sint8korr(A) (*((longlong *) (A)))
|
||||
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
|
||||
#define int3store(T,A) { *(T)= (uchar) ((A));\
|
||||
*(T+1)=(uchar) (((uint) (A) >> 8));\
|
||||
*(T+2)=(uchar) (((A) >> 16)); }
|
||||
#define int4store(T,A) *((long *) (T))= (long) (A)
|
||||
#define int5store(T,A) { *(T)= (uchar)((A));\
|
||||
*((T)+1)=(uchar) (((A) >> 8));\
|
||||
*((T)+2)=(uchar) (((A) >> 16));\
|
||||
*((T)+3)=(uchar) (((A) >> 24)); \
|
||||
*((T)+4)=(uchar) (((A) >> 32)); }
|
||||
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
|
||||
|
||||
#define doubleget(V,M) do { *((long *) &V) = *((long*) M); \
|
||||
*(((long *) &V)+1) = *(((long*) M)+1); } while(0)
|
||||
#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \
|
||||
*(((long *) T)+1) = *(((long*) &V)+1); } while(0)
|
||||
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
|
||||
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
|
||||
#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float))
|
||||
#define float8get(V,M) doubleget((V),(M))
|
||||
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
|
||||
#define float8store(V,M) doublestore((V),(M))
|
||||
#endif /* _WIN64 */
|
||||
|
||||
#define HAVE_PERROR
|
||||
#define HAVE_VFPRINT
|
||||
#define HAVE_RENAME /* Have rename() as function */
|
||||
#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */
|
||||
#define HAVE_LONG_JMP /* Have long jump function */
|
||||
#define HAVE_LOCKING /* have locking() call */
|
||||
#define HAVE_ERRNO_AS_DEFINE /* errno is a define */
|
||||
#define HAVE_STDLIB /* everything is include in this file */
|
||||
#define HAVE_MEMCPY
|
||||
#define HAVE_MEMMOVE
|
||||
#define HAVE_GETCWD
|
||||
#define HAVE_TELL
|
||||
#define HAVE_TZNAME
|
||||
#define HAVE_PUTENV
|
||||
#define HAVE_SELECT
|
||||
#define HAVE_SETLOCALE
|
||||
#define HAVE_SOCKET /* Giangi */
|
||||
#define HAVE_FLOAT_H
|
||||
#define HAVE_LIMITS_H
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_RINT /* defined in this file */
|
||||
#define NO_FCNTL_NONBLOCK /* No FCNTL */
|
||||
#define HAVE_ALLOCA
|
||||
#define HAVE_STRPBRK
|
||||
#define HAVE_STRSTR
|
||||
#define HAVE_COMPRESS
|
||||
#define HAVE_CREATESEMAPHORE
|
||||
#define HAVE_ISNAN
|
||||
#define HAVE_FINITE
|
||||
#define HAVE_QUERY_CACHE
|
||||
#define SPRINTF_RETURNS_INT
|
||||
#define HAVE_SETFILEPOINTER
|
||||
#define HAVE_VIO_READ_BUFF
|
||||
#define HAVE_STRNLEN
|
||||
|
||||
#ifndef __NT__
|
||||
#undef FILE_SHARE_DELETE
|
||||
#define FILE_SHARE_DELETE 0 /* Not implemented on Win 98/ME */
|
||||
#endif
|
||||
|
||||
#ifdef NOT_USED
|
||||
#define HAVE_SNPRINTF /* Gave link error */
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */
|
||||
#define HAVE_ANSI_INCLUDE
|
||||
#define HAVE_SYS_UTIME_H
|
||||
#define HAVE_STRTOUL
|
||||
#endif
|
||||
#define my_reinterpret_cast(A) reinterpret_cast <A>
|
||||
#define my_const_cast(A) const_cast<A>
|
||||
|
||||
|
||||
/* MYSQL OPTIONS */
|
||||
|
||||
#ifdef _CUSTOMCONFIG_
|
||||
#include <custom_conf.h>
|
||||
#else
|
||||
#define DEFAULT_MYSQL_HOME "c:\\mysql"
|
||||
#define PACKAGE "mysql"
|
||||
#define DEFAULT_BASEDIR "C:\\"
|
||||
#define SHAREDIR "share"
|
||||
#define DEFAULT_CHARSET_HOME "C:/mysql/"
|
||||
#endif
|
||||
#ifndef DEFAULT_HOME_ENV
|
||||
#define DEFAULT_HOME_ENV MYSQL_HOME
|
||||
#endif
|
||||
#ifndef DEFAULT_GROUP_SUFFIX_ENV
|
||||
#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX
|
||||
#endif
|
||||
|
||||
/* File name handling */
|
||||
|
||||
#define FN_LIBCHAR '\\'
|
||||
#define FN_ROOTDIR "\\"
|
||||
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
||||
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
|
||||
#define OS_FILE_LIMIT 2048
|
||||
|
||||
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
||||
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
||||
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
|
||||
/* The following is only used for statistics, so it should be good enough */
|
||||
#ifdef __NT__ /* This should also work on Win98 but .. */
|
||||
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
|
||||
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
|
||||
#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
|
||||
#else
|
||||
#define thread_safe_add(V,C,L) \
|
||||
pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L));
|
||||
#define thread_safe_sub(V,C,L) \
|
||||
pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L));
|
||||
#define statistic_add(V,C,L) (V)+=(C)
|
||||
#endif
|
||||
#define statistic_increment(V,L) thread_safe_increment((V),(L))
|
||||
#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
|
||||
|
||||
#define shared_memory_buffer_length 16000
|
||||
#define default_shared_memory_base_name "MYSQL"
|
||||
|
||||
#ifdef CYBOZU
|
||||
#define MYSQL_DEFAULT_CHARSET_NAME "utf8"
|
||||
#define MYSQL_DEFAULT_COLLATION_NAME "utf8_general_cs"
|
||||
#define HAVE_UTF8_GENERAL_CS 1
|
||||
#else
|
||||
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
|
||||
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
|
||||
#endif
|
||||
|
||||
#define HAVE_SPATIAL 1
|
||||
#define HAVE_RTREE_KEYS 1
|
||||
|
||||
#define HAVE_OPENSSL 1
|
||||
#define HAVE_YASSL 1
|
||||
|
||||
/* Define charsets you want */
|
||||
/* #undef HAVE_CHARSET_armscii8 */
|
||||
/* #undef HAVE_CHARSET_ascii */
|
||||
#ifndef CYBOZU
|
||||
#define HAVE_CHARSET_big5 1
|
||||
#define HAVE_CHARSET_cp1250 1
|
||||
#endif
|
||||
/* #undef HAVE_CHARSET_cp1251 */
|
||||
/* #undef HAVE_CHARSET_cp1256 */
|
||||
/* #undef HAVE_CHARSET_cp1257 */
|
||||
/* #undef HAVE_CHARSET_cp850 */
|
||||
/* #undef HAVE_CHARSET_cp852 */
|
||||
/* #undef HAVE_CHARSET_cp866 */
|
||||
#define HAVE_CHARSET_cp932 1
|
||||
/* #undef HAVE_CHARSET_dec8 */
|
||||
#ifndef CYBOZU
|
||||
#define HAVE_CHARSET_eucjpms 1
|
||||
#define HAVE_CHARSET_euckr 1
|
||||
#define HAVE_CHARSET_gb2312 1
|
||||
#define HAVE_CHARSET_gbk 1
|
||||
#endif
|
||||
/* #undef HAVE_CHARSET_greek */
|
||||
/* #undef HAVE_CHARSET_hebrew */
|
||||
/* #undef HAVE_CHARSET_hp8 */
|
||||
/* #undef HAVE_CHARSET_keybcs2 */
|
||||
/* #undef HAVE_CHARSET_koi8r */
|
||||
/* #undef HAVE_CHARSET_koi8u */
|
||||
#ifndef CYBOZU
|
||||
#define HAVE_CHARSET_latin1 1
|
||||
#define HAVE_CHARSET_latin2 1
|
||||
#endif
|
||||
/* #undef HAVE_CHARSET_latin5 */
|
||||
/* #undef HAVE_CHARSET_latin7 */
|
||||
/* #undef HAVE_CHARSET_macce */
|
||||
/* #undef HAVE_CHARSET_macroman */
|
||||
#define HAVE_CHARSET_sjis 1
|
||||
/* #undef HAVE_CHARSET_swe7 */
|
||||
#ifndef CYBOZU
|
||||
#define HAVE_CHARSET_tis620 1
|
||||
#define HAVE_CHARSET_ucs2 1
|
||||
#define HAVE_CHARSET_ujis 1
|
||||
#endif
|
||||
#define HAVE_CHARSET_utf8 1
|
||||
#define HAVE_UCA_COLLATIONS 1
|
||||
|
||||
|
@ -1,478 +1,493 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
A better inplementation of the UNIX ctype(3) library.
|
||||
Notes: my_global.h should be included before ctype.h
|
||||
*/
|
||||
|
||||
#ifndef _m_ctype_h
|
||||
#define _m_ctype_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MY_CS_NAME_SIZE 32
|
||||
#define MY_CS_CTYPE_TABLE_SIZE 257
|
||||
#define MY_CS_TO_LOWER_TABLE_SIZE 256
|
||||
#define MY_CS_TO_UPPER_TABLE_SIZE 256
|
||||
#define MY_CS_SORT_ORDER_TABLE_SIZE 256
|
||||
#define MY_CS_TO_UNI_TABLE_SIZE 256
|
||||
|
||||
#define CHARSET_DIR "charsets/"
|
||||
|
||||
#define my_wc_t ulong
|
||||
|
||||
typedef struct unicase_info_st
|
||||
{
|
||||
uint16 toupper;
|
||||
uint16 tolower;
|
||||
uint16 sort;
|
||||
} MY_UNICASE_INFO;
|
||||
|
||||
extern MY_UNICASE_INFO *my_unicase_default[256];
|
||||
extern MY_UNICASE_INFO *my_unicase_turkish[256];
|
||||
|
||||
#define MY_CS_ILSEQ 0
|
||||
#define MY_CS_ILUNI 0
|
||||
#define MY_CS_TOOSMALL -1
|
||||
#define MY_CS_TOOFEW(n) (-1-(n))
|
||||
|
||||
#define MY_SEQ_INTTAIL 1
|
||||
#define MY_SEQ_SPACES 2
|
||||
|
||||
/* My charsets_list flags */
|
||||
#define MY_CS_COMPILED 1 /* compiled-in sets */
|
||||
#define MY_CS_CONFIG 2 /* sets that have a *.conf file */
|
||||
#define MY_CS_INDEX 4 /* sets listed in the Index file */
|
||||
#define MY_CS_LOADED 8 /* sets that are currently loaded */
|
||||
#define MY_CS_BINSORT 16 /* if binary sort order */
|
||||
#define MY_CS_PRIMARY 32 /* if primary collation */
|
||||
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
|
||||
#define MY_CS_UNICODE 128 /* is a charset is full unicode */
|
||||
#define MY_CS_READY 256 /* if a charset is initialized */
|
||||
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
|
||||
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
|
||||
#define MY_CHARSET_UNDEFINED 0
|
||||
|
||||
|
||||
typedef struct my_uni_idx_st
|
||||
{
|
||||
uint16 from;
|
||||
uint16 to;
|
||||
uchar *tab;
|
||||
} MY_UNI_IDX;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint beg;
|
||||
uint end;
|
||||
uint mblen;
|
||||
} my_match_t;
|
||||
|
||||
enum my_lex_states
|
||||
{
|
||||
MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT,
|
||||
MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
|
||||
MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER,
|
||||
MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
|
||||
MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
|
||||
MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE,
|
||||
MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON,
|
||||
MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
|
||||
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
|
||||
MY_LEX_IDENT_OR_KEYWORD,
|
||||
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
|
||||
MY_LEX_STRING_OR_DELIMITER
|
||||
};
|
||||
|
||||
struct charset_info_st;
|
||||
|
||||
typedef struct my_collation_handler_st
|
||||
{
|
||||
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
|
||||
/* Collation routines */
|
||||
int (*strnncoll)(struct charset_info_st *,
|
||||
const uchar *, uint, const uchar *, uint, my_bool);
|
||||
int (*strnncollsp)(struct charset_info_st *,
|
||||
const uchar *, uint, const uchar *, uint,
|
||||
my_bool diff_if_only_endspace_difference);
|
||||
int (*strnxfrm)(struct charset_info_st *,
|
||||
uchar *, uint, const uchar *, uint);
|
||||
uint (*strnxfrmlen)(struct charset_info_st *, uint);
|
||||
my_bool (*like_range)(struct charset_info_st *,
|
||||
const char *s, uint s_length,
|
||||
pchar w_prefix, pchar w_one, pchar w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_len, uint *max_len);
|
||||
int (*wildcmp)(struct charset_info_st *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape,int w_one, int w_many);
|
||||
|
||||
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
|
||||
|
||||
uint (*instr)(struct charset_info_st *,
|
||||
const char *b, uint b_length,
|
||||
const char *s, uint s_length,
|
||||
my_match_t *match, uint nmatch);
|
||||
|
||||
/* Hash calculation */
|
||||
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
|
||||
ulong *nr1, ulong *nr2);
|
||||
my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len);
|
||||
} MY_COLLATION_HANDLER;
|
||||
|
||||
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
|
||||
extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
|
||||
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
|
||||
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
|
||||
|
||||
|
||||
typedef struct my_charset_handler_st
|
||||
{
|
||||
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
|
||||
/* Multibyte routines */
|
||||
int (*ismbchar)(struct charset_info_st *, const char *, const char *);
|
||||
int (*mbcharlen)(struct charset_info_st *, uint);
|
||||
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
||||
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
|
||||
uint (*well_formed_len)(struct charset_info_st *,
|
||||
const char *b,const char *e,
|
||||
uint nchars, int *error);
|
||||
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
|
||||
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
|
||||
|
||||
/* Unicode convertion */
|
||||
int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
|
||||
const unsigned char *s,const unsigned char *e);
|
||||
int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
|
||||
unsigned char *s,unsigned char *e);
|
||||
|
||||
/* Functions for case and sort convertion */
|
||||
void (*caseup_str)(struct charset_info_st *, char *);
|
||||
void (*casedn_str)(struct charset_info_st *, char *);
|
||||
uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
uint (*casedn)(struct charset_info_st *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
|
||||
/* Charset dependant snprintf() */
|
||||
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
|
||||
...);
|
||||
int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix,
|
||||
long int val);
|
||||
int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
|
||||
int radix, longlong val);
|
||||
|
||||
void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
|
||||
|
||||
/* String-to-number convertion routines */
|
||||
long (*strntol)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
longlong (*strntoll)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
|
||||
int *err);
|
||||
longlong (*strtoll10)(struct charset_info_st *cs,
|
||||
const char *nptr, char **endptr, int *error);
|
||||
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
|
||||
int sq);
|
||||
} MY_CHARSET_HANDLER;
|
||||
|
||||
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
|
||||
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
|
||||
|
||||
|
||||
typedef struct charset_info_st
|
||||
{
|
||||
uint number;
|
||||
uint primary_number;
|
||||
uint binary_number;
|
||||
uint state;
|
||||
const char *csname;
|
||||
const char *name;
|
||||
const char *comment;
|
||||
const char *tailoring;
|
||||
uchar *ctype;
|
||||
uchar *to_lower;
|
||||
uchar *to_upper;
|
||||
uchar *sort_order;
|
||||
uint16 *contractions;
|
||||
uint16 **sort_order_big;
|
||||
uint16 *tab_to_uni;
|
||||
MY_UNI_IDX *tab_from_uni;
|
||||
MY_UNICASE_INFO **caseinfo;
|
||||
uchar *state_map;
|
||||
uchar *ident_map;
|
||||
uint strxfrm_multiply;
|
||||
uchar caseup_multiply;
|
||||
uchar casedn_multiply;
|
||||
uint mbminlen;
|
||||
uint mbmaxlen;
|
||||
uint16 min_sort_char;
|
||||
uint16 max_sort_char; /* For LIKE optimization */
|
||||
uchar pad_char;
|
||||
my_bool escape_with_backslash_is_dangerous;
|
||||
|
||||
MY_CHARSET_HANDLER *cset;
|
||||
MY_COLLATION_HANDLER *coll;
|
||||
|
||||
} CHARSET_INFO;
|
||||
|
||||
|
||||
extern CHARSET_INFO my_charset_bin;
|
||||
extern CHARSET_INFO my_charset_big5_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_big5_bin;
|
||||
extern CHARSET_INFO my_charset_cp932_japanese_ci;
|
||||
extern CHARSET_INFO my_charset_cp932_bin;
|
||||
extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
|
||||
extern CHARSET_INFO my_charset_eucjpms_bin;
|
||||
extern CHARSET_INFO my_charset_euckr_korean_ci;
|
||||
extern CHARSET_INFO my_charset_euckr_bin;
|
||||
extern CHARSET_INFO my_charset_gb2312_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_gb2312_bin;
|
||||
extern CHARSET_INFO my_charset_gbk_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_gbk_bin;
|
||||
extern CHARSET_INFO my_charset_latin1;
|
||||
extern CHARSET_INFO my_charset_latin1_german2_ci;
|
||||
extern CHARSET_INFO my_charset_latin1_bin;
|
||||
extern CHARSET_INFO my_charset_latin2_czech_ci;
|
||||
extern CHARSET_INFO my_charset_sjis_japanese_ci;
|
||||
extern CHARSET_INFO my_charset_sjis_bin;
|
||||
extern CHARSET_INFO my_charset_tis620_thai_ci;
|
||||
extern CHARSET_INFO my_charset_tis620_bin;
|
||||
extern CHARSET_INFO my_charset_ucs2_general_ci;
|
||||
extern CHARSET_INFO my_charset_ucs2_bin;
|
||||
extern CHARSET_INFO my_charset_ucs2_general_uca;
|
||||
extern CHARSET_INFO my_charset_ujis_japanese_ci;
|
||||
extern CHARSET_INFO my_charset_ujis_bin;
|
||||
extern CHARSET_INFO my_charset_utf8_general_ci;
|
||||
extern CHARSET_INFO my_charset_utf8_bin;
|
||||
extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
||||
|
||||
/* declarations for simple charsets */
|
||||
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
|
||||
uint);
|
||||
uint my_strnxfrmlen_simple(CHARSET_INFO *, uint);
|
||||
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
|
||||
const uchar *, uint, my_bool);
|
||||
|
||||
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
|
||||
const uchar *, uint,
|
||||
my_bool diff_if_only_endspace_difference);
|
||||
|
||||
extern void my_hash_sort_simple(CHARSET_INFO *cs,
|
||||
const uchar *key, uint len,
|
||||
ulong *nr1, ulong *nr2);
|
||||
|
||||
extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length);
|
||||
|
||||
extern uint my_instr_simple(struct charset_info_st *,
|
||||
const char *b, uint b_length,
|
||||
const char *s, uint s_length,
|
||||
my_match_t *match, uint nmatch);
|
||||
|
||||
|
||||
/* Functions for 8bit */
|
||||
extern void my_caseup_str_8bit(CHARSET_INFO *, char *);
|
||||
extern void my_casedn_str_8bit(CHARSET_INFO *, char *);
|
||||
extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
|
||||
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
|
||||
|
||||
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
|
||||
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
|
||||
|
||||
ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
|
||||
|
||||
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
|
||||
const char *fmt, ...);
|
||||
|
||||
long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
|
||||
int *err);
|
||||
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
||||
long int val);
|
||||
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
||||
longlong val);
|
||||
|
||||
longlong my_strtoll10_8bit(CHARSET_INFO *cs,
|
||||
const char *nptr, char **endptr, int *error);
|
||||
longlong my_strtoll10_ucs2(CHARSET_INFO *cs,
|
||||
const char *nptr, char **endptr, int *error);
|
||||
|
||||
void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
|
||||
|
||||
my_bool my_like_range_simple(CHARSET_INFO *cs,
|
||||
const char *ptr, uint ptr_length,
|
||||
pbool escape, pbool w_one, pbool w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
|
||||
my_bool my_like_range_mb(CHARSET_INFO *cs,
|
||||
const char *ptr, uint ptr_length,
|
||||
pbool escape, pbool w_one, pbool w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
|
||||
my_bool my_like_range_ucs2(CHARSET_INFO *cs,
|
||||
const char *ptr, uint ptr_length,
|
||||
pbool escape, pbool w_one, pbool w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
|
||||
|
||||
int my_wildcmp_8bit(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
|
||||
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
|
||||
uint pos, int *error);
|
||||
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
|
||||
|
||||
|
||||
/* Functions for multibyte charsets */
|
||||
extern void my_caseup_str_mb(CHARSET_INFO *, char *);
|
||||
extern void my_casedn_str_mb(CHARSET_INFO *, char *);
|
||||
extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
|
||||
|
||||
int my_wildcmp_mb(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
|
||||
uint pos, int *error);
|
||||
uint my_instr_mb(struct charset_info_st *,
|
||||
const char *b, uint b_length,
|
||||
const char *s, uint s_length,
|
||||
my_match_t *match, uint nmatch);
|
||||
|
||||
int my_wildcmp_unicode(CHARSET_INFO *cs,
|
||||
const char *str, const char *str_end,
|
||||
const char *wildstr, const char *wildend,
|
||||
int escape, int w_one, int w_many,
|
||||
MY_UNICASE_INFO **weights);
|
||||
|
||||
extern my_bool my_parse_charset_xml(const char *bug, uint len,
|
||||
int (*add)(CHARSET_INFO *cs));
|
||||
|
||||
my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, uint len);
|
||||
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);
|
||||
|
||||
|
||||
#define _MY_U 01 /* Upper case */
|
||||
#define _MY_L 02 /* Lower case */
|
||||
#define _MY_NMR 04 /* Numeral (digit) */
|
||||
#define _MY_SPC 010 /* Spacing character */
|
||||
#define _MY_PNT 020 /* Punctuation */
|
||||
#define _MY_CTR 040 /* Control character */
|
||||
#define _MY_B 0100 /* Blank */
|
||||
#define _MY_X 0200 /* heXadecimal digit */
|
||||
|
||||
|
||||
#define my_isascii(c) (!((c) & ~0177))
|
||||
#define my_toascii(c) ((c) & 0177)
|
||||
#define my_tocntrl(c) ((c) & 31)
|
||||
#define my_toprint(c) ((c) | 64)
|
||||
#define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)])
|
||||
#define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)])
|
||||
#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L))
|
||||
#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U)
|
||||
#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L)
|
||||
#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR)
|
||||
#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X)
|
||||
#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR))
|
||||
#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC)
|
||||
#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT)
|
||||
#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
|
||||
#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
|
||||
#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR)
|
||||
|
||||
/* Some macros that should be cleaned up a little */
|
||||
#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
|
||||
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
|
||||
|
||||
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
|
||||
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
||||
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
|
||||
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
|
||||
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
|
||||
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
|
||||
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
|
||||
#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
|
||||
#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num))
|
||||
|
||||
|
||||
#define use_mb(s) ((s)->cset->ismbchar != NULL)
|
||||
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
|
||||
#ifdef USE_MB
|
||||
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
|
||||
#else
|
||||
#define my_mbcharlen(s, a) 1
|
||||
#endif
|
||||
|
||||
#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
|
||||
#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
|
||||
#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
|
||||
|
||||
|
||||
/* XXX: still need to take care of this one */
|
||||
#ifdef MY_CHARSET_TIS620
|
||||
#error The TIS620 charset is broken at the moment. Tell tim to fix it.
|
||||
#define USE_TIS620
|
||||
#include "t_ctype.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _m_ctype_h */
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
A better inplementation of the UNIX ctype(3) library.
|
||||
Notes: my_global.h should be included before ctype.h
|
||||
*/
|
||||
|
||||
#ifndef _m_ctype_h
|
||||
#define _m_ctype_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MY_CS_NAME_SIZE 32
|
||||
#define MY_CS_CTYPE_TABLE_SIZE 257
|
||||
#define MY_CS_TO_LOWER_TABLE_SIZE 256
|
||||
#define MY_CS_TO_UPPER_TABLE_SIZE 256
|
||||
#define MY_CS_SORT_ORDER_TABLE_SIZE 256
|
||||
#define MY_CS_TO_UNI_TABLE_SIZE 256
|
||||
|
||||
#define CHARSET_DIR "charsets/"
|
||||
|
||||
#define my_wc_t ulong
|
||||
|
||||
typedef struct unicase_info_st
|
||||
{
|
||||
uint16 toupper;
|
||||
uint16 tolower;
|
||||
uint16 sort;
|
||||
} MY_UNICASE_INFO;
|
||||
|
||||
|
||||
extern MY_UNICASE_INFO *my_unicase_default[256];
|
||||
extern MY_UNICASE_INFO *my_unicase_turkish[256];
|
||||
|
||||
|
||||
/* wm_wc and wc_mb return codes */
|
||||
#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */
|
||||
#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */
|
||||
#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */
|
||||
#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */
|
||||
#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */
|
||||
/* These following three are currently not really used */
|
||||
#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */
|
||||
#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */
|
||||
#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */
|
||||
/* A helper macros for "need at least n bytes" */
|
||||
#define MY_CS_TOOSMALLN(n) (-100-(n))
|
||||
|
||||
#define MY_SEQ_INTTAIL 1
|
||||
#define MY_SEQ_SPACES 2
|
||||
|
||||
/* My charsets_list flags */
|
||||
#define MY_CS_COMPILED 1 /* compiled-in sets */
|
||||
#define MY_CS_CONFIG 2 /* sets that have a *.conf file */
|
||||
#define MY_CS_INDEX 4 /* sets listed in the Index file */
|
||||
#define MY_CS_LOADED 8 /* sets that are currently loaded */
|
||||
#define MY_CS_BINSORT 16 /* if binary sort order */
|
||||
#define MY_CS_PRIMARY 32 /* if primary collation */
|
||||
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
|
||||
#define MY_CS_UNICODE 128 /* is a charset is full unicode */
|
||||
#define MY_CS_READY 256 /* if a charset is initialized */
|
||||
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
|
||||
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
|
||||
#define MY_CHARSET_UNDEFINED 0
|
||||
|
||||
|
||||
typedef struct my_uni_idx_st
|
||||
{
|
||||
uint16 from;
|
||||
uint16 to;
|
||||
uchar *tab;
|
||||
} MY_UNI_IDX;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint beg;
|
||||
uint end;
|
||||
uint mblen;
|
||||
} my_match_t;
|
||||
|
||||
enum my_lex_states
|
||||
{
|
||||
MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT,
|
||||
MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
|
||||
MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER,
|
||||
MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
|
||||
MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
|
||||
MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE,
|
||||
MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON,
|
||||
MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
|
||||
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
|
||||
MY_LEX_IDENT_OR_KEYWORD,
|
||||
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
|
||||
MY_LEX_STRING_OR_DELIMITER
|
||||
};
|
||||
|
||||
struct charset_info_st;
|
||||
|
||||
typedef struct my_collation_handler_st
|
||||
{
|
||||
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
|
||||
/* Collation routines */
|
||||
int (*strnncoll)(struct charset_info_st *,
|
||||
const uchar *, uint, const uchar *, uint, my_bool);
|
||||
int (*strnncollsp)(struct charset_info_st *,
|
||||
const uchar *, uint, const uchar *, uint,
|
||||
my_bool diff_if_only_endspace_difference);
|
||||
int (*strnxfrm)(struct charset_info_st *,
|
||||
uchar *, uint, const uchar *, uint);
|
||||
uint (*strnxfrmlen)(struct charset_info_st *, uint);
|
||||
my_bool (*like_range)(struct charset_info_st *,
|
||||
const char *s, uint s_length,
|
||||
pchar w_prefix, pchar w_one, pchar w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_len, uint *max_len);
|
||||
int (*wildcmp)(struct charset_info_st *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape,int w_one, int w_many);
|
||||
|
||||
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
|
||||
|
||||
uint (*instr)(struct charset_info_st *,
|
||||
const char *b, uint b_length,
|
||||
const char *s, uint s_length,
|
||||
my_match_t *match, uint nmatch);
|
||||
|
||||
/* Hash calculation */
|
||||
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
|
||||
ulong *nr1, ulong *nr2);
|
||||
my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len);
|
||||
} MY_COLLATION_HANDLER;
|
||||
|
||||
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
|
||||
extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
|
||||
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
|
||||
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
|
||||
|
||||
|
||||
typedef struct my_charset_handler_st
|
||||
{
|
||||
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
|
||||
/* Multibyte routines */
|
||||
int (*ismbchar)(struct charset_info_st *, const char *, const char *);
|
||||
int (*mbcharlen)(struct charset_info_st *, uint);
|
||||
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
||||
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
|
||||
uint (*well_formed_len)(struct charset_info_st *,
|
||||
const char *b,const char *e,
|
||||
uint nchars, int *error);
|
||||
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
|
||||
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
|
||||
|
||||
/* Unicode convertion */
|
||||
int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
|
||||
const unsigned char *s,const unsigned char *e);
|
||||
int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
|
||||
unsigned char *s,unsigned char *e);
|
||||
|
||||
/* Functions for case and sort convertion */
|
||||
void (*caseup_str)(struct charset_info_st *, char *);
|
||||
void (*casedn_str)(struct charset_info_st *, char *);
|
||||
uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
uint (*casedn)(struct charset_info_st *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
|
||||
/* Charset dependant snprintf() */
|
||||
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
|
||||
...);
|
||||
int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix,
|
||||
long int val);
|
||||
int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
|
||||
int radix, longlong val);
|
||||
|
||||
void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
|
||||
|
||||
/* String-to-number convertion routines */
|
||||
long (*strntol)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
longlong (*strntoll)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
|
||||
int base, char **e, int *err);
|
||||
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
|
||||
int *err);
|
||||
longlong (*strtoll10)(struct charset_info_st *cs,
|
||||
const char *nptr, char **endptr, int *error);
|
||||
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
|
||||
int sq);
|
||||
} MY_CHARSET_HANDLER;
|
||||
|
||||
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
|
||||
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
|
||||
|
||||
|
||||
typedef struct charset_info_st
|
||||
{
|
||||
uint number;
|
||||
uint primary_number;
|
||||
uint binary_number;
|
||||
uint state;
|
||||
const char *csname;
|
||||
const char *name;
|
||||
const char *comment;
|
||||
const char *tailoring;
|
||||
uchar *ctype;
|
||||
uchar *to_lower;
|
||||
uchar *to_upper;
|
||||
uchar *sort_order;
|
||||
uint16 *contractions;
|
||||
uint16 **sort_order_big;
|
||||
uint16 *tab_to_uni;
|
||||
MY_UNI_IDX *tab_from_uni;
|
||||
MY_UNICASE_INFO **caseinfo;
|
||||
uchar *state_map;
|
||||
uchar *ident_map;
|
||||
uint strxfrm_multiply;
|
||||
uchar caseup_multiply;
|
||||
uchar casedn_multiply;
|
||||
uint mbminlen;
|
||||
uint mbmaxlen;
|
||||
uint16 min_sort_char;
|
||||
uint16 max_sort_char; /* For LIKE optimization */
|
||||
uchar pad_char;
|
||||
my_bool escape_with_backslash_is_dangerous;
|
||||
|
||||
MY_CHARSET_HANDLER *cset;
|
||||
MY_COLLATION_HANDLER *coll;
|
||||
|
||||
} CHARSET_INFO;
|
||||
|
||||
|
||||
extern CHARSET_INFO my_charset_bin;
|
||||
extern CHARSET_INFO my_charset_big5_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_big5_bin;
|
||||
extern CHARSET_INFO my_charset_cp932_japanese_ci;
|
||||
extern CHARSET_INFO my_charset_cp932_bin;
|
||||
extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
|
||||
extern CHARSET_INFO my_charset_eucjpms_bin;
|
||||
extern CHARSET_INFO my_charset_euckr_korean_ci;
|
||||
extern CHARSET_INFO my_charset_euckr_bin;
|
||||
extern CHARSET_INFO my_charset_gb2312_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_gb2312_bin;
|
||||
extern CHARSET_INFO my_charset_gbk_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_gbk_bin;
|
||||
extern CHARSET_INFO my_charset_latin1;
|
||||
extern CHARSET_INFO my_charset_latin1_german2_ci;
|
||||
extern CHARSET_INFO my_charset_latin1_bin;
|
||||
extern CHARSET_INFO my_charset_latin2_czech_ci;
|
||||
extern CHARSET_INFO my_charset_sjis_japanese_ci;
|
||||
extern CHARSET_INFO my_charset_sjis_bin;
|
||||
extern CHARSET_INFO my_charset_tis620_thai_ci;
|
||||
extern CHARSET_INFO my_charset_tis620_bin;
|
||||
extern CHARSET_INFO my_charset_ucs2_general_ci;
|
||||
extern CHARSET_INFO my_charset_ucs2_bin;
|
||||
extern CHARSET_INFO my_charset_ucs2_general_uca;
|
||||
extern CHARSET_INFO my_charset_ujis_japanese_ci;
|
||||
extern CHARSET_INFO my_charset_ujis_bin;
|
||||
extern CHARSET_INFO my_charset_utf8_general_ci;
|
||||
extern CHARSET_INFO my_charset_utf8_bin;
|
||||
extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
||||
|
||||
/* declarations for simple charsets */
|
||||
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
|
||||
uint);
|
||||
uint my_strnxfrmlen_simple(CHARSET_INFO *, uint);
|
||||
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
|
||||
const uchar *, uint, my_bool);
|
||||
|
||||
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
|
||||
const uchar *, uint,
|
||||
my_bool diff_if_only_endspace_difference);
|
||||
|
||||
extern void my_hash_sort_simple(CHARSET_INFO *cs,
|
||||
const uchar *key, uint len,
|
||||
ulong *nr1, ulong *nr2);
|
||||
|
||||
extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length);
|
||||
|
||||
extern uint my_instr_simple(struct charset_info_st *,
|
||||
const char *b, uint b_length,
|
||||
const char *s, uint s_length,
|
||||
my_match_t *match, uint nmatch);
|
||||
|
||||
|
||||
/* Functions for 8bit */
|
||||
extern void my_caseup_str_8bit(CHARSET_INFO *, char *);
|
||||
extern void my_casedn_str_8bit(CHARSET_INFO *, char *);
|
||||
extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
|
||||
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
|
||||
|
||||
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
|
||||
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
|
||||
|
||||
ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
|
||||
|
||||
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
|
||||
const char *fmt, ...);
|
||||
|
||||
long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
||||
char **e, int *err);
|
||||
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
|
||||
int *err);
|
||||
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
||||
long int val);
|
||||
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
||||
longlong val);
|
||||
|
||||
longlong my_strtoll10_8bit(CHARSET_INFO *cs,
|
||||
const char *nptr, char **endptr, int *error);
|
||||
longlong my_strtoll10_ucs2(CHARSET_INFO *cs,
|
||||
const char *nptr, char **endptr, int *error);
|
||||
|
||||
void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
|
||||
|
||||
my_bool my_like_range_simple(CHARSET_INFO *cs,
|
||||
const char *ptr, uint ptr_length,
|
||||
pbool escape, pbool w_one, pbool w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
|
||||
my_bool my_like_range_mb(CHARSET_INFO *cs,
|
||||
const char *ptr, uint ptr_length,
|
||||
pbool escape, pbool w_one, pbool w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
|
||||
my_bool my_like_range_ucs2(CHARSET_INFO *cs,
|
||||
const char *ptr, uint ptr_length,
|
||||
pbool escape, pbool w_one, pbool w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
|
||||
|
||||
int my_wildcmp_8bit(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
|
||||
int my_wildcmp_bin(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
|
||||
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
|
||||
uint pos, int *error);
|
||||
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
|
||||
|
||||
|
||||
/* Functions for multibyte charsets */
|
||||
extern void my_caseup_str_mb(CHARSET_INFO *, char *);
|
||||
extern void my_casedn_str_mb(CHARSET_INFO *, char *);
|
||||
extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen,
|
||||
char *dst, uint dstlen);
|
||||
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
|
||||
|
||||
int my_wildcmp_mb(CHARSET_INFO *,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
int escape, int w_one, int w_many);
|
||||
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
|
||||
uint pos, int *error);
|
||||
uint my_instr_mb(struct charset_info_st *,
|
||||
const char *b, uint b_length,
|
||||
const char *s, uint s_length,
|
||||
my_match_t *match, uint nmatch);
|
||||
|
||||
int my_wildcmp_unicode(CHARSET_INFO *cs,
|
||||
const char *str, const char *str_end,
|
||||
const char *wildstr, const char *wildend,
|
||||
int escape, int w_one, int w_many,
|
||||
MY_UNICASE_INFO **weights);
|
||||
|
||||
extern my_bool my_parse_charset_xml(const char *bug, uint len,
|
||||
int (*add)(CHARSET_INFO *cs));
|
||||
|
||||
my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, uint len);
|
||||
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);
|
||||
|
||||
|
||||
#define _MY_U 01 /* Upper case */
|
||||
#define _MY_L 02 /* Lower case */
|
||||
#define _MY_NMR 04 /* Numeral (digit) */
|
||||
#define _MY_SPC 010 /* Spacing character */
|
||||
#define _MY_PNT 020 /* Punctuation */
|
||||
#define _MY_CTR 040 /* Control character */
|
||||
#define _MY_B 0100 /* Blank */
|
||||
#define _MY_X 0200 /* heXadecimal digit */
|
||||
|
||||
|
||||
#define my_isascii(c) (!((c) & ~0177))
|
||||
#define my_toascii(c) ((c) & 0177)
|
||||
#define my_tocntrl(c) ((c) & 31)
|
||||
#define my_toprint(c) ((c) | 64)
|
||||
#define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)])
|
||||
#define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)])
|
||||
#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L))
|
||||
#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U)
|
||||
#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L)
|
||||
#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR)
|
||||
#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X)
|
||||
#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR))
|
||||
#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC)
|
||||
#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT)
|
||||
#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
|
||||
#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
|
||||
#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR)
|
||||
|
||||
/* Some macros that should be cleaned up a little */
|
||||
#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
|
||||
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
|
||||
|
||||
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
|
||||
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
||||
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
|
||||
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
|
||||
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
|
||||
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
|
||||
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
|
||||
#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
|
||||
#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num))
|
||||
|
||||
|
||||
#define use_mb(s) ((s)->cset->ismbchar != NULL)
|
||||
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
|
||||
#ifdef USE_MB
|
||||
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
|
||||
#else
|
||||
#define my_mbcharlen(s, a) 1
|
||||
#endif
|
||||
|
||||
#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
|
||||
#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
|
||||
#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
|
||||
#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
|
||||
|
||||
|
||||
/* XXX: still need to take care of this one */
|
||||
#ifdef MY_CHARSET_TIS620
|
||||
#error The TIS620 charset is broken at the moment. Tell tim to fix it.
|
||||
#define USE_TIS620
|
||||
#include "t_ctype.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _m_ctype_h */
|
||||
|
@ -1,52 +1,52 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
Data structures for mysys/my_alloc.c (root memory allocator)
|
||||
*/
|
||||
|
||||
#ifndef _my_alloc_h
|
||||
#define _my_alloc_h
|
||||
|
||||
#define ALLOC_MAX_BLOCK_TO_DROP 4096
|
||||
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
|
||||
|
||||
typedef struct st_used_mem
|
||||
{ /* struct for once_alloc (block) */
|
||||
struct st_used_mem *next; /* Next block in use */
|
||||
unsigned int left; /* memory left in block */
|
||||
unsigned int size; /* size of block */
|
||||
} USED_MEM;
|
||||
|
||||
|
||||
typedef struct st_mem_root
|
||||
{
|
||||
USED_MEM *free; /* blocks with free memory in it */
|
||||
USED_MEM *used; /* blocks almost without free memory */
|
||||
USED_MEM *pre_alloc; /* preallocated block */
|
||||
/* if block have less memory it will be put in 'used' list */
|
||||
unsigned int min_malloc;
|
||||
unsigned int block_size; /* initial block size */
|
||||
unsigned int block_num; /* allocated blocks counter */
|
||||
/*
|
||||
first free block in queue test counter (if it exceed
|
||||
MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
|
||||
*/
|
||||
unsigned int first_block_usage;
|
||||
|
||||
void (*error_handler)(void);
|
||||
} MEM_ROOT;
|
||||
#endif
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
Data structures for mysys/my_alloc.c (root memory allocator)
|
||||
*/
|
||||
|
||||
#ifndef _my_alloc_h
|
||||
#define _my_alloc_h
|
||||
|
||||
#define ALLOC_MAX_BLOCK_TO_DROP 4096
|
||||
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
|
||||
|
||||
typedef struct st_used_mem
|
||||
{ /* struct for once_alloc (block) */
|
||||
struct st_used_mem *next; /* Next block in use */
|
||||
unsigned int left; /* memory left in block */
|
||||
unsigned int size; /* size of block */
|
||||
} USED_MEM;
|
||||
|
||||
|
||||
typedef struct st_mem_root
|
||||
{
|
||||
USED_MEM *free; /* blocks with free memory in it */
|
||||
USED_MEM *used; /* blocks almost without free memory */
|
||||
USED_MEM *pre_alloc; /* preallocated block */
|
||||
/* if block have less memory it will be put in 'used' list */
|
||||
unsigned int min_malloc;
|
||||
unsigned int block_size; /* initial block size */
|
||||
unsigned int block_num; /* allocated blocks counter */
|
||||
/*
|
||||
first free block in queue test counter (if it exceed
|
||||
MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
|
||||
*/
|
||||
unsigned int first_block_usage;
|
||||
|
||||
void (*error_handler)(void);
|
||||
} MEM_ROOT;
|
||||
#endif
|
||||
|
@ -1,101 +1,101 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _dbug_h
|
||||
#define _dbug_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if !defined(DBUG_OFF) && !defined(_lint)
|
||||
extern int _db_on_,_no_db_;
|
||||
extern FILE *_db_fp_;
|
||||
extern char *_db_process_;
|
||||
extern int _db_keyword_(const char *keyword);
|
||||
extern int _db_strict_keyword_(const char *keyword);
|
||||
extern void _db_setjmp_(void);
|
||||
extern void _db_longjmp_(void);
|
||||
extern void _db_push_(const char *control);
|
||||
extern void _db_pop_(void);
|
||||
extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
|
||||
const char **_sfunc_,const char **_sfile_,
|
||||
uint *_slevel_, char ***);
|
||||
extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
|
||||
uint *_slevel_);
|
||||
extern void _db_pargs_(uint _line_,const char *keyword);
|
||||
extern void _db_doprnt_ _VARARGS((const char *format,...));
|
||||
extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
|
||||
uint length);
|
||||
extern void _db_output_(uint flag);
|
||||
extern void _db_lock_file(void);
|
||||
extern void _db_unlock_file(void);
|
||||
|
||||
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
|
||||
char **_db_framep_; \
|
||||
_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
|
||||
&_db_framep_)
|
||||
#define DBUG_LEAVE \
|
||||
(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
|
||||
#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
|
||||
#define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
|
||||
#define DBUG_EXECUTE(keyword,a1) \
|
||||
{if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
|
||||
#define DBUG_PRINT(keyword,arglist) \
|
||||
{if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
|
||||
#define DBUG_PUSH(a1) _db_push_ (a1)
|
||||
#define DBUG_POP() _db_pop_ ()
|
||||
#define DBUG_PROCESS(a1) (_db_process_ = a1)
|
||||
#define DBUG_FILE (_db_fp_)
|
||||
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
|
||||
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
|
||||
#define DBUG_DUMP(keyword,a1,a2)\
|
||||
{if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
|
||||
#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
|
||||
#define DEBUGGER_OFF _no_db_=1;_db_on_=0;
|
||||
#define DEBUGGER_ON _no_db_=0
|
||||
#define DBUG_LOCK_FILE { _db_lock_file(); }
|
||||
#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
|
||||
#define DBUG_OUTPUT(A) { _db_output_(A); }
|
||||
#define DBUG_ASSERT(A) assert(A)
|
||||
#define DBUG_EXECUTE_IF(keyword,a1) \
|
||||
{if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}}
|
||||
#else /* No debugger */
|
||||
|
||||
#define DBUG_ENTER(a1)
|
||||
#define DBUG_RETURN(a1) return(a1)
|
||||
#define DBUG_VOID_RETURN return
|
||||
#define DBUG_EXECUTE(keyword,a1) {}
|
||||
#define DBUG_EXECUTE_IF(keyword,a1) {}
|
||||
#define DBUG_PRINT(keyword,arglist) {}
|
||||
#define DBUG_PUSH(a1) {}
|
||||
#define DBUG_POP() {}
|
||||
#define DBUG_PROCESS(a1) {}
|
||||
#define DBUG_FILE (stderr)
|
||||
#define DBUG_SETJMP setjmp
|
||||
#define DBUG_LONGJMP longjmp
|
||||
#define DBUG_DUMP(keyword,a1,a2) {}
|
||||
#define DBUG_IN_USE 0
|
||||
#define DEBUGGER_OFF
|
||||
#define DEBUGGER_ON
|
||||
#define DBUG_LOCK_FILE
|
||||
#define DBUG_UNLOCK_FILE
|
||||
#define DBUG_OUTPUT(A)
|
||||
#define DBUG_ASSERT(A) {}
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _dbug_h
|
||||
#define _dbug_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if !defined(DBUG_OFF) && !defined(_lint)
|
||||
extern int _db_on_,_no_db_;
|
||||
extern FILE *_db_fp_;
|
||||
extern char *_db_process_;
|
||||
extern int _db_keyword_(const char *keyword);
|
||||
extern int _db_strict_keyword_(const char *keyword);
|
||||
extern void _db_setjmp_(void);
|
||||
extern void _db_longjmp_(void);
|
||||
extern void _db_push_(const char *control);
|
||||
extern void _db_pop_(void);
|
||||
extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
|
||||
const char **_sfunc_,const char **_sfile_,
|
||||
uint *_slevel_, char ***);
|
||||
extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
|
||||
uint *_slevel_);
|
||||
extern void _db_pargs_(uint _line_,const char *keyword);
|
||||
extern void _db_doprnt_ _VARARGS((const char *format,...));
|
||||
extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
|
||||
uint length);
|
||||
extern void _db_output_(uint flag);
|
||||
extern void _db_lock_file(void);
|
||||
extern void _db_unlock_file(void);
|
||||
|
||||
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
|
||||
char **_db_framep_; \
|
||||
_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
|
||||
&_db_framep_)
|
||||
#define DBUG_LEAVE \
|
||||
(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
|
||||
#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
|
||||
#define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
|
||||
#define DBUG_EXECUTE(keyword,a1) \
|
||||
{if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
|
||||
#define DBUG_PRINT(keyword,arglist) \
|
||||
{if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
|
||||
#define DBUG_PUSH(a1) _db_push_ (a1)
|
||||
#define DBUG_POP() _db_pop_ ()
|
||||
#define DBUG_PROCESS(a1) (_db_process_ = a1)
|
||||
#define DBUG_FILE (_db_fp_)
|
||||
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
|
||||
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
|
||||
#define DBUG_DUMP(keyword,a1,a2)\
|
||||
{if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
|
||||
#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
|
||||
#define DEBUGGER_OFF _no_db_=1;_db_on_=0;
|
||||
#define DEBUGGER_ON _no_db_=0
|
||||
#define DBUG_LOCK_FILE { _db_lock_file(); }
|
||||
#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
|
||||
#define DBUG_OUTPUT(A) { _db_output_(A); }
|
||||
#define DBUG_ASSERT(A) assert(A)
|
||||
#define DBUG_EXECUTE_IF(keyword,a1) \
|
||||
{if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}}
|
||||
#else /* No debugger */
|
||||
|
||||
#define DBUG_ENTER(a1)
|
||||
#define DBUG_RETURN(a1) return(a1)
|
||||
#define DBUG_VOID_RETURN return
|
||||
#define DBUG_EXECUTE(keyword,a1) {}
|
||||
#define DBUG_EXECUTE_IF(keyword,a1) {}
|
||||
#define DBUG_PRINT(keyword,arglist) {}
|
||||
#define DBUG_PUSH(a1) {}
|
||||
#define DBUG_POP() {}
|
||||
#define DBUG_PROCESS(a1) {}
|
||||
#define DBUG_FILE (stderr)
|
||||
#define DBUG_SETJMP setjmp
|
||||
#define DBUG_LONGJMP longjmp
|
||||
#define DBUG_DUMP(keyword,a1,a2) {}
|
||||
#define DBUG_IN_USE 0
|
||||
#define DEBUGGER_OFF
|
||||
#define DEBUGGER_ON
|
||||
#define DBUG_LOCK_FILE
|
||||
#define DBUG_UNLOCK_FILE
|
||||
#define DBUG_OUTPUT(A)
|
||||
#define DBUG_ASSERT(A) {}
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,46 +1,46 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _list_h_
|
||||
#define _list_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct st_list {
|
||||
struct st_list *prev,*next;
|
||||
void *data;
|
||||
} LIST;
|
||||
|
||||
typedef int (*list_walk_action)(void *,void *);
|
||||
|
||||
extern LIST *list_add(LIST *root,LIST *element);
|
||||
extern LIST *list_delete(LIST *root,LIST *element);
|
||||
extern LIST *list_cons(void *data,LIST *root);
|
||||
extern LIST *list_reverse(LIST *root);
|
||||
extern void list_free(LIST *root,unsigned int free_data);
|
||||
extern unsigned int list_length(LIST *);
|
||||
extern int list_walk(LIST *,list_walk_action action,gptr argument);
|
||||
|
||||
#define list_rest(a) ((a)->next)
|
||||
#define list_push(a,b) (a)=list_cons((b),(a))
|
||||
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _list_h_
|
||||
#define _list_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct st_list {
|
||||
struct st_list *prev,*next;
|
||||
void *data;
|
||||
} LIST;
|
||||
|
||||
typedef int (*list_walk_action)(void *,void *);
|
||||
|
||||
extern LIST *list_add(LIST *root,LIST *element);
|
||||
extern LIST *list_delete(LIST *root,LIST *element);
|
||||
extern LIST *list_cons(void *data,LIST *root);
|
||||
extern LIST *list_reverse(LIST *root);
|
||||
extern void list_free(LIST *root,unsigned int free_data);
|
||||
extern unsigned int list_length(LIST *);
|
||||
extern int list_walk(LIST *,list_walk_action action,gptr argument);
|
||||
|
||||
#define list_rest(a) ((a)->next)
|
||||
#define list_push(a,b) (a)=list_cons((b),(a))
|
||||
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
1808
src/mysql/my_sys.h
1808
src/mysql/my_sys.h
File diff suppressed because it is too large
Load Diff
1686
src/mysql/mysql.h
1686
src/mysql/mysql.h
File diff suppressed because it is too large
Load Diff
@ -1,444 +1,452 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
** Common definition between mysql server & client
|
||||
*/
|
||||
|
||||
#ifndef _mysql_com_h
|
||||
#define _mysql_com_h
|
||||
|
||||
#define NAME_LEN 64 /* Field/table name length */
|
||||
#define HOSTNAME_LENGTH 60
|
||||
#define USERNAME_LENGTH 16
|
||||
#define SERVER_VERSION_LENGTH 60
|
||||
#define SQLSTATE_LENGTH 5
|
||||
|
||||
#define LOCAL_HOST "localhost"
|
||||
#define LOCAL_HOST_NAMEDPIPE "."
|
||||
|
||||
|
||||
#if defined(__WIN__) && !defined( _CUSTOMCONFIG_)
|
||||
#define MYSQL_NAMEDPIPE "MySQL"
|
||||
#define MYSQL_SERVICENAME "MySQL"
|
||||
#endif /* __WIN__ */
|
||||
|
||||
/*
|
||||
You should add new commands to the end of this list, otherwise old
|
||||
servers won't be able to handle them as 'unsupported'.
|
||||
*/
|
||||
|
||||
enum enum_server_command
|
||||
{
|
||||
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
|
||||
COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
|
||||
COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
|
||||
COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
|
||||
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
|
||||
COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
|
||||
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH,
|
||||
/* don't forget to update const char *command_name[] in sql_parse.cc */
|
||||
|
||||
/* Must be last */
|
||||
COM_END
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Length of random string sent by server on handshake; this is also length of
|
||||
obfuscated password, recieved from client
|
||||
*/
|
||||
#define SCRAMBLE_LENGTH 20
|
||||
#define SCRAMBLE_LENGTH_323 8
|
||||
/* length of password stored in the db: new passwords are preceeded with '*' */
|
||||
#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1)
|
||||
#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)
|
||||
|
||||
|
||||
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
|
||||
#define PRI_KEY_FLAG 2 /* Field is part of a primary key */
|
||||
#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */
|
||||
#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */
|
||||
#define BLOB_FLAG 16 /* Field is a blob */
|
||||
#define UNSIGNED_FLAG 32 /* Field is unsigned */
|
||||
#define ZEROFILL_FLAG 64 /* Field is zerofill */
|
||||
#define BINARY_FLAG 128 /* Field is binary */
|
||||
|
||||
/* The following are only sent to new clients */
|
||||
#define ENUM_FLAG 256 /* field is an enum */
|
||||
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
|
||||
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
|
||||
#define SET_FLAG 2048 /* field is a set */
|
||||
#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */
|
||||
#define NUM_FLAG 32768 /* Field is num (for clients) */
|
||||
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
|
||||
#define GROUP_FLAG 32768 /* Intern: Group field */
|
||||
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
|
||||
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
|
||||
|
||||
#define REFRESH_GRANT 1 /* Refresh grant tables */
|
||||
#define REFRESH_LOG 2 /* Start on new log file */
|
||||
#define REFRESH_TABLES 4 /* close all tables */
|
||||
#define REFRESH_HOSTS 8 /* Flush host cache */
|
||||
#define REFRESH_STATUS 16 /* Flush status variables */
|
||||
#define REFRESH_THREADS 32 /* Flush thread cache */
|
||||
#define REFRESH_SLAVE 64 /* Reset master info and restart slave
|
||||
thread */
|
||||
#define REFRESH_MASTER 128 /* Remove all bin logs in the index
|
||||
and truncate the index */
|
||||
|
||||
/* The following can't be set with mysql_refresh() */
|
||||
#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
|
||||
#define REFRESH_FAST 32768 /* Intern flag */
|
||||
|
||||
/* RESET (remove all queries) from query cache */
|
||||
#define REFRESH_QUERY_CACHE 65536
|
||||
#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
|
||||
#define REFRESH_DES_KEY_FILE 0x40000L
|
||||
#define REFRESH_USER_RESOURCES 0x80000L
|
||||
|
||||
#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
|
||||
#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
|
||||
#define CLIENT_LONG_FLAG 4 /* Get all column flags */
|
||||
#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */
|
||||
#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */
|
||||
#define CLIENT_COMPRESS 32 /* Can use compression protocol */
|
||||
#define CLIENT_ODBC 64 /* Odbc client */
|
||||
#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */
|
||||
#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */
|
||||
#define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */
|
||||
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
|
||||
#define CLIENT_SSL 2048 /* Switch to SSL after handshake */
|
||||
#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
|
||||
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
|
||||
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
|
||||
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
|
||||
#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt support */
|
||||
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
|
||||
#define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31)
|
||||
|
||||
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
|
||||
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
|
||||
#define SERVER_STATUS_MORE_RESULTS 4 /* More results on server */
|
||||
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
|
||||
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
|
||||
#define SERVER_QUERY_NO_INDEX_USED 32
|
||||
/*
|
||||
The server was able to fulfill the clients request and opened a
|
||||
read-only non-scrollable cursor for a query. This flag comes
|
||||
in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
|
||||
*/
|
||||
#define SERVER_STATUS_CURSOR_EXISTS 64
|
||||
/*
|
||||
This flag is sent when a read-only cursor is exhausted, in reply to
|
||||
COM_STMT_FETCH command.
|
||||
*/
|
||||
#define SERVER_STATUS_LAST_ROW_SENT 128
|
||||
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
|
||||
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
|
||||
|
||||
#define MYSQL_ERRMSG_SIZE 512
|
||||
#define NET_READ_TIMEOUT 30 /* Timeout on read */
|
||||
#define NET_WRITE_TIMEOUT 60 /* Timeout on write */
|
||||
#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */
|
||||
|
||||
#define ONLY_KILL_QUERY 1
|
||||
|
||||
struct st_vio; /* Only C */
|
||||
typedef struct st_vio Vio;
|
||||
|
||||
#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign */
|
||||
#define MAX_SMALLINT_WIDTH 5 /* Max width for a SHORT w.o. sign */
|
||||
#define MAX_MEDIUMINT_WIDTH 8 /* Max width for a INT24 w.o. sign */
|
||||
#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */
|
||||
#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */
|
||||
#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */
|
||||
#define MAX_BLOB_WIDTH 8192 /* Default width for blob */
|
||||
|
||||
typedef struct st_net {
|
||||
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
|
||||
Vio* vio;
|
||||
unsigned char *buff,*buff_end,*write_pos,*read_pos;
|
||||
my_socket fd; /* For Perl DBI/dbd */
|
||||
unsigned long max_packet,max_packet_size;
|
||||
unsigned int pkt_nr,compress_pkt_nr;
|
||||
unsigned int write_timeout, read_timeout, retry_count;
|
||||
int fcntl;
|
||||
my_bool compress;
|
||||
/*
|
||||
The following variable is set if we are doing several queries in one
|
||||
command ( as in LOAD TABLE ... FROM MASTER ),
|
||||
and do not want to confuse the client with OK at the wrong time
|
||||
*/
|
||||
unsigned long remain_in_buf,length, buf_length, where_b;
|
||||
unsigned int *return_status;
|
||||
unsigned char reading_or_writing;
|
||||
char save_char;
|
||||
my_bool no_send_ok; /* For SPs and other things that do multiple stmts */
|
||||
my_bool no_send_eof; /* For SPs' first version read-only cursors */
|
||||
/*
|
||||
Set if OK packet is already sent, and we do not need to send error
|
||||
messages
|
||||
*/
|
||||
my_bool no_send_error;
|
||||
/*
|
||||
Pointer to query object in query cache, do not equal NULL (0) for
|
||||
queries in cache that have not stored its results yet
|
||||
*/
|
||||
#endif
|
||||
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
|
||||
unsigned int last_errno;
|
||||
unsigned char error;
|
||||
gptr query_cache_query;
|
||||
my_bool report_error; /* We should report error (we have unreported error) */
|
||||
my_bool return_errno;
|
||||
} NET;
|
||||
|
||||
#define packet_error (~(unsigned long) 0)
|
||||
|
||||
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
|
||||
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
|
||||
MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
|
||||
MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
|
||||
MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
|
||||
MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
|
||||
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
|
||||
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
|
||||
MYSQL_TYPE_BIT,
|
||||
MYSQL_TYPE_NEWDECIMAL=246,
|
||||
MYSQL_TYPE_ENUM=247,
|
||||
MYSQL_TYPE_SET=248,
|
||||
MYSQL_TYPE_TINY_BLOB=249,
|
||||
MYSQL_TYPE_MEDIUM_BLOB=250,
|
||||
MYSQL_TYPE_LONG_BLOB=251,
|
||||
MYSQL_TYPE_BLOB=252,
|
||||
MYSQL_TYPE_VAR_STRING=253,
|
||||
MYSQL_TYPE_STRING=254,
|
||||
MYSQL_TYPE_GEOMETRY=255
|
||||
|
||||
};
|
||||
|
||||
/* For backward compatibility */
|
||||
#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS
|
||||
#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
|
||||
#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL
|
||||
#define FIELD_TYPE_TINY MYSQL_TYPE_TINY
|
||||
#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT
|
||||
#define FIELD_TYPE_LONG MYSQL_TYPE_LONG
|
||||
#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT
|
||||
#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE
|
||||
#define FIELD_TYPE_NULL MYSQL_TYPE_NULL
|
||||
#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP
|
||||
#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG
|
||||
#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24
|
||||
#define FIELD_TYPE_DATE MYSQL_TYPE_DATE
|
||||
#define FIELD_TYPE_TIME MYSQL_TYPE_TIME
|
||||
#define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME
|
||||
#define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR
|
||||
#define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE
|
||||
#define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM
|
||||
#define FIELD_TYPE_SET MYSQL_TYPE_SET
|
||||
#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB
|
||||
#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB
|
||||
#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB
|
||||
#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB
|
||||
#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING
|
||||
#define FIELD_TYPE_STRING MYSQL_TYPE_STRING
|
||||
#define FIELD_TYPE_CHAR MYSQL_TYPE_TINY
|
||||
#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM
|
||||
#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY
|
||||
#define FIELD_TYPE_BIT MYSQL_TYPE_BIT
|
||||
|
||||
|
||||
/* Shutdown/kill enums and constants */
|
||||
|
||||
/* Bits for THD::killable. */
|
||||
#define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0)
|
||||
#define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1)
|
||||
#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2)
|
||||
#define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3)
|
||||
|
||||
enum mysql_enum_shutdown_level {
|
||||
/*
|
||||
We want levels to be in growing order of hardness (because we use number
|
||||
comparisons). Note that DEFAULT does not respect the growing property, but
|
||||
it's ok.
|
||||
*/
|
||||
SHUTDOWN_DEFAULT = 0,
|
||||
/* wait for existing connections to finish */
|
||||
SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT,
|
||||
/* wait for existing trans to finish */
|
||||
SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS,
|
||||
/* wait for existing updates to finish (=> no partial MyISAM update) */
|
||||
SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE,
|
||||
/* flush InnoDB buffers and other storage engines' buffers*/
|
||||
SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1),
|
||||
/* don't flush InnoDB buffers, flush other storage engines' buffers*/
|
||||
SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1,
|
||||
/* Now the 2 levels of the KILL command */
|
||||
#if MYSQL_VERSION_ID >= 50000
|
||||
KILL_QUERY= 254,
|
||||
#endif
|
||||
KILL_CONNECTION= 255
|
||||
};
|
||||
|
||||
|
||||
enum enum_cursor_type
|
||||
{
|
||||
CURSOR_TYPE_NO_CURSOR= 0,
|
||||
CURSOR_TYPE_READ_ONLY= 1,
|
||||
CURSOR_TYPE_FOR_UPDATE= 2,
|
||||
CURSOR_TYPE_SCROLLABLE= 4
|
||||
};
|
||||
|
||||
|
||||
/* options for mysql_set_option */
|
||||
enum enum_mysql_set_option
|
||||
{
|
||||
MYSQL_OPTION_MULTI_STATEMENTS_ON,
|
||||
MYSQL_OPTION_MULTI_STATEMENTS_OFF
|
||||
};
|
||||
|
||||
#define net_new_transaction(net) ((net)->pkt_nr=0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
my_bool my_net_init(NET *net, Vio* vio);
|
||||
void my_net_local_init(NET *net);
|
||||
void net_end(NET *net);
|
||||
void net_clear(NET *net);
|
||||
my_bool net_realloc(NET *net, unsigned long length);
|
||||
my_bool net_flush(NET *net);
|
||||
my_bool my_net_write(NET *net,const char *packet,unsigned long len);
|
||||
my_bool net_write_command(NET *net,unsigned char command,
|
||||
const char *header, unsigned long head_len,
|
||||
const char *packet, unsigned long len);
|
||||
int net_real_write(NET *net,const char *packet,unsigned long len);
|
||||
unsigned long my_net_read(NET *net);
|
||||
|
||||
/*
|
||||
The following function is not meant for normal usage
|
||||
Currently it's used internally by manager.c
|
||||
*/
|
||||
struct sockaddr;
|
||||
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
|
||||
unsigned int timeout);
|
||||
|
||||
struct rand_struct {
|
||||
unsigned long seed1,seed2,max_value;
|
||||
double max_value_dbl;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* The following is for user defined functions */
|
||||
|
||||
enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT,
|
||||
DECIMAL_RESULT};
|
||||
|
||||
typedef struct st_udf_args
|
||||
{
|
||||
unsigned int arg_count; /* Number of arguments */
|
||||
enum Item_result *arg_type; /* Pointer to item_results */
|
||||
char **args; /* Pointer to argument */
|
||||
unsigned long *lengths; /* Length of string arguments */
|
||||
char *maybe_null; /* Set to 1 for all maybe_null args */
|
||||
char **attributes; /* Pointer to attribute name */
|
||||
unsigned long *attribute_lengths; /* Length of attribute arguments */
|
||||
} UDF_ARGS;
|
||||
|
||||
/* This holds information about the result */
|
||||
|
||||
typedef struct st_udf_init
|
||||
{
|
||||
my_bool maybe_null; /* 1 if function can return NULL */
|
||||
unsigned int decimals; /* for real functions */
|
||||
unsigned long max_length; /* For string functions */
|
||||
char *ptr; /* free pointer for function data */
|
||||
my_bool const_item; /* 0 if result is independent of arguments */
|
||||
} UDF_INIT;
|
||||
|
||||
/* Constants when using compression */
|
||||
#define NET_HEADER_SIZE 4 /* standard header size */
|
||||
#define COMP_HEADER_SIZE 3 /* compression header extra size */
|
||||
|
||||
/* Prototypes to password functions */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
These functions are used for authentication by client and server and
|
||||
implemented in sql/password.c
|
||||
*/
|
||||
|
||||
void randominit(struct rand_struct *, unsigned long seed1,
|
||||
unsigned long seed2);
|
||||
double my_rnd(struct rand_struct *);
|
||||
void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
|
||||
|
||||
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
|
||||
void make_scrambled_password_323(char *to, const char *password);
|
||||
void scramble_323(char *to, const char *message, const char *password);
|
||||
my_bool check_scramble_323(const char *, const char *message,
|
||||
unsigned long *salt);
|
||||
void get_salt_from_password_323(unsigned long *res, const char *password);
|
||||
void make_password_from_salt_323(char *to, const unsigned long *salt);
|
||||
|
||||
void make_scrambled_password(char *to, const char *password);
|
||||
void scramble(char *to, const char *message, const char *password);
|
||||
my_bool check_scramble(const char *reply, const char *message,
|
||||
const unsigned char *hash_stage2);
|
||||
void get_salt_from_password(unsigned char *res, const char *password);
|
||||
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
|
||||
char *octet2hex(char *to, const char *str, unsigned int len);
|
||||
|
||||
/* end of password.c */
|
||||
|
||||
char *get_tty_password(char *opt_message);
|
||||
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
|
||||
|
||||
/* Some other useful functions */
|
||||
|
||||
my_bool my_init(void);
|
||||
extern int modify_defaults_file(const char *file_location, const char *option,
|
||||
const char *option_value,
|
||||
const char *section_name, int remove_option);
|
||||
int load_defaults(const char *conf_file, const char **groups,
|
||||
int *argc, char ***argv);
|
||||
my_bool my_thread_init(void);
|
||||
void my_thread_end(void);
|
||||
|
||||
#ifdef _global_h
|
||||
ulong STDCALL net_field_length(uchar **packet);
|
||||
my_ulonglong net_field_length_ll(uchar **packet);
|
||||
char *net_store_length(char *pkg, ulonglong length);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
|
||||
#define MYSQL_STMT_HEADER 4
|
||||
#define MYSQL_LONG_DATA_HEADER 6
|
||||
|
||||
#endif
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
** Common definition between mysql server & client
|
||||
*/
|
||||
|
||||
#ifndef _mysql_com_h
|
||||
#define _mysql_com_h
|
||||
|
||||
#define NAME_LEN 64 /* Field/table name length */
|
||||
#define HOSTNAME_LENGTH 60
|
||||
#define USERNAME_LENGTH 16
|
||||
#define SERVER_VERSION_LENGTH 60
|
||||
#define SQLSTATE_LENGTH 5
|
||||
|
||||
/*
|
||||
USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
|
||||
username and hostname parts of the user identifier with trailing zero in
|
||||
MySQL standard format:
|
||||
user_name_part@host_name_part\0
|
||||
*/
|
||||
#define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2
|
||||
|
||||
#define LOCAL_HOST "localhost"
|
||||
#define LOCAL_HOST_NAMEDPIPE "."
|
||||
|
||||
|
||||
#if defined(__WIN__) && !defined( _CUSTOMCONFIG_)
|
||||
#define MYSQL_NAMEDPIPE "MySQL"
|
||||
#define MYSQL_SERVICENAME "MySQL"
|
||||
#endif /* __WIN__ */
|
||||
|
||||
/*
|
||||
You should add new commands to the end of this list, otherwise old
|
||||
servers won't be able to handle them as 'unsupported'.
|
||||
*/
|
||||
|
||||
enum enum_server_command
|
||||
{
|
||||
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
|
||||
COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
|
||||
COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
|
||||
COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
|
||||
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
|
||||
COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
|
||||
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH,
|
||||
/* don't forget to update const char *command_name[] in sql_parse.cc */
|
||||
|
||||
/* Must be last */
|
||||
COM_END
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Length of random string sent by server on handshake; this is also length of
|
||||
obfuscated password, recieved from client
|
||||
*/
|
||||
#define SCRAMBLE_LENGTH 20
|
||||
#define SCRAMBLE_LENGTH_323 8
|
||||
/* length of password stored in the db: new passwords are preceeded with '*' */
|
||||
#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1)
|
||||
#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)
|
||||
|
||||
|
||||
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
|
||||
#define PRI_KEY_FLAG 2 /* Field is part of a primary key */
|
||||
#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */
|
||||
#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */
|
||||
#define BLOB_FLAG 16 /* Field is a blob */
|
||||
#define UNSIGNED_FLAG 32 /* Field is unsigned */
|
||||
#define ZEROFILL_FLAG 64 /* Field is zerofill */
|
||||
#define BINARY_FLAG 128 /* Field is binary */
|
||||
|
||||
/* The following are only sent to new clients */
|
||||
#define ENUM_FLAG 256 /* field is an enum */
|
||||
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
|
||||
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
|
||||
#define SET_FLAG 2048 /* field is a set */
|
||||
#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */
|
||||
#define NUM_FLAG 32768 /* Field is num (for clients) */
|
||||
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
|
||||
#define GROUP_FLAG 32768 /* Intern: Group field */
|
||||
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
|
||||
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
|
||||
|
||||
#define REFRESH_GRANT 1 /* Refresh grant tables */
|
||||
#define REFRESH_LOG 2 /* Start on new log file */
|
||||
#define REFRESH_TABLES 4 /* close all tables */
|
||||
#define REFRESH_HOSTS 8 /* Flush host cache */
|
||||
#define REFRESH_STATUS 16 /* Flush status variables */
|
||||
#define REFRESH_THREADS 32 /* Flush thread cache */
|
||||
#define REFRESH_SLAVE 64 /* Reset master info and restart slave
|
||||
thread */
|
||||
#define REFRESH_MASTER 128 /* Remove all bin logs in the index
|
||||
and truncate the index */
|
||||
|
||||
/* The following can't be set with mysql_refresh() */
|
||||
#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
|
||||
#define REFRESH_FAST 32768 /* Intern flag */
|
||||
|
||||
/* RESET (remove all queries) from query cache */
|
||||
#define REFRESH_QUERY_CACHE 65536
|
||||
#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
|
||||
#define REFRESH_DES_KEY_FILE 0x40000L
|
||||
#define REFRESH_USER_RESOURCES 0x80000L
|
||||
|
||||
#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
|
||||
#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
|
||||
#define CLIENT_LONG_FLAG 4 /* Get all column flags */
|
||||
#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */
|
||||
#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */
|
||||
#define CLIENT_COMPRESS 32 /* Can use compression protocol */
|
||||
#define CLIENT_ODBC 64 /* Odbc client */
|
||||
#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */
|
||||
#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */
|
||||
#define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */
|
||||
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
|
||||
#define CLIENT_SSL 2048 /* Switch to SSL after handshake */
|
||||
#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
|
||||
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
|
||||
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
|
||||
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
|
||||
#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt support */
|
||||
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
|
||||
#define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31)
|
||||
|
||||
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
|
||||
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
|
||||
#define SERVER_STATUS_MORE_RESULTS 4 /* More results on server */
|
||||
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
|
||||
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
|
||||
#define SERVER_QUERY_NO_INDEX_USED 32
|
||||
/*
|
||||
The server was able to fulfill the clients request and opened a
|
||||
read-only non-scrollable cursor for a query. This flag comes
|
||||
in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
|
||||
*/
|
||||
#define SERVER_STATUS_CURSOR_EXISTS 64
|
||||
/*
|
||||
This flag is sent when a read-only cursor is exhausted, in reply to
|
||||
COM_STMT_FETCH command.
|
||||
*/
|
||||
#define SERVER_STATUS_LAST_ROW_SENT 128
|
||||
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
|
||||
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
|
||||
|
||||
#define MYSQL_ERRMSG_SIZE 512
|
||||
#define NET_READ_TIMEOUT 30 /* Timeout on read */
|
||||
#define NET_WRITE_TIMEOUT 60 /* Timeout on write */
|
||||
#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */
|
||||
|
||||
#define ONLY_KILL_QUERY 1
|
||||
|
||||
struct st_vio; /* Only C */
|
||||
typedef struct st_vio Vio;
|
||||
|
||||
#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign */
|
||||
#define MAX_SMALLINT_WIDTH 5 /* Max width for a SHORT w.o. sign */
|
||||
#define MAX_MEDIUMINT_WIDTH 8 /* Max width for a INT24 w.o. sign */
|
||||
#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */
|
||||
#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */
|
||||
#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */
|
||||
#define MAX_BLOB_WIDTH 8192 /* Default width for blob */
|
||||
|
||||
typedef struct st_net {
|
||||
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
|
||||
Vio* vio;
|
||||
unsigned char *buff,*buff_end,*write_pos,*read_pos;
|
||||
my_socket fd; /* For Perl DBI/dbd */
|
||||
unsigned long max_packet,max_packet_size;
|
||||
unsigned int pkt_nr,compress_pkt_nr;
|
||||
unsigned int write_timeout, read_timeout, retry_count;
|
||||
int fcntl;
|
||||
my_bool compress;
|
||||
/*
|
||||
The following variable is set if we are doing several queries in one
|
||||
command ( as in LOAD TABLE ... FROM MASTER ),
|
||||
and do not want to confuse the client with OK at the wrong time
|
||||
*/
|
||||
unsigned long remain_in_buf,length, buf_length, where_b;
|
||||
unsigned int *return_status;
|
||||
unsigned char reading_or_writing;
|
||||
char save_char;
|
||||
my_bool no_send_ok; /* For SPs and other things that do multiple stmts */
|
||||
my_bool no_send_eof; /* For SPs' first version read-only cursors */
|
||||
/*
|
||||
Set if OK packet is already sent, and we do not need to send error
|
||||
messages
|
||||
*/
|
||||
my_bool no_send_error;
|
||||
/*
|
||||
Pointer to query object in query cache, do not equal NULL (0) for
|
||||
queries in cache that have not stored its results yet
|
||||
*/
|
||||
#endif
|
||||
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
|
||||
unsigned int last_errno;
|
||||
unsigned char error;
|
||||
gptr query_cache_query;
|
||||
my_bool report_error; /* We should report error (we have unreported error) */
|
||||
my_bool return_errno;
|
||||
} NET;
|
||||
|
||||
#define packet_error (~(unsigned long) 0)
|
||||
|
||||
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
|
||||
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
|
||||
MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
|
||||
MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
|
||||
MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
|
||||
MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
|
||||
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
|
||||
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
|
||||
MYSQL_TYPE_BIT,
|
||||
MYSQL_TYPE_NEWDECIMAL=246,
|
||||
MYSQL_TYPE_ENUM=247,
|
||||
MYSQL_TYPE_SET=248,
|
||||
MYSQL_TYPE_TINY_BLOB=249,
|
||||
MYSQL_TYPE_MEDIUM_BLOB=250,
|
||||
MYSQL_TYPE_LONG_BLOB=251,
|
||||
MYSQL_TYPE_BLOB=252,
|
||||
MYSQL_TYPE_VAR_STRING=253,
|
||||
MYSQL_TYPE_STRING=254,
|
||||
MYSQL_TYPE_GEOMETRY=255
|
||||
|
||||
};
|
||||
|
||||
/* For backward compatibility */
|
||||
#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS
|
||||
#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
|
||||
#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL
|
||||
#define FIELD_TYPE_TINY MYSQL_TYPE_TINY
|
||||
#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT
|
||||
#define FIELD_TYPE_LONG MYSQL_TYPE_LONG
|
||||
#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT
|
||||
#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE
|
||||
#define FIELD_TYPE_NULL MYSQL_TYPE_NULL
|
||||
#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP
|
||||
#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG
|
||||
#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24
|
||||
#define FIELD_TYPE_DATE MYSQL_TYPE_DATE
|
||||
#define FIELD_TYPE_TIME MYSQL_TYPE_TIME
|
||||
#define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME
|
||||
#define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR
|
||||
#define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE
|
||||
#define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM
|
||||
#define FIELD_TYPE_SET MYSQL_TYPE_SET
|
||||
#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB
|
||||
#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB
|
||||
#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB
|
||||
#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB
|
||||
#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING
|
||||
#define FIELD_TYPE_STRING MYSQL_TYPE_STRING
|
||||
#define FIELD_TYPE_CHAR MYSQL_TYPE_TINY
|
||||
#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM
|
||||
#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY
|
||||
#define FIELD_TYPE_BIT MYSQL_TYPE_BIT
|
||||
|
||||
|
||||
/* Shutdown/kill enums and constants */
|
||||
|
||||
/* Bits for THD::killable. */
|
||||
#define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0)
|
||||
#define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1)
|
||||
#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2)
|
||||
#define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3)
|
||||
|
||||
enum mysql_enum_shutdown_level {
|
||||
/*
|
||||
We want levels to be in growing order of hardness (because we use number
|
||||
comparisons). Note that DEFAULT does not respect the growing property, but
|
||||
it's ok.
|
||||
*/
|
||||
SHUTDOWN_DEFAULT = 0,
|
||||
/* wait for existing connections to finish */
|
||||
SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT,
|
||||
/* wait for existing trans to finish */
|
||||
SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS,
|
||||
/* wait for existing updates to finish (=> no partial MyISAM update) */
|
||||
SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE,
|
||||
/* flush InnoDB buffers and other storage engines' buffers*/
|
||||
SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1),
|
||||
/* don't flush InnoDB buffers, flush other storage engines' buffers*/
|
||||
SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1,
|
||||
/* Now the 2 levels of the KILL command */
|
||||
#if MYSQL_VERSION_ID >= 50000
|
||||
KILL_QUERY= 254,
|
||||
#endif
|
||||
KILL_CONNECTION= 255
|
||||
};
|
||||
|
||||
|
||||
enum enum_cursor_type
|
||||
{
|
||||
CURSOR_TYPE_NO_CURSOR= 0,
|
||||
CURSOR_TYPE_READ_ONLY= 1,
|
||||
CURSOR_TYPE_FOR_UPDATE= 2,
|
||||
CURSOR_TYPE_SCROLLABLE= 4
|
||||
};
|
||||
|
||||
|
||||
/* options for mysql_set_option */
|
||||
enum enum_mysql_set_option
|
||||
{
|
||||
MYSQL_OPTION_MULTI_STATEMENTS_ON,
|
||||
MYSQL_OPTION_MULTI_STATEMENTS_OFF
|
||||
};
|
||||
|
||||
#define net_new_transaction(net) ((net)->pkt_nr=0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
my_bool my_net_init(NET *net, Vio* vio);
|
||||
void my_net_local_init(NET *net);
|
||||
void net_end(NET *net);
|
||||
void net_clear(NET *net);
|
||||
my_bool net_realloc(NET *net, unsigned long length);
|
||||
my_bool net_flush(NET *net);
|
||||
my_bool my_net_write(NET *net,const char *packet,unsigned long len);
|
||||
my_bool net_write_command(NET *net,unsigned char command,
|
||||
const char *header, unsigned long head_len,
|
||||
const char *packet, unsigned long len);
|
||||
int net_real_write(NET *net,const char *packet,unsigned long len);
|
||||
unsigned long my_net_read(NET *net);
|
||||
|
||||
/*
|
||||
The following function is not meant for normal usage
|
||||
Currently it's used internally by manager.c
|
||||
*/
|
||||
struct sockaddr;
|
||||
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
|
||||
unsigned int timeout);
|
||||
|
||||
struct rand_struct {
|
||||
unsigned long seed1,seed2,max_value;
|
||||
double max_value_dbl;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* The following is for user defined functions */
|
||||
|
||||
enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT,
|
||||
DECIMAL_RESULT};
|
||||
|
||||
typedef struct st_udf_args
|
||||
{
|
||||
unsigned int arg_count; /* Number of arguments */
|
||||
enum Item_result *arg_type; /* Pointer to item_results */
|
||||
char **args; /* Pointer to argument */
|
||||
unsigned long *lengths; /* Length of string arguments */
|
||||
char *maybe_null; /* Set to 1 for all maybe_null args */
|
||||
char **attributes; /* Pointer to attribute name */
|
||||
unsigned long *attribute_lengths; /* Length of attribute arguments */
|
||||
} UDF_ARGS;
|
||||
|
||||
/* This holds information about the result */
|
||||
|
||||
typedef struct st_udf_init
|
||||
{
|
||||
my_bool maybe_null; /* 1 if function can return NULL */
|
||||
unsigned int decimals; /* for real functions */
|
||||
unsigned long max_length; /* For string functions */
|
||||
char *ptr; /* free pointer for function data */
|
||||
my_bool const_item; /* 0 if result is independent of arguments */
|
||||
} UDF_INIT;
|
||||
|
||||
/* Constants when using compression */
|
||||
#define NET_HEADER_SIZE 4 /* standard header size */
|
||||
#define COMP_HEADER_SIZE 3 /* compression header extra size */
|
||||
|
||||
/* Prototypes to password functions */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
These functions are used for authentication by client and server and
|
||||
implemented in sql/password.c
|
||||
*/
|
||||
|
||||
void randominit(struct rand_struct *, unsigned long seed1,
|
||||
unsigned long seed2);
|
||||
double my_rnd(struct rand_struct *);
|
||||
void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
|
||||
|
||||
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
|
||||
void make_scrambled_password_323(char *to, const char *password);
|
||||
void scramble_323(char *to, const char *message, const char *password);
|
||||
my_bool check_scramble_323(const char *, const char *message,
|
||||
unsigned long *salt);
|
||||
void get_salt_from_password_323(unsigned long *res, const char *password);
|
||||
void make_password_from_salt_323(char *to, const unsigned long *salt);
|
||||
|
||||
void make_scrambled_password(char *to, const char *password);
|
||||
void scramble(char *to, const char *message, const char *password);
|
||||
my_bool check_scramble(const char *reply, const char *message,
|
||||
const unsigned char *hash_stage2);
|
||||
void get_salt_from_password(unsigned char *res, const char *password);
|
||||
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
|
||||
char *octet2hex(char *to, const char *str, unsigned int len);
|
||||
|
||||
/* end of password.c */
|
||||
|
||||
char *get_tty_password(char *opt_message);
|
||||
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
|
||||
|
||||
/* Some other useful functions */
|
||||
|
||||
my_bool my_init(void);
|
||||
extern int modify_defaults_file(const char *file_location, const char *option,
|
||||
const char *option_value,
|
||||
const char *section_name, int remove_option);
|
||||
int load_defaults(const char *conf_file, const char **groups,
|
||||
int *argc, char ***argv);
|
||||
my_bool my_thread_init(void);
|
||||
void my_thread_end(void);
|
||||
|
||||
#ifdef _global_h
|
||||
ulong STDCALL net_field_length(uchar **packet);
|
||||
my_ulonglong net_field_length_ll(uchar **packet);
|
||||
char *net_store_length(char *pkg, ulonglong length);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
|
||||
#define MYSQL_STMT_HEADER 4
|
||||
#define MYSQL_LONG_DATA_HEADER 6
|
||||
|
||||
#endif
|
||||
|
@ -1,56 +1,56 @@
|
||||
/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _mysql_time_h_
|
||||
#define _mysql_time_h_
|
||||
|
||||
/*
|
||||
Time declarations shared between the server and client API:
|
||||
you should not add anything to this header unless it's used
|
||||
(and hence should be visible) in mysql.h.
|
||||
If you're looking for a place to add new time-related declaration,
|
||||
it's most likely my_time.h. See also "C API Handling of Date
|
||||
and Time Values" chapter in documentation.
|
||||
*/
|
||||
|
||||
enum enum_mysql_timestamp_type
|
||||
{
|
||||
MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
|
||||
MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Structure which is used to represent datetime values inside MySQL.
|
||||
|
||||
We assume that values in this structure are normalized, i.e. year <= 9999,
|
||||
month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
|
||||
in server such as my_system_gmt_sec() or make_time() family of functions
|
||||
rely on this (actually now usage of make_*() family relies on a bit weaker
|
||||
restriction). Also functions that produce MYSQL_TIME as result ensure this.
|
||||
There is one exception to this rule though if this structure holds time
|
||||
value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold
|
||||
bigger values.
|
||||
*/
|
||||
typedef struct st_mysql_time
|
||||
{
|
||||
unsigned int year, month, day, hour, minute, second;
|
||||
unsigned long second_part;
|
||||
my_bool neg;
|
||||
enum enum_mysql_timestamp_type time_type;
|
||||
} MYSQL_TIME;
|
||||
|
||||
#endif /* _mysql_time_h_ */
|
||||
/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _mysql_time_h_
|
||||
#define _mysql_time_h_
|
||||
|
||||
/*
|
||||
Time declarations shared between the server and client API:
|
||||
you should not add anything to this header unless it's used
|
||||
(and hence should be visible) in mysql.h.
|
||||
If you're looking for a place to add new time-related declaration,
|
||||
it's most likely my_time.h. See also "C API Handling of Date
|
||||
and Time Values" chapter in documentation.
|
||||
*/
|
||||
|
||||
enum enum_mysql_timestamp_type
|
||||
{
|
||||
MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
|
||||
MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Structure which is used to represent datetime values inside MySQL.
|
||||
|
||||
We assume that values in this structure are normalized, i.e. year <= 9999,
|
||||
month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
|
||||
in server such as my_system_gmt_sec() or make_time() family of functions
|
||||
rely on this (actually now usage of make_*() family relies on a bit weaker
|
||||
restriction). Also functions that produce MYSQL_TIME as result ensure this.
|
||||
There is one exception to this rule though if this structure holds time
|
||||
value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold
|
||||
bigger values.
|
||||
*/
|
||||
typedef struct st_mysql_time
|
||||
{
|
||||
unsigned int year, month, day, hour, minute, second;
|
||||
unsigned long second_part;
|
||||
my_bool neg;
|
||||
enum enum_mysql_timestamp_type time_type;
|
||||
} MYSQL_TIME;
|
||||
|
||||
#endif /* _mysql_time_h_ */
|
||||
|
@ -1,29 +1,29 @@
|
||||
/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
|
||||
This file is public domain and comes with NO WARRANTY of any kind */
|
||||
|
||||
/* Version numbers for protocol & mysqld */
|
||||
|
||||
#ifndef _mysql_version_h
|
||||
#define _mysql_version_h
|
||||
#ifdef _CUSTOMCONFIG_
|
||||
#include <custom_conf.h>
|
||||
#else
|
||||
#define PROTOCOL_VERSION 10
|
||||
#define MYSQL_SERVER_VERSION "5.0.16"
|
||||
#define MYSQL_BASE_VERSION "mysqld-5.0"
|
||||
#define MYSQL_SERVER_SUFFIX_DEF ""
|
||||
#define FRM_VER 6
|
||||
#define MYSQL_VERSION_ID 50016
|
||||
#define MYSQL_PORT 3306
|
||||
#define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
|
||||
#define MYSQL_CONFIG_NAME "my"
|
||||
#define MYSQL_COMPILATION_COMMENT "Official MySQL binary"
|
||||
|
||||
/* mysqld compile time options */
|
||||
#endif /* _CUSTOMCONFIG_ */
|
||||
|
||||
#ifndef LICENSE
|
||||
#define LICENSE GPL
|
||||
#endif /* LICENSE */
|
||||
|
||||
#endif /* _mysql_version_h */
|
||||
/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
|
||||
This file is public domain and comes with NO WARRANTY of any kind */
|
||||
|
||||
/* Version numbers for protocol & mysqld */
|
||||
|
||||
#ifndef _mysql_version_h
|
||||
#define _mysql_version_h
|
||||
#ifdef _CUSTOMCONFIG_
|
||||
#include <custom_conf.h>
|
||||
#else
|
||||
#define PROTOCOL_VERSION 10
|
||||
#define MYSQL_SERVER_VERSION "5.0.20"
|
||||
#define MYSQL_BASE_VERSION "mysqld-5.0"
|
||||
#define MYSQL_SERVER_SUFFIX_DEF "-community-max-nt"
|
||||
#define FRM_VER 6
|
||||
#define MYSQL_VERSION_ID 50020
|
||||
#define MYSQL_PORT 3306
|
||||
#define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
|
||||
#define MYSQL_CONFIG_NAME "my"
|
||||
#define MYSQL_COMPILATION_COMMENT "MySQL Community Edition - Max (GPL)"
|
||||
|
||||
/* mysqld compile time options */
|
||||
#endif /* _CUSTOMCONFIG_ */
|
||||
|
||||
#ifndef LICENSE
|
||||
#define LICENSE GPL
|
||||
#endif /* LICENSE */
|
||||
|
||||
#endif /* _mysql_version_h */
|
||||
|
318
src/mysql/raid.h
318
src/mysql/raid.h
@ -1,159 +1,159 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Parser needs these defines always, even if USE_RAID is not defined */
|
||||
#define RAID_TYPE_0 1 /* Striping */
|
||||
#define RAID_TYPE_x 2 /* Some new modes */
|
||||
#define RAID_TYPE_y 3
|
||||
|
||||
#define RAID_DEFAULT_CHUNKS 4
|
||||
#define RAID_DEFAULT_CHUNKSIZE 256*1024 /* 256kB */
|
||||
|
||||
C_MODE_START
|
||||
#define my_raid_type(raid_type) raid_type_string[(int)(raid_type)]
|
||||
extern const char *raid_type_string[];
|
||||
C_MODE_END
|
||||
|
||||
#ifdef DONT_USE_RAID
|
||||
#undef USE_RAID
|
||||
#endif
|
||||
#if defined(USE_RAID)
|
||||
|
||||
#include "my_dir.h"
|
||||
|
||||
/* Trap all occurences of my_...() in source and use our wrapper around this function */
|
||||
|
||||
#ifdef MAP_TO_USE_RAID
|
||||
#define my_read(A,B,C,D) my_raid_read(A,B,C,D)
|
||||
#define my_write(A,B,C,D) my_raid_write(A,B,C,D)
|
||||
#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E)
|
||||
#define my_pread(A,B,C,D,E) my_raid_pread(A,B,C,D,E)
|
||||
#define my_chsize(A,B,C,D) my_raid_chsize(A,B,C,D)
|
||||
#define my_close(A,B) my_raid_close(A,B)
|
||||
#define my_tell(A,B) my_raid_tell(A,B)
|
||||
#define my_seek(A,B,C,D) my_raid_seek(A,B,C,D)
|
||||
#define my_lock(A,B,C,D,E) my_raid_lock(A,B,C,D,E)
|
||||
#define my_fstat(A,B,C) my_raid_fstat(A,B,C)
|
||||
#endif /* MAP_TO_USE_RAID */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void init_raid(void);
|
||||
void end_raid(void);
|
||||
|
||||
bool is_raid(File fd);
|
||||
File my_raid_create(const char *FileName, int CreateFlags, int access_flags,
|
||||
uint raid_type, uint raid_chunks, ulong raid_chunksize,
|
||||
myf MyFlags);
|
||||
File my_raid_open(const char *FileName, int Flags,
|
||||
uint raid_type, uint raid_chunks, ulong raid_chunksize,
|
||||
myf MyFlags);
|
||||
int my_raid_rename(const char *from, const char *to, uint raid_chunks,
|
||||
myf MyFlags);
|
||||
int my_raid_delete(const char *from, uint raid_chunks, myf MyFlags);
|
||||
int my_raid_redel(const char *old_name, const char *new_name,
|
||||
uint raid_chunks, myf MyFlags);
|
||||
|
||||
my_off_t my_raid_seek(File fd, my_off_t pos, int whence, myf MyFlags);
|
||||
my_off_t my_raid_tell(File fd, myf MyFlags);
|
||||
|
||||
uint my_raid_write(File,const byte *Buffer, uint Count, myf MyFlags);
|
||||
uint my_raid_read(File Filedes, byte *Buffer, uint Count, myf MyFlags);
|
||||
|
||||
uint my_raid_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
|
||||
myf MyFlags);
|
||||
uint my_raid_pwrite(int Filedes, const byte *Buffer, uint Count,
|
||||
my_off_t offset, myf MyFlags);
|
||||
|
||||
int my_raid_lock(File,int locktype, my_off_t start, my_off_t length,
|
||||
myf MyFlags);
|
||||
int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
|
||||
int my_raid_close(File, myf MyFlags);
|
||||
int my_raid_fstat(int Filedes, struct stat *buf, myf MyFlags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#ifdef USE_PRAGMA_INTERFACE
|
||||
#pragma interface /* gcc class implementation */
|
||||
#endif
|
||||
|
||||
class RaidName {
|
||||
public:
|
||||
RaidName(const char *FileName);
|
||||
~RaidName();
|
||||
bool IsRaid();
|
||||
int Rename(const char * from, const char * to, myf MyFlags);
|
||||
private:
|
||||
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
|
||||
uint _raid_chunks; /* 1..n */
|
||||
ulong _raid_chunksize; /* 1..n in bytes */
|
||||
};
|
||||
|
||||
class RaidFd {
|
||||
public:
|
||||
RaidFd(uint raid_type, uint raid_chunks , ulong raid_chunksize);
|
||||
~RaidFd();
|
||||
File Create(const char *FileName, int CreateFlags, int access_flags,
|
||||
myf MyFlags);
|
||||
File Open(const char *FileName, int Flags, myf MyFlags);
|
||||
my_off_t Seek(my_off_t pos,int whence,myf MyFlags);
|
||||
my_off_t Tell(myf MyFlags);
|
||||
int Write(const byte *Buffer, uint Count, myf MyFlags);
|
||||
int Read(const byte *Buffer, uint Count, myf MyFlags);
|
||||
int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags);
|
||||
int Chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
|
||||
int Fstat(int fd, MY_STAT *stat_area, myf MyFlags );
|
||||
int Close(myf MyFlags);
|
||||
static bool IsRaid(File fd);
|
||||
static DYNAMIC_ARRAY _raid_map; /* Map of RaidFD* */
|
||||
private:
|
||||
|
||||
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
|
||||
uint _raid_chunks; /* 1..n */
|
||||
ulong _raid_chunksize; /* 1..n in bytes */
|
||||
|
||||
ulong _total_block; /* We are operating with block no x (can be 0..many). */
|
||||
uint _this_block; /* can be 0.._raid_chunks */
|
||||
uint _remaining_bytes; /* Maximum bytes that can be written in this block */
|
||||
|
||||
my_off_t _position;
|
||||
my_off_t _size; /* Cached file size for faster seek(SEEK_END) */
|
||||
File _fd;
|
||||
File *_fd_vector; /* Array of File */
|
||||
off_t *_seek_vector; /* Array of cached seek positions */
|
||||
|
||||
inline void Calculate()
|
||||
{
|
||||
DBUG_ENTER("RaidFd::_Calculate");
|
||||
DBUG_PRINT("info",("_position: %lu _raid_chunksize: %d, _size: %lu",
|
||||
(ulong) _position, _raid_chunksize, (ulong) _size));
|
||||
|
||||
_total_block = (ulong) (_position / _raid_chunksize);
|
||||
_this_block = _total_block % _raid_chunks; /* can be 0.._raid_chunks */
|
||||
_remaining_bytes = (uint) (_raid_chunksize -
|
||||
(_position - _total_block * _raid_chunksize));
|
||||
DBUG_PRINT("info",
|
||||
("_total_block: %d this_block: %d _remaining_bytes:%d",
|
||||
_total_block, _this_block, _remaining_bytes));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
#endif /* USE_RAID */
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Parser needs these defines always, even if USE_RAID is not defined */
|
||||
#define RAID_TYPE_0 1 /* Striping */
|
||||
#define RAID_TYPE_x 2 /* Some new modes */
|
||||
#define RAID_TYPE_y 3
|
||||
|
||||
#define RAID_DEFAULT_CHUNKS 4
|
||||
#define RAID_DEFAULT_CHUNKSIZE 256*1024 /* 256kB */
|
||||
|
||||
C_MODE_START
|
||||
#define my_raid_type(raid_type) raid_type_string[(int)(raid_type)]
|
||||
extern const char *raid_type_string[];
|
||||
C_MODE_END
|
||||
|
||||
#ifdef DONT_USE_RAID
|
||||
#undef USE_RAID
|
||||
#endif
|
||||
#if defined(USE_RAID)
|
||||
|
||||
#include "my_dir.h"
|
||||
|
||||
/* Trap all occurences of my_...() in source and use our wrapper around this function */
|
||||
|
||||
#ifdef MAP_TO_USE_RAID
|
||||
#define my_read(A,B,C,D) my_raid_read(A,B,C,D)
|
||||
#define my_write(A,B,C,D) my_raid_write(A,B,C,D)
|
||||
#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E)
|
||||
#define my_pread(A,B,C,D,E) my_raid_pread(A,B,C,D,E)
|
||||
#define my_chsize(A,B,C,D) my_raid_chsize(A,B,C,D)
|
||||
#define my_close(A,B) my_raid_close(A,B)
|
||||
#define my_tell(A,B) my_raid_tell(A,B)
|
||||
#define my_seek(A,B,C,D) my_raid_seek(A,B,C,D)
|
||||
#define my_lock(A,B,C,D,E) my_raid_lock(A,B,C,D,E)
|
||||
#define my_fstat(A,B,C) my_raid_fstat(A,B,C)
|
||||
#endif /* MAP_TO_USE_RAID */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void init_raid(void);
|
||||
void end_raid(void);
|
||||
|
||||
bool is_raid(File fd);
|
||||
File my_raid_create(const char *FileName, int CreateFlags, int access_flags,
|
||||
uint raid_type, uint raid_chunks, ulong raid_chunksize,
|
||||
myf MyFlags);
|
||||
File my_raid_open(const char *FileName, int Flags,
|
||||
uint raid_type, uint raid_chunks, ulong raid_chunksize,
|
||||
myf MyFlags);
|
||||
int my_raid_rename(const char *from, const char *to, uint raid_chunks,
|
||||
myf MyFlags);
|
||||
int my_raid_delete(const char *from, uint raid_chunks, myf MyFlags);
|
||||
int my_raid_redel(const char *old_name, const char *new_name,
|
||||
uint raid_chunks, myf MyFlags);
|
||||
|
||||
my_off_t my_raid_seek(File fd, my_off_t pos, int whence, myf MyFlags);
|
||||
my_off_t my_raid_tell(File fd, myf MyFlags);
|
||||
|
||||
uint my_raid_write(File,const byte *Buffer, uint Count, myf MyFlags);
|
||||
uint my_raid_read(File Filedes, byte *Buffer, uint Count, myf MyFlags);
|
||||
|
||||
uint my_raid_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
|
||||
myf MyFlags);
|
||||
uint my_raid_pwrite(int Filedes, const byte *Buffer, uint Count,
|
||||
my_off_t offset, myf MyFlags);
|
||||
|
||||
int my_raid_lock(File,int locktype, my_off_t start, my_off_t length,
|
||||
myf MyFlags);
|
||||
int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
|
||||
int my_raid_close(File, myf MyFlags);
|
||||
int my_raid_fstat(int Filedes, struct stat *buf, myf MyFlags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#ifdef USE_PRAGMA_INTERFACE
|
||||
#pragma interface /* gcc class implementation */
|
||||
#endif
|
||||
|
||||
class RaidName {
|
||||
public:
|
||||
RaidName(const char *FileName);
|
||||
~RaidName();
|
||||
bool IsRaid();
|
||||
int Rename(const char * from, const char * to, myf MyFlags);
|
||||
private:
|
||||
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
|
||||
uint _raid_chunks; /* 1..n */
|
||||
ulong _raid_chunksize; /* 1..n in bytes */
|
||||
};
|
||||
|
||||
class RaidFd {
|
||||
public:
|
||||
RaidFd(uint raid_type, uint raid_chunks , ulong raid_chunksize);
|
||||
~RaidFd();
|
||||
File Create(const char *FileName, int CreateFlags, int access_flags,
|
||||
myf MyFlags);
|
||||
File Open(const char *FileName, int Flags, myf MyFlags);
|
||||
my_off_t Seek(my_off_t pos,int whence,myf MyFlags);
|
||||
my_off_t Tell(myf MyFlags);
|
||||
int Write(const byte *Buffer, uint Count, myf MyFlags);
|
||||
int Read(const byte *Buffer, uint Count, myf MyFlags);
|
||||
int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags);
|
||||
int Chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
|
||||
int Fstat(int fd, MY_STAT *stat_area, myf MyFlags );
|
||||
int Close(myf MyFlags);
|
||||
static bool IsRaid(File fd);
|
||||
static DYNAMIC_ARRAY _raid_map; /* Map of RaidFD* */
|
||||
private:
|
||||
|
||||
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
|
||||
uint _raid_chunks; /* 1..n */
|
||||
ulong _raid_chunksize; /* 1..n in bytes */
|
||||
|
||||
ulong _total_block; /* We are operating with block no x (can be 0..many). */
|
||||
uint _this_block; /* can be 0.._raid_chunks */
|
||||
uint _remaining_bytes; /* Maximum bytes that can be written in this block */
|
||||
|
||||
my_off_t _position;
|
||||
my_off_t _size; /* Cached file size for faster seek(SEEK_END) */
|
||||
File _fd;
|
||||
File *_fd_vector; /* Array of File */
|
||||
off_t *_seek_vector; /* Array of cached seek positions */
|
||||
|
||||
inline void Calculate()
|
||||
{
|
||||
DBUG_ENTER("RaidFd::_Calculate");
|
||||
DBUG_PRINT("info",("_position: %lu _raid_chunksize: %d, _size: %lu",
|
||||
(ulong) _position, _raid_chunksize, (ulong) _size));
|
||||
|
||||
_total_block = (ulong) (_position / _raid_chunksize);
|
||||
_this_block = _total_block % _raid_chunks; /* can be 0.._raid_chunks */
|
||||
_remaining_bytes = (uint) (_raid_chunksize -
|
||||
(_position - _total_block * _raid_chunksize));
|
||||
DBUG_PRINT("info",
|
||||
("_total_block: %d this_block: %d _remaining_bytes:%d",
|
||||
_total_block, _this_block, _remaining_bytes));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
#endif /* USE_RAID */
|
||||
|
@ -1,34 +1,34 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
|
||||
#ifndef _typelib_h
|
||||
#define _typelib_h
|
||||
|
||||
typedef struct st_typelib { /* Different types saved here */
|
||||
unsigned int count; /* How many types */
|
||||
const char *name; /* Name of typelib */
|
||||
const char **type_names;
|
||||
unsigned int *type_lengths;
|
||||
} TYPELIB;
|
||||
|
||||
extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name);
|
||||
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
|
||||
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
|
||||
|
||||
extern TYPELIB sql_protocol_typelib;
|
||||
|
||||
#endif /* _typelib_h */
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
|
||||
#ifndef _typelib_h
|
||||
#define _typelib_h
|
||||
|
||||
typedef struct st_typelib { /* Different types saved here */
|
||||
unsigned int count; /* How many types */
|
||||
const char *name; /* Name of typelib */
|
||||
const char **type_names;
|
||||
unsigned int *type_lengths;
|
||||
} TYPELIB;
|
||||
|
||||
extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name);
|
||||
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
|
||||
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
|
||||
|
||||
extern TYPELIB sql_protocol_typelib;
|
||||
|
||||
#endif /* _typelib_h */
|
||||
|
@ -21,7 +21,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;PACKETVER=6;NEW_006b;__WIN32;LOCALZLIB;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="FALSE"
|
||||
BasicRuntimeChecks="0"
|
||||
@ -38,7 +38,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib zdll.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib"
|
||||
OutputFile="../char-server_sql.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
@ -88,7 +88,7 @@
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_WIN32;PACKETVER=6;NEW_006b;__WIN32;LOCALZLIB;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
@ -100,7 +100,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib zdll.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib"
|
||||
OutputFile="../char-server_sql.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
|
@ -20,7 +20,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;PACKETVER=6;TXT_ONLY;NEW_006b;__WIN32;LOCALZLIB;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="FALSE"
|
||||
BasicRuntimeChecks="0"
|
||||
@ -87,7 +87,7 @@
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_WIN32;PACKETVER=6;TXT_ONLY;NEW_006b;__WIN32;LOCALZLIB;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
|
@ -20,7 +20,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;PACKETVER=6;NEW_006b;__WIN32;LOCALZLIB;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="FALSE"
|
||||
BasicRuntimeChecks="0"
|
||||
@ -37,7 +37,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib zdll.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib"
|
||||
OutputFile="..\login-server_sql.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
@ -87,7 +87,7 @@
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_WIN32;PACKETVER=6;NEW_006b;__WIN32;LOCALZLIB;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
@ -101,7 +101,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib zdll.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib"
|
||||
OutputFile="..\login-server_sql.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
|
@ -20,7 +20,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;PACKETVER=6;TXT_ONLY;NEW_006b;__WIN32;LOCALZLIB;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="FALSE"
|
||||
BasicRuntimeChecks="0"
|
||||
@ -93,7 +93,7 @@
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_WIN32;PACKETVER=6;TXT_ONLY;NEW_006b;__WIN32;LOCALZLIB;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
|
@ -20,7 +20,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;PACKETVER=6;NEW_006b;__WIN32;LOCALZLIB;PCRE_SUPPORT;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION;MAPREGSQL"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;PCRE_SUPPORT;MAPREGSQL;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="FALSE"
|
||||
BasicRuntimeChecks="0"
|
||||
@ -89,7 +89,7 @@
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_WIN32;PACKETVER=6;NEW_006b;__WIN32;LOCALZLIB;PCRE_SUPPORT;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION;MAPREGSQL"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;PCRE_SUPPORT;MAPREGSQL;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
|
@ -20,7 +20,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;PACKETVER=6;TXT_ONLY;NEW_006b;__WIN32;LOCALZLIB;PCRE_SUPPORT;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;PCRE_SUPPORT;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="FALSE"
|
||||
ExceptionHandling="TRUE"
|
||||
@ -90,7 +90,7 @@
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_WIN32;PACKETVER=6;TXT_ONLY;NEW_006b;__WIN32;LOCALZLIB;PCRE_SUPPORT;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;PCRE_SUPPORT;TXT_ONLY;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
EnableEnhancedInstructionSet="2"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
|
@ -65,7 +65,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib"
|
||||
OutputFile="../char-server_sql.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
@ -128,6 +128,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
@ -149,7 +150,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib"
|
||||
OutputFile="../char-server_sql.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
|
@ -127,6 +127,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;TXT_ONLY;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
|
@ -65,7 +65,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib"
|
||||
OutputFile="..\login-server_sql.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
@ -128,6 +128,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
@ -151,7 +152,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib"
|
||||
OutputFile="..\login-server_sql.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
|
@ -135,6 +135,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;TXT_ONLY;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
|
@ -65,7 +65,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib pcre.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib pcre.lib"
|
||||
OutputFile="..\map-server_sql.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
@ -128,6 +128,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib;..\src\mysql"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;PCRE_SUPPORT;MAPREGSQL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
@ -149,7 +150,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WSOCK32.lib mysqlclient.lib pcre.lib"
|
||||
AdditionalDependencies="WSOCK32.lib libmysql.lib zdll.lib pcre.lib"
|
||||
OutputFile="..\map-server_sql.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib"
|
||||
|
@ -131,6 +131,7 @@
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\src\common;..\src\zlib"
|
||||
PreprocessorDefinitions="WIN32;_WIN32;__WIN32;PCRE_SUPPORT;TXT_ONLY;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;FD_SETSIZE=4096;DB_MANUAL_CAST_TO_UNION"
|
||||
RuntimeLibrary="0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user