Commit dab74107 authored by monty@donna.mysql.fi's avatar monty@donna.mysql.fi

Fix a crash in Innobase with tables with many columns and a range query

Removed all Attic directories.
parent 700dd225
This diff is collapsed.
......@@ -42425,8 +42425,8 @@ of connections in a short time).
Don't free the key cache on @code{FLUSH TABLES} as this will cause problems
with temporary tables.
@item
Fixed problem in Innobase with with other character sets than latin1 and
alarms on Solaris.
Fixed problem in Innobase with with other character sets than latin1,
alarms on Solaris and many columns.
@item
Fixed a core-dump bug when using very complex query involving
@code{DISTINCT} and summary functions.
This diff is collapsed.
This diff is collapsed.
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/*
** print_default.c:
** Print all parameters in a default file that will be given to some program.
**
** Written by Monty
*/
#include <global.h>
#include <my_sys.h>
#include <getopt.h>
const char *config_file="my"; /* Default config file */
static struct option long_options[] =
{
{"config-file", required_argument, 0, 'c'},
{"defaults-file", required_argument, 0, 'c'},
{"no-defaults", no_argument, 0, 'd'},
{"help", no_argument, 0, '?'},
{"version", no_argument, 0, 'V'},
{0, 0, 0, 0}
};
static void usage(my_bool version)
{
printf("%s Ver 1.1 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE);
if (version)
return;
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Prints all arguments that is give to some program using the default files");
printf("Usage: %s [OPTIONS] groups\n",my_progname);
printf("\n\
-c, --config-file=# --defaults-file=#\n\
The config file to use (default '%s')\n\
--no-defaults Return an empty string (useful for scripts)\n\
-?, --help Display this help message and exit.\n\
-V, --version Output version information and exit.\n",
config_file);
printf("\nExample usage: %s --config-file=my client mysql\n",my_progname);
}
static int get_options(int *argc,char ***argv)
{
int c,option_index;
while ((c=getopt_long(*argc,*argv,"c:V?I",
long_options, &option_index)) != EOF)
{
switch (c) {
case 'c':
config_file=optarg;
break;
case 'n':
exit(0);
case 'I':
case '?':
usage(0);
exit(0);
case 'V':
usage(1);
exit(0);
}
}
(*argc)-=optind;
(*argv)+=optind;
if (*argc < 1)
{
usage(0);
return 1;
}
return 0;
}
int main(int argc, char **argv)
{
int count;
char **load_default_groups, *tmp_arguments[2],
**argument, **arguments;
MY_INIT(argv[0]);
/*
** Check out the args
*/
if (get_options(&argc,&argv))
exit(1);
if (!(load_default_groups=(char**) my_malloc((argc+2)*sizeof(char*),
MYF(MY_WME))))
exit(1);
for (count=0; *argv ; argv++,count++)
load_default_groups[count]= *argv;
load_default_groups[count]=0;
count=1;
arguments=tmp_arguments;
arguments[0]=my_progname;
arguments[1]=0;
load_defaults(config_file, (const char **) load_default_groups,
&count, &arguments);
for (argument= arguments+1 ; *argument ; argument++)
puts(*argument);
my_free((char*) load_default_groups,MYF(0));
free_defaults(arguments);
exit(0);
}
/* Defines for Win32 to make it compatible for MySQL */
#include <sys/locking.h>
#include <windows.h>
#include <math.h> /* Because of rint() */
#include <fcntl.h>
#include <io.h>
#include <malloc.h>
#ifdef __NT__
#define SYSTEM_TYPE "NT"
#else
#define SYSTEM_TYPE "Win95/Win98"
#endif
#define MACHINE_TYPE "i586" /* Define to machine type name */
#ifndef __WIN32__
#define __WIN32__ /* 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 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 */
#define LONGLONG_MIN ((__int64) 0x8000000000000000)
#define LONGLONG_MAX ((__int64) 0x7FFFFFFFFFFFFFFF)
#define LL(A) ((__int64) A)
/* Type information */
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned int size_t;
typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */
typedef __int64 longlong;
typedef int sigset_t;
#define longlong_defined
/* off_t should not be __int64 because of conflicts in header files;
Use my_off_t or os_off_t instead */
typedef long off_t;
typedef __int64 os_off_t;
#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 */
#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
#define HAVE_BROKEN_NETINET_INCLUDES
#ifdef __NT__
#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
#endif
/* Convert some simple functions to Posix */
#define sigset(A,B) signal((A),(B))
#define finite(A) _finite(A)
#define sleep(A) Sleep((A)*1000)
#ifndef __BORLANDC__
#define access(A,B) _access(A,B)
#endif
#if defined(__cplusplus)
inline double rint(double nr)
{
double f = floor(nr);
double c = ceil(nr);
return (((c-nr) >= (nr-f)) ? f :c);
}
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)
#else
#define inline __inline
#endif
#if SIZEOF_OFF_T > 4
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
#define tell(A) _telli64(A)
#endif
#define STACK_DIRECTION -1
/* Optimized store functions for Intel x86 */
#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)))
#define uint3korr(A) (long) (*((unsigned long *) (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 float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#define HAVE_PERROR
#define HAVE_VFPRINT
#define HAVE_CHSIZE /* System has chsize() function */
#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_COMPRESS
#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:\\"
#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 FN_LOWER_CASE TRUE /* Files are represented in lower case */
#define MY_NFILE 127 /* This is only used to save filenames */
#define thread_safe_increment(V,L) InterlockedIncrement((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))
#else
#define thread_safe_add(V,C,L) InterlockedExchange((long*) &(V),(V)+(C))
#endif
/* Copyright (C) 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
For a more info consult the file COPYRIGHT distributed with this file */
/*
A better inplementation of the UNIX ctype(3) library.
Notes: global.h should be included before ctype.h
*/
#ifndef _m_ctype_h
#define _m_ctype_h
#define MY_CHARSET_UNDEFINED 0
#define MY_CHARSET_BIG5 1
#define MY_CHARSET_CZECH 2
#define MY_CHARSET_DEC8 3
#define MY_CHARSET_DOS 4
#define MY_CHARSET_GERMAN1 5
#define MY_CHARSET_HP8 6
#define MY_CHARSET_KOI8_RU 7
#define MY_CHARSET_LATIN1 8
#define MY_CHARSET_LATIN2 9
#define MY_CHARSET_SWE7 10
#define MY_CHARSET_USA7 11
#define MY_CHARSET_UJIS 12
#define MY_CHARSET_SJIS 13
#define MY_CHARSET_CP1251 14
#define MY_CHARSET_DANISH 15
#define MY_CHARSET_HEBREW 16
#define MY_CHARSET_WIN1251 17
#define MY_CHARSET_TIS620 18
#define MY_CHARSET_EUC_KR 19
#define MY_CHARSET_ESTONIA 20
#define MY_CHARSET_HUNGARIAN 21
#define MY_CHARSET_KOI8_UKR 22
#define MY_CHARSET_WIN1251UKR 23
#define MY_CHARSET_GB2312 24
#define MY_CHARSET_GREEK 25
#define MY_CHARSET_WIN1250 26
#define MY_CHARSET_CROAT 27
#define MY_CHARSET_GBK 28
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __WIN32__
#include <ctype.h>
#endif
/* Don't include std ctype.h when this is included */
#define _CTYPE_H
#define _CTYPE_INCLUDED
#define __CTYPE_INCLUDED
#define _CTYPE_USING /* Don't put names in global namespace. */
#ifndef CTYPE_LIBRARY
#define EXT extern
#define D(x)
#else
#define EXT
#define D(x) = x
#endif
#define _U 01 /* Upper case */
#define _L 02 /* Lower case */
#define _N 04 /* Numeral (digit) */
#define _S 010 /* Spacing character */
#define _P 020 /* Punctuation */
#define _C 040 /* Control character */
#define _B 0100 /* Blank */
#define _X 0200 /* heXadecimal digit */
extern uchar NEAR ctype_@mystrings_charset@[];
extern uchar NEAR to_upper_@mystrings_charset@[];
extern uchar NEAR to_lower_@mystrings_charset@[];
extern uchar NEAR sort_order_@mystrings_charset@[];
#define my_ctype ctype_@mystrings_charset@
#define my_to_upper to_upper_@mystrings_charset@
#define my_to_lower to_lower_@mystrings_charset@
#define my_sort_order sort_order_@mystrings_charset@
#ifndef __WIN32__
#define _toupper(c) (char) my_to_upper[(uchar) (c)]
#define _tolower(c) (char) my_to_lower[(uchar) (c)]
#define toupper(c) (char) my_to_upper[(uchar) (c)]
#define tolower(c) (char) my_to_lower[(uchar) (c)]
#define isalpha(c) ((my_ctype+1)[(uchar) (c)] & (_U | _L))
#define isupper(c) ((my_ctype+1)[(uchar) (c)] & _U)
#define islower(c) ((my_ctype+1)[(uchar) (c)] & _L)
#define isdigit(c) ((my_ctype+1)[(uchar) (c)] & _N)
#define isxdigit(c) ((my_ctype+1)[(uchar) (c)] & _X)
#define isalnum(c) ((my_ctype+1)[(uchar) (c)] & (_U | _L | _N))
#define isspace(c) ((my_ctype+1)[(uchar) (c)] & _S)
#define ispunct(c) ((my_ctype+1)[(uchar) (c)] & _P)
#define isprint(c) ((my_ctype+1)[(uchar) (c)] & (_P | _U | _L | _N | _B))
#define isgraph(c) ((my_ctype+1)[(uchar) (c)] & (_P | _U | _L | _N))
#define iscntrl(c) ((my_ctype+1)[(uchar) (c)] & _C)
#define isascii(c) (!((c) & ~0177))
#define toascii(c) ((c) & 0177)
#ifdef ctype
#undef ctype
#endif /* ctype */
#endif /* __WIN32__ */
/* Some macros that should be cleaned up a little */
#define isvar(c) (isalnum(c) || (c) == '_')
#define isvar_start(c) (isalpha(c) || (c) == '_')
#define tocntrl(c) ((c) & 31)
#define toprint(c) ((c) | 64)
/* Support for Japanese(UJIS) characters, by tommy@valley.ne.jp */
#if MY_CHARSET_CURRENT == MY_CHARSET_UJIS
#define USE_MB
#define USE_MB_IDENT
#define isujis(c) ((0xa1<=((c)&0xff) && ((c)&0xff)<=0xfe))
#define iskata(c) ((0xa1<=((c)&0xff) && ((c)&0xff)<=0xdf))
#define isujis_ss2(c) (((c)&0xff) == 0x8e)
#define isujis_ss3(c) (((c)&0xff) == 0x8f)
#define ismbchar(p, end) ((*(uchar*)(p)<0x80)? 0:\
isujis(*(p)) && (end)-(p)>1 && isujis(*((p)+1))? 2:\
isujis_ss2(*(p)) && (end)-(p)>1 && iskata(*((p)+1))? 2:\
isujis_ss3(*(p)) && (end)-(p)>2 && isujis(*((p)+1)) && isujis(*((p)+2))? 3:\
0)
#define ismbhead(c) (isujis(c) || isujis_ss2(c) || isujis_ss3(c))
#define mbcharlen(c) (isujis(c)? 2: isujis_ss2(c)? 2: isujis_ss3(c)? 3: 0)
#define MBMAXLEN 3
#endif
/* Support for Japanese(SJIS) characters, by tommy@valley.ne.jp */
#if MY_CHARSET_CURRENT == MY_CHARSET_SJIS
#define USE_MB
#define USE_MB_IDENT
#define issjishead(c) ((0x81<=((c)&0xff) && ((c)&0xff)<=0x9f) || (0xe0<=((c)&0xff) && ((c)&0xff)<=0xfc))
#define issjistail(c) ((0x40<=((c)&0xff) && ((c)&0xff)<=0x7e) || (0x80<=((c)&0xff) && ((c)&0xff)<=0xfc))
#define ismbchar(p, end) (issjishead(*(p)) && (end)-(p)>1 && issjistail(*((p)+1))? 2: 0)
#define ismbhead(c) issjishead(c)
#define mbcharlen(c) (issjishead(c)? 2: 0)
#define MBMAXLEN 2
#endif
/* Support for Chinese(BIG5) characters, by jou@nematic.ieo.nctu.edu.tw
modified by Wei He (hewei@mail.ied.ac.cn) */
#if MY_CHARSET_CURRENT == MY_CHARSET_BIG5
#define USE_MB
#define USE_MB_IDENT
#define isbig5head(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xf9)
#define isbig5tail(c) ((0x40<=(uchar)(c) && (uchar)(c)<=0x7e) || \
(0xa1<=(uchar)(c) && (uchar)(c)<=0xfe))
#define ismbchar(p, end) (isbig5head(*(p)) && (end)-(p)>1 && isbig5tail(*((p)+1))? 2: 0)
#define ismbhead(c) isbig5head(c)
#define mbcharlen(c) (isbig5head(c)? 2: 0)
#define MBMAXLEN 2
#
#undef USE_STRCOLL
#define USE_STRCOLL
#endif
/* Support for Chinese(GB2312) characters, by Miles Tsai (net-bull@126.com)
modified by Wei He (hewei@mail.ied.ac.cn) */
#if MY_CHARSET_CURRENT == MY_CHARSET_GB2312
#define USE_MB
#define USE_MB_IDENT
#define isgb2312head(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xf7)
#define isgb2312tail(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)
#define ismbchar(p, end) (isgb2312head(*(p)) && (end)-(p)>1 && isgb2312tail(*((p)+1))? 2: 0)
#define ismbhead(c) isgb2312head(c)
#define mbcharlen(c) (isgb2312head(c)? 2:0)
#define MBMAXLEN 2
#endif
/* Support for Chinese(GBK) characters, by hewei@mail.ied.ac.cn */
#if MY_CHARSET_CURRENT == MY_CHARSET_GBK
#define USE_MB
#define USE_MB_IDENT
#define isgbkhead(c) (0x81<=(uchar)(c) && (uchar)(c)<=0xfe)
#define isgbktail(c) ((0x40<=(uchar)(c) && (uchar)(c)<=0x7e) || \
(0x80<=(uchar)(c) && (uchar)(c)<=0xfe))
#define ismbchar(p, end) (isgbkhead(*(p)) && (end)-(p)>1 && isgbktail(*((p)+1))? 2: 0)
#define ismbhead(c) isgbkhead(c)
#define mbcharlen(c) (isgbkhead(c)? 2:0)
#define MBMAXLEN 2
#undef USE_STRCOLL
#define USE_STRCOLL
#endif
/* Define, how much will the string grow under strxfrm */
#if MY_CHARSET_CURRENT == MY_CHARSET_CZECH
#undef USE_STRCOLL
#define USE_STRCOLL
#endif
#if MY_CHARSET_CURRENT == MY_CHARSET_TIS620
#undef USE_STRCOLL
#define USE_STRCOLL
#define USE_TIS620
#include "t_ctype.h"
#endif
/* Support for Korean(EUC_KR) characters, by powerm90@tinc.co.kr and mrpark@tinc.co.kr */
#if MY_CHARSET_CURRENT == MY_CHARSET_EUC_KR
#define USE_MB
#define USE_MB_IDENT
#define iseuc_kr(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe))
#define ismbchar(p, end) ((*(uchar*)(p)<0x80)? 0:\
iseuc_kr(*(p)) && (end)-(p)>1 && iseuc_kr(*((p)+1))? 2:\
0)
#define ismbhead(c) (iseuc_kr(c))
#define mbcharlen(c) (iseuc_kr(c) ? 2 : 0)
#define MBMAXLEN 2
#endif
#ifdef USE_STRCOLL
extern uint MY_STRXFRM_MULTIPLY;
extern int my_strnxfrm(unsigned char *, unsigned char *, int, int);
extern int my_strnncoll(const unsigned char *, int, const unsigned char *, int);
extern int my_strxfrm(unsigned char *, unsigned char *, int);
extern int my_strcoll(const unsigned char *, const unsigned char *);
extern my_bool my_like_range(const char *ptr,uint ptr_length,pchar escape,
uint res_length, char *min_str,char *max_str,
uint *min_length,uint *max_length);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _m_ctype_h */
/* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
/*
** Common definition between mysql server & client
*/
#ifndef _mysql_com_h
#define _mysql_com_h
#ifdef __cplusplus
extern "C" {
#endif
#define NAME_LEN 64 /* Field/table name length */
#define HOSTNAME_LENGTH 60
#define USERNAME_LENGTH 16
#define LOCAL_HOST "localhost"
#define LOCAL_HOST_NAMEDPIPE "."
#ifndef _CUSTOMCONFIG_
#define MYSQL_PORT @MYSQL_TCP_PORT@ /* Alloced by ISI for MySQL */
#else
#include "custom_conf.h"
#endif
#define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@"
#if defined(__EMX__) || defined(__OS2__)
#undef MYSQL_UNIX_ADDR
#define MYSQL_OS2_ADDR "\\socket\\MySQL"
#define MYSQL_UNIX_ADDR MYSQL_OS2_ADDR
#endif
#if defined(__WIN32__) && !defined( _CUSTOMCONFIG_)
#define MYSQL_NAMEDPIPE "MySQL"
#define MYSQL_SERVICENAME "MySql"
#endif /* __WIN32__ */
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};
#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
/* 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 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 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_FAST 32768 /* Intern flag */
#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_CHANGE_USER 512 /* Support the mysql_change_user() */
#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 MYSQL_ERRMSG_SIZE 200
#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 */
#ifndef Vio_defined
#define Vio_defined
#ifdef HAVE_VIO
class Vio; /* Fill Vio class in C++ */
#else
struct st_vio; /* Only C */
typedef struct st_vio Vio;
#endif
#endif
typedef struct st_net {
Vio* vio;
my_socket fd; /* For Perl DBI/dbd */
int fcntl;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
char last_error[MYSQL_ERRMSG_SIZE];
unsigned int last_errno,max_packet,timeout,pkt_nr;
my_bool error,return_errno,compress;
unsigned long remain_in_buf,length, buf_length, where_b;
my_bool more;
char save_char;
} NET;
#define packet_error ((unsigned int) -1)
enum enum_field_types { FIELD_TYPE_DECIMAL, FIELD_TYPE_TINY,
FIELD_TYPE_SHORT, FIELD_TYPE_LONG,
FIELD_TYPE_FLOAT, FIELD_TYPE_DOUBLE,
FIELD_TYPE_NULL, FIELD_TYPE_TIMESTAMP,
FIELD_TYPE_LONGLONG,FIELD_TYPE_INT24,
FIELD_TYPE_DATE, FIELD_TYPE_TIME,
FIELD_TYPE_DATETIME, FIELD_TYPE_YEAR,
FIELD_TYPE_NEWDATE,
FIELD_TYPE_ENUM=247,
FIELD_TYPE_SET=248,
FIELD_TYPE_TINY_BLOB=249,
FIELD_TYPE_MEDIUM_BLOB=250,
FIELD_TYPE_LONG_BLOB=251,
FIELD_TYPE_BLOB=252,
FIELD_TYPE_VAR_STRING=253,
FIELD_TYPE_STRING=254
};
#define FIELD_TYPE_CHAR FIELD_TYPE_TINY /* For compability */
#define FIELD_TYPE_INTERVAL FIELD_TYPE_ENUM /* For compability */
extern unsigned long max_allowed_packet;
extern unsigned long net_buffer_length;
#define net_new_transaction(net) ((net)->pkt_nr=0)
int my_net_init(NET *net, Vio* vio);
void net_end(NET *net);
void net_clear(NET *net);
int net_flush(NET *net);
int my_net_write(NET *net,const char *packet,unsigned long len);
int net_write_command(NET *net,unsigned char command,const char *packet,
unsigned long len);
int net_real_write(NET *net,const char *packet,unsigned long len);
unsigned int my_net_read(NET *net);
struct rand_struct {
unsigned long seed1,seed2,max_value;
double max_value_dbl;
};
/* The following is for user defined functions */
enum Item_result {STRING_RESULT,REAL_RESULT,INT_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 */
} 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 int 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 */
void randominit(struct rand_struct *,unsigned long seed1,
unsigned long seed2);
double rnd(struct rand_struct *);
void make_scrambled_password(char *to,const char *password);
void get_salt_from_password(unsigned long *res,const char *password);
void make_password_from_salt(char *to, unsigned long *hash_res);
char *scramble(char *to,const char *message,const char *password,
my_bool old_ver);
my_bool check_scramble(const char *, const char *message,
unsigned long *salt,my_bool old_ver);
char *get_tty_password(char *opt_message);
void hash_password(unsigned long *result, const char *password);
/* Some other useful functions */
void my_init(void);
void load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv);
#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
#ifdef __WIN32__
#define socket_errno WSAGetLastError()
#else
#define socket_errno errno
#endif
#ifdef __cplusplus
}
#endif
#endif
/* Copyright (C) 2000 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 */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
/* some definitions for full-text indices */
/* #include "myisam.h" */
#ifndef _ft_global_h
#define _ft_global_h
#ifdef __cplusplus
extern "C" {
#endif
#define FT_QUERY_MAXLEN 1024
typedef struct ft_doc_rec {
my_off_t dpos;
double weight;
} FT_DOC;
typedef struct st_ft_doclist {
int ndocs;
int curdoc;
void *info; /* actually (MI_INFO *) but don't want to include myisam.h */
FT_DOC doc[1];
} FT_DOCLIST;
int ft_init_stopwords(const char **);
FT_DOCLIST * ft_init_search(MI_INFO *, uint, byte *, uint, bool);
double ft_read_next(FT_DOCLIST *, char *);
#define ft_close_search(handler) my_free(((gptr)(handler)),MYF(0))
#ifdef __cplusplus
}
#endif
#endif
......@@ -445,3 +445,5 @@ i j
1 2
MIN(B) MAX(b)
1 1
table type possible_keys key key_len ref rows Extra
t1 range PRIMARY PRIMARY 4 NULL 1 where used
......@@ -80,6 +80,7 @@ then
bindir=@bindir@
execdir=@libexecdir@
elif test -d "$basedir/libexec"
then
bindir="$basedir/bin"
execdir="$basedir/libexec"
else
......
This diff is collapsed.
This diff is collapsed.
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
/* Error messages for MySQL clients */
/* error messages for the demon is in share/language/errmsg.sys */
#include <global.h>
#include <my_sys.h>
#include "errmsg.h"
#ifdef GERMAN
const char *client_errors[]=
{
"Unbekannter MySQL Fehler",
"Kann UNIX-Socket nicht anlegen (%d)",
"Keine Verbindung zu lokalem MySQL Server, socket: '%-.64s' (%d)",
"Keine Verbindung zu MySQL Server auf %-.64s (%d)",
"Kann TCP/IP-Socket nicht anlegen (%d)",
"Unbekannter MySQL Server Host (%-.64s) (%d)",
"MySQL Server nicht vorhanden",
"Protokolle ungleich. Server Version = % d Client Version = %d",
"MySQL client got out of memory",
"Wrong host info",
"Localhost via UNIX socket",
"%s via TCP/IP",
"Error in server handshake",
"Lost connection to MySQL server during query",
"Commands out of sync; You can't run this command now",
"Verbindung ueber Named Pipe; Host: %-.64s",
"Kann nicht auf Named Pipe warten. Host: %-.64s pipe: %-.32s (%lu)",
"Kann Named Pipe nicht oeffnen. Host: %-.64s pipe: %-.32s (%lu)",
"Kann den Status der Named Pipe nicht setzen. Host: %-.64s pipe: %-.32s (%lu)"
};
#else /* ENGLISH */
const char *client_errors[]=
{
"Unknown MySQL error",
"Can't create UNIX socket (%d)",
"Can't connect to local MySQL server through socket '%-.64s' (%d)",
"Can't connect to MySQL server on '%-.64s' (%d)",
"Can't create TCP/IP socket (%d)",
"Unknown MySQL Server Host '%-.64s' (%d)",
"MySQL server has gone away",
"Protocol mismatch. Server Version = %d Client Version = %d",
"MySQL client run out of memory",
"Wrong host info",
"Localhost via UNIX socket",
"%s via TCP/IP",
"Error in server handshake",
"Lost connection to MySQL server during query",
"Commands out of sync; You can't run this command now",
"%s via named pipe",
"Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)",
"Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)",
"Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)",
};
#endif
void init_client_errs(void)
{
errmsg[CLIENT_ERRMAP] = &client_errors[0];
}
This diff is collapsed.
This diff is collapsed.
......@@ -165,6 +165,7 @@ class ha_berkeley: public handler
};
extern bool berkeley_skip, berkeley_shared_data;
extern SHOW_COMP_OPTION have_berkeley_db;
extern u_int32_t berkeley_init_flags,berkeley_env_flags, berkeley_lock_type,
berkeley_lock_types[];
extern ulong berkeley_cache_size, berkeley_max_lock, berkeley_log_buffer_size;
......
......@@ -19,12 +19,10 @@
#pragma implementation // gcc: Class implementation
#endif
#include <string.h>
#include "mysql_priv.h"
#include "my_pthread.h"
#ifdef HAVE_GEMINI_DB
#include "my_pthread.h"
#include "dbconfig.h"
#include "dsmpub.h"
#include "recpub.h"
......
......@@ -2462,10 +2462,10 @@ ha_innobase::records_in_range(
index = dict_table_get_index_noninline(prebuilt->table, key->name);
range_start = dtuple_create_for_mysql(&heap1, key->key_parts);
dict_index_copy_types(range_start, index, index->n_fields);
dict_index_copy_types(range_start, index, key->key_parts);
range_end = dtuple_create_for_mysql(&heap2, key->key_parts);
dict_index_copy_types(range_end, index, index->n_fields);
dict_index_copy_types(range_end, index, key->key_parts);
row_sel_convert_mysql_key_to_innobase(
range_start, (byte*) key_val_buff, index,
......
......@@ -151,6 +151,8 @@ int ha_init()
return error;
if (!berkeley_skip) // If we couldn't use handler
opt_using_transactions=1;
else
have_berkeley_db=SHOW_OPTION_DISABLED;
}
#endif
#ifdef HAVE_INNOBASE_DB
......@@ -159,10 +161,9 @@ int ha_init()
if (innobase_init())
return -1;
if (!innobase_skip) // If we couldn't use handler
{
opt_using_transactions=1;
else
have_innobase=SHOW_OPTION_DISABLED;
}
}
#endif
#ifdef HAVE_GEMINI_DB
......@@ -171,10 +172,9 @@ int ha_init()
if (gemini_init())
return -1;
if (!gemini_skip) // If we couldn't use handler
{
opt_using_transactions=1;
else
have_gemini=SHOW_OPTION_DISABLED;
}
}
#endif
return 0;
......
......@@ -2112,7 +2112,7 @@ static void create_new_thread(THD *thd)
(void) pthread_mutex_unlock(&LOCK_thread_count);
}
}
DBUG_PRINT("info",(("Thread %d created"), thd->thread_id));
DBUG_PRINT("info",("Thread created"));
DBUG_VOID_RETURN;
}
......
This diff is collapsed.
/* Generate definitions of ctype arrays
*/
#include <global.h>
#define CTYPE_LIBRARY /* initialize ctype arrays */
#include "m_ctype.h"
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include <global.h>
#include <m_ctype.h>
@CHARSET_DECLARATIONS@
static CHARSET_INFO comp_cs[] = {
@CHARSET_COMP_CS_INIT@
};
CHARSET_INFO *default_charset_info = &comp_cs[0];
CHARSET_INFO *find_compiled_charset(uint8 cs_number)
{
uint i;
for (i = 0; i < array_elements(comp_cs); ++i)
if (comp_cs[i].number == cs_number)
return &comp_cs[i];
return NULL;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment