errmsg.h   errmsg.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
/* Error messages for MySQL clients */ /* Error messages for MySQL clients */
/* (Error messages for the daemon are in share/language/errmsg.sys) */ /* (Error messages for the daemon are in share/language/errmsg.sys) */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void init_client_errs(void); void init_client_errs(void);
void finish_client_errs(void);
extern const char *client_errors[]; /* Error messages */ extern const char *client_errors[]; /* Error messages */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#define CR_MIN_ERROR 2000 /* For easier client code */ #define CR_MIN_ERROR 2000 /* For easier client code */
#define CR_MAX_ERROR 2999 #define CR_MAX_ERROR 2999
#if defined(OS2) && defined(MYSQL_SERVER) #if defined(OS2) && defined(MYSQL_SERVER)
#define CER(X) client_errors[(X)-CR_MIN_ERROR] #define CER(X) client_errors[(X)-CR_MIN_ERROR]
#elif !defined(ER) #elif !defined(ER)
#define ER(X) client_errors[(X)-CR_MIN_ERROR] #define ER(X) client_errors[(X)-CR_MIN_ERROR]
#endif #endif
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ #define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
/* Do not add error numbers before CR_ERROR_FIRST. */
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
#define CR_UNKNOWN_ERROR 2000 #define CR_UNKNOWN_ERROR 2000
#define CR_SOCKET_CREATE_ERROR 2001 #define CR_SOCKET_CREATE_ERROR 2001
#define CR_CONNECTION_ERROR 2002 #define CR_CONNECTION_ERROR 2002
#define CR_CONN_HOST_ERROR 2003 #define CR_CONN_HOST_ERROR 2003
#define CR_IPSOCK_ERROR 2004 #define CR_IPSOCK_ERROR 2004
#define CR_UNKNOWN_HOST 2005 #define CR_UNKNOWN_HOST 2005
#define CR_SERVER_GONE_ERROR 2006 #define CR_SERVER_GONE_ERROR 2006
#define CR_VERSION_ERROR 2007 #define CR_VERSION_ERROR 2007
#define CR_OUT_OF_MEMORY 2008 #define CR_OUT_OF_MEMORY 2008
#define CR_WRONG_HOST_INFO 2009 #define CR_WRONG_HOST_INFO 2009
skipping to change at line 94 skipping to change at line 97
#define CR_SHARED_MEMORY_MAP_ERROR 2043 #define CR_SHARED_MEMORY_MAP_ERROR 2043
#define CR_SHARED_MEMORY_EVENT_ERROR 2044 #define CR_SHARED_MEMORY_EVENT_ERROR 2044
#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 #define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
#define CR_CONN_UNKNOW_PROTOCOL 2047 #define CR_CONN_UNKNOW_PROTOCOL 2047
#define CR_INVALID_CONN_HANDLE 2048 #define CR_INVALID_CONN_HANDLE 2048
#define CR_SECURE_AUTH 2049 #define CR_SECURE_AUTH 2049
#define CR_FETCH_CANCELED 2050 #define CR_FETCH_CANCELED 2050
#define CR_NO_DATA 2051 #define CR_NO_DATA 2051
#define CR_NO_STMT_METADATA 2052 #define CR_NO_STMT_METADATA 2052
#define CR_NO_RESULT_SET 2053
#define CR_NOT_IMPLEMENTED 2054
#define CR_SERVER_LOST_EXTENDED 2055
#define CR_ERROR_LAST /*Copy last error nr:*/ 2055
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
 End of changes. 4 change blocks. 
2 lines changed or deleted 5 lines changed or added


 keycache.h   keycache.h 
/* Copyright (C) 2003 MySQL AB /* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 48 skipping to change at line 47
#define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */ #define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */
/* /*
The key cache structure The key cache structure
It also contains read-only statistics parameters. It also contains read-only statistics parameters.
*/ */
typedef struct st_key_cache typedef struct st_key_cache
{ {
my_bool key_cache_inited; my_bool key_cache_inited;
my_bool in_resize; /* true during resize operation */
my_bool resize_in_flush; /* true during flush of resize operation */ my_bool resize_in_flush; /* true during flush of resize operation */
my_bool can_be_used; /* usage of cache for read/write is allowe d */ my_bool can_be_used; /* usage of cache for read/write is allowe d */
uint key_cache_shift; size_t key_cache_mem_size; /* specified size of the cache memory
ulong key_cache_mem_size; /* specified size of the cache memory */
*/
uint key_cache_block_size; /* size of the page buffer of a cache bloc k */ uint key_cache_block_size; /* size of the page buffer of a cache bloc k */
ulong min_warm_blocks; /* min number of warm blocks; */ ulong min_warm_blocks; /* min number of warm blocks; */
ulong age_threshold; /* age threshold for hot blocks */ ulong age_threshold; /* age threshold for hot blocks */
ulonglong keycache_time; /* total number of block link operations */ ulonglong keycache_time; /* total number of block link operations */
uint hash_entries; /* max number of entries in the hash table */ uint hash_entries; /* max number of entries in the hash table */
int hash_links; /* max number of hash links */ int hash_links; /* max number of hash links */
int hash_links_used; /* number of hash links currently used */ int hash_links_used; /* number of hash links currently used */
int disk_blocks; /* max number of blocks in the cache */ int disk_blocks; /* max number of blocks in the cache */
ulong blocks_used; /* maximum number of concurrently used blocks */ ulong blocks_used; /* maximum number of concurrently used blocks */
ulong blocks_unused; /* number of currently unused blocks */ ulong blocks_unused; /* number of currently unused blocks */
skipping to change at line 76 skipping to change at line 75
HASH_LINK **hash_root; /* arr. of entries into hash table buckets */ HASH_LINK **hash_root; /* arr. of entries into hash table buckets */
HASH_LINK *hash_link_root; /* memory for hash table links */ HASH_LINK *hash_link_root; /* memory for hash table links */
HASH_LINK *free_hash_list; /* list of free hash links */ HASH_LINK *free_hash_list; /* list of free hash links */
BLOCK_LINK *free_block_list; /* list of free blocks */ BLOCK_LINK *free_block_list; /* list of free blocks */
BLOCK_LINK *block_root; /* memory for block links */ BLOCK_LINK *block_root; /* memory for block links */
byte HUGE_PTR *block_mem; /* memory for block buffers */ byte HUGE_PTR *block_mem; /* memory for block buffers */
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */ BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */ BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
pthread_mutex_t cache_lock; /* to lock access to the cache structure */ pthread_mutex_t cache_lock; /* to lock access to the cache structure */
KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */ KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
/*
Waiting for a zero resize count. Using a queue for symmetry though
only one thread can wait here.
*/
KEYCACHE_WQUEUE waiting_for_resize_cnt;
KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */ KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */
KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free bloc k */ KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free bloc k */
BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file b l.*/ BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file b l.*/
BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash for other file b l.*/ BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash for other file b l.*/
/* /*
The following variables are and variables used to hold parameters for The following variables are and variables used to hold parameters for
initializing the key cache. initializing the key cache.
*/ */
skipping to change at line 106 skipping to change at line 110
ulonglong global_cache_read; /* number of reads from files to cache */ ulonglong global_cache_read; /* number of reads from files to cache */
int blocks; /* max number of blocks in the cache */ int blocks; /* max number of blocks in the cache */
my_bool in_init; /* Set to 1 in MySQL during init/resize */ my_bool in_init; /* Set to 1 in MySQL during init/resize */
} KEY_CACHE; } KEY_CACHE;
/* The default key cache */ /* The default key cache */
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache; extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
ulong use_mem, uint division_limit, size_t use_mem, uint division_limit,
uint age_threshold); uint age_threshold);
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
ulong use_mem, uint division_limit, size_t use_mem, uint division_limit,
uint age_threshold); uint age_threshold);
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit , extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit ,
uint age_threshold); uint age_threshold);
extern byte *key_cache_read(KEY_CACHE *keycache, extern byte *key_cache_read(KEY_CACHE *keycache,
File file, my_off_t filepos, int level, File file, my_off_t filepos, int level,
byte *buff, uint length, byte *buff, uint length,
uint block_length,int return_buffer); uint block_length,int return_buffer);
extern int key_cache_insert(KEY_CACHE *keycache, extern int key_cache_insert(KEY_CACHE *keycache,
File file, my_off_t filepos, int level, File file, my_off_t filepos, int level,
byte *buff, uint length); byte *buff, uint length);
extern int key_cache_write(KEY_CACHE *keycache, extern int key_cache_write(KEY_CACHE *keycache,
 End of changes. 6 change blocks. 
9 lines changed or deleted 13 lines changed or added


 m_ctype.h   m_ctype.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
/* /*
A better inplementation of the UNIX ctype(3) library. A better inplementation of the UNIX ctype(3) library.
Notes: my_global.h should be included before ctype.h Notes: my_global.h should be included before ctype.h
*/ */
#ifndef _m_ctype_h #ifndef _m_ctype_h
#define _m_ctype_h #define _m_ctype_h
#include <my_attribute.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define MY_CS_NAME_SIZE 32 #define MY_CS_NAME_SIZE 32
#define MY_CS_CTYPE_TABLE_SIZE 257 #define MY_CS_CTYPE_TABLE_SIZE 257
#define MY_CS_TO_LOWER_TABLE_SIZE 256 #define MY_CS_TO_LOWER_TABLE_SIZE 256
#define MY_CS_TO_UPPER_TABLE_SIZE 256 #define MY_CS_TO_UPPER_TABLE_SIZE 256
#define MY_CS_SORT_ORDER_TABLE_SIZE 256 #define MY_CS_SORT_ORDER_TABLE_SIZE 256
#define MY_CS_TO_UNI_TABLE_SIZE 256 #define MY_CS_TO_UNI_TABLE_SIZE 256
skipping to change at line 47 skipping to change at line 48
#define my_wc_t ulong #define my_wc_t ulong
typedef struct unicase_info_st typedef struct unicase_info_st
{ {
uint16 toupper; uint16 toupper;
uint16 tolower; uint16 tolower;
uint16 sort; uint16 sort;
} MY_UNICASE_INFO; } 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 */ /* wm_wc and wc_mb return codes */
#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ #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_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_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_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 */ #define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */
/* These following three are currently not really used */ /* 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_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_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 */ #define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */
skipping to change at line 75 skipping to change at line 79
#define MY_CS_CONFIG 2 /* sets that have a *.conf file */ #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_INDEX 4 /* sets listed in the Index file */
#define MY_CS_LOADED 8 /* sets that are currently loaded */ #define MY_CS_LOADED 8 /* sets that are currently loaded */
#define MY_CS_BINSORT 16 /* if binary sort order */ #define MY_CS_BINSORT 16 /* if binary sort order */
#define MY_CS_PRIMARY 32 /* if primary collation */ #define MY_CS_PRIMARY 32 /* if primary collation */
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ #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_UNICODE 128 /* is a charset is full unicode */
#define MY_CS_READY 256 /* if a charset is initialized */ #define MY_CS_READY 256 /* if a charset is initialized */
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */ #define MY_CS_CSSORT 1024 /* if case sensitive sort order */
#define MY_CS_PUREASCII 2048 /* if a charset is pure ascii */
#define MY_CHARSET_UNDEFINED 0 #define MY_CHARSET_UNDEFINED 0
/* Character repertoire flags */
#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F
*/
#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF
*/
#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF
*/
typedef struct my_uni_idx_st typedef struct my_uni_idx_st
{ {
uint16 from; uint16 from;
uint16 to; uint16 to;
uchar *tab; uchar *tab;
} MY_UNI_IDX; } MY_UNI_IDX;
typedef struct typedef struct
{ {
uint beg; uint beg;
uint end; uint end;
uint mblen; uint mb_len;
} my_match_t; } my_match_t;
enum my_lex_states enum my_lex_states
{ {
MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT,
MY_LEX_IDENT_SEP, MY_LEX_IDENT_START, MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
MY_LEX_REAL, MY_LEX_HEX_NUMBER, 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_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_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_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_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_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
MY_LEX_IDENT_OR_KEYWORD, MY_LEX_IDENT_OR_KEYWORD,
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR, MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
MY_LEX_STRING_OR_DELIMITER MY_LEX_STRING_OR_DELIMITER
}; };
skipping to change at line 117 skipping to change at line 127
struct charset_info_st; struct charset_info_st;
/* See strings/CHARSET_INFO.txt for information about this structure */ /* See strings/CHARSET_INFO.txt for information about this structure */
typedef struct my_collation_handler_st typedef struct my_collation_handler_st
{ {
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
/* Collation routines */ /* Collation routines */
int (*strnncoll)(struct charset_info_st *, int (*strnncoll)(struct charset_info_st *,
const uchar *, uint, const uchar *, uint, my_bool); const uchar *, uint, const uchar *, uint, my_bool);
int (*strnncollsp)(struct charset_info_st *, int (*strnncollsp)(struct charset_info_st *,
const uchar *, uint, const uchar *, uint); const uchar *, uint, const uchar *, uint,
my_bool diff_if_only_endspace_difference);
int (*strnxfrm)(struct charset_info_st *, int (*strnxfrm)(struct charset_info_st *,
uchar *, uint, const uchar *, uint); uchar *, uint, const uchar *, uint);
uint (*strnxfrmlen)(struct charset_info_st *, uint);
my_bool (*like_range)(struct charset_info_st *, my_bool (*like_range)(struct charset_info_st *,
const char *s, uint s_length, const char *s, uint s_length,
pchar w_prefix, pchar w_one, pchar w_many, pchar w_prefix, pchar w_one, pchar w_many,
uint res_length, uint res_length,
char *min_str, char *max_str, char *min_str, char *max_str,
uint *min_len, uint *max_len); uint *min_len, uint *max_len);
int (*wildcmp)(struct charset_info_st *, int (*wildcmp)(struct charset_info_st *,
const char *str,const char *str_end, const char *str,const char *str_end,
const char *wildstr,const char *wildend, const char *wildstr,const char *wildend,
int escape,int w_one, int w_many); int escape,int w_one, int w_many);
skipping to change at line 141 skipping to change at line 153
int (*strcasecmp)(struct charset_info_st *, const char *, const char *); int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
uint (*instr)(struct charset_info_st *, uint (*instr)(struct charset_info_st *,
const char *b, uint b_length, const char *b, uint b_length,
const char *s, uint s_length, const char *s, uint s_length,
my_match_t *match, uint nmatch); my_match_t *match, uint nmatch);
/* Hash calculation */ /* Hash calculation */
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len, void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
ulong *nr1, ulong *nr2); ulong *nr1, ulong *nr2);
my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint l en);
} MY_COLLATION_HANDLER; } MY_COLLATION_HANDLER;
extern MY_COLLATION_HANDLER my_collation_mb_bin_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_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
/* See strings/CHARSET_INFO.txt about information on this structure */ /* See strings/CHARSET_INFO.txt about information on this structure */
typedef struct my_charset_handler_st typedef struct my_charset_handler_st
{ {
skipping to change at line 170 skipping to change at line 183
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint lengt h); uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint lengt h);
uint (*numcells)(struct charset_info_st *, const char *b, const char * e); uint (*numcells)(struct charset_info_st *, const char *b, const char * e);
/* Unicode convertion */ /* Unicode convertion */
int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc, int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
const unsigned char *s,const unsigned char *e); const unsigned char *s,const unsigned char *e);
int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc, int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
unsigned char *s,unsigned char *e); unsigned char *s,unsigned char *e);
/* Functions for case and sort convertion */ /* Functions for case and sort convertion */
void (*caseup_str)(struct charset_info_st *, char *); uint (*caseup_str)(struct charset_info_st *, char *);
void (*casedn_str)(struct charset_info_st *, char *); uint (*casedn_str)(struct charset_info_st *, char *);
void (*caseup)(struct charset_info_st *, char *, uint); uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
void (*casedn)(struct charset_info_st *, char *, uint); char *dst, uint dstlen);
uint (*casedn)(struct charset_info_st *, char *src, uint srclen,
char *dst, uint dstlen);
/* Charset dependant snprintf() */ /* Charset dependant snprintf() */
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char * fmt, int (*snprintf)(struct charset_info_st *, char *to, uint n, const char * fmt,
...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5); ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5);
int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int rad ix, int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int rad ix,
long int val); long int val);
int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n, int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
int radix, longlong val); int radix, longlong val);
void (*fill)(struct charset_info_st *, char *to, uint len, int fill); void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
skipping to change at line 196 skipping to change at line 211
long (*strntol)(struct charset_info_st *, const char *s, uint l, long (*strntol)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err); int base, char **e, int *err);
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l, ulong (*strntoul)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err); int base, char **e, int *err);
longlong (*strntoll)(struct charset_info_st *, const char *s, uint l, longlong (*strntoll)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err); int base, char **e, int *err);
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l, ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err); int base, char **e, int *err);
double (*strntod)(struct charset_info_st *, char *s, uint l, char ** e, double (*strntod)(struct charset_info_st *, char *s, uint l, char ** e,
int *err); int *err);
longlong (*my_strtoll10)(struct charset_info_st *cs, longlong (*strtoll10)(struct charset_info_st *cs,
const char *nptr, char **endptr, int *error); const char *nptr, char **endptr, int *error);
ulonglong (*strntoull10rnd)(struct charset_info_st *cs,
const char *str, uint length, int unsigned_
fl,
char **endptr, int *error);
ulong (*scan)(struct charset_info_st *, const char *b, const char *e, ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
int sq); int sq);
} MY_CHARSET_HANDLER; } MY_CHARSET_HANDLER;
extern MY_CHARSET_HANDLER my_charset_8bit_handler; extern MY_CHARSET_HANDLER my_charset_8bit_handler;
extern MY_CHARSET_HANDLER my_charset_ucs2_handler; extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
/* See strings/CHARSET_INFO.txt about information on this structure */ /* See strings/CHARSET_INFO.txt about information on this structure */
typedef struct charset_info_st typedef struct charset_info_st
{ {
skipping to change at line 224 skipping to change at line 242
const char *comment; const char *comment;
const char *tailoring; const char *tailoring;
uchar *ctype; uchar *ctype;
uchar *to_lower; uchar *to_lower;
uchar *to_upper; uchar *to_upper;
uchar *sort_order; uchar *sort_order;
uint16 *contractions; uint16 *contractions;
uint16 **sort_order_big; uint16 **sort_order_big;
uint16 *tab_to_uni; uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni; MY_UNI_IDX *tab_from_uni;
MY_UNICASE_INFO **caseinfo;
uchar *state_map; uchar *state_map;
uchar *ident_map; uchar *ident_map;
uint strxfrm_multiply; uint strxfrm_multiply;
uchar caseup_multiply;
uchar casedn_multiply;
uint mbminlen; uint mbminlen;
uint mbmaxlen; uint mbmaxlen;
uint16 min_sort_char; uint16 min_sort_char;
uint16 max_sort_char; /* For LIKE optimization */ uint16 max_sort_char; /* For LIKE optimization */
uchar pad_char;
my_bool escape_with_backslash_is_dangerous; my_bool escape_with_backslash_is_dangerous;
MY_CHARSET_HANDLER *cset; MY_CHARSET_HANDLER *cset;
MY_COLLATION_HANDLER *coll; MY_COLLATION_HANDLER *coll;
} CHARSET_INFO; } CHARSET_INFO;
extern CHARSET_INFO my_charset_bin; extern CHARSET_INFO my_charset_bin;
extern CHARSET_INFO my_charset_big5_chinese_ci; extern CHARSET_INFO my_charset_big5_chinese_ci;
extern CHARSET_INFO my_charset_big5_bin; extern CHARSET_INFO my_charset_big5_bin;
extern CHARSET_INFO my_charset_cp932_japanese_ci; extern CHARSET_INFO my_charset_cp932_japanese_ci;
extern CHARSET_INFO my_charset_cp932_bin; 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_korean_ci;
extern CHARSET_INFO my_charset_euckr_bin; extern CHARSET_INFO my_charset_euckr_bin;
extern CHARSET_INFO my_charset_gb2312_chinese_ci; extern CHARSET_INFO my_charset_gb2312_chinese_ci;
extern CHARSET_INFO my_charset_gb2312_bin; extern CHARSET_INFO my_charset_gb2312_bin;
extern CHARSET_INFO my_charset_gbk_chinese_ci; extern CHARSET_INFO my_charset_gbk_chinese_ci;
extern CHARSET_INFO my_charset_gbk_bin; extern CHARSET_INFO my_charset_gbk_bin;
extern CHARSET_INFO my_charset_latin1; extern CHARSET_INFO my_charset_latin1;
extern CHARSET_INFO my_charset_latin1_german2_ci; extern CHARSET_INFO my_charset_latin1_german2_ci;
extern CHARSET_INFO my_charset_latin1_bin; extern CHARSET_INFO my_charset_latin1_bin;
extern CHARSET_INFO my_charset_latin2_czech_ci; extern CHARSET_INFO my_charset_latin2_czech_ci;
extern CHARSET_INFO my_charset_sjis_japanese_ci; extern CHARSET_INFO my_charset_sjis_japanese_ci;
extern CHARSET_INFO my_charset_sjis_bin; extern CHARSET_INFO my_charset_sjis_bin;
extern CHARSET_INFO my_charset_tis620_thai_ci; extern CHARSET_INFO my_charset_tis620_thai_ci;
extern CHARSET_INFO my_charset_tis620_bin; extern CHARSET_INFO my_charset_tis620_bin;
extern CHARSET_INFO my_charset_ucs2_general_ci; extern CHARSET_INFO my_charset_ucs2_general_ci;
extern CHARSET_INFO my_charset_ucs2_bin; extern CHARSET_INFO my_charset_ucs2_bin;
extern CHARSET_INFO my_charset_ucs2_general_uca; extern CHARSET_INFO my_charset_ucs2_unicode_ci;
extern CHARSET_INFO my_charset_ujis_japanese_ci; extern CHARSET_INFO my_charset_ujis_japanese_ci;
extern CHARSET_INFO my_charset_ujis_bin; extern CHARSET_INFO my_charset_ujis_bin;
extern CHARSET_INFO my_charset_utf8_general_ci; extern CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf8_unicode_ci;
extern CHARSET_INFO my_charset_utf8_bin; extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci; extern CHARSET_INFO my_charset_cp1250_czech_ci;
/* declarations for simple charsets */ /* declarations for simple charsets */
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar * , extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar * ,
uint); uint);
uint my_strnxfrmlen_simple(CHARSET_INFO *, uint);
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint, extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint, my_bool); const uchar *, uint, my_bool);
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint, extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint); const uchar *, uint,
my_bool diff_if_only_endspace_difference)
;
extern void my_hash_sort_simple(CHARSET_INFO *cs, extern void my_hash_sort_simple(CHARSET_INFO *cs,
const uchar *key, uint len, const uchar *key, uint len,
ulong *nr1, ulong *nr2); ulong *nr1, ulong *nr2);
extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length ); extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length );
extern uint my_instr_simple(struct charset_info_st *, extern uint my_instr_simple(struct charset_info_st *,
const char *b, uint b_length, const char *b, uint b_length,
const char *s, uint s_length, const char *s, uint s_length,
my_match_t *match, uint nmatch); my_match_t *match, uint nmatch);
/* Functions for 8bit */ /* Functions for 8bit */
extern void my_caseup_str_8bit(CHARSET_INFO *, char *); extern uint my_caseup_str_8bit(CHARSET_INFO *, char *);
extern void my_casedn_str_8bit(CHARSET_INFO *, char *); extern uint my_casedn_str_8bit(CHARSET_INFO *, char *);
extern void my_caseup_8bit(CHARSET_INFO *, char *, uint); extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen,
extern void my_casedn_8bit(CHARSET_INFO *, char *, uint); 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 * ); 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_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); 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); 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, int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
const char *fmt, ...) const char *fmt, ...)
skipping to change at line 323 skipping to change at line 352
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
long int val); long int val);
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
longlong val); longlong val);
longlong my_strtoll10_8bit(CHARSET_INFO *cs, longlong my_strtoll10_8bit(CHARSET_INFO *cs,
const char *nptr, char **endptr, int *error); const char *nptr, char **endptr, int *error);
longlong my_strtoll10_ucs2(CHARSET_INFO *cs, longlong my_strtoll10_ucs2(CHARSET_INFO *cs,
const char *nptr, char **endptr, int *error); const char *nptr, char **endptr, int *error);
ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs,
const char *str, uint length, int unsigned
_fl,
char **endptr, int *error);
ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs,
const char *str, uint length, int unsigned
_fl,
char **endptr, int *error);
void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill); void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
my_bool my_like_range_simple(CHARSET_INFO *cs, my_bool my_like_range_simple(CHARSET_INFO *cs,
const char *ptr, uint ptr_length, const char *ptr, uint ptr_length,
pbool escape, pbool w_one, pbool w_many, pbool escape, pbool w_one, pbool w_many,
uint res_length, uint res_length,
char *min_str, char *max_str, char *min_str, char *max_str,
uint *min_length, uint *max_length); uint *min_length, uint *max_length);
my_bool my_like_range_mb(CHARSET_INFO *cs, my_bool my_like_range_mb(CHARSET_INFO *cs,
skipping to change at line 364 skipping to change at line 400
int escape, int w_one, int w_many); int escape, int w_one, int w_many);
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); 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_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_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 my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
uint pos, int *error); uint pos, int *error);
int my_mbcharlen_8bit(CHARSET_INFO *, uint c); int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
/* Functions for multibyte charsets */ /* Functions for multibyte charsets */
extern void my_caseup_str_mb(CHARSET_INFO *, char *); extern uint my_caseup_str_mb(CHARSET_INFO *, char *);
extern void my_casedn_str_mb(CHARSET_INFO *, char *); extern uint my_casedn_str_mb(CHARSET_INFO *, char *);
extern void my_caseup_mb(CHARSET_INFO *, char *, uint); extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen,
extern void my_casedn_mb(CHARSET_INFO *, char *, uint); 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 *); extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
int my_wildcmp_mb(CHARSET_INFO *, int my_wildcmp_mb(CHARSET_INFO *,
const char *str,const char *str_end, const char *str,const char *str_end,
const char *wildstr,const char *wildend, const char *wildstr,const char *wildend,
int escape, int w_one, int w_many); int escape, int w_one, int w_many);
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); 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_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_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 my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
skipping to change at line 393 skipping to change at line 431
int my_wildcmp_unicode(CHARSET_INFO *cs, int my_wildcmp_unicode(CHARSET_INFO *cs,
const char *str, const char *str_end, const char *str, const char *str_end,
const char *wildstr, const char *wildend, const char *wildstr, const char *wildend,
int escape, int w_one, int w_many, int escape, int w_one, int w_many,
MY_UNICASE_INFO **weights); MY_UNICASE_INFO **weights);
extern my_bool my_parse_charset_xml(const char *bug, uint len, extern my_bool my_parse_charset_xml(const char *bug, uint len,
int (*add)(CHARSET_INFO *cs)); 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);
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
uint my_charset_repertoire(CHARSET_INFO *cs);
#define _MY_U 01 /* Upper case */ #define _MY_U 01 /* Upper case */
#define _MY_L 02 /* Lower case */ #define _MY_L 02 /* Lower case */
#define _MY_NMR 04 /* Numeral (digit) */ #define _MY_NMR 04 /* Numeral (digit) */
#define _MY_SPC 010 /* Spacing character */ #define _MY_SPC 010 /* Spacing character */
#define _MY_PNT 020 /* Punctuation */ #define _MY_PNT 020 /* Punctuation */
#define _MY_CTR 040 /* Control character */ #define _MY_CTR 040 /* Control character */
#define _MY_B 0100 /* Blank */ #define _MY_B 0100 /* Blank */
#define _MY_X 0200 /* heXadecimal digit */ #define _MY_X 0200 /* heXadecimal digit */
#define my_isascii(c) (!((c) & ~0177)) #define my_isascii(c) (!((c) & ~0177))
skipping to change at line 442 skipping to change at line 488
#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char *) (b), (const char *)(e), (num)) #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 use_mb(s) ((s)->cset->ismbchar != NULL)
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b))) #define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
#ifdef USE_MB #ifdef USE_MB
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a))) #define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
#else #else
#define my_mbcharlen(s, a) 1 #define my_mbcharlen(s, a) 1
#endif #endif
#define my_caseup(s, a, l) ((s)->cset->caseup((s), (a), (l)))
#define my_casedn(s, a, l) ((s)->cset->casedn((s), (a), (l)))
#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a))) #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_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_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_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_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_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))) #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 */ /* XXX: still need to take care of this one */
#ifdef MY_CHARSET_TIS620 #ifdef MY_CHARSET_TIS620
 End of changes. 26 change blocks. 
23 lines changed or deleted 74 lines changed or added


 m_string.h   m_string.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 91 skipping to change at line 90
# define bcopy(s, d, n) memcpy((d), (s), (n)) # define bcopy(s, d, n) memcpy((d), (s), (n))
# define bcmp(A,B,C) memcmp((A),(B),(C)) # define bcmp(A,B,C) memcmp((A),(B),(C))
# define bzero(A,B) memset((A),0,(B)) # define bzero(A,B) memset((A),0,(B))
# define bmove_align(A,B,C) memcpy((A),(B),(C)) # define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif #endif
#if defined(__cplusplus) && !defined(OS2) #if defined(__cplusplus) && !defined(OS2)
extern "C" { extern "C" {
#endif #endif
/*
my_str_malloc() and my_str_free() are assigned to implementations in
strings/alloc.c, but can be overridden in the calling program.
*/
extern void *(*my_str_malloc)(size_t);
extern void (*my_str_free)(void *);
#if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread) #if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread)
#define strmov(A,B) stpcpy((A),(B)) #define strmov(A,B) stpcpy((A),(B))
#ifndef stpcpy #ifndef stpcpy
extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 * / extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 * /
#endif #endif
#endif #endif
/* Declared in int2str() */ /* Declared in int2str() */
extern char NEAR _dig_vec_upper[]; extern char NEAR _dig_vec_upper[];
extern char NEAR _dig_vec_lower[]; extern char NEAR _dig_vec_lower[];
/* Defined in strtod.c */
extern const double log_10[309];
#ifdef BAD_STRING_COMPILER #ifdef BAD_STRING_COMPILER
#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1) #define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1)
#else #else
#define strmov_overlapp(A,B) strmov(A,B) #define strmov_overlapp(A,B) strmov(A,B)
#define strmake_overlapp(A,B,C) strmake(A,B,C) #define strmake_overlapp(A,B,C) strmake(A,B,C)
#endif #endif
#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */ #ifdef BAD_MEMCPY /* Problem with gcc on Alpha */
#define memcpy_fixed(A,B,C) bmove((A),(B),(C)) #define memcpy_fixed(A,B,C) bmove((A),(B),(C))
#else #else
skipping to change at line 213 skipping to change at line 222
extern char *strstr(const char *, const char *); extern char *strstr(const char *, const char *);
#endif #endif
#endif #endif
extern int is_prefix(const char *, const char *); extern int is_prefix(const char *, const char *);
/* Conversion routines */ /* Conversion routines */
double my_strtod(const char *str, char **end, int *error); double my_strtod(const char *str, char **end, int *error);
double my_atof(const char *nptr); double my_atof(const char *nptr);
extern char *llstr(longlong value,char *buff); extern char *llstr(longlong value,char *buff);
extern char *ullstr(longlong value,char *buff);
#ifndef HAVE_STRTOUL #ifndef HAVE_STRTOUL
extern long strtol(const char *str, char **ptr, int base); extern long strtol(const char *str, char **ptr, int base);
extern ulong strtoul(const char *str, char **ptr, int base); extern ulong strtoul(const char *str, char **ptr, int base);
#endif #endif
extern char *int2str(long val, char *dst, int radix, int upcase); extern char *int2str(long val, char *dst, int radix, int upcase);
extern char *int10_to_str(long val,char *dst,int radix); extern char *int10_to_str(long val,char *dst,int radix);
extern char *str2int(const char *src,int radix,long lower,long upper, extern char *str2int(const char *src,int radix,long lower,long upper,
long *val); long *val);
longlong my_strtoll10(const char *nptr, char **endptr, int *error); longlong my_strtoll10(const char *nptr, char **endptr, int *error);
 End of changes. 4 change blocks. 
2 lines changed or deleted 12 lines changed or added


 my_alloc.h   my_alloc.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
 End of changes. 1 change blocks. 
2 lines changed or deleted 1 lines changed or added


 my_config.h   my_config.h 
/* config.h. Generated by configure. */ /* include/config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.in by autoheader. */ /* config.h.in. Generated from configure.in by autoheader. */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* Support big tables */ /* Support big tables */
/* #undef BIG_TABLES */ /* #undef BIG_TABLES */
/* Whether features provided by the user community should be included */
/* #undef COMMUNITY_SERVER */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those syste ms. systems. This function is required for `alloca.c' support on those syste ms.
*/ */
/* #undef CRAY_STACKSEG_END */ /* #undef CRAY_STACKSEG_END */
/* Define to 1 if using `alloca.c'. */ /* Define to 1 if using `alloca.c'. */
/* #undef C_ALLOCA */ /* #undef C_ALLOCA */
/* Don't use libdbug */
#define DBUG_OFF 1
/* Use libdbug */
/* #undef DBUG_ON */
/* all charsets are available */ /* all charsets are available */
/* #undef DEFINE_ALL_CHARACTER_SETS */ /* #undef DEFINE_ALL_CHARACTER_SETS */
/* Disables the use of --init-file, --skip-grant-tables and --bootstrap
options */
/* #undef DISABLE_GRANT_OPTIONS */
/* Version of .frm files */ /* Version of .frm files */
#define DOT_FRM_VERSION 6 #define DOT_FRM_VERSION 6
/* If LOAD DATA LOCAL INFILE should be enabled by default */ /* If LOAD DATA LOCAL INFILE should be enabled by default */
/* #undef ENABLED_LOCAL_INFILE */ /* #undef ENABLED_LOCAL_INFILE */
/* If SHOW PROFILE should be enabled */
/* #undef ENABLED_PROFILING */
/* Do we have FIONREAD */ /* Do we have FIONREAD */
#define FIONREAD_IN_SYS_IOCTL 1 #define FIONREAD_IN_SYS_IOCTL 1
/* READLINE: your system defines TIOCGWINSZ in sys/ioctl.h. */ /* READLINE: your system defines TIOCGWINSZ in sys/ioctl.h. */
#define GWINSZ_IN_SYS_IOCTL 1 #define GWINSZ_IN_SYS_IOCTL 1
/* Define to 1 if you have the `alarm' function. */ /* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1 #define HAVE_ALARM 1
/* Define to 1 if you have `alloca', as a function or macro. */ /* Define to 1 if you have `alloca', as a function or macro. */
skipping to change at line 73 skipping to change at line 92
/* Builds Blackhole Storage Engine */ /* Builds Blackhole Storage Engine */
/* #undef HAVE_BLACKHOLE_DB */ /* #undef HAVE_BLACKHOLE_DB */
/* Define to 1 if you have the `bmove' function. */ /* Define to 1 if you have the `bmove' function. */
/* #undef HAVE_BMOVE */ /* #undef HAVE_BMOVE */
/* bool is not defined by all C++ compilators */ /* bool is not defined by all C++ compilators */
#define HAVE_BOOL 1 #define HAVE_BOOL 1
/* Define to 1 if isinf() uses 80-bit register for intermediate values */
/* #undef HAVE_BROKEN_ISINF */
/* Can netinet be included */ /* Can netinet be included */
/* #undef HAVE_BROKEN_NETINET_INCLUDES */ /* #undef HAVE_BROKEN_NETINET_INCLUDES */
/* BSD style signals */ /* BSD style signals */
/* #undef HAVE_BSD_SIGNALS */ /* #undef HAVE_BSD_SIGNALS */
/* Define to 1 if you have the `bzero' function. */ /* Define to 1 if you have the `bzero' function. */
#define HAVE_BZERO 1 #define HAVE_BZERO 1
/* Define to enable charset armscii8 */ /* Define to enable charset armscii8 */
skipping to change at line 118 skipping to change at line 140
/* Define to enable charset cp866 */ /* Define to enable charset cp866 */
/* #undef HAVE_CHARSET_cp866 */ /* #undef HAVE_CHARSET_cp866 */
/* Define to enable charset cp932 */ /* Define to enable charset cp932 */
/* #undef HAVE_CHARSET_cp932 */ /* #undef HAVE_CHARSET_cp932 */
/* Define to enable charset dec8 */ /* Define to enable charset dec8 */
/* #undef HAVE_CHARSET_dec8 */ /* #undef HAVE_CHARSET_dec8 */
/* Define to enable charset eucjpms */
/* #undef HAVE_CHARSET_eucjpms */
/* Define to enable charset euckr */ /* Define to enable charset euckr */
/* #undef HAVE_CHARSET_euckr */ /* #undef HAVE_CHARSET_euckr */
/* Define to enable charset gb2312 */ /* Define to enable charset gb2312 */
/* #undef HAVE_CHARSET_gb2312 */ /* #undef HAVE_CHARSET_gb2312 */
/* Define to enable charset gbk */ /* Define to enable charset gbk */
/* #undef HAVE_CHARSET_gbk */ /* #undef HAVE_CHARSET_gbk */
/* Define to enable charset geostd8 */ /* Define to enable charset geostd8 */
skipping to change at line 212 skipping to change at line 237
/* Define to 1 if you have the <curses.h> header file. */ /* Define to 1 if you have the <curses.h> header file. */
#define HAVE_CURSES_H 1 #define HAVE_CURSES_H 1
/* Define to 1 if you have the `cuserid' function. */ /* Define to 1 if you have the `cuserid' function. */
#define HAVE_CUSERID 1 #define HAVE_CUSERID 1
/* Define to 1 if you have the declaration of `madvise', and to 0 if you /* Define to 1 if you have the declaration of `madvise', and to 0 if you
don't. */ don't. */
#define HAVE_DECL_MADVISE 1 #define HAVE_DECL_MADVISE 1
/* Define to 1 if you have the declaration of `SHM_HUGETLB', and to 0 if yo
u
don't. */
#define HAVE_DECL_SHM_HUGETLB 1
/* Define to 1 if you have the declaration of `tgoto', and to 0 if you don'
t.
*/
#define HAVE_DECL_TGOTO 1
/* Whether we are using DEC threads */ /* Whether we are using DEC threads */
/* #undef HAVE_DEC_THREADS */ /* #undef HAVE_DEC_THREADS */
/* Define to 1 if you have the <dirent.h> header file. */ /* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1 #define HAVE_DIRENT_H 1
/* Define to 1 if you have the `dlerror' function. */ /* Define to 1 if you have the `dlerror' function. */
#define HAVE_DLERROR 1 #define HAVE_DLERROR 1
/* Define to 1 if you have the <dlfcn.h> header file. */ /* Define to 1 if you have the <dlfcn.h> header file. */
skipping to change at line 236 skipping to change at line 269
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */ /* #undef HAVE_DOPRNT */
/* Access checks in embedded library */ /* Access checks in embedded library */
/* #undef HAVE_EMBEDDED_PRIVILEGE_CONTROL */ /* #undef HAVE_EMBEDDED_PRIVILEGE_CONTROL */
/* Builds Example DB */ /* Builds Example DB */
/* #undef HAVE_EXAMPLE_DB */ /* #undef HAVE_EXAMPLE_DB */
/* Defined by configure. Use explicit template instantiation. */
#define HAVE_EXPLICIT_TEMPLATE_INSTANTIATION 1
/* Define to 1 if you have the `fchmod' function. */ /* Define to 1 if you have the `fchmod' function. */
#define HAVE_FCHMOD 1 #define HAVE_FCHMOD 1
/* Define to 1 if you have the `fcntl' function. */ /* Define to 1 if you have the `fcntl' function. */
#define HAVE_FCNTL 1 #define HAVE_FCNTL 1
/* Define to 1 if you have the <fcntl.h> header file. */ /* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1 #define HAVE_FCNTL_H 1
/* Define to 1 if you have the `fconvert' function. */ /* Define to 1 if you have the `fconvert' function. */
/* #undef HAVE_FCONVERT */ /* #undef HAVE_FCONVERT */
/* Define to 1 if you have the `fdatasync' function. */ /* Define to 1 if you have the `fdatasync' function. */
#define HAVE_FDATASYNC 1 #define HAVE_FDATASYNC 1
/* Define to enable Federated Handler */
/* #undef HAVE_FEDERATED_DB */
/* Define to 1 if you have the <fenv.h> header file. */
#define HAVE_FENV_H 1
/* Define to 1 if you have the `fesetround' function. */
#define HAVE_FESETROUND 1
/* Define to 1 if you have the `fgetln' function. */ /* Define to 1 if you have the `fgetln' function. */
/* #undef HAVE_FGETLN */ /* #undef HAVE_FGETLN */
/* Define to 1 if you have the `finite' function. */ /* Define to 1 if you have the `finite' function. */
#define HAVE_FINITE 1 #define HAVE_FINITE 1
/* Define to 1 if you have the <floatingpoint.h> header file. */ /* Define to 1 if you have the <floatingpoint.h> header file. */
/* #undef HAVE_FLOATINGPOINT_H */ /* #undef HAVE_FLOATINGPOINT_H */
/* Define to 1 if you have the <float.h> header file. */ /* Define to 1 if you have the <float.h> header file. */
skipping to change at line 357 skipping to change at line 402
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
/* whether int8, int16 and int32 types exist */ /* whether int8, int16 and int32 types exist */
/* #undef HAVE_INT_8_16_32 */ /* #undef HAVE_INT_8_16_32 */
/* system headers define in_addr_t */ /* system headers define in_addr_t */
#define HAVE_IN_ADDR_T 1 #define HAVE_IN_ADDR_T 1
/* Using old ISAM tables */
/* #undef HAVE_ISAM */
/* isinf() macro or function */ /* isinf() macro or function */
#define HAVE_ISINF 1 #define HAVE_ISINF 1
/* Define to 1 if you have the `isnan' function. */ /* Define to 1 if you have the `isnan' function. */
#define HAVE_ISNAN 1 #define HAVE_ISNAN 1
/* Define to 1 if you have the `issetugid' function. */ /* Define to 1 if you have the `issetugid' function. */
/* #undef HAVE_ISSETUGID */ /* #undef HAVE_ISSETUGID */
/* Define if mysql_cv_langinfo_codeset=yes */
#define HAVE_LANGINFO_CODESET /**/
/* Define to 1 if you have the <langinfo.h> header file. */
#define HAVE_LANGINFO_H 1
/* Define if you have large pages support */
#define HAVE_LARGE_PAGES 1
/* Define to 1 if you have the `bind' library (-lbind). */ /* Define to 1 if you have the `bind' library (-lbind). */
/* #undef HAVE_LIBBIND */ /* #undef HAVE_LIBBIND */
/* Define to 1 if you have the `compat' library (-lcompat). */ /* Define to 1 if you have the `compat' library (-lcompat). */
/* #undef HAVE_LIBCOMPAT */ /* #undef HAVE_LIBCOMPAT */
/* Define to 1 if you have the `c_r' library (-lc_r). */ /* Define to 1 if you have the `c_r' library (-lc_r). */
/* #undef HAVE_LIBC_R */ /* #undef HAVE_LIBC_R */
/* Define to 1 if you have the `dl' library (-ldl). */ /* Define to 1 if you have the `dl' library (-ldl). */
skipping to change at line 441 skipping to change at line 492
/* Define to 1 if you have the `madvise' function. */ /* Define to 1 if you have the `madvise' function. */
#define HAVE_MADVISE 1 #define HAVE_MADVISE 1
/* Define to 1 if you have the `mallinfo' function. */ /* Define to 1 if you have the `mallinfo' function. */
#define HAVE_MALLINFO 1 #define HAVE_MALLINFO 1
/* Define to 1 if you have the <malloc.h> header file. */ /* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1 #define HAVE_MALLOC_H 1
/* Define if you have mbrlen */
#define HAVE_MBRLEN /**/
/* Define if you have mbrtowc */
#define HAVE_MBRTOWC /**/
/* Define if you have mbsrtowcs */
#define HAVE_MBSRTOWCS /**/
/* Define if mysql_cv_have_mbstate_t=yes */
#define HAVE_MBSTATE_T /**/
/* Define to 1 if you have the `memcpy' function. */ /* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
/* Define to 1 if you have the `memmove' function. */ /* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1 #define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mkstemp' function. */ /* Define to 1 if you have the `mkstemp' function. */
#define HAVE_MKSTEMP 1 #define HAVE_MKSTEMP 1
/* Define to 1 if you have the `mlockall' function. */ /* Define to 1 if you have the `mlockall' function. */
#define HAVE_MLOCKALL 1 #define HAVE_MLOCKALL 1
/* Define to 1 if you have a working `mmap' system call. */ /* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1 #define HAVE_MMAP 1
/* Using Ndb Cluster DB */ /* Using Ndb Cluster DB */
/* #undef HAVE_NDBCLUSTER_DB */ /* #undef HAVE_NDBCLUSTER_DB */
/* Define to 1 if you have the <ndir.h> header file. */ /* Define to 1 if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */ /* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <netinet/in.h> header file. */ /* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1 #define HAVE_NETINET_IN_H 1
skipping to change at line 483 skipping to change at line 546
/* sigwait with one argument */ /* sigwait with one argument */
/* #undef HAVE_NONPOSIX_SIGWAIT */ /* #undef HAVE_NONPOSIX_SIGWAIT */
/* NPTL threads implementation */ /* NPTL threads implementation */
#define HAVE_NPTL 1 #define HAVE_NPTL 1
/* Define to 1 if the system has the type `off_t'. */ /* Define to 1 if the system has the type `off_t'. */
#define HAVE_OFF_T 1 #define HAVE_OFF_T 1
/* OpenSSL */ /* Defined by configure. Using yaSSL for OpenSSL emulation. */
/* #undef HAVE_OPENSSL */ /* #undef HAVE_OPENSSL */
/* ORBIT */
/* #undef HAVE_ORBIT */
/* Define to 1 if you have the <paths.h> header file. */ /* Define to 1 if you have the <paths.h> header file. */
#define HAVE_PATHS_H 1 #define HAVE_PATHS_H 1
/* Define to 1 if you have the `perror' function. */ /* Define to 1 if you have the `perror' function. */
#define HAVE_PERROR 1 #define HAVE_PERROR 1
/* Define to 1 if you have the `poll' function. */ /* Define to 1 if you have the `poll' function. */
#define HAVE_POLL 1 #define HAVE_POLL 1
/* Signal handling is POSIX (sigset/sighold, etc) */ /* Signal handling is POSIX (sigset/sighold, etc) */
skipping to change at line 713 skipping to change at line 773
/* Define to 1 if you have the `strlcpy' function. */ /* Define to 1 if you have the `strlcpy' function. */
/* #undef HAVE_STRLCPY */ /* #undef HAVE_STRLCPY */
/* Define to 1 if you have the `strnlen' function. */ /* Define to 1 if you have the `strnlen' function. */
#define HAVE_STRNLEN 1 #define HAVE_STRNLEN 1
/* Define to 1 if you have the `strpbrk' function. */ /* Define to 1 if you have the `strpbrk' function. */
#define HAVE_STRPBRK 1 #define HAVE_STRPBRK 1
/* Define to 1 if you have the `strsignal' function. */
#define HAVE_STRSIGNAL 1
/* Define to 1 if you have the `strstr' function. */ /* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
/* Define to 1 if you have the `strtok_r' function. */ /* Define to 1 if you have the `strtok_r' function. */
#define HAVE_STRTOK_R 1 #define HAVE_STRTOK_R 1
/* Define to 1 if you have the `strtol' function. */ /* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
/* Define to 1 if you have the `strtoll' function. */ /* Define to 1 if you have the `strtoll' function. */
skipping to change at line 753 skipping to change at line 816
/* Define to 1 if you have the <sys/dir.h> header file. */ /* Define to 1 if you have the <sys/dir.h> header file. */
#define HAVE_SYS_DIR_H 1 #define HAVE_SYS_DIR_H 1
/* Define to 1 if you have the <sys/file.h> header file. */ /* Define to 1 if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1 #define HAVE_SYS_FILE_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */ /* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/ipc.h> header file. */
#define HAVE_SYS_IPC_H 1
/* Define to 1 if you have the <sys/malloc.h> header file. */ /* Define to 1 if you have the <sys/malloc.h> header file. */
/* #undef HAVE_SYS_MALLOC_H */ /* #undef HAVE_SYS_MALLOC_H */
/* Define to 1 if you have the <sys/mman.h> header file. */ /* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1 #define HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/ndir.h> header file. */ /* Define to 1 if you have the <sys/ndir.h> header file. */
/* #undef HAVE_SYS_NDIR_H */ /* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */ /* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/prctl.h> header file. */
#define HAVE_SYS_PRCTL_H 1
/* Define to 1 if you have the <sys/ptem.h> header file. */ /* Define to 1 if you have the <sys/ptem.h> header file. */
/* #undef HAVE_SYS_PTEM_H */ /* #undef HAVE_SYS_PTEM_H */
/* Define to 1 if you have the <sys/pte.h> header file. */ /* Define to 1 if you have the <sys/pte.h> header file. */
/* #undef HAVE_SYS_PTE_H */ /* #undef HAVE_SYS_PTE_H */
/* Define to 1 if you have the <sys/resource.h> header file. */ /* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1 #define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/select.h> header file. */ /* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/shm.h> header file. */
#define HAVE_SYS_SHM_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */ /* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1 #define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */ /* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1 #define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/stream.h> header file. */ /* Define to 1 if you have the <sys/stream.h> header file. */
/* #undef HAVE_SYS_STREAM_H */ /* #undef HAVE_SYS_STREAM_H */
/* Define to 1 if you have the <sys/timeb.h> header file. */ /* Define to 1 if you have the <sys/timeb.h> header file. */
skipping to change at line 876 skipping to change at line 948
/* Define to 1 if the system has the type `u_int32_t'. */ /* Define to 1 if the system has the type `u_int32_t'. */
#define HAVE_U_INT32_T 1 #define HAVE_U_INT32_T 1
/* Define to 1 if you have the <varargs.h> header file. */ /* Define to 1 if you have the <varargs.h> header file. */
/* #undef HAVE_VARARGS_H */ /* #undef HAVE_VARARGS_H */
/* Define to 1 if you have the `vidattr' function. */ /* Define to 1 if you have the `vidattr' function. */
/* #undef HAVE_VIDATTR */ /* #undef HAVE_VIDATTR */
/* Virtual IO */ /* Define to enable buffered read. This works only if syscalls read/recv
/* #undef HAVE_VIO */ return as soon as there is some data in the kernel buffer, no matter how
big the given buffer is. */
#define HAVE_VIO_READ_BUFF 1
/* Found vis.h and the strvis() function */ /* Found vis.h and the strvis() function */
/* #undef HAVE_VIS_H */ /* #undef HAVE_VIS_H */
/* Define to 1 if you have the `vprintf' function. */ /* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1 #define HAVE_VPRINTF 1
/* Do we use user level threads */ /* Define to 1 if you have the <wchar.h> header file. */
/* #undef HAVE_mit_thread */ #define HAVE_WCHAR_H 1
/* Define if you check wcsdup */
#define HAVE_WCSDUP /**/
/* Define if you have wctomb */
#define HAVE_WCTOMB /**/
/* Define to 1 if you have the <wctype.h> header file. */
#define HAVE_WCTYPE_H 1
/* Define if you have wcwidth */
#define HAVE_WCWIDTH /**/
/* Defined by configure. Using yaSSL for OpenSSL emulation. */
/* #undef HAVE_YASSL */
/* Define if /proc/meminfo shows the huge page size (Linux only) */
#define HUGETLB_USE_PROC_MEMINFO 1
/* Define if you have -lwrap */ /* Define if you have -lwrap */
/* #undef LIBWRAP */ /* #undef LIBWRAP */
/* Machine type name, eg sun10 */ /* Define to the sub-directory in which libtool stores uninstalled librarie
s.
*/
#define LT_OBJDIR ".libs/"
/* Machine type name, eg sparc */
#define MACHINE_TYPE "i686" #define MACHINE_TYPE "i686"
/* Maximum number of indexes per table */
#define MAX_INDEXES 64
/* Define the default charset name */ /* Define the default charset name */
#define MYSQL_DEFAULT_CHARSET_NAME "latin1" #define MYSQL_DEFAULT_CHARSET_NAME "latin1"
/* Define the default charset name */ /* Define the default charset name */
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" #define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
/* Including Ndb Cluster DB sci transporter */ /* Including Ndb Cluster DB sci transporter */
/* #undef NDB_SCI_TRANSPORTER */ /* #undef NDB_SCI_TRANSPORTER */
/* Including Ndb Cluster DB shared memory transporter */ /* Including Ndb Cluster DB shared memory transporter */
/* #undef NDB_SHM_TRANSPORTER */ /* #undef NDB_SHM_TRANSPORTER */
/* NDB build version */ /* NDB build version */
#define NDB_VERSION_BUILD 22 #define NDB_VERSION_BUILD 89
/* NDB major version */ /* NDB major version */
#define NDB_VERSION_MAJOR 4 #define NDB_VERSION_MAJOR 5
/* NDB minor version */ /* NDB minor version */
#define NDB_VERSION_MINOR 1 #define NDB_VERSION_MINOR 0
/* NDB status version */ /* NDB status version */
#define NDB_VERSION_STATUS "" #define NDB_VERSION_STATUS ""
/* Name of package */ /* Name of package */
#define PACKAGE "mysql" #define PACKAGE "mysql"
/* Define to the address where bug reports for this package should be sent. */ /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "" #define PACKAGE_BUGREPORT ""
skipping to change at line 948 skipping to change at line 1047
/* qsort returns void */ /* qsort returns void */
#define QSORT_TYPE_IS_VOID 1 #define QSORT_TYPE_IS_VOID 1
/* The return type of qsort (int or void). */ /* The return type of qsort (int or void). */
#define RETQSORTTYPE void #define RETQSORTTYPE void
/* Define as the return type of signal handlers (`int' or `void'). */ /* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void #define RETSIGTYPE void
/* The size of a `char', as computed by sizeof. */ /* The size of `char', as computed by sizeof. */
#define SIZEOF_CHAR 1 #define SIZEOF_CHAR 1
/* The size of a `char*', as computed by sizeof. */ /* The size of `char*', as computed by sizeof. */
#define SIZEOF_CHARP 4 #define SIZEOF_CHARP 4
/* The size of a `int', as computed by sizeof. */ /* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4 #define SIZEOF_INT 4
/* The size of a `long', as computed by sizeof. */ /* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4 #define SIZEOF_LONG 4
/* The size of a `long long', as computed by sizeof. */ /* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8 #define SIZEOF_LONG_LONG 8
/* */ /* */
#define SIZEOF_OFF_T 8 #define SIZEOF_OFF_T 8
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The base type of the last arg to accept */ /* The base type of the last arg to accept */
#define SOCKET_SIZE_TYPE socklen_t #define SOCKET_SIZE_TYPE socklen_t
/* Last argument to get/setsockopt */ /* Last argument to get/setsockopt */
/* #undef SOCKOPT_OPTLEN_TYPE */ /* #undef SOCKOPT_OPTLEN_TYPE */
/* Broken sprintf */ /* Broken sprintf */
/* #undef SPRINTF_RETURNS_GARBAGE */ /* #undef SPRINTF_RETURNS_GARBAGE */
/* POSIX sprintf */ /* POSIX sprintf */
#define SPRINTF_RETURNS_INT 1 #define SPRINTF_RETURNS_INT 1
/* Broken sprintf */ /* Broken sprintf */
/* #undef SPRINTF_RETURNS_PTR */ /* #undef SPRINTF_RETURNS_PTR */
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
automatically deduced at run-time. automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */ STACK_DIRECTION = 0 => direction of growth unknown */
#define STACK_DIRECTION -1 #define STACK_DIRECTION -1
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ /* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */ /* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* d_ino member present in struct dirent */ /* d_ino member present in struct dirent */
#define STRUCT_DIRENT_HAS_D_INO 1 #define STRUCT_DIRENT_HAS_D_INO 1
/* d_namlen member present in struct dirent */ /* d_namlen member present in struct dirent */
/* #undef STRUCT_DIRENT_HAS_D_NAMLEN */ /* #undef STRUCT_DIRENT_HAS_D_NAMLEN */
/* The struct rlimit type to use with setrlimit */ /* The struct rlimit type to use with setrlimit */
#define STRUCT_RLIMIT struct rlimit #define STRUCT_RLIMIT struct rlimit
/* Name of system, eg solaris */ /* Name of system, eg sun-solaris */
#define SYSTEM_TYPE "pc-linux-gnu" #define SYSTEM_TYPE "pc-linux-gnu"
/* Whether we build for Linux */ /* Whether we build for Linux */
#define TARGET_OS_LINUX 1 #define TARGET_OS_LINUX 1
/* Define if you want to have threaded code. This may be undef on client co de /* Define if you want to have threaded code. This may be undef on client co de
*/ */
#define THREAD 1 #define THREAD 1
/* Should be client be thread safe */ /* Should be client be thread safe */
/* #undef THREAD_SAFE_CLIENT */ /* #undef THREAD_SAFE_CLIENT */
/* Define to 1 if time_t is unsigned */
/* #undef TIME_T_UNSIGNED */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1 #define TIME_WITH_SYS_TIME 1
/* declaration of TIOCSTAT in sys/ioctl.h */ /* declaration of TIOCSTAT in sys/ioctl.h */
/* #undef TIOCSTAT_IN_SYS_IOCTL */ /* #undef TIOCSTAT_IN_SYS_IOCTL */
/* Define to 1 if your <sys/time.h> declares `struct tm'. */ /* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */ /* #undef TM_IN_SYS_TIME */
/* used libedit interface (can we dereference result of /* used libedit interface (can we dereference result of
rl_completion_entry_function) */ rl_completion_entry_function) */
#define USE_LIBEDIT_INTERFACE 1 #define USE_LIBEDIT_INTERFACE 1
/* Use multi-byte character routines */ /* Use multi-byte character routines */
#define USE_MB 1 #define USE_MB 1
/* */ /* */
#define USE_MB_IDENT 1 #define USE_MB_IDENT 1
/* Needs to use mysys_new helpers */
/* #undef USE_MYSYS_NEW */
/* used new readline interface (are rl_completion_func_t and /* used new readline interface (are rl_completion_func_t and
rl_compentry_func_t defined) */ rl_compentry_func_t defined) */
/* #undef USE_NEW_READLINE_INTERFACE */ /* #undef USE_NEW_READLINE_INTERFACE */
/* the pstack backtrace library */ /* the pstack backtrace library */
/* #undef USE_PSTACK */ /* #undef USE_PSTACK */
/* Use MySQL RAID */
/* #undef USE_RAID */
/* Version number of package */ /* Version number of package */
#define VERSION "4.1.22" #define VERSION "5.0.89"
/* sighandler type is void (*signal ()) (); */ /* sighandler type is void (*signal ()) (); */
#define VOID_SIGHANDLER 1 #define VOID_SIGHANDLER 1
/* Define to 1 if your processor stores words with the most significant byt /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
e significant byte first (like Motorola and SPARC, unlike Intel). */
first (like Motorola and SPARC, unlike Intel and VAX). */ #if defined AC_APPLE_UNIVERSAL_BUILD
/* #undef WORDS_BIGENDIAN */ # if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Number of bits in a file offset, on hosts where this is settable. */ /* Number of bits in a file offset, on hosts where this is settable. */
#define _FILE_OFFSET_BITS 64 #define _FILE_OFFSET_BITS 64
/* makes fseeko etc. visible, on some hosts. */ /* makes fseeko etc. visible, on some hosts. */
#define _LARGEFILE_SOURCE 1 #define _LARGEFILE_SOURCE 1
/* Large files support on AIX-style hosts. */ /* Large files support on AIX-style hosts. */
/* #undef _LARGE_FILES */ /* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */ /* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler /* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */ calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus #ifndef __cplusplus
/* #undef inline */ /* #undef inline */
#endif #endif
/* Define to `long' if <sys/types.h> does not define. */ /* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */ /* #undef off_t */
/* Define to `unsigned' if <sys/types.h> does not define. */ /* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */ /* #undef size_t */
 End of changes. 43 change blocks. 
34 lines changed or deleted 149 lines changed or added


 my_dbug.h   my_dbug.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
#ifndef _dbug_h #ifndef _dbug_h
#define _dbug_h #define _dbug_h
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if !defined(DBUG_OFF) && !defined(_lint) #if !defined(DBUG_OFF) && !defined(_lint)
extern int _db_on_,_no_db_; struct _db_code_state_;
extern FILE *_db_fp_; extern int _db_keyword_(struct _db_code_state_ *cs, const char *keyword);
extern char *_db_process_; extern int _db_strict_keyword_(const char *keyword);
extern int _db_keyword_(const char *keyword); extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len)
;
extern int _db_explain_init_(char *buf, size_t len);
extern void _db_setjmp_(void); extern void _db_setjmp_(void);
extern void _db_longjmp_(void); extern void _db_longjmp_(void);
extern void _db_process_(const char *name);
extern void _db_push_(const char *control); extern void _db_push_(const char *control);
extern void _db_pop_(void); extern void _db_pop_(void);
extern void _db_set_(struct _db_code_state_ *cs, const char *control);
extern void _db_set_init_(const char *control);
extern void _db_enter_(const char *_func_,const char *_file_,uint _line_, extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
const char **_sfunc_,const char **_sfile_, const char **_sfunc_,const char **_sfile_,
uint *_slevel_, char ***); uint *_slevel_, char ***);
extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfil e_, extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfil e_,
uint *_slevel_); uint *_slevel_);
extern void _db_pargs_(uint _line_,const char *keyword); extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ _VARARGS((const char *format,...)); extern void _db_doprnt_ _VARARGS((const char *format,...))
extern void _db_dump_(uint _line_,const char *keyword,const char *memory, ATTRIBUTE_FORMAT(printf, 1, 2);
uint length); extern void _db_dump_(uint _line_,const char *keyword,
extern void _db_output_(); const unsigned char *memory, size_t length);
extern void _db_lock_file(); extern void _db_end_(void);
extern void _db_unlock_file(); extern void _db_lock_file_(void);
extern void _db_unlock_file_(void);
extern FILE *_db_fp_(void);
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \ #define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
char **_db_framep_; \ char **_db_framep_; \
_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \ _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
&_db_framep_) &_db_framep_)
#define DBUG_LEAVE \ #define DBUG_LEAVE \
(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_)) _db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_)
#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);} #define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
#define DBUG_VOID_RETURN {DBUG_LEAVE; return;} #define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
#define DBUG_EXECUTE(keyword,a1) \ #define DBUG_EXECUTE(keyword,a1) \
{if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}} do {if (_db_keyword_(0, (keyword))) { a1 }} while(0)
#define DBUG_EXECUTE_IF(keyword,a1) \
do {if (_db_strict_keyword_ (keyword)) { a1 } } while(0)
#define DBUG_EVALUATE(keyword,a1,a2) \
(_db_keyword_(0,(keyword)) ? (a1) : (a2))
#define DBUG_EVALUATE_IF(keyword,a1,a2) \
(_db_strict_keyword_((keyword)) ? (a1) : (a2))
#define DBUG_PRINT(keyword,arglist) \ #define DBUG_PRINT(keyword,arglist) \
{if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}} do {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;} while(0)
#define DBUG_PUSH(a1) _db_push_ (a1) #define DBUG_PUSH(a1) _db_push_ (a1)
#define DBUG_POP() _db_pop_ () #define DBUG_POP() _db_pop_ ()
#define DBUG_PROCESS(a1) (_db_process_ = a1) #define DBUG_SET(a1) _db_set_ (0, (a1))
#define DBUG_FILE (_db_fp_) #define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
#define DBUG_PROCESS(a1) _db_process_(a1)
#define DBUG_FILE _db_fp_()
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1)) #define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2)) #define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
#define DBUG_DUMP(keyword,a1,a2)\ #define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
{if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}} #define DBUG_END() _db_end_ ()
#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr) #define DBUG_LOCK_FILE _db_lock_file_()
#define DEBUGGER_OFF _no_db_=1;_db_on_=0; #define DBUG_UNLOCK_FILE _db_unlock_file_()
#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_ASSERT(A) assert(A)
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
#define IF_DBUG(A) A
#else /* No debugger */ #else /* No debugger */
#define DBUG_ENTER(a1) #define DBUG_ENTER(a1)
#define DBUG_RETURN(a1) return(a1) #define DBUG_LEAVE
#define DBUG_VOID_RETURN return #define DBUG_RETURN(a1) do { return(a1); } while(0)
#define DBUG_EXECUTE(keyword,a1) {} #define DBUG_VOID_RETURN do { return; } while(0)
#define DBUG_PRINT(keyword,arglist) {} #define DBUG_EXECUTE(keyword,a1) do { } while(0)
#define DBUG_PUSH(a1) {} #define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
#define DBUG_POP() {} #define DBUG_EVALUATE(keyword,a1,a2) (a2)
#define DBUG_PROCESS(a1) {} #define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
#define DBUG_FILE (stderr) #define DBUG_PRINT(keyword,arglist) do { } while(0)
#define DBUG_SETJMP setjmp #define DBUG_PUSH(a1)
#define DBUG_LONGJMP longjmp #define DBUG_SET(a1)
#define DBUG_DUMP(keyword,a1,a2) {} #define DBUG_SET_INITIAL(a1)
#define DBUG_IN_USE 0 #define DBUG_POP()
#define DEBUGGER_OFF #define DBUG_PROCESS(a1)
#define DEBUGGER_ON #define DBUG_SETJMP(a1) setjmp(a1)
#define DBUG_LONGJMP(a1) longjmp(a1)
#define DBUG_DUMP(keyword,a1,a2)
#define DBUG_END()
#define DBUG_ASSERT(A)
#define DBUG_LOCK_FILE #define DBUG_LOCK_FILE
#define DBUG_FILE (stderr)
#define DBUG_UNLOCK_FILE #define DBUG_UNLOCK_FILE
#define DBUG_OUTPUT(A) #define DBUG_EXPLAIN(buf,len)
#define DBUG_ASSERT(A) {} #define DBUG_EXPLAIN_INITIAL(buf,len)
#define IF_DBUG(A)
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 14 change blocks. 
43 lines changed or deleted 62 lines changed or added


 my_dir.h   my_dir.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
 End of changes. 1 change blocks. 
2 lines changed or deleted 1 lines changed or added


 my_getopt.h   my_getopt.h 
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB /* Copyright (C) 2002-2004 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 71 skipping to change at line 70
extern my_bool my_getopt_print_errors; extern my_bool my_getopt_print_errors;
extern my_error_reporter my_getopt_error_reporter; extern my_error_reporter my_getopt_error_reporter;
extern int handle_options (int *argc, char ***argv, extern int handle_options (int *argc, char ***argv,
const struct my_option *longopts, my_get_one_opti on); const struct my_option *longopts, my_get_one_opti on);
extern void my_print_help(const struct my_option *options); extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options); extern void my_print_variables(const struct my_option *options);
extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, ui nt, extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, ui nt,
const struct my_o ption *)); const struct my_o ption *));
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *opt ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *opt
p); p,
bool *fixed);
my_bool getopt_compare_strings(const char *s, const char *t, uint length); my_bool getopt_compare_strings(const char *s, const char *t, uint length);
C_MODE_END C_MODE_END
#endif /* _my_getopt_h */ #endif /* _my_getopt_h */
 End of changes. 3 change blocks. 
5 lines changed or deleted 5 lines changed or added


 my_global.h   my_global.h 
/* Copyright (C) 2000-2003 MySQL AB /* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 46 skipping to change at line 45
#undef WIN #undef WIN
#undef WIN32 #undef WIN32
#undef _WIN #undef _WIN
#undef _WIN32 #undef _WIN32
#undef _WIN64 #undef _WIN64
#undef __WIN__ #undef __WIN__
#undef __WIN32__ #undef __WIN32__
#define HAVE_ERRNO_AS_DEFINE #define HAVE_ERRNO_AS_DEFINE
#endif /* __CYGWIN__ */ #endif /* __CYGWIN__ */
#if defined(__QNXNTO__) && !defined(FD_SETSIZE)
#define FD_SETSIZE 1024 /* Max number of file descriptor bits in
fd_set, used when calling 'select'
Must be defined before including
"sys/select.h" and "sys/time.h"
*/
#endif
/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ /* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */
#ifdef USE_PRAGMA_IMPLEMENTATION #ifdef USE_PRAGMA_IMPLEMENTATION
#define USE_PRAGMA_INTERFACE #define USE_PRAGMA_INTERFACE
#endif #endif
#if defined(i386) && !defined(__i386__) #if defined(i386) && !defined(__i386__)
#define __i386__ #define __i386__
#endif #endif
/* Macros to make switching between C and C++ mode easier */ /* Macros to make switching between C and C++ mode easier */
skipping to change at line 81 skipping to change at line 88
#if defined(__cplusplus) && defined(inline) #if defined(__cplusplus) && defined(inline)
#undef inline /* fix configure problem */ #undef inline /* fix configure problem */
#endif #endif
#else #else
#include <my_config.h> #include <my_config.h>
#if defined(__cplusplus) && defined(inline) #if defined(__cplusplus) && defined(inline)
#undef inline /* fix configure problem */ #undef inline /* fix configure problem */
#endif #endif
#endif /* _WIN32... */ #endif /* _WIN32... */
/* Make it easier to add conditionl code for windows */
#ifdef __WIN__
#define IF_WIN(A,B) (A)
#else
#define IF_WIN(A,B) (B)
#endif
/* Some defines to avoid ifdefs in the code */ /* Some defines to avoid ifdefs in the code */
#ifndef NETWARE_YIELD #ifndef NETWARE_YIELD
#define NETWARE_YIELD #define NETWARE_YIELD
#define NETWARE_SET_SCREEN_MODE(A) #define NETWARE_SET_SCREEN_MODE(A)
#endif #endif
/* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX *
/
#if defined(_AIX) && defined(_LARGE_FILE_API)
#undef _LARGE_FILE_API
#endif
/*
The macros below are used to allow build of Universal/fat binaries of
MySQL and MySQL applications under darwin.
*/
#if defined(__APPLE__) && defined(__MACH__)
# undef SIZEOF_CHARP
# undef SIZEOF_SHORT
# undef SIZEOF_INT
# undef SIZEOF_LONG
# undef SIZEOF_LONG_LONG
# undef SIZEOF_OFF_T
# undef WORDS_BIGENDIAN
# define SIZEOF_SHORT 2
# define SIZEOF_INT 4
# define SIZEOF_LONG_LONG 8
# define SIZEOF_OFF_T 8
# if defined(__i386__) || defined(__ppc__)
# define SIZEOF_CHARP 4
# define SIZEOF_LONG 4
# elif defined(__x86_64__) || defined(__ppc64__)
# define SIZEOF_CHARP 8
# define SIZEOF_LONG 8
# else
# error Building FAT binary for an unknown architecture.
# endif
# if defined(__ppc__) || defined(__ppc64__)
# define WORDS_BIGENDIAN
# endif
#endif /* defined(__APPLE__) && defined(__MACH__) */
/* /*
The macros below are borrowed from include/linux/compiler.h in the The macros below are borrowed from include/linux/compiler.h in the
Linux kernel. Use them to indicate the likelyhood of the truthfulness Linux kernel. Use them to indicate the likelyhood of the truthfulness
of a condition. This serves two purposes - newer versions of gcc will be of a condition. This serves two purposes - newer versions of gcc will be
able to optimize for branch predication, which could yield siginficant able to optimize for branch predication, which could yield siginficant
performance gains in frequently executed sections of the code, and the performance gains in frequently executed sections of the code, and the
other reason to use them is for documentation other reason to use them is for documentation
*/ */
#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) #if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
#define __builtin_expect(x, expected_value) (x) #define __builtin_expect(x, expected_value) (x)
#endif #endif
#define likely(x) __builtin_expect((x),1) #define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0) #define unlikely(x) __builtin_expect((x),0)
/* Fix problem with S_ISLNK() on Linux */ /* Fix problem with S_ISLNK() on Linux */
#if defined(TARGET_OS_LINUX) #if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
#undef _GNU_SOURCE #undef _GNU_SOURCE
#define _GNU_SOURCE 1 #define _GNU_SOURCE 1
#endif #endif
/*
Temporary solution to solve bug#7156. Include "sys/types.h" before
the thread headers, else the function madvise() will not be defined
*/
#if defined(HAVE_SYS_TYPES_H) && ( defined(sun) || defined(__sun) )
#include <sys/types.h>
#endif
/* The client defines this to avoid all thread code */ /* The client defines this to avoid all thread code */
#if defined(UNDEF_THREADS_HACK) #if defined(UNDEF_THREADS_HACK)
#undef THREAD #undef THREAD
#undef HAVE_mit_thread #undef HAVE_mit_thread
#undef HAVE_LINUXTHREADS #undef HAVE_LINUXTHREADS
#undef HAVE_NPTL #undef HAVE_NPTL
#undef HAVE_UNIXWARE7_THREADS #undef HAVE_UNIXWARE7_THREADS
#endif #endif
#ifdef HAVE_THREADS_WITHOUT_SOCKETS #ifdef HAVE_THREADS_WITHOUT_SOCKETS
/* MIT pthreads does not work with unix sockets */ /* MIT pthreads does not work with unix sockets */
#undef HAVE_SYS_UN_H #undef HAVE_SYS_UN_H
#endif #endif
#define __EXTENSIONS__ 1 /* We want some extension */ #define __EXTENSIONS__ 1 /* We want some extension */
#ifndef __STDC_EXT__ #ifndef __STDC_EXT__
#define __STDC_EXT__ 1 /* To get large file support on hpux */ #define __STDC_EXT__ 1 /* To get large file support on hpux */
#endif #endif
/*
Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
System Interfaces and Headers, Issue 5
saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
but apparently other systems (namely FreeBSD) don't agree.
On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
Furthermore, it tests that if a program requires older standard
(_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
run on a new compiler (that defines _STDC_C99) and issues an #error.
It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
C++ compiler does not!
So, in a desperate attempt to get correct prototypes for both
C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500
depending on the compiler's announced C standard support.
Cleaner solutions are welcome.
*/
#ifdef __sun
#if __STDC_VERSION__ - 0 >= 199901L
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif
#endif
#if defined(THREAD) && !defined(__WIN__) && !defined(OS2) #if defined(THREAD) && !defined(__WIN__) && !defined(OS2)
#ifndef _POSIX_PTHREAD_SEMANTICS #ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ #define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
#endif #endif
#if !defined(SCO) #if !defined(SCO)
#define _REENTRANT 1 /* Some thread libraries require this */ #define _REENTRANT 1 /* Some thread libraries require this */
#endif #endif
#if !defined(_THREAD_SAFE) && !defined(_AIX) #if !defined(_THREAD_SAFE) && !defined(_AIX)
#define _THREAD_SAFE /* Required for OSF1 */ #define _THREAD_SAFE /* Required for OSF1 */
skipping to change at line 199 skipping to change at line 288
#undef HAVE_INITGROUPS #undef HAVE_INITGROUPS
#endif #endif
/* gcc/egcs issues */ /* gcc/egcs issues */
#if defined(__GNUC) && defined(__EXCEPTIONS) #if defined(__GNUC) && defined(__EXCEPTIONS)
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile" #error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
#endif #endif
/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */ /* Fix a bug in gcc 2.8.0 on IRIX 6.2 */
#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) #if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_M INOR__ == 8)
#undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */ #undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */
#define __LONG_MAX__ 2147483647 #define __LONG_MAX__ 2147483647
#endif #endif
/* Fix problem when linking c++ programs with gcc 3.x */
#ifdef DEFINE_CXA_PURE_VIRTUAL
#define FIX_GCC_LINKING_PROBLEM \
C_MODE_START int __cxa_pure_virtual() {\
DBUG_ASSERT("Pure virtual method called." == "Aborted");\
return 0;\
} C_MODE_END
#else
#define FIX_GCC_LINKING_PROBLEM
#endif
/* egcs 1.1.2 has a problem with memcpy on Alpha */ /* egcs 1.1.2 has a problem with memcpy on Alpha */
#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) #if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
#define BAD_MEMCPY #define BAD_MEMCPY
#endif #endif
#if defined(_lint) && !defined(lint) #if defined(_lint) && !defined(lint)
#define lint #define lint
#endif #endif
#if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG) #if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG)
#define _LONG_LONG 1 /* For AIX string library */ #define _LONG_LONG 1 /* For AIX string library */
skipping to change at line 244 skipping to change at line 322
#include <stddef.h> #include <stddef.h>
#endif #endif
#include <math.h> #include <math.h>
#ifdef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
#include <limits.h> #include <limits.h>
#endif #endif
#ifdef HAVE_FLOAT_H #ifdef HAVE_FLOAT_H
#include <float.h> #include <float.h>
#endif #endif
#ifdef HAVE_FENV_H
#include <fenv.h> /* For fesetround() */
#endif
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
#include <fcntl.h> #include <fcntl.h>
#endif #endif
#ifdef HAVE_SYS_TIMEB_H #ifdef HAVE_SYS_TIMEB_H
#include <sys/timeb.h> /* Avoid warnings on SCO */ #include <sys/timeb.h> /* Avoid warnings on SCO */
#endif #endif
skipping to change at line 324 skipping to change at line 405
#endif #endif
#ifdef __QNXNTO__ #ifdef __QNXNTO__
/* This has to be after include limits.h */ /* This has to be after include limits.h */
#define HAVE_ERRNO_AS_DEFINE #define HAVE_ERRNO_AS_DEFINE
#define HAVE_FCNTL_LOCK #define HAVE_FCNTL_LOCK
#undef HAVE_FINITE #undef HAVE_FINITE
#undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */ #undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */
#undef LONGLONG_MAX /* standard system library 'limits.h' */ #undef LONGLONG_MAX /* standard system library 'limits.h' */
#ifdef __cplusplus #ifdef __cplusplus
#define HAVE_RINT /* rint() and isnan() functions are not */ #ifndef HAVE_RINT
#define HAVE_RINT
#endif /* rint() and isnan() functions are not */
#define rint(a) std::rint(a) /* visible in C++ scope due to an error */ #define rint(a) std::rint(a) /* visible in C++ scope due to an error */
#define isnan(a) std::isnan(a) /* in the usr/include/math.h on QNX */ #define isnan(a) std::isnan(a) /* in the usr/include/math.h on QNX */
#endif #endif
#endif #endif
/* We can not live without the following defines */ /* We can not live without the following defines */
#define USE_MYFUNC 1 /* Must use syscall indirection */ #define USE_MYFUNC 1 /* Must use syscall indirection */
#define MASTER 1 /* Compile without unireg */ #define MASTER 1 /* Compile without unireg */
#define ENGLISH 1 /* Messages in English */ #define ENGLISH 1 /* Messages in English */
skipping to change at line 373 skipping to change at line 456
#define VOID(X) (X) #define VOID(X) (X)
#endif #endif
#endif /* DONT_DEFINE_VOID */ #endif /* DONT_DEFINE_VOID */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) #if defined(_lint) || defined(FORCE_INIT_OF_VARS)
#define LINT_INIT(var) var=0 /* No uninitialize-warning * / #define LINT_INIT(var) var=0 /* No uninitialize-warning * /
#else #else
#define LINT_INIT(var) #define LINT_INIT(var)
#endif #endif
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify) /*
#define PURIFY_OR_LINT_INIT(var) var=0 Suppress uninitialized variable warning without generating code.
The _cplusplus is a temporary workaround for C++ code pending a fix
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
*/
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(__cplusplus) |
| \
!defined(__GNUC__)
#define UNINIT_VAR(x) x= 0
#else #else
#define PURIFY_OR_LINT_INIT(var) #define UNINIT_VAR(x) x= x
#endif #endif
/* Define some useful general macros */ /* Define some useful general macros */
#if !defined(max) #if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b))
#endif #endif
#if defined(__EMX__) || !defined(HAVE_UINT) #if defined(__EMX__) || !defined(HAVE_UINT)
#undef HAVE_UINT #undef HAVE_UINT
skipping to change at line 401 skipping to change at line 491
#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) #define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
#define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dumm y; } #define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dumm y; }
#define test(a) ((a) ? 1 : 0) #define test(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) #define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0) #define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
#define test_all_bits(a,b) (((a) & (b)) == (b)) #define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1)) #define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
#ifndef HAVE_RINT
#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5))
#endif
/* Define some general constants */ /* Define some general constants */
#ifndef TRUE #ifndef TRUE
#define TRUE (1) /* Logical true */ #define TRUE (1) /* Logical true */
#define FALSE (0) /* Logical false */ #define FALSE (0) /* Logical false */
#endif #endif
#if defined(__GNUC__) #if defined(__GNUC__)
#define function_volatile volatile #define function_volatile volatile
#define my_reinterpret_cast(A) reinterpret_cast<A> #define my_reinterpret_cast(A) reinterpret_cast<A>
#define my_const_cast(A) const_cast<A> #define my_const_cast(A) const_cast<A>
# ifndef GCC_VERSION # ifndef GCC_VERSION
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) # define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
# endif # endif
#elif !defined(my_reinterpret_cast) #elif !defined(my_reinterpret_cast)
#define my_reinterpret_cast(A) (A) #define my_reinterpret_cast(A) (A)
#define my_const_cast(A) (A) #define my_const_cast(A) (A)
#endif #endif
/* #include <my_attribute.h>
Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
Some forms of __attribute__ are actually supported in earlier versions of
g++, but we just disable them all because we only use them to generate
compilation warnings.
*/
#ifndef __attribute__
# if !defined(__GNUC__)
# define __attribute__(A)
# elif GCC_VERSION < 2008
# define __attribute__(A)
# elif defined(__cplusplus) && GCC_VERSION < 3004
# define __attribute__(A)
# endif
#endif
/*
__attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3
.4
But that's already covered by the __attribute__ tests above, so this is
just a convenience macro.
*/
#ifndef ATTRIBUTE_FORMAT
# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
#endif
/* /*
__attribute__((format(...))) on a function pointer is not supported Wen using the embedded library, users might run into link problems,
until gcc 3.1 duplicate declaration of __cxa_pure_virtual, solved by declaring it a
weak symbol.
*/ */
#ifndef ATTRIBUTE_FORMAT_FPTR #if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL)
# if (GCC_VERSION >= 3001) C_MODE_START
# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n) int __cxa_pure_virtual () __attribute__ ((weak));
# else C_MODE_END
# define ATTRIBUTE_FORMAT_FPTR(style, m, n)
# endif /* GNUC >= 3.1 */
#endif #endif
/* From old s-system.h */ /* From old s-system.h */
/* /*
Support macros for non ansi & other old compilers. Since such Support macros for non ansi & other old compilers. Since such
things are no longer supported we do nothing. We keep then since things are no longer supported we do nothing. We keep then since
some of our code may still be needed to upgrade old customers. some of our code may still be needed to upgrade old customers.
*/ */
#define _VARARGS(X) X #define _VARARGS(X) X
#define _STATIC_VARARGS(X) X #define _STATIC_VARARGS(X) X
#define _PC(X) X
#if defined(DBUG_ON) && defined(DBUG_OFF) #if defined(DBUG_ON) && defined(DBUG_OFF)
#undef DBUG_OFF #undef DBUG_OFF
#endif #endif
#if defined(_lint) && !defined(DBUG_OFF) /* We might be forced to turn debug off, if not turned off already */
#define DBUG_OFF #if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF)
# define DBUG_OFF
# ifdef DBUG_ON
# undef DBUG_ON
# endif
#endif #endif
#include <my_dbug.h> #include <my_dbug.h>
#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/ #define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/
#define ASCII_BITS_USED 8 /* Bit char used */ #define ASCII_BITS_USED 8 /* Bit char used */
#define NEAR_F /* No near function handling */ #define NEAR_F /* No near function handling */
/* Some types that is different between systems */ /* Some types that is different between systems */
skipping to change at line 560 skipping to change at line 626
#ifndef O_TEMPORARY #ifndef O_TEMPORARY
#define O_TEMPORARY 0 #define O_TEMPORARY 0
#endif #endif
#ifndef O_SHORT_LIVED #ifndef O_SHORT_LIVED
#define O_SHORT_LIVED 0 #define O_SHORT_LIVED 0
#endif #endif
#ifndef O_NOFOLLOW #ifndef O_NOFOLLOW
#define O_NOFOLLOW 0 #define O_NOFOLLOW 0
#endif #endif
/* additional file share flags for win32 */
#ifdef __WIN__
#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */
#define _SH_DENYWRD 0x120 /* deny write mode & delete */
#define _SH_DENYRDD 0x130 /* deny read mode & delete */
#define _SH_DENYDEL 0x140 /* deny delete only */
#endif /* __WIN__ */
/* #define USE_RECORD_LOCK */ /* #define USE_RECORD_LOCK */
/* Unsigned types supported by the compiler */ /* Unsigned types supported by the compiler */
#define UNSINT8 /* unsigned int8 (char) */ #define UNSINT8 /* unsigned int8 (char) */
#define UNSINT16 /* unsigned int16 */ #define UNSINT16 /* unsigned int16 */
#define UNSINT32 /* unsigned int32 */ #define UNSINT32 /* unsigned int32 */
/* General constants */ /* General constants */
#define SC_MAXWIDTH 256 /* Max width of screen (for error messages) */ #define SC_MAXWIDTH 256 /* Max width of screen (for error messages) */
#define FN_LEN 256 /* Max file name len */ #define FN_LEN 256 /* Max file name len */
#define FN_HEADLEN 253 /* Max length of filepart of file name */ #define FN_HEADLEN 253 /* Max length of filepart of file name */
#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */ #define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */
#ifdef PATH_MAX
#define FN_REFLEN PATH_MAX/* Max length of full path-name */
#else
#define FN_REFLEN 512 /* Max length of full path-name */ #define FN_REFLEN 512 /* Max length of full path-name */
#endif
#define FN_EXTCHAR '.' #define FN_EXTCHAR '.'
#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ #define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
#define FN_PARENTDIR ".." /* Parent directory; Must be a string */ #define FN_PARENTDIR ".." /* Parent directory; Must be a string */
#define FN_DEVCHAR ':'
#ifndef FN_LIBCHAR #ifndef FN_LIBCHAR
#ifdef __EMX__ #ifdef __EMX__
#define FN_LIBCHAR '\\' #define FN_LIBCHAR '\\'
#define FN_ROOTDIR "\\" #define FN_ROOTDIR "\\"
#else #else
#define FN_LIBCHAR '/' #define FN_LIBCHAR '/'
#define FN_ROOTDIR "/" #define FN_ROOTDIR "/"
#endif #endif
#endif #endif
skipping to change at line 646 skipping to change at line 715
#ifndef __WIN__ #ifndef __WIN__
#ifdef OS2 #ifdef OS2
#define closesocket(A) soclose(A) #define closesocket(A) soclose(A)
#else #else
#define closesocket(A) close(A) #define closesocket(A) close(A)
#endif #endif
#ifndef ulonglong2double #ifndef ulonglong2double
#define ulonglong2double(A) ((double) (ulonglong) (A)) #define ulonglong2double(A) ((double) (ulonglong) (A))
#define my_off_t2double(A) ((double) (my_off_t) (A)) #define my_off_t2double(A) ((double) (my_off_t) (A))
#endif #endif
#ifndef double2ulonglong
#define double2ulonglong(A) ((ulonglong) (double) (A))
#endif
#endif #endif
#ifndef offsetof #ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif #endif
#define ulong_to_double(X) ((double) (ulong) (X)) #define ulong_to_double(X) ((double) (ulong) (X))
#define SET_STACK_SIZE(X) /* Not needed on real machines */ #define SET_STACK_SIZE(X) /* Not needed on real machines */
#if !defined(HAVE_mit_thread) && !defined(HAVE_STRTOK_R) #if !defined(HAVE_mit_thread) && !defined(HAVE_STRTOK_R)
#define strtok_r(A,B,C) strtok((A),(B)) #define strtok_r(A,B,C) strtok((A),(B))
skipping to change at line 706 skipping to change at line 778
#define INT_MAX32 0x7FFFFFFFL #define INT_MAX32 0x7FFFFFFFL
#define UINT_MAX32 0xFFFFFFFFL #define UINT_MAX32 0xFFFFFFFFL
#define INT_MIN24 (~0x007FFFFF) #define INT_MIN24 (~0x007FFFFF)
#define INT_MAX24 0x007FFFFF #define INT_MAX24 0x007FFFFF
#define UINT_MAX24 0x00FFFFFF #define UINT_MAX24 0x00FFFFFF
#define INT_MIN16 (~0x7FFF) #define INT_MIN16 (~0x7FFF)
#define INT_MAX16 0x7FFF #define INT_MAX16 0x7FFF
#define UINT_MAX16 0xFFFF #define UINT_MAX16 0xFFFF
#define INT_MIN8 (~0x7F) #define INT_MIN8 (~0x7F)
#define INT_MAX8 0x7F #define INT_MAX8 0x7F
#define UINT_MAX8 0xFF
/* From limits.h instead */ /* From limits.h instead */
#ifndef DBL_MIN #ifndef DBL_MIN
#define DBL_MIN 4.94065645841246544e-324 #define DBL_MIN 4.94065645841246544e-324
#define FLT_MIN ((float)1.40129846432481707e-45) #define FLT_MIN ((float)1.40129846432481707e-45)
#endif #endif
#ifndef DBL_MAX #ifndef DBL_MAX
#define DBL_MAX 1.79769313486231470e+308 #define DBL_MAX 1.79769313486231470e+308
#define FLT_MAX ((float)3.40282346638528860e+38) #define FLT_MAX ((float)3.40282346638528860e+38)
#endif #endif
#if !defined(HAVE_ISINF) && !defined(isinf) #ifndef HAVE_FINITE
#define isinf(X) 0 #define finite(x) (1.0 / fabs(x) > 0.0)
#endif
#ifndef HAVE_ISNAN
#define isnan(x) ((x) != (x))
#endif
#ifdef HAVE_ISINF
/* Check if C compiler is affected by GCC bug #39228 */
#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF)
/* Force store/reload of the argument to/from a 64-bit double */
static inline double my_isinf(double x)
{
volatile double t= x;
return isinf(t);
}
#else
/* System-provided isinf() is available and safe to use */
#define my_isinf(X) isinf(X)
#endif
#else /* !HAVE_ISINF */
#define my_isinf(X) (!finite(X) && !isnan(X))
#endif
/* Define missing math constants. */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_E
#define M_E 2.7182818284590452354
#endif
#ifndef M_LN2
#define M_LN2 0.69314718055994530942
#endif #endif
/* /*
Max size that must be added to a so that we know Size to make Max size that must be added to a so that we know Size to make
adressable obj. adressable obj.
*/ */
#if SIZEOF_CHARP == 4 #if SIZEOF_CHARP == 4
typedef long my_ptrdiff_t; typedef long my_ptrdiff_t;
#else #else
typedef long long my_ptrdiff_t; typedef long long my_ptrdiff_t;
skipping to change at line 740 skipping to change at line 845
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1)) #define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double)) #define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
/* Size to make adressable obj. */ /* Size to make adressable obj. */
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t))) #define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
/* Offset of field f in structure t */ /* Offset of field f in structure t */
#define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f) #define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size) #define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B)) #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B))
/*
Custom version of standard offsetof() macro which can be used to get
offsets of members in class for non-POD types (according to the current
version of C++ standard offsetof() macro can't be used in such cases and
attempt to do so causes warnings to be emitted, OTOH in many cases it is
still OK to assume that all instances of the class has the same offsets
for the same members).
This is temporary solution which should be removed once File_parser class
and related routines are refactored.
*/
#define my_offsetof(TYPE, MEMBER) \
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
#define NullS (char *) 0 #define NullS (char *) 0
/* Nowdays we do not support MessyDos */ /* Nowdays we do not support MessyDos */
#ifndef NEAR #ifndef NEAR
#define NEAR /* Who needs segments ? */ #define NEAR /* Who needs segments ? */
#define FAR /* On a good machine */ #define FAR /* On a good machine */
#ifndef HUGE_PTR #ifndef HUGE_PTR
#define HUGE_PTR #define HUGE_PTR
#endif #endif
#endif #endif
#if defined(__IBMC__) || defined(__IBMCPP__) #if defined(__IBMC__) || defined(__IBMCPP__)
skipping to change at line 784 skipping to change at line 904
#ifndef HAVE_INT_8_16_32 #ifndef HAVE_INT_8_16_32
typedef int int32; typedef int int32;
#endif #endif
typedef unsigned int uint32; /* Short for unsigned integer >= 32 bits */ typedef unsigned int uint32; /* Short for unsigned integer >= 32 bits */
#elif SIZEOF_LONG == 4 #elif SIZEOF_LONG == 4
#ifndef HAVE_INT_8_16_32 #ifndef HAVE_INT_8_16_32
typedef long int32; typedef long int32;
#endif #endif
typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */ typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */
#else #else
error "Neither int or long is of 4 bytes width" #error "Neither int or long is of 4 bytes width"
#endif #endif
#if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined(__USE_MIS C) #if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined(__USE_MIS C)
typedef unsigned long ulong; /* Short for unsigned long */ typedef unsigned long ulong; /* Short for unsigned long */
#endif #endif
#ifndef longlong_defined #ifndef longlong_defined
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8 /*
Using [unsigned] long long is preferable as [u]longlong because we use
[unsigned] long long unconditionally in many places,
for example in constants with [U]LL suffix.
*/
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */ typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int longlong; typedef long long int longlong;
#else #else
typedef unsigned long ulonglong; /* ulong or unsigned long long */ typedef unsigned long ulonglong; /* ulong or unsigned long long */
typedef long longlong; typedef long longlong;
#endif #endif
#endif #endif
#if defined(NO_CLIENT_LONG_LONG) #if defined(NO_CLIENT_LONG_LONG)
typedef unsigned long my_ulonglong; typedef unsigned long my_ulonglong;
skipping to change at line 840 skipping to change at line 965
#if !defined(__WIN__) && !defined(OS2) #if !defined(__WIN__) && !defined(OS2)
typedef off_t os_off_t; typedef off_t os_off_t;
#endif #endif
#if defined(__WIN__) #if defined(__WIN__)
#define socket_errno WSAGetLastError() #define socket_errno WSAGetLastError()
#define SOCKET_EINTR WSAEINTR #define SOCKET_EINTR WSAEINTR
#define SOCKET_EAGAIN WSAEINPROGRESS #define SOCKET_EAGAIN WSAEINPROGRESS
#define SOCKET_ETIMEDOUT WSAETIMEDOUT #define SOCKET_ETIMEDOUT WSAETIMEDOUT
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK #define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
#define SOCKET_EADDRINUSE WSAEADDRINUSE
#define SOCKET_ENFILE ENFILE #define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE #define SOCKET_EMFILE EMFILE
#elif defined(OS2) #elif defined(OS2)
#define socket_errno sock_errno() #define socket_errno sock_errno()
#define SOCKET_EINTR SOCEINTR #define SOCKET_EINTR SOCEINTR
#define SOCKET_EAGAIN SOCEINPROGRESS #define SOCKET_EAGAIN SOCEINPROGRESS
#define SOCKET_ETIMEDOUT SOCKET_EINTR #define SOCKET_ETIMEDOUT SOCKET_EINTR
#define SOCKET_EWOULDBLOCK SOCEWOULDBLOCK #define SOCKET_EWOULDBLOCK SOCEWOULDBLOCK
#define SOCKET_EADDRINUSE SOCEADDRINUSE
#define SOCKET_ENFILE SOCENFILE #define SOCKET_ENFILE SOCENFILE
#define SOCKET_EMFILE SOCEMFILE #define SOCKET_EMFILE SOCEMFILE
#define closesocket(A) soclose(A) #define closesocket(A) soclose(A)
#else /* Unix */ #else /* Unix */
#define socket_errno errno #define socket_errno errno
#define closesocket(A) close(A) #define closesocket(A) close(A)
#define SOCKET_EINTR EINTR #define SOCKET_EINTR EINTR
#define SOCKET_EAGAIN EAGAIN #define SOCKET_EAGAIN EAGAIN
#define SOCKET_ETIMEDOUT SOCKET_EINTR #define SOCKET_ETIMEDOUT SOCKET_EINTR
#define SOCKET_EWOULDBLOCK EWOULDBLOCK #define SOCKET_EWOULDBLOCK EWOULDBLOCK
#define SOCKET_EADDRINUSE EADDRINUSE
#define SOCKET_ENFILE ENFILE #define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE #define SOCKET_EMFILE EMFILE
#endif #endif
typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */ typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
typedef short int15; /* Most effective integer 0 <= x <= 32767 */ typedef short int15; /* Most effective integer 0 <= x <= 32767 */
typedef char *my_string; /* String of characters */ typedef char *my_string; /* String of characters */
typedef unsigned long size_s; /* Size of strings (In string-funcs) */ typedef unsigned long size_s; /* Size of strings (In string-funcs) */
typedef int myf; /* Type of MyFlags in my_funcs */ typedef int myf; /* Type of MyFlags in my_funcs */
#ifndef byte_defined #ifndef byte_defined
typedef char byte; /* Smallest addressable unit */ typedef char byte; /* Smallest addressable unit */
#endif #endif
typedef char my_bool; /* Small bool */ typedef char my_bool; /* Small bool */
#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !de fined(__cplusplus)) #if !defined(bool) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
typedef char bool; /* Ordinary boolean values 0 1 */ typedef char bool; /* Ordinary boolean values 0 1 */
#endif #endif
/* Macros for converting *constants* to the right type */ /* Macros for converting *constants* to the right type */
#define INT8(v) (int8) (v) #define INT8(v) (int8) (v)
#define INT16(v) (int16) (v) #define INT16(v) (int16) (v)
#define INT32(v) (int32) (v) #define INT32(v) (int32) (v)
#define MYF(v) (myf) (v) #define MYF(v) (myf) (v)
#ifndef LL #ifndef LL
#ifdef HAVE_LONG_LONG #ifdef HAVE_LONG_LONG
skipping to change at line 936 skipping to change at line 1064
#else #else
#define dbug_volatile #define dbug_volatile
#endif #endif
/* Defines for time function */ /* Defines for time function */
#define SCALE_SEC 100 #define SCALE_SEC 100
#define SCALE_USEC 10000 #define SCALE_USEC 10000
#define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */ #define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */ #define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */
#ifndef set_timespec
#ifdef HAVE_TIMESPEC_TS_SEC
#define set_timespec(ABSTIME,SEC) { (ABSTIME).ts_sec=time(0) + (time_t) (SE
C); (ABSTIME).ts_nsec=0; }
#else
#define set_timespec(ABSTIME,SEC) \
{\
struct timeval tv;\
gettimeofday(&tv,0);\
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
#endif /* HAVE_TIMESPEC_TS_SEC */
#endif /* set_timespec */
/* /*
Define-funktions for reading and storing in machine independent format Define-funktions for reading and storing in machine independent format
(low byte first) (low byte first)
*/ */
/* Optimized store functions for Intel x86 */ /* Optimized store functions for Intel x86 */
#if defined(__i386__) && !defined(_WIN64) #if defined(__i386__) || defined(_WIN32)
#define sint2korr(A) (*((int16 *) (A))) #define sint2korr(A) (*((int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \ (((uint32) 255L << 24) | \
(((uint32) (uchar) (A)[2]) << 16) |\ (((uint32) (uchar) (A)[2]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \ (((uint32) (uchar) (A)[1]) << 8) | \
((uint32) (uchar) (A)[0])) : \ ((uint32) (uchar) (A)[0])) : \
(((uint32) (uchar) (A)[2]) << 16) |\ (((uint32) (uchar) (A)[2]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \ (((uint32) (uchar) (A)[1]) << 8) | \
((uint32) (uchar) (A)[0]))) ((uint32) (uchar) (A)[0])))
#define sint4korr(A) (*((long *) (A))) #define sint4korr(A) (*((long *) (A)))
#define uint2korr(A) (*((uint16 *) (A))) #define uint2korr(A) (*((uint16 *) (A)))
#ifdef HAVE_purify #if defined(HAVE_purify) && !defined(_WIN32)
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ #define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16)) (((uint32) ((uchar) (A)[2])) << 16))
#else #else
/* /*
ATTENTION ! ATTENTION !
Please, note, uint3korr reads 4 bytes (not 3) ! Please, note, uint3korr reads 4 bytes (not 3) !
It means, that you have to provide enough allocated space ! It means, that you have to provide enough allocated space !
*/ */
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) #define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
#endif #endif /* HAVE_purify && !_WIN32 */
#define uint4korr(A) (*((unsigned long *) (A))) #define uint4korr(A) (*((uint32 *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16) +\ (((uint32) ((uchar) (A)[2])) << 16) +\
(((uint32) ((uchar) (A)[3])) << 24)) +\ (((uint32) ((uchar) (A)[3])) << 24)) +\
(((ulonglong) ((uchar) (A)[4])) << 32)) (((ulonglong) ((uchar) (A)[4])) << 32))
#define uint8korr(A) (*((ulonglong *) (A))) #define uint8korr(A) (*((ulonglong *) (A)))
#define sint8korr(A) (*((longlong *) (A))) #define sint8korr(A) (*((longlong *) (A)))
#define int2store(T,A) *((uint16*) (T))= (uint16) (A) #define int2store(T,A) *((uint16*) (T))= (uint16) (A)
#define int3store(T,A) do { *(T)= (uchar) ((A));\ #define int3store(T,A) do { *(T)= (uchar) ((A));\
*(T+1)=(uchar) (((uint) (A) >> 8));\ *(T+1)=(uchar) (((uint) (A) >> 8));\
skipping to change at line 1019 skipping to change at line 1133
(V) = _tmp.v; } while(0) (V) = _tmp.v; } while(0)
#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0] ; \ #define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0] ; \
*(((long *) T)+1) = ((doubleget_union *)&V)->m[ 1]; \ *(((long *) T)+1) = ((doubleget_union *)&V)->m[ 1]; \
} while (0) } while (0)
#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while( 0) #define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while( 0)
#define float8get(V,M) doubleget((V),(M)) #define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) #define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float)) #define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float))
#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) #define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float))
#define float8store(V,M) doublestore((V),(M)) #define float8store(V,M) doublestore((V),(M))
#endif /* __i386__ */ #else
#ifndef sint2korr
/* /*
We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines
were done before) were done before)
*/ */
#define sint2korr(A) (int16) (((int16) ((uchar) (A)[0])) +\ #define sint2korr(A) (int16) (((int16) ((uchar) (A)[0])) +\
((int16) ((int16) (A)[1]) << 8)) ((int16) ((int16) (A)[1]) << 8))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \ (((uint32) 255L << 24) | \
(((uint32) (uchar) (A)[2]) << 16) |\ (((uint32) (uchar) (A)[2]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \ (((uint32) (uchar) (A)[1]) << 8) | \
skipping to change at line 1146 skipping to change at line 1259
((byte*) &def_temp)[5]=(M)[1];\ ((byte*) &def_temp)[5]=(M)[1];\
((byte*) &def_temp)[6]=(M)[2];\ ((byte*) &def_temp)[6]=(M)[2];\
((byte*) &def_temp)[7]=(M)[3];\ ((byte*) &def_temp)[7]=(M)[3];\
(V) = def_temp; } while(0) (V) = def_temp; } while(0)
#endif /* __FLOAT_WORD_ORDER */ #endif /* __FLOAT_WORD_ORDER */
#define float8get(V,M) doubleget((V),(M)) #define float8get(V,M) doubleget((V),(M))
#define float8store(V,M) doublestore((V),(M)) #define float8store(V,M) doublestore((V),(M))
#endif /* WORDS_BIGENDIAN */ #endif /* WORDS_BIGENDIAN */
#endif /* sint2korr */ #endif /* __i386__ OR _WIN32 */
/* /*
Macro for reading 32-bit integer from network byte order (big-endian) Macro for reading 32-bit integer from network byte order (big-endian)
from unaligned memory location. from unaligned memory location.
*/ */
#define int4net(A) (int32) (((uint32) ((uchar) (A)[3])) |\ #define int4net(A) (int32) (((uint32) ((uchar) (A)[3])) |\
(((uint32) ((uchar) (A)[2])) << 8) |\ (((uint32) ((uchar) (A)[2])) << 8) |\
(((uint32) ((uchar) (A)[1])) << 16) |\ (((uint32) ((uchar) (A)[1])) << 16) |\
(((uint32) ((uchar) (A)[0])) << 24)) (((uint32) ((uchar) (A)[0])) << 24))
/* /*
skipping to change at line 1245 skipping to change at line 1358
#ifdef HAVE_CHARSET_utf8 #ifdef HAVE_CHARSET_utf8
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
#else #else
#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME #define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
#endif #endif
#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL) #if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL)
#define NO_EMBEDDED_ACCESS_CHECKS #define NO_EMBEDDED_ACCESS_CHECKS
#endif #endif
/* Length of decimal number represented by INT32. */
#define MY_INT32_NUM_DECIMAL_DIGITS 11
/* Length of decimal number represented by INT64. */
#define MY_INT64_NUM_DECIMAL_DIGITS 21
#ifndef HAVE_RINT
/**
All integers up to this number can be represented exactly as double prec
ision
values (DBL_MANT_DIG == 53 for IEEE 754 hardware).
*/
#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1)
/**
rint(3) implementation for platforms that do not have it.
Always rounds to the nearest integer with ties being rounded to the near
est
even integer to mimic glibc's rint() behavior in the "round-to-nearest"
FPU mode. Hardware-specific optimizations are possible (frndint on x86).
Unlike this implementation, hardware will also honor the FPU rounding mo
de.
*/
static inline double rint(double x)
{
double f, i;
f = modf(x, &i);
/*
All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
no need to check it.
*/
if (x > 0.0)
i += (double) ((f > 0.5) || (f == 0.5 &&
i <= (double) MAX_EXACT_INTEGER &&
(longlong) i % 2));
else
i -= (double) ((f < -0.5) || (f == -0.5 &&
i >= (double) -MAX_EXACT_INTEGER &&
(longlong) i % 2));
return i;
}
#endif /* HAVE_RINT */
#endif /* my_global_h */ #endif /* my_global_h */
 End of changes. 41 change blocks. 
90 lines changed or deleted 249 lines changed or added


 my_list.h   my_list.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
 End of changes. 1 change blocks. 
2 lines changed or deleted 1 lines changed or added


 my_net.h   my_net.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 64 skipping to change at line 63
#endif #endif
#if defined(__EMX__) #if defined(__EMX__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#define ioctlsocket(A,B,C) ioctl((A),(B),(void *)(C),sizeof(*(C))) #define ioctlsocket(A,B,C) ioctl((A),(B),(void *)(C),sizeof(*(C)))
#undef HAVE_FCNTL #undef HAVE_FCNTL
#endif /* defined(__EMX__) */ #endif /* defined(__EMX__) */
#if defined(MSDOS) || defined(__WIN__) #if defined(MSDOS) || defined(__WIN__)
#define O_NONBLOCK 1 /* For emulation of fcntl() */ #define O_NONBLOCK 1 /* For emulation of fcntl() */
/*
SHUT_RDWR is called SD_BOTH in windows and
is defined to 2 in winsock2.h
#define SD_BOTH 0x02
*/
#define SHUT_RDWR 0x02
#endif #endif
/* /*
On OSes which don't have the in_addr_t, we guess that using uint32 is the best On OSes which don't have the in_addr_t, we guess that using uint32 is the best
possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD 64bit possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD 64bit
& Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too. & Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too.
*/ */
#ifndef HAVE_IN_ADDR_T #ifndef HAVE_IN_ADDR_T
#define in_addr_t uint32 #define in_addr_t uint32
#endif #endif
/* On some operating systems (e.g. Solaris) INADDR_NONE is not defined */
#ifndef INADDR_NONE
#define INADDR_NONE -1 /* Error value from inet_ad
dr */
#endif
/* Thread safe or portable version of some functions */ /* Thread safe or portable version of some functions */
void my_inet_ntoa(struct in_addr in, char *buf); void my_inet_ntoa(struct in_addr in, char *buf);
/* /*
Handling of gethostbyname_r() Handling of gethostbyname_r()
*/ */
#if !defined(HPUX10) #if !defined(HPUX10)
struct hostent; struct hostent;
 End of changes. 3 change blocks. 
2 lines changed or deleted 15 lines changed or added


 my_no_pthread.h   my_no_pthread.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
#if !defined(_my_no_pthread_h) && !defined(THREAD)
#define _my_no_pthread_h
/*
This block is to access some thread-related type definitions
even in builds which do not need thread functions,
as some variables (based on these types) are declared
even in non-threaded builds.
Case in point: 'mf_keycache.c'
*/
#if defined(__WIN__) || defined(OS2)
#elif defined(HAVE_UNIXWARE7_THREADS)
/* #include <thread.h> Currently, not relevant. Enable if needed. */
#else /* Normal threads */
#include <pthread.h>
#endif /* defined(__WIN__) */
/* /*
This undefs some pthread mutex locks when one isn't using threads This undefs some pthread mutex locks when one isn't using threads
to make thread safe code, that should also work in single thread to make thread safe code, that should also work in single thread
environment, easier to use. environment, easier to use.
*/ */
#if !defined(_my_no_pthread_h) && !defined(THREAD)
#define _my_no_pthread_h
#define pthread_mutex_init(A,B) #define pthread_mutex_init(A,B)
#define pthread_mutex_lock(A) #define pthread_mutex_lock(A)
#define pthread_mutex_unlock(A) #define pthread_mutex_unlock(A)
#define pthread_mutex_destroy(A) #define pthread_mutex_destroy(A)
#define my_rwlock_init(A,B) #define my_rwlock_init(A,B)
#define rw_rdlock(A) #define rw_rdlock(A)
#define rw_wrlock(A) #define rw_wrlock(A)
#define rw_unlock(A) #define rw_unlock(A)
#define rwlock_destroy(A) #define rwlock_destroy(A)
#endif #endif
 End of changes. 4 change blocks. 
6 lines changed or deleted 22 lines changed or added


 my_pthread.h   my_pthread.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 28 skipping to change at line 27
#ifndef _my_pthread_h #ifndef _my_pthread_h
#define _my_pthread_h #define _my_pthread_h
#include <errno.h> #include <errno.h>
#ifndef ETIME #ifndef ETIME
#define ETIME ETIMEDOUT /* For FreeBSD */ #define ETIME ETIMEDOUT /* For FreeBSD */
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
#define EXTERNC extern "C"
extern "C" { extern "C" {
#else
#define EXTERNC
#endif /* __cplusplus */ #endif /* __cplusplus */
#if defined(__WIN__) || defined(OS2) #if defined(__WIN__) || defined(OS2)
#ifdef OS2 #ifdef OS2
typedef ULONG HANDLE; typedef ULONG HANDLE;
typedef ULONG DWORD; typedef ULONG DWORD;
typedef int sigset_t; typedef int sigset_t;
#endif #endif
skipping to change at line 62 skipping to change at line 64
/* Implementation of posix conditions */ /* Implementation of posix conditions */
typedef struct st_pthread_link { typedef struct st_pthread_link {
DWORD thread_id; DWORD thread_id;
struct st_pthread_link *next; struct st_pthread_link *next;
} pthread_link; } pthread_link;
typedef struct { typedef struct {
uint32 waiting; uint32 waiting;
#ifdef OS2 CRITICAL_SECTION lock_waiting;
HEV semaphore;
#else
HANDLE semaphore;
#endif
} pthread_cond_t;
#ifndef OS2 enum {
struct timespec { /* For pthread_cond_timedwait() */ SIGNAL= 0,
time_t tv_sec; BROADCAST= 1,
long tv_nsec; MAX_EVENTS= 2
}; } EVENTS;
#endif
HANDLE events[MAX_EVENTS];
HANDLE broadcast_block_event;
} pthread_cond_t;
typedef int pthread_mutexattr_t; typedef int pthread_mutexattr_t;
#define win_pthread_self my_thread_var->pthread_self #define win_pthread_self my_thread_var->pthread_self
#ifdef OS2 #ifdef OS2
#define pthread_handler_decl(A,B) void * _Optlink A(void *B) #define pthread_handler_t EXTERNC void * _Optlink
typedef void * (_Optlink *pthread_handler)(void *); typedef void * (_Optlink *pthread_handler)(void *);
#else #else
#define pthread_handler_decl(A,B) void * __cdecl A(void *B) #define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *); typedef void * (__cdecl *pthread_handler)(void *);
#endif #endif
/*
Struct and macros to be used in combination with the
windows implementation of pthread_cond_timedwait
*/
/*
Declare a union to make sure FILETIME is properly aligned
so it can be used directly as a 64 bit value. The value
stored is in 100ns units.
*/
union ft64 {
FILETIME ft;
__int64 i64;
};
struct timespec {
union ft64 tv;
/* The max timeout value in millisecond for pthread_cond_timedwait */
long max_timeout_msec;
};
#define set_timespec(ABSTIME,SEC) { \
GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
(ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \
(ABSTIME).max_timeout_msec= (long)((SEC)*1000); \
}
#define set_timespec_nsec(ABSTIME,NSEC) { \
GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
(ABSTIME).tv.i64+= (__int64)(NSEC)/100; \
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
}
void win_pthread_init(void); void win_pthread_init(void);
int win_pthread_setspecific(void *A,void *B,uint length); int win_pthread_setspecific(void *A,void *B,uint length);
int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *); int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *);
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) ; int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) ;
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime); struct timespec *abstime);
int pthread_cond_signal(pthread_cond_t *cond); int pthread_cond_signal(pthread_cond_t *cond);
int pthread_cond_broadcast(pthread_cond_t *cond); int pthread_cond_broadcast(pthread_cond_t *cond);
int pthread_cond_destroy(pthread_cond_t *cond); int pthread_cond_destroy(pthread_cond_t *cond);
int pthread_attr_init(pthread_attr_t *connect_att); int pthread_attr_init(pthread_attr_t *connect_att);
int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack);
skipping to change at line 145 skipping to change at line 177
#define pthread_equal(A,B) ((A) == (B)) #define pthread_equal(A,B) ((A) == (B))
#ifdef OS2 #ifdef OS2
extern int pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *); extern int pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *);
extern int pthread_mutex_lock (pthread_mutex_t *); extern int pthread_mutex_lock (pthread_mutex_t *);
extern int pthread_mutex_unlock (pthread_mutex_t *); extern int pthread_mutex_unlock (pthread_mutex_t *);
extern int pthread_mutex_destroy (pthread_mutex_t *); extern int pthread_mutex_destroy (pthread_mutex_t *);
#define my_pthread_setprio(A,B) DosSetPriority(PRTYS_THREAD,PRTYC_NOCHANGE , B, A) #define my_pthread_setprio(A,B) DosSetPriority(PRTYS_THREAD,PRTYC_NOCHANGE , B, A)
#define pthread_kill(A,B) raise(B) #define pthread_kill(A,B) raise(B)
#define pthread_exit(A) pthread_dummy() #define pthread_exit(A) pthread_dummy()
#else #else
#define pthread_mutex_init(A,B) InitializeCriticalSection(A) #define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0)
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
#define pthread_mutex_trylock(A) (WaitForSingleObject((A), 0) == WAIT_TIMEO UT) #define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A))
#define pthread_mutex_unlock(A) LeaveCriticalSection(A) #define pthread_mutex_unlock(A) LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) #define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
#define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#endif /* OS2 */ #endif /* OS2 */
/* Dummy defines for easier code */ /* Dummy defines for easier code */
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B) #define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B)
#define pthread_attr_setscope(A,B) #define pthread_attr_setscope(A,B)
#define pthread_detach_this_thread() #define pthread_detach_this_thread()
#define pthread_condattr_init(A) #define pthread_condattr_init(A)
#define pthread_condattr_destroy(A) #define pthread_condattr_destroy(A)
/*Irena: compiler does not like this: */
/*#define my_pthread_getprio(pthread_t thread_id) pthread_dummy(0) */
#define my_pthread_getprio(thread_id) pthread_dummy(0) #define my_pthread_getprio(thread_id) pthread_dummy(0)
#elif defined(HAVE_UNIXWARE7_THREADS) #elif defined(HAVE_UNIXWARE7_THREADS)
#include <thread.h> #include <thread.h>
#include <synch.h> #include <synch.h>
#ifndef _REENTRANT #ifndef _REENTRANT
#define _REENTRANT #define _REENTRANT
#endif #endif
skipping to change at line 185 skipping to change at line 215
#define HAVE_NONPOSIX_SIGWAIT #define HAVE_NONPOSIX_SIGWAIT
#define pthread_t thread_t #define pthread_t thread_t
#define pthread_cond_t cond_t #define pthread_cond_t cond_t
#define pthread_mutex_t mutex_t #define pthread_mutex_t mutex_t
#define pthread_key_t thread_key_t #define pthread_key_t thread_key_t
typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */ typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */
#define pthread_key_create(A,B) thr_keycreate((A),(B)) #define pthread_key_create(A,B) thr_keycreate((A),(B))
#define pthread_key_delete(A) thr_keydelete(A) #define pthread_key_delete(A) thr_keydelete(A)
#define pthread_handler_decl(A,B) void *A(void *B) #define pthread_handler_t EXTERNC void *
#define pthread_key(T,V) pthread_key_t V #define pthread_key(T,V) pthread_key_t V
void * my_pthread_getspecific_imp(pthread_key_t key); void * my_pthread_getspecific_imp(pthread_key_t key);
#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B)) #define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,V) #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,V)
#define pthread_setspecific(A,B) thr_setspecific(A,B) #define pthread_setspecific(A,B) thr_setspecific(A,B)
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,V) #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,V)
#define pthread_create(A,B,C,D) thr_create(NULL,65536L,(C),(D),THR_DETACHED ,(A)) #define pthread_create(A,B,C,D) thr_create(NULL,65536L,(C),(D),THR_DETACHED ,(A))
skipping to change at line 263 skipping to change at line 293
void my_pthread_exit(void *status); void my_pthread_exit(void *status);
#define pthread_exit(A) my_pthread_exit(A) #define pthread_exit(A) my_pthread_exit(A)
#endif #endif
extern int my_pthread_getprio(pthread_t thread_id); extern int my_pthread_getprio(pthread_t thread_id);
#define pthread_key(T,V) pthread_key_t V #define pthread_key(T,V) pthread_key_t V
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V)) #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V)) #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
#define pthread_detach_this_thread() #define pthread_detach_this_thread()
#define pthread_handler_decl(A,B) void *A(void *B) #define pthread_handler_t EXTERNC void *
typedef void *(* pthread_handler)(void *); typedef void *(* pthread_handler)(void *);
/* Test first for RTS or FSU threads */ /* Test first for RTS or FSU threads */
#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) #if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM)
#define HAVE_rts_threads #define HAVE_rts_threads
extern int my_pthread_create_detached; extern int my_pthread_create_detached;
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define PTHREAD_CREATE_DETACHED &my_pthread_create_detached #define PTHREAD_CREATE_DETACHED &my_pthread_create_detached
#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL
skipping to change at line 329 skipping to change at line 359
int sigwait(sigset_t *setp, int *sigp); /* Use our implement ion */ int sigwait(sigset_t *setp, int *sigp); /* Use our implement ion */
#endif #endif
/* /*
We define my_sigset() and use that instead of the system sigset() so that We define my_sigset() and use that instead of the system sigset() so that
we can favor an implementation based on sigaction(). On some systems, suc h we can favor an implementation based on sigaction(). On some systems, suc h
as Mac OS X, sigset() results in flags such as SA_RESTART being set, and as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
we want to make sure that no such flags are set. we want to make sure that no such flags are set.
*/ */
#if defined(HAVE_SIGACTION) && !defined(my_sigset) #if defined(HAVE_SIGACTION) && !defined(my_sigset)
#define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; #define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc;
\ \
DBUG_ASSERT((A) != 0); DBUG_ASSERT((A) != 0);
\ \
sigemptyset(&set); sigemptyset(&l_set);
\ \
s.sa_handler = (B); l_s.sa_handler = (B);
\ \
s.sa_mask = set; l_s.sa_mask = l_set;
\ \
s.sa_flags = 0; l_s.sa_flags = 0;
\ \
rc= sigaction((A), &s, (struct sigaction *) NUL l_rc= sigaction((A), &l_s, (struct sigaction *)
L);\ NULL);\
DBUG_ASSERT(rc == 0); DBUG_ASSERT(l_rc == 0);
\ \
} while (0) } while (0)
#elif defined(HAVE_SIGSET) && !defined(my_sigset) #elif defined(HAVE_SIGSET) && !defined(my_sigset)
#define my_sigset(A,B) sigset((A),(B)) #define my_sigset(A,B) sigset((A),(B))
#elif !defined(my_sigset) #elif !defined(my_sigset)
#define my_sigset(A,B) signal((A),(B)) #define my_sigset(A,B) signal((A),(B))
#endif #endif
#ifndef my_pthread_setprio #ifndef my_pthread_setprio
#if defined(HAVE_PTHREAD_SETPRIO_NP) /* FSU threads */ #if defined(HAVE_PTHREAD_SETPRIO_NP) /* FSU threads */
#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B)) #define my_pthread_setprio(A,B) pthread_setprio_np((A),(B))
skipping to change at line 416 skipping to change at line 446
#define pthread_attr_delete(A) pthread_dummy(0) #define pthread_attr_delete(A) pthread_dummy(0)
#define pthread_condattr_delete(A) pthread_dummy(0) #define pthread_condattr_delete(A) pthread_dummy(0)
#define pthread_attr_setstacksize(A,B) pthread_dummy(0) #define pthread_attr_setstacksize(A,B) pthread_dummy(0)
#define pthread_equal(A,B) ((A) == (B)) #define pthread_equal(A,B) ((A) == (B))
#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b)) #define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b))
#define pthread_attr_init(A) pthread_attr_create(A) #define pthread_attr_init(A) pthread_attr_create(A)
#define pthread_attr_destroy(A) pthread_attr_delete(A) #define pthread_attr_destroy(A) pthread_attr_delete(A)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) #define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread #undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthre ad_detach(&tmp); } #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthre ad_detach(&tmp); }
#endif #endif
#ifdef HAVE_DARWIN5_THREADS #ifdef HAVE_DARWIN5_THREADS
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#define pthread_condattr_init(A) pthread_dummy(0) #define pthread_condattr_init(A) pthread_dummy(0)
#define pthread_condattr_destroy(A) pthread_dummy(0) #define pthread_condattr_destroy(A) pthread_dummy(0)
#undef pthread_detach_this_thread #undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthre ad_detach(tmp); } #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthre ad_detach(tmp); }
#endif #endif
#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defin ed(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) #if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defin ed(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */ /* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */
#define pthread_key_create(A,B) \ #define pthread_key_create(A,B) \
pthread_keycreate(A,(B) ?\ pthread_keycreate(A,(B) ?\
(pthread_destructor_t) (B) :\ (pthread_destructor_t) (B) :\
(pthread_destructor_t) pthread_dummy) (pthread_destructor_t) pthread_dummy)
#define pthread_attr_init(A) pthread_attr_create(A) #define pthread_attr_init(A) pthread_attr_create(A)
#define pthread_attr_destroy(A) pthread_attr_delete(A) #define pthread_attr_destroy(A) pthread_attr_delete(A)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) #define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#ifndef pthread_sigmask #ifndef pthread_sigmask
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#endif #endif
#define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread #undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthre ad_detach(&tmp); } #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthre ad_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ #elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#define HAVE_PTHREAD_KILL #define HAVE_PTHREAD_KILL
#endif #endif
#endif /* defined(__WIN__) */ #endif /* defined(__WIN__) */
#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) #if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#undef pthread_cond_timedwait #undef pthread_cond_timedwait
skipping to change at line 470 skipping to change at line 500
#define pthread_attr_getstacksize(A,B) my_pthread_attr_getstacksize(A,B) #define pthread_attr_getstacksize(A,B) my_pthread_attr_getstacksize(A,B)
void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size); void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
#endif #endif
#if defined(HAVE_POSIX1003_4a_MUTEX) && !defined(DONT_REMAP_PTHREAD_FUNCTIO NS) #if defined(HAVE_POSIX1003_4a_MUTEX) && !defined(DONT_REMAP_PTHREAD_FUNCTIO NS)
#undef pthread_mutex_trylock #undef pthread_mutex_trylock
#define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a)) #define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a))
int my_pthread_mutex_trylock(pthread_mutex_t *mutex); int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif #endif
/*
The defines set_timespec and set_timespec_nsec should be used
for calculating an absolute time at which
pthread_cond_timedwait should timeout
*/
#ifdef HAVE_TIMESPEC_TS_SEC
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{ \
(ABSTIME).ts_sec=time(0) + (time_t) (SEC); \
(ABSTIME).ts_nsec=0; \
}
#endif /* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{ \
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).ts_sec= (now / ULL(10000000)); \
(ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#else
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{\
struct timeval tv;\
gettimeofday(&tv,0);\
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
#endif /* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \
(ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#endif /* HAVE_TIMESPEC_TS_SEC */
/* safe_mutex adds checking to mutex for easier debugging */ /* safe_mutex adds checking to mutex for easier debugging */
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY) #if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
#define SAFE_MUTEX_DETECT_DESTROY #define SAFE_MUTEX_DETECT_DESTROY
#endif #endif
typedef struct st_safe_mutex_t typedef struct st_safe_mutex_t
{ {
pthread_mutex_t global,mutex; pthread_mutex_t global,mutex;
const char *file; const char *file;
skipping to change at line 505 skipping to change at line 576
{ {
struct st_safe_mutex_info_t *next; struct st_safe_mutex_info_t *next;
struct st_safe_mutex_info_t *prev; struct st_safe_mutex_info_t *prev;
const char *init_file; const char *init_file;
uint32 init_line; uint32 init_line;
} safe_mutex_info_t; } safe_mutex_info_t;
#endif /* SAFE_MUTEX_DETECT_DESTROY */ #endif /* SAFE_MUTEX_DETECT_DESTROY */
int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
const char *file, uint line); const char *file, uint line);
int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, u int line);
int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
uint line); uint line);
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
struct timespec *abstime, const char *file, uint lin e); struct timespec *abstime, const char *file, uint lin e);
void safe_mutex_global_init(void); void safe_mutex_global_init(void);
void safe_mutex_end(FILE *file); void safe_mutex_end(FILE *file);
/* Wrappers if safe mutex is actually used */ /* Wrappers if safe mutex is actually used */
skipping to change at line 528 skipping to change at line 599
#undef pthread_mutex_lock #undef pthread_mutex_lock
#undef pthread_mutex_unlock #undef pthread_mutex_unlock
#undef pthread_mutex_destroy #undef pthread_mutex_destroy
#undef pthread_mutex_wait #undef pthread_mutex_wait
#undef pthread_mutex_timedwait #undef pthread_mutex_timedwait
#undef pthread_mutex_t #undef pthread_mutex_t
#undef pthread_cond_wait #undef pthread_cond_wait
#undef pthread_cond_timedwait #undef pthread_cond_timedwait
#undef pthread_mutex_trylock #undef pthread_mutex_trylock
#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__) #define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__)
#define pthread_mutex_lock(A) safe_mutex_lock((A),__FILE__,__LINE__) #define pthread_mutex_lock(A) safe_mutex_lock((A), FALSE, __FILE__, __LINE_ _)
#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__) #define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__)
#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__) #define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__) #define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__)
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FIL E__,__LINE__) #define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FIL E__,__LINE__)
#define pthread_mutex_trylock(A) pthread_mutex_lock(A) #define pthread_mutex_trylock(A) safe_mutex_lock((A), TRUE, __FILE__, __LIN E__)
#define pthread_mutex_t safe_mutex_t #define pthread_mutex_t safe_mutex_t
#define safe_mutex_assert_owner(mp) DBUG_ASSERT((mp)->count > 0 && pthread_ #define safe_mutex_assert_owner(mp) \
equal(pthread_self(),(mp)->thread)) DBUG_ASSERT((mp)->count > 0 && \
pthread_equal(pthread_self(), (mp)->thread))
#define safe_mutex_assert_not_owner(mp) \
DBUG_ASSERT(! (mp)->count || \
! pthread_equal(pthread_self(), (mp)->thread))
#else #else
#define safe_mutex_assert_owner(mp) #define safe_mutex_assert_owner(mp)
#define safe_mutex_assert_not_owner(mp)
#endif /* SAFE_MUTEX */ #endif /* SAFE_MUTEX */
/* READ-WRITE thread locking */ /* READ-WRITE thread locking */
#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */ #ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */
#undef HAVE_PTHREAD_RWLOCK_RDLOCK #undef HAVE_PTHREAD_RWLOCK_RDLOCK
#undef HAVE_RWLOCK_INIT #undef HAVE_RWLOCK_INIT
#undef HAVE_RWLOCK_T #undef HAVE_RWLOCK_T
#endif #endif
skipping to change at line 623 skipping to change at line 700
#else #else
#define MY_MUTEX_INIT_FAST NULL #define MY_MUTEX_INIT_FAST NULL
#endif #endif
#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP #ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
extern pthread_mutexattr_t my_errorcheck_mutexattr; extern pthread_mutexattr_t my_errorcheck_mutexattr;
#define MY_MUTEX_INIT_ERRCHK &my_errorcheck_mutexattr #define MY_MUTEX_INIT_ERRCHK &my_errorcheck_mutexattr
#else #else
#define MY_MUTEX_INIT_ERRCHK NULL #define MY_MUTEX_INIT_ERRCHK NULL
#endif #endif
#ifndef ESRCH
/* Define it to something */
#define ESRCH 1
#endif
extern my_bool my_thread_global_init(void); extern my_bool my_thread_global_init(void);
extern void my_thread_global_end(void); extern void my_thread_global_end(void);
extern my_bool my_thread_init(void); extern my_bool my_thread_init(void);
extern void my_thread_end(void); extern void my_thread_end(void);
extern const char *my_thread_name(void); extern const char *my_thread_name(void);
extern long my_thread_id(void); extern long my_thread_id(void);
extern int pthread_no_free(void *); extern int pthread_no_free(void *);
extern int pthread_dummy(int); extern int pthread_dummy(int);
/* All thread specific variables are in the following struct */ /* All thread specific variables are in the following struct */
#define THREAD_NAME_SIZE 10 #define THREAD_NAME_SIZE 10
#ifndef DEFAULT_THREAD_STACK #ifndef DEFAULT_THREAD_STACK
#if defined(__ia64__) #if SIZEOF_CHARP > 4
/* /*
MySQL can survive with 32K, but some glibc libraries require > 128K stack MySQL can survive with 32K, but some glibc libraries require > 128K stack
To resolve hostnames To resolve hostnames. Also recursive stored procedures needs stack.
*/ */
#define DEFAULT_THREAD_STACK (256*1024L) #define DEFAULT_THREAD_STACK (256*1024L)
#else #else
#define DEFAULT_THREAD_STACK (192*1024) #define DEFAULT_THREAD_STACK (192*1024)
#endif #endif
#endif #endif
struct st_my_thread_var struct st_my_thread_var
{ {
int thr_errno; int thr_errno;
skipping to change at line 668 skipping to change at line 750
my_bool init; my_bool init;
struct st_my_thread_var *next,**prev; struct st_my_thread_var *next,**prev;
void *opt_info; void *opt_info;
#ifndef DBUG_OFF #ifndef DBUG_OFF
gptr dbug; gptr dbug;
char name[THREAD_NAME_SIZE+1]; char name[THREAD_NAME_SIZE+1];
#endif #endif
}; };
extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const) ); extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const) );
extern uint my_thread_end_wait_time;
#define my_thread_var (_my_thread_var()) #define my_thread_var (_my_thread_var())
#define my_errno my_thread_var->thr_errno #define my_errno my_thread_var->thr_errno
/* /*
Keep track of shutdown,signal, and main threads so that my_end() will not Keep track of shutdown,signal, and main threads so that my_end() will not
report errors with them report errors with them
*/ */
extern pthread_t shutdown_th, main_th, signal_th;
/* Which kind of thread library is in use */
#define THD_LIB_OTHER 1
#define THD_LIB_NPTL 2
#define THD_LIB_LT 4
extern uint thd_lib_detected;
/* statistics_xxx functions are for not essential statistic */ /* statistics_xxx functions are for not essential statistic */
#ifndef thread_safe_increment #ifndef thread_safe_increment
#ifdef HAVE_ATOMIC_ADD #ifdef HAVE_ATOMIC_ADD
#define thread_safe_increment(V,L) atomic_add(1,(atomic_t*) &V); #define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V)
#define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V); #define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V)
#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V); #define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V)
#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V)
#else #else
#define thread_safe_increment(V,L) \ #define thread_safe_increment(V,L) \
pthread_mutex_lock((L)); (V)++; pthread_mutex_unlock((L)); (pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L)))
#define thread_safe_add(V,C,L) \ #define thread_safe_decrement(V,L) \
pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L)); (pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L)))
#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_
mutex_unlock((L)))
#define thread_safe_sub(V,C,L) \ #define thread_safe_sub(V,C,L) \
pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L)); (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
#endif /* HAVE_ATOMIC_ADD */ #endif /* HAVE_ATOMIC_ADD */
#ifdef SAFE_STATISTICS #ifdef SAFE_STATISTICS
#define statistic_increment(V,L) thread_safe_increment((V),(L)) #define statistic_increment(V,L) thread_safe_increment((V),(L))
#define statistic_decrement(V,L) thread_safe_decrement((V),(L))
#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) #define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
#else #else
#define statistic_decrement(V,L) (V)--
#define statistic_increment(V,L) (V)++ #define statistic_increment(V,L) (V)++
#define statistic_add(V,C,L) (V)+=(C) #define statistic_add(V,C,L) (V)+=(C)
#endif /* SAFE_STATISTICS */ #endif /* SAFE_STATISTICS */
#endif /* thread_safe_increment */ #endif /* thread_safe_increment */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _my_ptread_h */ #endif /* _my_ptread_h */
 End of changes. 35 change blocks. 
57 lines changed or deleted 151 lines changed or added


 my_sys.h   my_sys.h 
/* Copyright (C) 2000-2003 MySQL AB /* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 35 skipping to change at line 34
int pending; int pending;
} my_aio_result; } my_aio_result;
#endif #endif
#ifndef THREAD #ifndef THREAD
extern int NEAR my_errno; /* Last error in mysys */ extern int NEAR my_errno; /* Last error in mysys */
#else #else
#include <my_pthread.h> #include <my_pthread.h>
#endif #endif
#ifndef _m_ctype_h
#include <m_ctype.h> /* for CHARSET_INFO */ #include <m_ctype.h> /* for CHARSET_INFO */
#endif
#include <stdarg.h> #include <stdarg.h>
#include <typelib.h> #include <typelib.h>
#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curs es; mysys_uses_curses=1; } #define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curs es; mysys_uses_curses=1; }
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_ no_curses; mysys_uses_curses=0;} #define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_ no_curses; mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); } #define MY_INIT(name); { my_progname= name; my_init(); }
#define MAXMAPS (4) /* Number of error message maps */
#define ERRMOD (1000) /* Max number of errors in a map */
#define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */ #define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */
#define NRERRBUFFS (2) /* Buffers for parameters */ #define NRERRBUFFS (2) /* Buffers for parameters */
#define MY_FILE_ERROR ((uint) ~0) #define MY_FILE_ERROR ((uint) ~0)
/* General bitmaps for my_func's */ /* General bitmaps for my_func's */
#define MY_FFNF 1 /* Fatal if file not found */ #define MY_FFNF 1 /* Fatal if file not found */
#define MY_FNABP 2 /* Fatal if not all bytes read/writen */ #define MY_FNABP 2 /* Fatal if not all bytes read/writen */
#define MY_NABP 4 /* Error if not all bytes read/write n */ #define MY_NABP 4 /* Error if not all bytes read/write n */
#define MY_FAE 8 /* Fatal if any error */ #define MY_FAE 8 /* Fatal if any error */
#define MY_WME 16 /* Write message on error */ #define MY_WME 16 /* Write message on error */
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */ #define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
#define MY_RAID 64 /* Support for RAID (not the "Johnson&Johns #define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors
on"-s one ;) */ */
#define MY_FULL_IO 512 /* For my_read - loop intil I/O #define MY_RAID 64 /* Support for RAID */
is complete #define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete
*/ */
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */ #define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */ #define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
#define MY_COPYTIME 64 /* my_redel() copys time */ #define MY_COPYTIME 64 /* my_redel() copys time */
#define MY_DELETE_OLD 256 /* my_create_with_symlink() */ #define MY_DELETE_OLD 256 /* my_create_with_symlink() */
#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */ #define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */
#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */ #define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */
#define MY_REDEL_MAKE_BACKUP 256 #define MY_REDEL_MAKE_BACKUP 256
#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */ #define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */
#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */ #define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */
#define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */ #define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */
#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */ #define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
#define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */ #define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */ #define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
#define MY_SYNC 4096 /* my_copy(): sync dst file */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/ #define MY_GIVE_INFO 2 /* Give time info about process*/
#define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */
#define ME_HIGHBYTE 8 /* Shift for colours */ #define ME_HIGHBYTE 8 /* Shift for colours */
#define ME_NOCUR 1 /* Don't use curses message */ #define ME_NOCUR 1 /* Don't use curses message */
#define ME_OLDWIN 2 /* Use old window */ #define ME_OLDWIN 2 /* Use old window */
#define ME_BELL 4 /* Ring bell then printing message * / #define ME_BELL 4 /* Ring bell then printing message * /
#define ME_HOLDTANG 8 /* Don't delete last keys */ #define ME_HOLDTANG 8 /* Don't delete last keys */
#define ME_WAITTOT 16 /* Wait for errtime secs of for a action */ #define ME_WAITTOT 16 /* Wait for errtime secs of for a action */
#define ME_WAITTANG 32 /* Wait for a user action */ #define ME_WAITTANG 32 /* Wait for a user action */
#define ME_NOREFRESH 64 /* Dont refresh screen */ #define ME_NOREFRESH 64 /* Dont refresh screen */
#define ME_NOINPUT 128 /* Dont use the input libary */ #define ME_NOINPUT 128 /* Dont use the input libary */
skipping to change at line 124 skipping to change at line 119
#define DFLT_INIT_HITS 3 #define DFLT_INIT_HITS 3
/* root_alloc flags */ /* root_alloc flags */
#define MY_KEEP_PREALLOC 1 #define MY_KEEP_PREALLOC 1
#define MY_MARK_BLOCKS_FREE 2 /* move used to free list and reuse them */ #define MY_MARK_BLOCKS_FREE 2 /* move used to free list and reuse them */
/* Internal error numbers (for assembler functions) */ /* Internal error numbers (for assembler functions) */
#define MY_ERRNO_EDOM 33 #define MY_ERRNO_EDOM 33
#define MY_ERRNO_ERANGE 34 #define MY_ERRNO_ERANGE 34
/* Bits for get_date timeflag */
#define GETDATE_DATE_TIME 1
#define GETDATE_SHORT_DATE 2
#define GETDATE_HHMMSSTIME 4
#define GETDATE_GMT 8
#define GETDATE_FIXEDLENGTH 16
/* defines when allocating data */ /* defines when allocating data */
#ifdef SAFEMALLOC #ifdef SAFEMALLOC
#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG ) #define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG )
#define my_malloc_ci(SZ,FLAG) _mymalloc((SZ), sFile, uLine, FLAG ) #define my_malloc_ci(SZ,FLAG) _mymalloc((SZ), sFile, uLine, FLAG )
#define my_realloc(PTR,SZ,FLAG) _myrealloc((PTR), (SZ), __FILE__, __LINE__, FLAG ) #define my_realloc(PTR,SZ,FLAG) _myrealloc((PTR), (SZ), __FILE__, __LINE__, FLAG )
#define my_checkmalloc() _sanity( __FILE__, __LINE__ ) #define my_checkmalloc() _sanity( __FILE__, __LINE__ )
#define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG) #define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG)
#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C) #define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C)
#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C) #define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C)
#define my_strdup_with_length(A,B,C) _my_strdup_with_length((A),(B),__FILE_ _,__LINE__,C) #define my_strdup_with_length(A,B,C) _my_strdup_with_length((A),(B),__FILE_ _,__LINE__,C)
#define TRASH(A,B) bfill(A, B, 0x8F)
#define QUICK_SAFEMALLOC sf_malloc_quick=1 #define QUICK_SAFEMALLOC sf_malloc_quick=1
#define NORMAL_SAFEMALLOC sf_malloc_quick=0 #define NORMAL_SAFEMALLOC sf_malloc_quick=0
extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
extern ulonglong sf_malloc_mem_limit; extern ulonglong sf_malloc_mem_limit;
#define CALLER_INFO_PROTO , const char *sFile, uint uLine #define CALLER_INFO_PROTO , const char *sFile, uint uLine
#define CALLER_INFO , __FILE__, __LINE__ #define CALLER_INFO , __FILE__, __LINE__
#define ORIG_CALLER_INFO , sFile, uLine #define ORIG_CALLER_INFO , sFile, uLine
#else #else
#define my_checkmalloc() #define my_checkmalloc()
#undef TERMINATE #undef TERMINATE
#define TERMINATE(A) {} #define TERMINATE(A) {}
#define QUICK_SAFEMALLOC #define QUICK_SAFEMALLOC
#define NORMAL_SAFEMALLOC #define NORMAL_SAFEMALLOC
extern gptr my_malloc(uint Size,myf MyFlags); extern gptr my_malloc(size_t Size, myf MyFlags);
#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) #define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG )
extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags); extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags);
extern void my_no_flags_free(gptr ptr); extern void my_no_flags_free(gptr ptr);
extern gptr my_memdup(const byte *from,uint length,myf MyFlags); extern gptr my_memdup(const byte *from, size_t length, myf MyFlags);
extern char *my_strdup(const char *from,myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags);
extern char *my_strdup_with_length(const byte *from, uint length, extern char *my_strdup_with_length(const char *from, size_t length,
myf MyFlags); myf MyFlags);
#define my_free(PTR,FG) my_no_flags_free(PTR) /* we do use FG (as a no-op) in below so that a typo on FG is caught */
#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR))
#define CALLER_INFO_PROTO /* nothing */ #define CALLER_INFO_PROTO /* nothing */
#define CALLER_INFO /* nothing */ #define CALLER_INFO /* nothing */
#define ORIG_CALLER_INFO /* nothing */ #define ORIG_CALLER_INFO /* nothing */
#define TRASH(A,B) /* nothing */
#endif #endif
#define my_strndup(A,B,C) my_strdup_with_length((A), (B), (C))
#ifdef HAVE_LARGE_PAGES
extern uint my_get_large_page_size(void);
extern gptr my_large_malloc(size_t size, myf my_flags);
extern void my_large_free(gptr ptr, myf my_flags);
#else
#define my_get_large_page_size() (0)
#define my_large_malloc(A,B) my_malloc_lock((A),(B))
#define my_large_free(A,B) my_free_lock((A),(B))
#endif /* HAVE_LARGE_PAGES */
#ifdef HAVE_ALLOCA #ifdef HAVE_ALLOCA
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43) #if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca #pragma alloca
#endif /* _AIX */ #endif /* _AIX */
#if defined(__MWERKS__) #if defined(__MWERKS__)
#undef alloca #undef alloca
#define alloca _alloca #define alloca _alloca
#endif /* __MWERKS__ */ #endif /* __MWERKS__ */
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca) #if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
skipping to change at line 203 skipping to change at line 219
#endif #endif
#endif /* MSDOS */ #endif /* MSDOS */
#ifndef errno /* did we already get it? */ #ifndef errno /* did we already get it? */
#ifdef HAVE_ERRNO_AS_DEFINE #ifdef HAVE_ERRNO_AS_DEFINE
#include <errno.h> /* errno is a define */ #include <errno.h> /* errno is a define */
#else #else
extern int errno; /* declare errno */ extern int errno; /* declare errno */
#endif #endif
#endif /* #ifndef errno */ #endif /* #ifndef errno */
extern const char ** NEAR my_errmsg[];
extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
extern char *home_dir; /* Home directory for user */ extern char *home_dir; /* Home directory for user */
extern char *my_progname; /* program-name (printed in errors) */ extern const char *my_progname; /* program-name (printed in errors) */
extern char NEAR curr_dir[]; /* Current directory for user */ extern char NEAR curr_dir[]; /* Current directory for user */
extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern int (*fatal_error_handler_hook)(uint my_err, const char *str, extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
myf MyFlags); myf MyFlags);
extern uint my_file_limit; extern uint my_file_limit;
#ifdef HAVE_LARGE_PAGES
extern my_bool my_use_large_pages;
extern uint my_large_page_size;
#endif
/* charsets */ /* charsets */
extern CHARSET_INFO *default_charset_info; extern CHARSET_INFO *default_charset_info;
extern CHARSET_INFO *all_charsets[256]; extern CHARSET_INFO *all_charsets[256];
extern CHARSET_INFO compiled_charsets[]; extern CHARSET_INFO compiled_charsets[];
/* statistics */ /* statistics */
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern uint mysys_usage_id; extern uint mysys_usage_id;
extern my_bool my_init_done; extern my_bool my_init_done;
skipping to change at line 235 skipping to change at line 255
/* Executed before jump to shell */ /* Executed before jump to shell */
(*my_sigtstp_restart)(void), (*my_sigtstp_restart)(void),
(*my_abort_hook)(int); (*my_abort_hook)(int);
/* Executed when comming from shell */ /* Executed when comming from shell */
extern int NEAR my_umask, /* Default creation mask */ extern int NEAR my_umask, /* Default creation mask */
NEAR my_umask_dir, NEAR my_umask_dir,
NEAR my_recived_signals, /* Signals we have got */ NEAR my_recived_signals, /* Signals we have got */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */ NEAR my_dont_interrupt; /* call remember_intr when set */
extern my_bool NEAR mysys_uses_curses, my_use_symdir; extern my_bool NEAR mysys_uses_curses, my_use_symdir;
extern ulong sf_malloc_cur_memory, sf_malloc_max_memory; extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
extern ulong my_default_record_cache_size; extern ulong my_default_record_cache_size;
extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io, extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks; NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks;
extern char wild_many,wild_one,wild_prefix; extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir; extern const char *charsets_dir;
extern char *defaults_extra_file; /* from default.c */
extern char *my_defaults_extra_file;
extern const char *my_defaults_group_suffix;
extern const char *my_defaults_file;
extern my_bool timed_mutexes;
typedef struct wild_file_pack /* Struct to hold info when selecting files */ typedef struct wild_file_pack /* Struct to hold info when selecting files */
{ {
uint wilds; /* How many wildcards */ uint wilds; /* How many wildcards */
uint not_pos; /* Start of not-theese-files */ uint not_pos; /* Start of not-theese-files */
my_string *wild; /* Pointer to wildcards */ my_string *wild; /* Pointer to wildcards */
} WF_PACK; } WF_PACK;
enum loglevel { enum loglevel {
ERROR_LEVEL, ERROR_LEVEL,
WARNING_LEVEL, WARNING_LEVEL,
INFORMATION_LEVEL INFORMATION_LEVEL
}; };
enum cache_type enum cache_type
{ {
READ_CACHE,WRITE_CACHE, TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE,
SEQ_READ_APPEND /* sequential read or append */, SEQ_READ_APPEND /* sequential read or append */,
READ_FIFO, READ_NET,WRITE_NET}; READ_FIFO, READ_NET,WRITE_NET};
enum flush_type enum flush_type
{ {
FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE
}; };
typedef struct st_record_cache /* Used when cacheing records */ typedef struct st_record_cache /* Used when cacheing records */
{ {
skipping to change at line 299 skipping to change at line 324
{ {
my_string name; my_string name;
enum file_type type; enum file_type type;
#if defined(THREAD) && !defined(HAVE_PREAD) #if defined(THREAD) && !defined(HAVE_PREAD)
pthread_mutex_t mutex; pthread_mutex_t mutex;
#endif #endif
}; };
extern struct st_my_file_info *my_file_info; extern struct st_my_file_info *my_file_info;
typedef struct st_dynamic_array
{
char *buffer;
uint elements,max_element;
uint alloc_increment;
uint size_of_element;
} DYNAMIC_ARRAY;
typedef struct st_my_tmpdir typedef struct st_my_tmpdir
{ {
DYNAMIC_ARRAY full_list;
char **list; char **list;
uint cur, max; uint cur, max;
#ifdef THREAD #ifdef THREAD
pthread_mutex_t mutex; pthread_mutex_t mutex;
#endif #endif
} MY_TMPDIR; } MY_TMPDIR;
typedef struct st_dynamic_array
{
char *buffer;
uint elements,max_element;
uint alloc_increment;
uint size_of_element;
} DYNAMIC_ARRAY;
typedef struct st_dynamic_string typedef struct st_dynamic_string
{ {
char *str; char *str;
uint length,max_length,alloc_increment; uint length,max_length,alloc_increment;
} DYNAMIC_STRING; } DYNAMIC_STRING;
struct st_io_cache; struct st_io_cache;
typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
#ifdef THREAD #ifdef THREAD
skipping to change at line 490 skipping to change at line 516
#define my_b_read(info,Buffer,Count) \ #define my_b_read(info,Buffer,Count) \
((info)->read_pos + (Count) <= (info)->read_end ?\ ((info)->read_pos + (Count) <= (info)->read_end ?\
(memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \ (memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \
((info)->read_pos+=(Count)),0) :\ ((info)->read_pos+=(Count)),0) :\
(*(info)->read_function)((info),Buffer,Count)) (*(info)->read_function)((info),Buffer,Count))
#define my_b_write(info,Buffer,Count) \ #define my_b_write(info,Buffer,Count) \
((info)->write_pos + (Count) <=(info)->write_end ?\ ((info)->write_pos + (Count) <=(info)->write_end ?\
(memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\ (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\
((info)->write_pos+=(Count)),0) : \ ((info)->write_pos+=(Count)),0) : \
(*(info)->write_function)((info),(Buffer),(Count))) (*(info)->write_function)((info),(Buffer), (uint)(Count)))
#define my_b_get(info) \ #define my_b_get(info) \
((info)->read_pos != (info)->read_end ?\ ((info)->read_pos != (info)->read_end ?\
((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\ ((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\
_my_b_get(info)) _my_b_get(info))
/* my_b_write_byte dosn't have any err-check */ /* my_b_write_byte dosn't have any err-check */
#define my_b_write_byte(info,chr) \ #define my_b_write_byte(info,chr) \
(((info)->write_pos < (info)->write_end) ?\ (((info)->write_pos < (info)->write_end) ?\
((*(info)->write_pos++)=(chr)) :\ ((*(info)->write_pos++)=(chr)) :\
(_my_b_write(info,0,0) , ((*(info)->write_pos++)=(chr)))) (_my_b_write(info,0,0) , ((*(info)->write_pos++)=(chr))))
#define my_b_fill_cache(info) \ #define my_b_fill_cache(info) \
(((info)->read_end=(info)->read_pos),(*(info)->read_function)(info,0,0)) (((info)->read_end=(info)->read_pos),(*(info)->read_function)(info,0,0))
#define my_b_tell(info) ((info)->pos_in_file + \ #define my_b_tell(info) ((info)->pos_in_file + \
(uint) (*(info)->current_pos - (info)->request_pos) ) (uint) (*(info)->current_pos - (info)->request_pos) )
#define my_b_get_buffer_start(info) (info)->request_pos
#define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \
(char*) my_b_get_buffer_start(info)
#define my_b_get_pos_in_file(info) (info)->pos_in_file
/* tell write offset in the SEQ_APPEND cache */ /* tell write offset in the SEQ_APPEND cache */
my_off_t my_b_append_tell(IO_CACHE* info); my_off_t my_b_append_tell(IO_CACHE* info);
my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
#define my_b_bytes_in_cache(info) (uint) (*(info)->current_end - \ #define my_b_bytes_in_cache(info) (uint) (*(info)->current_end - \
*(info)->current_pos) *(info)->current_pos)
typedef uint32 ha_checksum; typedef uint32 ha_checksum;
/* Define the type of function to be passed to process_default_option_files
*/
typedef int (*Process_option_func)(void *ctx, const char *group_name,
const char *option);
#include <my_alloc.h> #include <my_alloc.h>
/* Prototypes for mysys and my_func functions */ /* Prototypes for mysys and my_func functions */
extern int my_copy(const char *from,const char *to,myf MyFlags); extern int my_copy(const char *from,const char *to,myf MyFlags);
extern int my_append(const char *from,const char *to,myf MyFlags); extern int my_append(const char *from,const char *to,myf MyFlags);
extern int my_delete(const char *name,myf MyFlags); extern int my_delete(const char *name,myf MyFlags);
extern int my_getwd(my_string buf,uint size,myf MyFlags); extern int my_getwd(my_string buf,uint size,myf MyFlags);
extern int my_setwd(const char *dir,myf MyFlags); extern int my_setwd(const char *dir,myf MyFlags);
extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFla gs); extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFla gs);
extern gptr my_once_alloc(uint Size,myf MyFlags); extern gptr my_once_alloc(uint Size,myf MyFlags);
extern void my_once_free(void); extern void my_once_free(void);
extern char *my_once_strdup(const char *src,myf myflags); extern char *my_once_strdup(const char *src,myf myflags);
extern char *my_once_memdup(const char *src, uint len, myf myflags); extern char *my_once_memdup(const char *src, uint len, myf myflags);
extern my_string my_tempnam(const char *dir,const char *pfx,myf MyFlags);
extern File my_open(const char *FileName,int Flags,myf MyFlags); extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName, extern File my_register_filename(File fd, const char *FileName,
enum file_type type_of_file, enum file_type type_of_file,
uint error_message_number, myf MyFlags); uint error_message_number, myf MyFlags);
extern File my_create(const char *FileName,int CreateFlags, extern File my_create(const char *FileName,int CreateFlags,
int AccsesFlags, myf MyFlags); int AccsesFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags); extern int my_close(File Filedes,myf MyFlags);
extern File my_dup(File file, myf MyFlags); extern File my_dup(File file, myf MyFlags);
extern int my_mkdir(const char *dir, int Flags, myf MyFlags); extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
extern int my_readlink(char *to, const char *filename, myf MyFlags); extern int my_readlink(char *to, const char *filename, myf MyFlags);
extern int my_is_symlink(const char *filename);
extern int my_realpath(char *to, const char *filename, myf MyFlags); extern int my_realpath(char *to, const char *filename, myf MyFlags);
extern File my_create_with_symlink(const char *linkname, const char *filena me, extern File my_create_with_symlink(const char *linkname, const char *filena me,
int createflags, int access_flags, int createflags, int access_flags,
myf MyFlags); myf MyFlags);
extern int my_delete_with_symlink(const char *name, myf MyFlags); extern int my_delete_with_symlink(const char *name, myf MyFlags);
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFla gs); extern int my_rename_with_symlink(const char *from,const char *to,myf MyFla gs);
extern int my_symlink(const char *content, const char *linkname, myf MyFlag s); extern int my_symlink(const char *content, const char *linkname, myf MyFlag s);
extern uint my_read(File Filedes,byte *Buffer,uint Count,myf MyFlags); extern uint my_read(File Filedes,byte *Buffer,uint Count,myf MyFlags);
extern uint my_pread(File Filedes,byte *Buffer,uint Count,my_off_t offset, extern uint my_pread(File Filedes,byte *Buffer,uint Count,my_off_t offset,
myf MyFlags); myf MyFlags);
skipping to change at line 564 skipping to change at line 600
extern my_off_t my_tell(File fd,myf MyFlags); extern my_off_t my_tell(File fd,myf MyFlags);
extern uint my_write(File Filedes,const byte *Buffer,uint Count, extern uint my_write(File Filedes,const byte *Buffer,uint Count,
myf MyFlags); myf MyFlags);
extern uint my_pwrite(File Filedes,const byte *Buffer,uint Count, extern uint my_pwrite(File Filedes,const byte *Buffer,uint Count,
my_off_t offset,myf MyFlags); my_off_t offset,myf MyFlags);
extern uint my_fread(FILE *stream,byte *Buffer,uint Count,myf MyFlags); extern uint my_fread(FILE *stream,byte *Buffer,uint Count,myf MyFlags);
extern uint my_fwrite(FILE *stream,const byte *Buffer,uint Count, extern uint my_fwrite(FILE *stream,const byte *Buffer,uint Count,
myf MyFlags); myf MyFlags);
extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_ftell(FILE *stream,myf MyFlags); extern my_off_t my_ftell(FILE *stream,myf MyFlags);
extern gptr _mymalloc(uint uSize,const char *sFile, extern gptr _mymalloc(size_t uSize, const char *sFile,
uint uLine, myf MyFlag); uint uLine, myf MyFlag);
extern gptr _myrealloc(gptr pPtr,uint uSize,const char *sFile, extern gptr _myrealloc(gptr pPtr, size_t uSize, const char *sFile,
uint uLine, myf MyFlag); uint uLine, myf MyFlag);
extern gptr my_multi_malloc _VARARGS((myf MyFlags, ...)); extern gptr my_multi_malloc _VARARGS((myf MyFlags, ...));
extern void _myfree(gptr pPtr,const char *sFile,uint uLine, myf MyFlag); extern void _myfree(gptr pPtr, const char *sFile, uint uLine, myf MyFlag);
extern int _sanity(const char *sFile,unsigned int uLine); extern int _sanity(const char *sFile,unsigned int uLine);
extern gptr _my_memdup(const byte *from,uint length, extern gptr _my_memdup(const byte *from, size_t length,
const char *sFile, uint uLine,myf MyFlag); const char *sFile, uint uLine, myf MyFlag);
extern my_string _my_strdup(const char *from, const char *sFile, uint uLine , extern my_string _my_strdup(const char *from, const char *sFile, uint uLine ,
myf MyFlag); myf MyFlag);
extern char *_my_strdup_with_length(const byte *from, uint length, extern char *_my_strdup_with_length(const char *from, size_t length,
const char *sFile, uint uLine, const char *sFile, uint uLine,
myf MyFlag); myf MyFlag);
/* implemented in my_memmem.c */
extern void *my_memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
#ifdef __WIN__ #ifdef __WIN__
extern int my_access(const char *path, int amode); extern int my_access(const char *path, int amode);
extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
#else #else
#define my_access access #define my_access access
#endif #endif
extern int check_if_legal_filename(const char *path); extern int check_if_legal_filename(const char *path);
#if defined(__WIN__) && defined(__NT__)
extern int nt_share_delete(const char *name,myf MyFlags);
#define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags
))
#else
#define my_delete_allow_opened(fname,flags) my_delete((fname),(flags))
#endif
#ifndef TERMINATE #ifndef TERMINATE
extern void TERMINATE(FILE *file); extern void TERMINATE(FILE *file);
#endif #endif
extern void init_glob_errs(void); extern void init_glob_errs(void);
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags ); extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags );
extern int my_fclose(FILE *fd,myf MyFlags); extern int my_fclose(FILE *fd,myf MyFlags);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_sync(File fd, myf my_flags); extern int my_sync(File fd, myf my_flags);
extern int my_error _VARARGS((int nr,myf MyFlags, ...)); extern int my_error _VARARGS((int nr,myf MyFlags, ...));
extern int my_printf_error _VARARGS((uint my_err, const char *format, extern int my_printf_error _VARARGS((uint my_err, const char *format,
myf MyFlags, ...)) myf MyFlags, ...))
ATTRIBUTE_FORMAT(printf, 2, 4); ATTRIBUTE_FORMAT(printf, 2, 4);
extern int my_error_register(const char **errmsgs, int first, int last);
extern const char **my_error_unregister(int first, int last);
extern int my_message(uint my_err, const char *str,myf MyFlags); extern int my_message(uint my_err, const char *str,myf MyFlags);
extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags); extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern int my_message_curses(uint my_err, const char *str,myf MyFlags); extern int my_message_curses(uint my_err, const char *str,myf MyFlags);
extern my_bool my_init(void); extern my_bool my_init(void);
extern void my_end(int infoflag); extern void my_end(int infoflag);
extern int my_redel(const char *from, const char *to, int MyFlags); extern int my_redel(const char *from, const char *to, int MyFlags);
extern int my_copystat(const char *from, const char *to, int MyFlags); extern int my_copystat(const char *from, const char *to, int MyFlags);
extern my_string my_filename(File fd); extern my_string my_filename(File fd);
#ifndef THREAD #ifndef THREAD
skipping to change at line 634 skipping to change at line 685
extern int test_if_hard_path(const char *dir_name); extern int test_if_hard_path(const char *dir_name);
extern my_bool has_path(const char *name); extern my_bool has_path(const char *name);
extern char *convert_dirname(char *to, const char *from, const char *from_e nd); extern char *convert_dirname(char *to, const char *from, const char *from_e nd);
extern void to_unix_path(my_string name); extern void to_unix_path(my_string name);
extern my_string fn_ext(const char *name); extern my_string fn_ext(const char *name);
extern my_string fn_same(my_string toname,const char *name,int flag); extern my_string fn_same(my_string toname,const char *name,int flag);
extern my_string fn_format(my_string to,const char *name,const char *dir, extern my_string fn_format(my_string to,const char *name,const char *dir,
const char *form, uint flag); const char *form, uint flag);
extern size_s strlength(const char *str); extern size_s strlength(const char *str);
extern void pack_dirname(my_string to,const char *from); extern void pack_dirname(my_string to,const char *from);
extern uint normalize_dirname(char * to, const char *from);
extern uint unpack_dirname(my_string to,const char *from); extern uint unpack_dirname(my_string to,const char *from);
extern uint cleanup_dirname(my_string to,const char *from); extern uint cleanup_dirname(my_string to,const char *from);
extern uint system_filename(my_string to,const char *from); extern uint system_filename(my_string to,const char *from);
extern uint unpack_filename(my_string to,const char *from); extern uint unpack_filename(my_string to,const char *from);
extern my_string intern_filename(my_string to,const char *from); extern my_string intern_filename(my_string to,const char *from);
extern my_string directory_file_name(my_string dst, const char *src); extern my_string directory_file_name(my_string dst, const char *src);
extern int pack_filename(my_string to, const char *name, size_s max_length) ; extern int pack_filename(my_string to, const char *name, size_s max_length) ;
extern my_string my_path(my_string to,const char *progname, extern my_string my_path(my_string to,const char *progname,
const char *own_pathname_part); const char *own_pathname_part);
extern my_string my_load_path(my_string to, const char *path, extern my_string my_load_path(my_string to, const char *path,
const char *own_path_prefix); const char *own_path_prefix);
extern int wild_compare(const char *str,const char *wildstr,pbool str_is_pa ttern); extern int wild_compare(const char *str,const char *wildstr,pbool str_is_pa ttern);
extern WF_PACK *wf_comp(my_string str); extern WF_PACK *wf_comp(my_string str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name); extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer); extern void wf_end(struct wild_file_pack *buffer);
extern size_s strip_sp(my_string str); extern size_s strip_sp(my_string str);
extern my_bool array_append_string_unique(const char *str,
const char **array, size_t size);
extern void get_date(my_string to,int timeflag,time_t use_time); extern void get_date(my_string to,int timeflag,time_t use_time);
extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,p bool remove_garbage); extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,p bool remove_garbage);
extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file, extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file,
uint reclength,enum cache_type type, uint reclength,enum cache_type type,
pbool use_async_io); pbool use_async_io);
extern int read_cache_record(RECORD_CACHE *info,byte *to); extern int read_cache_record(RECORD_CACHE *info,byte *to);
extern int end_record_cache(RECORD_CACHE *info); extern int end_record_cache(RECORD_CACHE *info);
extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos, extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos,
const byte *record,uint length); const byte *record,uint length);
extern int flush_write_cache(RECORD_CACHE *info); extern int flush_write_cache(RECORD_CACHE *info);
extern long my_clock(void); extern long my_clock(void);
extern sig_handler sigtstp_handler(int signal_number); extern sig_handler sigtstp_handler(int signal_number);
extern void handle_recived_signals(void); extern void handle_recived_signals(void);
extern sig_handler my_set_alarm_variable(int signo); extern sig_handler my_set_alarm_variable(int signo);
extern void my_string_ptr_sort(void *base,uint items,size_s size); extern void my_string_ptr_sort(void *base,uint items,size_s size);
extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
size_s size_of_element,uchar *buffer[]); size_s size_of_element,uchar *buffer[]);
extern qsort_t qsort2(void *base_ptr, size_t total_elems, size_t size, extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size,
qsort2_cmp cmp, void *cmp_argument); qsort_cmp cmp);
extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size,
qsort2_cmp cmp, void *cmp_argument);
extern qsort2_cmp get_ptr_compare(uint); extern qsort2_cmp get_ptr_compare(uint);
void my_store_ptr(byte *buff, uint pack_length, my_off_t pos);
my_off_t my_get_ptr(byte *ptr, uint pack_length);
extern int init_io_cache(IO_CACHE *info,File file,uint cachesize, extern int init_io_cache(IO_CACHE *info,File file,uint cachesize,
enum cache_type type,my_off_t seek_offset, enum cache_type type,my_off_t seek_offset,
pbool use_async_io, myf cache_myflags); pbool use_async_io, myf cache_myflags);
extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
my_off_t seek_offset,pbool use_async_io, my_off_t seek_offset,pbool use_async_io,
pbool clear_cache); pbool clear_cache);
extern void setup_io_cache(IO_CACHE* info); extern void setup_io_cache(IO_CACHE* info);
extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count); extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count);
#ifdef THREAD #ifdef THREAD
extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count); extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count);
skipping to change at line 716 skipping to change at line 774
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
const char *prefix, uint cache_size, const char *prefix, uint cache_size,
myf cache_myflags); myf cache_myflags);
extern my_bool real_open_cached_file(IO_CACHE *cache); extern my_bool real_open_cached_file(IO_CACHE *cache);
extern void close_cached_file(IO_CACHE *cache); extern void close_cached_file(IO_CACHE *cache);
File create_temp_file(char *to, const char *dir, const char *pfx, File create_temp_file(char *to, const char *dir, const char *pfx,
int mode, myf MyFlags); int mode, myf MyFlags);
#define my_init_dynamic_array(A,B,C,D) init_dynamic_array(A,B,C,D CALLER_IN FO) #define my_init_dynamic_array(A,B,C,D) init_dynamic_array(A,B,C,D CALLER_IN FO)
#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_C ALLER_INFO) #define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_C ALLER_INFO)
extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
uint init_alloc,uint alloc_increment CALLER_INFO_PROTO); uint init_alloc,uint alloc_increment
CALLER_INFO_PROTO);
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element); extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element);
extern byte *alloc_dynamic(DYNAMIC_ARRAY *array); extern byte *alloc_dynamic(DYNAMIC_ARRAY *array);
extern byte *pop_dynamic(DYNAMIC_ARRAY*); extern byte *pop_dynamic(DYNAMIC_ARRAY*);
extern my_bool set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_ind ex); extern my_bool set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_ind ex);
extern void get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index) ; extern void get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index) ;
extern void delete_dynamic(DYNAMIC_ARRAY *array); extern void delete_dynamic(DYNAMIC_ARRAY *array);
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
extern void freeze_size(DYNAMIC_ARRAY *array); extern void freeze_size(DYNAMIC_ARRAY *array);
#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index) *(array)->size_of_element) #define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index) *(array)->size_of_element)
#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +( array_index)) #define dynamic_element(array,array_index,type) ((type)((array)->buffer) +( array_index))
#define push_dynamic(A,B) insert_dynamic(A,B) #define push_dynamic(A,B) insert_dynamic(A,B)
#define reset_dynamic(array) ((array)->elements= 0) #define reset_dynamic(array) ((array)->elements= 0)
extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_st r, extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_st r,
uint init_alloc,uint alloc_increment); uint init_alloc,uint alloc_increment);
extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append); extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append);
my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
uint length); uint length);
extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *app
end,
...);
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str); extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size); extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size);
extern void dynstr_free(DYNAMIC_STRING *str); extern void dynstr_free(DYNAMIC_STRING *str);
#ifdef HAVE_MLOCK #ifdef HAVE_MLOCK
extern byte *my_malloc_lock(uint length,myf flags); extern byte *my_malloc_lock(uint length,myf flags);
extern void my_free_lock(byte *ptr,myf flags); extern void my_free_lock(byte *ptr,myf flags);
#else #else
#define my_malloc_lock(A,B) my_malloc((A),(B)) #define my_malloc_lock(A,B) my_malloc((A),(B))
#define my_free_lock(A,B) my_free((A),(B)) #define my_free_lock(A,B) my_free((A),(B))
#endif #endif
#define alloc_root_inited(A) ((A)->min_malloc != 0) #define alloc_root_inited(A) ((A)->min_malloc != 0)
#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) #define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; ( A)->min_malloc=0;} while(0) #define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; ( A)->min_malloc=0;} while(0)
extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size, extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
uint pre_alloc_size); uint pre_alloc_size);
extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size); extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
extern gptr multi_alloc_root(MEM_ROOT *mem_root, ...);
extern void free_root(MEM_ROOT *root, myf MyFLAGS); extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr); extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size, extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
uint prealloc_size); uint prealloc_size);
extern char *strdup_root(MEM_ROOT *root,const char *str); extern char *strdup_root(MEM_ROOT *root,const char *str);
extern char *strmake_root(MEM_ROOT *root,const char *str,uint len); extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
extern char *memdup_root(MEM_ROOT *root,const char *str,uint len); extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
extern void get_defaults_files(int argc, char **argv, extern int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults); char **defaults, char **extra_defaults,
char **group_suffix);
extern int load_defaults(const char *conf_file, const char **groups, extern int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv); int *argc, char ***argv);
extern int modify_defaults_file(const char *file_location, const char *opti
on,
const char *option_value,
const char *section_name, int remove_option
);
extern int my_search_option_files(const char *conf_file, int *argc,
char ***argv, uint *args_used,
Process_option_func func, void *func_ctx)
;
extern void free_defaults(char **argv); extern void free_defaults(char **argv);
extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups); extern void print_defaults(const char *conf_file, const char **groups);
extern my_bool my_compress(byte *, ulong *, ulong *); extern my_bool my_compress(byte *, ulong *, ulong *);
extern my_bool my_uncompress(byte *, ulong *, ulong *); extern my_bool my_uncompress(byte *, ulong *, ulong *);
extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *compl en); extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *compl en);
extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count ); extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count );
extern uint my_bit_log2(ulong value); extern uint my_bit_log2(ulong value);
extern uint my_count_bits(ulonglong v); extern uint my_count_bits(ulonglong v);
extern uint my_count_bits_ushort(ushort v);
extern void my_sleep(ulong m_seconds); extern void my_sleep(ulong m_seconds);
extern ulong crc32(ulong crc, const uchar *buf, uint len); extern ulong crc32(ulong crc, const uchar *buf, uint len);
extern uint my_set_max_open_files(uint files); extern uint my_set_max_open_files(uint files);
void my_free_open_file_info(void); void my_free_open_file_info(void);
ulonglong my_getsystime(void); ulonglong my_getsystime(void);
my_bool my_gethwaddr(uchar *to); my_bool my_gethwaddr(uchar *to);
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#ifndef MAP_NOSYNC
#define MAP_NOSYNC 0
#endif
#define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f)
#define my_munmap(a,b) munmap((a),(b))
#else
/* not a complete set of mmap() flags, but only those that nesessary */
#define PROT_READ 1
#define PROT_WRITE 2
#define MAP_SHARED 0x0001
#define MAP_NOSYNC 0x0800
#define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000
#ifndef __NETWARE__
#define HAVE_MMAP
#endif
void *my_mmap(void *, size_t, int, int, int, my_off_t);
int my_munmap(void *, size_t);
#endif
/* my_getpagesize */
#ifdef HAVE_GETPAGESIZE
#define my_getpagesize() getpagesize()
#else
int my_getpagesize(void);
#endif
int my_msync(int, void *, size_t, int);
/* character sets */ /* character sets */
extern uint get_charset_number(const char *cs_name, uint cs_flags); extern uint get_charset_number(const char *cs_name, uint cs_flags);
extern uint get_collation_number(const char *name); extern uint get_collation_number(const char *name);
extern const char *get_charset_name(uint cs_number); extern const char *get_charset_name(uint cs_number);
extern CHARSET_INFO *get_charset(uint cs_number, myf flags); extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
uint cs_flags, myf my_flags); uint cs_flags, myf my_flags);
extern CHARSET_INFO *get_compatible_charset_with_ctype(CHARSET_INFO
*original_cs);
extern void free_charsets(void); extern void free_charsets(void);
extern char *get_charsets_dir(char *buf); extern char *get_charsets_dir(char *buf);
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
extern my_bool init_compiled_charsets(myf flags); extern my_bool init_compiled_charsets(myf flags);
extern void add_compiled_collation(CHARSET_INFO *cs); extern void add_compiled_collation(CHARSET_INFO *cs);
extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info,
char *to, ulong to_length,
const char *from, ulong length); const char *from, ulong length);
#ifdef __WIN__ #ifdef __WIN__
#define BACKSLASH_MBTAIL #define BACKSLASH_MBTAIL
/* File system character set */ /* File system character set */
extern CHARSET_INFO *fs_character_set(void); extern CHARSET_INFO *fs_character_set(void);
#endif #endif
extern ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info,
char *to, ulong to_length,
const char *from, ulong length);
extern void thd_increment_bytes_sent(ulong length);
extern void thd_increment_bytes_received(ulong length);
extern void thd_increment_net_big_packet_count(ulong length);
#ifdef __WIN__ #ifdef __WIN__
extern my_bool have_tcpip; /* Is set if tcpip is used */ extern my_bool have_tcpip; /* Is set if tcpip is used */
/* implemented in my_windac.c */ /* implemented in my_windac.c */
int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror,
DWORD owner_rights, DWORD everybody_rights); DWORD owner_rights, DWORD everybody_rights);
void my_security_attr_free(SECURITY_ATTRIBUTES *sa); void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
 End of changes. 53 change blocks. 
50 lines changed or deleted 174 lines changed or added


 my_xml.h   my_xml.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
 End of changes. 1 change blocks. 
2 lines changed or deleted 1 lines changed or added


 mysql.h   mysql.h 
/* Copyright (C) 2000-2003 MySQL AB /* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
/*
This file defines the client API to MySQL and also the ABI of the
dynamically linked libmysqlclient.
The ABI should never be changed in a released product of MySQL
thus you need to take great care when changing the file. In case
the file is changed so the ABI is broken, you must also
update the SHAREDLIB_MAJOR_VERSION in configure.in .
*/
#ifndef _mysql_h #ifndef _mysql_h
#define _mysql_h #define _mysql_h
#ifdef _AIX /* large-file support will break without this */
#include <standards.h>
#endif
#ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */ #ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */
#undef WIN #undef WIN
#undef _WIN #undef _WIN
#undef _WIN32 #undef _WIN32
#undef _WIN64 #undef _WIN64
#undef __WIN__ #undef __WIN__
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
skipping to change at line 57 skipping to change at line 71
#ifndef my_socket_defined #ifndef my_socket_defined
#ifdef __WIN__ #ifdef __WIN__
#define my_socket SOCKET #define my_socket SOCKET
#else #else
typedef int my_socket; typedef int my_socket;
#endif /* __WIN__ */ #endif /* __WIN__ */
#endif /* my_socket_defined */ #endif /* my_socket_defined */
#endif /* _global_h */ #endif /* _global_h */
#include "mysql_version.h"
#include "mysql_com.h" #include "mysql_com.h"
#include "mysql_time.h" #include "mysql_time.h"
#include "mysql_version.h"
#include "typelib.h" #include "typelib.h"
#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */ #include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
extern unsigned int mysql_port; extern unsigned int mysql_port;
extern char *mysql_unix_port; extern char *mysql_unix_port;
#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout o n read */ #define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout o n read */
#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */ #define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
#ifdef __NETWARE__ #ifdef __NETWARE__
#pragma pack(push, 8) /* 8 byte alignment */ #pragma pack(push, 8) /* 8 byte alignment */
#endif #endif
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) #define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG) #define IS_BLOB(n) ((n) & BLOB_FLAG)
#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR) #define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR | | (t) == FIELD_TYPE_NEWDECIMAL)
#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG) #define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)- >type == FIELD_TYPE_YEAR) #define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)- >type == FIELD_TYPE_YEAR)
#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_ST RING)
typedef struct st_mysql_field { typedef struct st_mysql_field {
char *name; /* Name of column */ char *name; /* Name of column */
char *org_name; /* Original column name, if an alias */ char *org_name; /* Original column name, if an alias */
char *table; /* Table of column if column was a field */ char *table; /* Table of column if column was a field */
char *org_table; /* Org table name, if table was an alias */ char *org_table; /* Org table name, if table was an alias */
char *db; /* Database for table */ char *db; /* Database for table */
char *catalog; /* Catalog for table */ char *catalog; /* Catalog for table */
char *def; /* Default value (set by mysql_list_fields) * / char *def; /* Default value (set by mysql_list_fields) * /
unsigned long length; /* Width of column (create length) */ unsigned long length; /* Width of column (create length) */
skipping to change at line 119 skipping to change at line 134
typedef unsigned long my_ulonglong; typedef unsigned long my_ulonglong;
#elif defined (__WIN__) #elif defined (__WIN__)
typedef unsigned __int64 my_ulonglong; typedef unsigned __int64 my_ulonglong;
#else #else
typedef unsigned long long my_ulonglong; typedef unsigned long long my_ulonglong;
#endif #endif
#endif #endif
#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0) #define MYSQL_COUNT_ERROR (~(my_ulonglong) 0)
/* backward compatibility define - to be removed eventually */
#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED
typedef struct st_mysql_rows { typedef struct st_mysql_rows {
struct st_mysql_rows *next; /* list of rows */ struct st_mysql_rows *next; /* list of rows */
MYSQL_ROW data; MYSQL_ROW data;
unsigned long length; unsigned long length;
} MYSQL_ROWS; } MYSQL_ROWS;
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
#include "my_alloc.h" #include "my_alloc.h"
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
typedef struct st_mysql_data { typedef struct st_mysql_data {
my_ulonglong rows; my_ulonglong rows;
unsigned int fields; unsigned int fields;
MYSQL_ROWS *data; MYSQL_ROWS *data;
MEM_ROOT alloc; MEM_ROOT alloc;
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY) /* extra info for embedded library */
MYSQL_ROWS **prev_ptr; struct embedded_query_result *embedded_info;
#endif
} MYSQL_DATA; } MYSQL_DATA;
enum mysql_option enum mysql_option
{ {
MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT , MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT ,
MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
}; };
struct st_mysql_options { struct st_mysql_options {
unsigned int connect_timeout, read_timeout, write_timeout; unsigned int connect_timeout, read_timeout, write_timeout;
unsigned int port, protocol; unsigned int port, protocol;
unsigned long client_flag; unsigned long client_flag;
char *host,*user,*password,*unix_socket,*db; char *host,*user,*password,*unix_socket,*db;
struct st_dynamic_array *init_commands; struct st_dynamic_array *init_commands;
char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
char *ssl_key; /* PEM key file */ char *ssl_key; /* PEM key file */
skipping to change at line 188 skipping to change at line 208
a read that is replication-aware a read that is replication-aware
*/ */
my_bool no_master_reads; my_bool no_master_reads;
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY) #if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
my_bool separate_thread; my_bool separate_thread;
#endif #endif
enum mysql_option methods_to_use; enum mysql_option methods_to_use;
char *client_ip; char *client_ip;
/* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */ /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
my_bool secure_auth; my_bool secure_auth;
/* 0 - never report, 1 - always report (default) */
my_bool report_data_truncation;
/* function pointers for local infile support */ /* function pointers for local infile support */
int (*local_infile_init)(void **, const char *, void *); int (*local_infile_init)(void **, const char *, void *);
int (*local_infile_read)(void *, char *, unsigned int); int (*local_infile_read)(void *, char *, unsigned int);
void (*local_infile_end)(void *); void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, unsigned int); int (*local_infile_error)(void *, char *, unsigned int);
void *local_infile_userdata; void *local_infile_userdata;
}; };
enum mysql_status enum mysql_status
skipping to change at line 217 skipping to change at line 239
/* /*
There are three types of queries - the ones that have to go to There are three types of queries - the ones that have to go to
the master, the ones that go to a slave, and the adminstrative the master, the ones that go to a slave, and the adminstrative
type which must happen on the pivot connectioin type which must happen on the pivot connectioin
*/ */
enum mysql_rpl_type enum mysql_rpl_type
{ {
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
}; };
typedef struct character_set
{
unsigned int number; /* character set number */
unsigned int state; /* character set state */
const char *csname; /* collation name */
const char *name; /* character set name */
const char *comment; /* comment */
const char *dir; /* character set directory */
unsigned int mbminlen; /* min. length for multibyte strings */
unsigned int mbmaxlen; /* max. length for multibyte strings */
} MY_CHARSET_INFO;
struct st_mysql_methods; struct st_mysql_methods;
struct st_mysql_stmt; struct st_mysql_stmt;
typedef struct st_mysql typedef struct st_mysql
{ {
NET net; /* Communication parameters */ NET net; /* Communication parameters */
gptr connector_fd; /* ConnectorFd for SSL */ gptr connector_fd; /* ConnectorFd for SSL */
char *host,*user,*passwd,*unix_socket,*server_version,*host_info, *info; char *host,*user,*passwd,*unix_socket,*server_version,*host_info, *info;
char *db; char *db;
struct charset_info_st *charset; struct charset_info_st *charset;
MYSQL_FIELD *fields; MYSQL_FIELD *fields;
MEM_ROOT field_alloc; MEM_ROOT field_alloc;
my_ulonglong affected_rows; my_ulonglong affected_rows;
my_ulonglong insert_id; /* id if insert on table with NEXTNR */ my_ulonglong insert_id; /* id if insert on table with NEXTNR */
my_ulonglong extra_info; /* Used by mysqlshow */ my_ulonglong extra_info; /* Not used */
unsigned long thread_id; /* Id for connection in server */ unsigned long thread_id; /* Id for connection in server */
unsigned long packet_length; unsigned long packet_length;
unsigned int port; unsigned int port;
unsigned long client_flag,server_capabilities; unsigned long client_flag,server_capabilities;
unsigned int protocol_version; unsigned int protocol_version;
unsigned int field_count; unsigned int field_count;
unsigned int server_status; unsigned int server_status;
unsigned int server_language; unsigned int server_language;
unsigned int warning_count; unsigned int warning_count;
struct st_mysql_options options; struct st_mysql_options options;
skipping to change at line 272 skipping to change at line 306
struct st_mysql* last_used_con; struct st_mysql* last_used_con;
LIST *stmts; /* list of all statements */ LIST *stmts; /* list of all statements */
const struct st_mysql_methods *methods; const struct st_mysql_methods *methods;
void *thd; void *thd;
/* /*
Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag
from mysql_stmt_close if close had to cancel result set of this object. from mysql_stmt_close if close had to cancel result set of this object.
*/ */
my_bool *unbuffered_fetch_owner; my_bool *unbuffered_fetch_owner;
/* #if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MY
In embedded server it points to the statement that is processed SQL_VERSION_ID >= 50100
in the current query. We store some results directly in statement /* needed for embedded server - no net buffer to store the 'info' */
fields then. char *info_buffer;
*/ #endif
struct st_mysql_stmt *current_stmt;
} MYSQL; } MYSQL;
typedef struct st_mysql_res { typedef struct st_mysql_res {
my_ulonglong row_count; my_ulonglong row_count;
MYSQL_FIELD *fields; MYSQL_FIELD *fields;
MYSQL_DATA *data; MYSQL_DATA *data;
MYSQL_ROWS *data_cursor; MYSQL_ROWS *data_cursor;
unsigned long *lengths; /* column lengths of current row */ unsigned long *lengths; /* column lengths of current row */
MYSQL *handle; /* for unbuffered reads */ MYSQL *handle; /* for unbuffered reads */
MEM_ROOT field_alloc; MEM_ROOT field_alloc;
skipping to change at line 389 skipping to change at line 421
unsigned int STDCALL mysql_field_count(MYSQL *mysql); unsigned int STDCALL mysql_field_count(MYSQL *mysql);
my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql); my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);
my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql); my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);
unsigned int STDCALL mysql_errno(MYSQL *mysql); unsigned int STDCALL mysql_errno(MYSQL *mysql);
const char * STDCALL mysql_error(MYSQL *mysql); const char * STDCALL mysql_error(MYSQL *mysql);
const char *STDCALL mysql_sqlstate(MYSQL *mysql); const char *STDCALL mysql_sqlstate(MYSQL *mysql);
unsigned int STDCALL mysql_warning_count(MYSQL *mysql); unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
const char * STDCALL mysql_info(MYSQL *mysql); const char * STDCALL mysql_info(MYSQL *mysql);
unsigned long STDCALL mysql_thread_id(MYSQL *mysql); unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
const char * STDCALL mysql_character_set_name(MYSQL *mysql); const char * STDCALL mysql_character_set_name(MYSQL *mysql);
int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csna me);
MYSQL * STDCALL mysql_init(MYSQL *mysql); MYSQL * STDCALL mysql_init(MYSQL *mysql);
my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
const char *cert, const char *ca, const char *cert, const char *ca,
const char *capath, const char *cipher ); const char *capath, const char *cipher );
const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql);
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char * user, my_bool STDCALL mysql_change_user(MYSQL *mysql, const char * user,
const char *passwd, const char *db ); const char *passwd, const char *db );
MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
const char *user, const char *user,
const char *passwd, const char *passwd,
const char *db, const char *db,
unsigned int port, unsigned int port,
const char *unix_socket, const char *unix_socket,
unsigned long clientflag); unsigned long clientflag);
int STDCALL mysql_select_db(MYSQL *mysql, const char *db); int STDCALL mysql_select_db(MYSQL *mysql, const char *db);
skipping to change at line 423 skipping to change at line 456
/* perform query on master */ /* perform query on master */
my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q, my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q,
unsigned long length); unsigned long length);
my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q, my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
unsigned long length); unsigned long length);
/* perform query on slave */ /* perform query on slave */
my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char * q, my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char * q,
unsigned long length); unsigned long length);
my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const c har *q, my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const c har *q,
unsigned long length); unsigned long length);
void STDCALL mysql_get_character_set_info(MYSQL *mysql,
MY_CHARSET_INFO *charset);
/* local infile support */ /* local infile support */
#define LOCAL_INFILE_ERROR_LEN 512 #define LOCAL_INFILE_ERROR_LEN 512
void void
mysql_set_local_infile_handler(MYSQL *mysql, mysql_set_local_infile_handler(MYSQL *mysql,
int (*local_infile_init)(void **, const char *, int (*local_infile_init)(void **, const char *,
void *), void *),
int (*local_infile_read)(void *, char *, int (*local_infile_read)(void *, char *,
skipping to change at line 554 skipping to change at line 589
client-server protocol client-server protocol
*/ */
/* statement state */ /* statement state */
enum enum_mysql_stmt_state enum enum_mysql_stmt_state
{ {
MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE , MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE ,
MYSQL_STMT_FETCH_DONE MYSQL_STMT_FETCH_DONE
}; };
/* bind structure */ /*
This structure is used to define bind information, and
internally by the client library.
Public members with their descriptions are listed below
(conventionally `On input' refers to the binds given to
mysql_stmt_bind_param, `On output' refers to the binds given
to mysql_stmt_bind_result):
buffer_type - One of the MYSQL_* types, used to describe
the host language type of buffer.
On output: if column type is different from
buffer_type, column value is automatically converted
to buffer_type before it is stored in the buffer.
buffer - On input: points to the buffer with input data.
On output: points to the buffer capable to store
output data.
The type of memory pointed by buffer must correspond
to buffer_type. See the correspondence table in
the comment to mysql_stmt_bind_param.
The two above members are mandatory for any kind of bind.
buffer_length - the length of the buffer. You don't have to set
it for any fixed length buffer: float, double,
int, etc. It must be set however for variable-length
types, such as BLOBs or STRINGs.
length - On input: in case when lengths of input values
are different for each execute, you can set this to
point at a variable containining value length. This
way the value length can be different in each execute.
If length is not NULL, buffer_length is not used.
Note, length can even point at buffer_length if
you keep bind structures around while fetching:
this way you can change buffer_length before
each execution, everything will work ok.
On output: if length is set, mysql_stmt_fetch will
write column length into it.
is_null - On input: points to a boolean variable that should
be set to TRUE for NULL values.
This member is useful only if your data may be
NULL in some but not all cases.
If your data is never NULL, is_null should be set to 0.
If your data is always NULL, set buffer_type
to MYSQL_TYPE_NULL, and is_null will not be used.
is_unsigned - On input: used to signify that values provided for one
of numeric types are unsigned.
On output describes signedness of the output buffer.
If, taking into account is_unsigned flag, column data
is out of range of the output buffer, data for this colu
mn
is regarded truncated. Note that this has no corresponde
nce
to the sign of result set column, if you need to find it
out
use mysql_stmt_result_metadata.
error - where to write a truncation error if it is present.
possible error value is:
0 no truncation
1 value is out of range or buffer is too small
Please note that MYSQL_BIND also has internals members.
*/
typedef struct st_mysql_bind typedef struct st_mysql_bind
{ {
unsigned long *length; /* output length pointer */ unsigned long *length; /* output length pointer */
my_bool *is_null; /* Pointer to null indicator */ my_bool *is_null; /* Pointer to null indicator */
void *buffer; /* buffer to get/put data */ void *buffer; /* buffer to get/put data */
/* set this if you want to track data truncations happened during fetch *
/
my_bool *error;
enum enum_field_types buffer_type; /* buffer type */ enum enum_field_types buffer_type; /* buffer type */
unsigned long buffer_length; /* buffer length, must be set for str/bin /* output buffer length, must be set when fetching str/binary */
ary */ unsigned long buffer_length;
unsigned char *row_ptr; /* for the current data position */
/* Following are for internal use. Set by mysql_stmt_bind_param */
unsigned char *inter_buffer; /* for the current data position */
unsigned long offset; /* offset position for char/binary fetch */ unsigned long offset; /* offset position for char/binary fetch */
unsigned long internal_length; /* Used if length is 0 */ unsigned long length_value; /* Used if length is 0 */
unsigned int param_number; /* For null count and error messages */ unsigned int param_number; /* For null count and error messages */
unsigned int pack_length; /* Internal length for packed data */ unsigned int pack_length; /* Internal length for packed data */
my_bool error_value; /* used if error is 0 */
my_bool is_unsigned; /* set if integer type is unsigned */ my_bool is_unsigned; /* set if integer type is unsigned */
my_bool long_data_used; /* If used with mysql_send_long_data */ my_bool long_data_used; /* If used with mysql_send_long_data */
my_bool internal_is_null; /* Used if is_null is 0 */ my_bool is_null_value; /* Used if is_null is 0 */
void (*store_param_func)(NET *net, struct st_mysql_bind *param); void (*store_param_func)(NET *net, struct st_mysql_bind *param);
void (*fetch_result)(struct st_mysql_bind *, unsigned char **row); void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
unsigned char **row);
void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
unsigned char **row); unsigned char **row);
} MYSQL_BIND; } MYSQL_BIND;
/* statement handler */ /* statement handler */
typedef struct st_mysql_stmt typedef struct st_mysql_stmt
{ {
MEM_ROOT mem_root; /* root allocations */ MEM_ROOT mem_root; /* root allocations */
LIST list; /* list to keep track of all stmts * / LIST list; /* list to keep track of all stmts * /
MYSQL *mysql; /* connection handle */ MYSQL *mysql; /* connection handle */
skipping to change at line 599 skipping to change at line 699
/* copy of mysql->affected_rows after statement execution */ /* copy of mysql->affected_rows after statement execution */
my_ulonglong affected_rows; my_ulonglong affected_rows;
my_ulonglong insert_id; /* copy of mysql->insert_id */ my_ulonglong insert_id; /* copy of mysql->insert_id */
/* /*
mysql_stmt_fetch() calls this function to fetch one row (it's different mysql_stmt_fetch() calls this function to fetch one row (it's different
for buffered, unbuffered and cursor fetch). for buffered, unbuffered and cursor fetch).
*/ */
int (*read_row_func)(struct st_mysql_stmt *stmt, int (*read_row_func)(struct st_mysql_stmt *stmt,
unsigned char **row); unsigned char **row);
unsigned long stmt_id; /* Id for prepared statement */ unsigned long stmt_id; /* Id for prepared statement */
unsigned long flags; /* i.e. type of cursor to open */
unsigned long prefetch_rows; /* number of rows per one COM_FETCH
*/
/*
Copied from mysql->server_status after execute/fetch to know
server-side cursor status for this statement.
*/
unsigned int server_status;
unsigned int last_errno; /* error code */ unsigned int last_errno; /* error code */
unsigned int param_count; /* input parameter count */ unsigned int param_count; /* input parameter count */
unsigned int field_count; /* number of columns in result set * / unsigned int field_count; /* number of columns in result set * /
enum enum_mysql_stmt_state state; /* statement state */ enum enum_mysql_stmt_state state; /* statement state */
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */ char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
char sqlstate[SQLSTATE_LENGTH+1]; char sqlstate[SQLSTATE_LENGTH+1];
/* Types of input parameters should be sent to server */ /* Types of input parameters should be sent to server */
my_bool send_types_to_server; my_bool send_types_to_server;
my_bool bind_param_done; /* input buffers were supplied */ my_bool bind_param_done; /* input buffers were supplied */
my_bool bind_result_done; /* output buffers were supplied */ unsigned char bind_result_done; /* output buffers were supplied */
/* mysql_stmt_close() had to cancel this result */ /* mysql_stmt_close() had to cancel this result */
my_bool unbuffered_fetch_cancelled; my_bool unbuffered_fetch_cancelled;
/* /*
Is set to true if we need to calculate field->max_length for Is set to true if we need to calculate field->max_length for
metadata fields when doing mysql_stmt_store_result. metadata fields when doing mysql_stmt_store_result.
*/ */
my_bool update_max_length; my_bool update_max_length;
} MYSQL_STMT; } MYSQL_STMT;
enum enum_stmt_attr_type enum enum_stmt_attr_type
{ {
/* /*
When doing mysql_stmt_store_result calculate max_length attribute When doing mysql_stmt_store_result calculate max_length attribute
of statement metadata. This is to be consistent with the old API, of statement metadata. This is to be consistent with the old API,
where this was done automatically. where this was done automatically.
In the new API we do that only by request because it slows down In the new API we do that only by request because it slows down
mysql_stmt_store_result sufficiently. mysql_stmt_store_result sufficiently.
*/ */
STMT_ATTR_UPDATE_MAX_LENGTH STMT_ATTR_UPDATE_MAX_LENGTH,
/*
unsigned long with combination of cursor flags (read only, for update,
etc)
*/
STMT_ATTR_CURSOR_TYPE,
/*
Amount of rows to retrieve from server per one fetch if using cursors.
Accepts unsigned long attribute in the range 1 - ulong_max
*/
STMT_ATTR_PREFETCH_ROWS
}; };
typedef struct st_mysql_methods typedef struct st_mysql_methods
{ {
my_bool (*read_query_result)(MYSQL *mysql); my_bool (*read_query_result)(MYSQL *mysql);
my_bool (*advanced_command)(MYSQL *mysql, my_bool (*advanced_command)(MYSQL *mysql,
enum enum_server_command command, enum enum_server_command command,
const char *header, const char *header,
unsigned long header_length, unsigned long header_length,
const char *arg, const char *arg,
skipping to change at line 657 skipping to change at line 774
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) #if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD * (*list_fields)(MYSQL *mysql); MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt); int (*stmt_execute)(MYSQL_STMT *stmt);
int (*read_binary_rows)(MYSQL_STMT *stmt); int (*read_binary_rows)(MYSQL_STMT *stmt);
int (*unbuffered_fetch)(MYSQL *mysql, char **row); int (*unbuffered_fetch)(MYSQL *mysql, char **row);
void (*free_embedded_thd)(MYSQL *mysql); void (*free_embedded_thd)(MYSQL *mysql);
const char *(*read_statistics)(MYSQL *mysql); const char *(*read_statistics)(MYSQL *mysql);
my_bool (*next_result)(MYSQL *mysql); my_bool (*next_result)(MYSQL *mysql);
int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *pass wd); int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *pass wd);
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
#endif #endif
} MYSQL_METHODS; } MYSQL_METHODS;
MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql); MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
unsigned long length); unsigned long length);
int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt); int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt); int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg,
unsigned int column, unsigned int column,
unsigned long offset); unsigned long offset);
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt); unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
enum enum_stmt_attr_type attr_type, enum enum_stmt_attr_type attr_type,
const void *attr); const void *attr);
my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
enum enum_stmt_attr_type attr_type, enum enum_stmt_attr_type attr_type,
void *attr); void *attr);
skipping to change at line 707 skipping to change at line 825
unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt); unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt);
my_bool STDCALL mysql_commit(MYSQL * mysql); my_bool STDCALL mysql_commit(MYSQL * mysql);
my_bool STDCALL mysql_rollback(MYSQL * mysql); my_bool STDCALL mysql_rollback(MYSQL * mysql);
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
my_bool STDCALL mysql_more_results(MYSQL *mysql); my_bool STDCALL mysql_more_results(MYSQL *mysql);
int STDCALL mysql_next_result(MYSQL *mysql); int STDCALL mysql_next_result(MYSQL *mysql);
void STDCALL mysql_close(MYSQL *sock); void STDCALL mysql_close(MYSQL *sock);
/* status return codes */ /* status return codes */
#define MYSQL_NO_DATA 100 #define MYSQL_NO_DATA 100
#define MYSQL_DATA_TRUNCATED 101
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
#ifdef USE_OLD_FUNCTIONS #ifdef USE_OLD_FUNCTIONS
MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host , MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host ,
const char *user, const char *passwd); const char *user, const char *passwd);
int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
#endif #endif
skipping to change at line 731 skipping to change at line 850
The following functions are mainly exported because of mysqlbinlog; The following functions are mainly exported because of mysqlbinlog;
They are not for general usage They are not for general usage
*/ */
#define simple_command(mysql, command, arg, length, skip_check) \ #define simple_command(mysql, command, arg, length, skip_check) \
(*(mysql)->methods->advanced_command)(mysql, command, NullS, \ (*(mysql)->methods->advanced_command)(mysql, command, NullS, \
0, arg, length, skip_check, NULL) 0, arg, length, skip_check, NULL)
#define stmt_command(mysql, command, arg, length, stmt) \ #define stmt_command(mysql, command, arg, length, stmt) \
(*(mysql)->methods->advanced_command)(mysql, command, NullS, \ (*(mysql)->methods->advanced_command)(mysql, command, NullS, \
0, arg, length, 1, stmt) 0, arg, length, 1, stmt)
unsigned long net_safe_read(MYSQL* mysql);
#ifdef __NETWARE__ #ifdef __NETWARE__
#pragma pack(pop) /* restore alignment */ #pragma pack(pop) /* restore alignment */
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _mysql_h */ #endif /* _mysql_h */
 End of changes. 32 change blocks. 
30 lines changed or deleted 153 lines changed or added


 mysql_com.h   mysql_com.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 30 skipping to change at line 29
#ifndef _mysql_com_h #ifndef _mysql_com_h
#define _mysql_com_h #define _mysql_com_h
#define NAME_LEN 64 /* Field/table name length */ #define NAME_LEN 64 /* Field/table name length */
#define HOSTNAME_LENGTH 60 #define HOSTNAME_LENGTH 60
#define USERNAME_LENGTH 16 #define USERNAME_LENGTH 16
#define SERVER_VERSION_LENGTH 60 #define SERVER_VERSION_LENGTH 60
#define SQLSTATE_LENGTH 5 #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 "localhost"
#define LOCAL_HOST_NAMEDPIPE "." #define LOCAL_HOST_NAMEDPIPE "."
#if defined(__WIN__) && !defined( _CUSTOMCONFIG_) #if defined(__WIN__) && !defined( _CUSTOMCONFIG_)
#define MYSQL_NAMEDPIPE "MySQL" #define MYSQL_NAMEDPIPE "MySQL"
#define MYSQL_SERVICENAME "MySQL" #define MYSQL_SERVICENAME "MySQL"
#endif /* __WIN__ */ #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 enum enum_server_command
{ {
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, 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_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_PREPARE, COM_EXECUTE, COM_LONG_DATA, COM_CLOSE_STMT, COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLO
COM_RESET_STMT, COM_SET_OPTION, SE,
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH,
/* don't forget to update const char *command_name[] in sql_parse.cc */ /* don't forget to update const char *command_name[] in sql_parse.cc */
/* Must be last */ /* Must be last */
COM_END COM_END
}; };
/* /*
Length of random string sent by server on handshake; this is also length of Length of random string sent by server on handshake; this is also length of
obfuscated password, recieved from client obfuscated password, recieved from client
*/ */
skipping to change at line 77 skipping to change at line 89
#define BLOB_FLAG 16 /* Field is a blob */ #define BLOB_FLAG 16 /* Field is a blob */
#define UNSIGNED_FLAG 32 /* Field is unsigned */ #define UNSIGNED_FLAG 32 /* Field is unsigned */
#define ZEROFILL_FLAG 64 /* Field is zerofill */ #define ZEROFILL_FLAG 64 /* Field is zerofill */
#define BINARY_FLAG 128 /* Field is binary */ #define BINARY_FLAG 128 /* Field is binary */
/* The following are only sent to new clients */ /* The following are only sent to new clients */
#define ENUM_FLAG 256 /* field is an enum */ #define ENUM_FLAG 256 /* field is an enum */
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */ #define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ #define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
#define SET_FLAG 2048 /* field is a set */ #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 NUM_FLAG 32768 /* Field is num (for clients) */
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */ #define PART_KEY_FLAG 16384 /* Intern; Part of some key */
#define GROUP_FLAG 32768 /* Intern: Group field */ #define GROUP_FLAG 32768 /* Intern: Group field */
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ #define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ #define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
#define REFRESH_GRANT 1 /* Refresh grant tables */ #define REFRESH_GRANT 1 /* Refresh grant tables */
#define REFRESH_LOG 2 /* Start on new log file */ #define REFRESH_LOG 2 /* Start on new log file */
#define REFRESH_TABLES 4 /* close all tables */ #define REFRESH_TABLES 4 /* close all tables */
#define REFRESH_HOSTS 8 /* Flush host cache */ #define REFRESH_HOSTS 8 /* Flush host cache */
skipping to change at line 120 skipping to change at line 133
#define CLIENT_ODBC 64 /* Odbc client */ #define CLIENT_ODBC 64 /* Odbc client */
#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */ #define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */
#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */ #define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */
#define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */ #define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */ #define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
#define CLIENT_SSL 2048 /* Switch to SSL after handshake */ #define CLIENT_SSL 2048 /* Switch to SSL after handshake */
#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */ #define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions * / #define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions * /
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */ #define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ #define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt suppor #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt su
t */ pport */
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results
#define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31) */
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ #define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ #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_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16 #define SERVER_QUERY_NO_GOOD_INDEX_USED 16
#define SERVER_QUERY_NO_INDEX_USED 32 #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_DB_DROPPED 256 /* A database was dropped */
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
#define MYSQL_ERRMSG_SIZE 512 #define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */ #define NET_READ_TIMEOUT 30 /* Timeout on read */
#define NET_WRITE_TIMEOUT 60 /* Timeout on write */ #define NET_WRITE_TIMEOUT 60 /* Timeout on write */
#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */ #define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */
#define ONLY_KILL_QUERY 1
struct st_vio; /* Only C */ struct st_vio; /* Only C */
typedef struct st_vio Vio; typedef struct st_vio Vio;
#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign * / #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_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_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_INT_WIDTH 10 /* Max width for a LONG w.o. sign * /
#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */ #define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */
#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ #define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */
#define MAX_BLOB_WIDTH 8192 /* Default width for blob */ #define MAX_BLOB_WIDTH 8192 /* Default width for blob */
skipping to change at line 167 skipping to change at line 195
my_bool compress; my_bool compress;
/* /*
The following variable is set if we are doing several queries in one The following variable is set if we are doing several queries in one
command ( as in LOAD TABLE ... FROM MASTER ), command ( as in LOAD TABLE ... FROM MASTER ),
and do not want to confuse the client with OK at the wrong time 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 long remain_in_buf,length, buf_length, where_b;
unsigned int *return_status; unsigned int *return_status;
unsigned char reading_or_writing; unsigned char reading_or_writing;
char save_char; char save_char;
my_bool no_send_ok; 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 Pointer to query object in query cache, do not equal NULL (0) for
queries in cache that have not stored its results yet queries in cache that have not stored its results yet
*/ */
#endif #endif
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1]; char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
unsigned int last_errno; unsigned int last_errno;
unsigned char error; unsigned char error;
/*
'query_cache_query' should be accessed only via query cache
functions and methods to maintain proper locking.
*/
gptr query_cache_query; gptr query_cache_query;
my_bool report_error; /* We should report error (we have unreported error ) */ my_bool report_error; /* We should report error (we have unreported error ) */
my_bool return_errno; my_bool return_errno;
} NET; } NET;
#define packet_error (~(unsigned long) 0) #define packet_error (~(unsigned long) 0)
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247, MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248, MYSQL_TYPE_SET=248,
MYSQL_TYPE_TINY_BLOB=249, MYSQL_TYPE_TINY_BLOB=249,
MYSQL_TYPE_MEDIUM_BLOB=250, MYSQL_TYPE_MEDIUM_BLOB=250,
MYSQL_TYPE_LONG_BLOB=251, MYSQL_TYPE_LONG_BLOB=251,
MYSQL_TYPE_BLOB=252, MYSQL_TYPE_BLOB=252,
MYSQL_TYPE_VAR_STRING=253, MYSQL_TYPE_VAR_STRING=253,
MYSQL_TYPE_STRING=254, MYSQL_TYPE_STRING=254,
MYSQL_TYPE_GEOMETRY=255 MYSQL_TYPE_GEOMETRY=255
}; };
/* For backward compatibility */ /* For backward compatibility */
#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS #define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS
#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL #define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL
#define FIELD_TYPE_TINY MYSQL_TYPE_TINY #define FIELD_TYPE_TINY MYSQL_TYPE_TINY
#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT #define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT
#define FIELD_TYPE_LONG MYSQL_TYPE_LONG #define FIELD_TYPE_LONG MYSQL_TYPE_LONG
#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT #define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT
#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE #define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE
#define FIELD_TYPE_NULL MYSQL_TYPE_NULL #define FIELD_TYPE_NULL MYSQL_TYPE_NULL
#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP #define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP
#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG #define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG
#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24 #define FIELD_TYPE_INT24 MYSQL_TYPE_INT24
#define FIELD_TYPE_DATE MYSQL_TYPE_DATE #define FIELD_TYPE_DATE MYSQL_TYPE_DATE
skipping to change at line 231 skipping to change at line 274
#define FIELD_TYPE_SET MYSQL_TYPE_SET #define FIELD_TYPE_SET MYSQL_TYPE_SET
#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB #define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB
#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB #define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB
#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB #define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB
#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB #define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB
#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING #define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING
#define FIELD_TYPE_STRING MYSQL_TYPE_STRING #define FIELD_TYPE_STRING MYSQL_TYPE_STRING
#define FIELD_TYPE_CHAR MYSQL_TYPE_TINY #define FIELD_TYPE_CHAR MYSQL_TYPE_TINY
#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM #define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM
#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY #define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY
#define FIELD_TYPE_BIT MYSQL_TYPE_BIT
/* Shutdown/kill enums and constants */ /* Shutdown/kill enums and constants */
/* Bits for THD::killable. */ /* Bits for THD::killable. */
#define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0) #define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0)
#define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1) #define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1)
#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2) #define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2)
#define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3) #define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3)
enum mysql_enum_shutdown_level { enum mysql_enum_shutdown_level {
skipping to change at line 264 skipping to change at line 308
SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1), SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1),
/* don't flush InnoDB buffers, flush other storage engines' buffers*/ /* don't flush InnoDB buffers, flush other storage engines' buffers*/
SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1 , SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1 ,
/* Now the 2 levels of the KILL command */ /* Now the 2 levels of the KILL command */
#if MYSQL_VERSION_ID >= 50000 #if MYSQL_VERSION_ID >= 50000
KILL_QUERY= 254, KILL_QUERY= 254,
#endif #endif
KILL_CONNECTION= 255 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 */ /* options for mysql_set_option */
enum enum_mysql_set_option enum enum_mysql_set_option
{ {
MYSQL_OPTION_MULTI_STATEMENTS_ON, MYSQL_OPTION_MULTI_STATEMENTS_ON,
MYSQL_OPTION_MULTI_STATEMENTS_OFF MYSQL_OPTION_MULTI_STATEMENTS_OFF
}; };
#define net_new_transaction(net) ((net)->pkt_nr=0) #define net_new_transaction(net) ((net)->pkt_nr=0)
#ifdef __cplusplus #ifdef __cplusplus
skipping to change at line 290 skipping to change at line 342
void net_clear(NET *net); void net_clear(NET *net);
my_bool net_realloc(NET *net, unsigned long length); my_bool net_realloc(NET *net, unsigned long length);
my_bool net_flush(NET *net); my_bool net_flush(NET *net);
my_bool my_net_write(NET *net,const char *packet,unsigned long len); my_bool my_net_write(NET *net,const char *packet,unsigned long len);
my_bool net_write_command(NET *net,unsigned char command, my_bool net_write_command(NET *net,unsigned char command,
const char *header, unsigned long head_len, const char *header, unsigned long head_len,
const char *packet, unsigned long len); const char *packet, unsigned long len);
int net_real_write(NET *net,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); unsigned long my_net_read(NET *net);
#ifdef _global_h
void my_net_set_write_timeout(NET *net, uint timeout);
void my_net_set_read_timeout(NET *net, uint timeout);
#endif
/* /*
The following function is not meant for normal usage The following function is not meant for normal usage
Currently it's used internally by manager.c Currently it's used internally by manager.c
*/ */
struct sockaddr; struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namel en, int my_connect(my_socket s, const struct sockaddr *name, unsigned int namel en,
unsigned int timeout); unsigned int timeout);
struct rand_struct { struct rand_struct {
unsigned long seed1,seed2,max_value; unsigned long seed1,seed2,max_value;
double max_value_dbl; double max_value_dbl;
}; };
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* The following is for user defined functions */ /* The following is for user defined functions */
enum Item_result {STRING_RESULT, REAL_RESULT, INT_RESULT, ROW_RESULT}; enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT,
DECIMAL_RESULT};
typedef struct st_udf_args typedef struct st_udf_args
{ {
unsigned int arg_count; /* Number of arguments */ unsigned int arg_count; /* Number of arguments */
enum Item_result *arg_type; /* Pointer to item_results */ enum Item_result *arg_type; /* Pointer to item_results */
char **args; /* Pointer to argument */ char **args; /* Pointer to argument */
unsigned long *lengths; /* Length of string arguments */ unsigned long *lengths; /* Length of string arguments */
char *maybe_null; /* Set to 1 for all maybe_null args */ 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; } UDF_ARGS;
/* This holds information about the result */ /* This holds information about the result */
typedef struct st_udf_init typedef struct st_udf_init
{ {
my_bool maybe_null; /* 1 if function can return NULL */ my_bool maybe_null; /* 1 if function can return NULL */
unsigned int decimals; /* for real functions */ unsigned int decimals; /* for real functions */
unsigned long max_length; /* For string functions */ unsigned long max_length; /* For string functions */
char *ptr; /* free pointer for function data */ char *ptr; /* free pointer for function data */
my_bool const_item; /* 0 if result is independent of arg my_bool const_item; /* 1 if function always returns the same val
uments */ ue */
} UDF_INIT; } UDF_INIT;
/*
TODO: add a notion for determinism of the UDF.
See Item_udf_func::update_used_tables ()
*/
/* Constants when using compression */ /* Constants when using compression */
#define NET_HEADER_SIZE 4 /* standard header size */ #define NET_HEADER_SIZE 4 /* standard header size */
#define COMP_HEADER_SIZE 3 /* compression header extra size */ #define COMP_HEADER_SIZE 3 /* compression header extra size */
/* Prototypes to password functions */ /* Prototypes to password functions */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
skipping to change at line 365 skipping to change at line 429
unsigned long *salt); unsigned long *salt);
void get_salt_from_password_323(unsigned long *res, const char *password); 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_password_from_salt_323(char *to, const unsigned long *salt);
void make_scrambled_password(char *to, const char *password); void make_scrambled_password(char *to, const char *password);
void scramble(char *to, const char *message, const char *password); void scramble(char *to, const char *message, const char *password);
my_bool check_scramble(const char *reply, const char *message, my_bool check_scramble(const char *reply, const char *message,
const unsigned char *hash_stage2); const unsigned char *hash_stage2);
void get_salt_from_password(unsigned char *res, const char *password); void get_salt_from_password(unsigned char *res, const char *password);
void make_password_from_salt(char *to, const unsigned char *hash_stage2); 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 */ /* end of password.c */
char *get_tty_password(char *opt_message); char *get_tty_password(char *opt_message);
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
/* Some other useful functions */ /* Some other useful functions */
my_bool my_init(void); my_bool my_init(void);
extern int modify_defaults_file(const char *file_location, const char *opti
on,
const char *option_value,
const char *section_name, int remove_option
);
int load_defaults(const char *conf_file, const char **groups, int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv); int *argc, char ***argv);
my_bool my_thread_init(void); my_bool my_thread_init(void);
void my_thread_end(void); void my_thread_end(void);
#ifdef _global_h #ifdef _global_h
ulong STDCALL net_field_length(uchar **packet); ulong STDCALL net_field_length(uchar **packet);
my_ulonglong net_field_length_ll(uchar **packet); my_ulonglong net_field_length_ll(uchar **packet);
char *net_store_length(char *pkg, ulonglong length); char *net_store_length(char *pkg, ulonglong length);
#endif #endif
 End of changes. 24 change blocks. 
18 lines changed or deleted 91 lines changed or added


 mysql_embed.h   mysql_embed.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
/* Defines that are unique to the embedded version of MySQL */ /* Defines that are unique to the embedded version of MySQL */
#ifdef EMBEDDED_LIBRARY #ifdef EMBEDDED_LIBRARY
/* Things we don't need in the embedded version of MySQL */ /* Things we don't need in the embedded version of MySQL */
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */ /* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
#undef HAVE_PSTACK /* No stacktrace */ #undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_DLOPEN /* No udf functions */ #undef HAVE_DLOPEN /* No udf functions */
#undef HAVE_OPENSSL #undef HAVE_OPENSSL
#undef HAVE_ISAM
#undef HAVE_SMEM /* No shared memory */ #undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ #undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#define DONT_USE_RAID #define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added


 mysql_time.h   mysql_time.h 
/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB /* Copyright (C) 2004 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
 End of changes. 2 change blocks. 
3 lines changed or deleted 2 lines changed or added


 mysql_version.h   mysql_version.h 
skipping to change at line 12 skipping to change at line 12
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
/* Version numbers for protocol & mysqld */ /* Version numbers for protocol & mysqld */
#ifndef _mysql_version_h #ifndef _mysql_version_h
#define _mysql_version_h #define _mysql_version_h
#ifdef _CUSTOMCONFIG_ #ifdef _CUSTOMCONFIG_
#include <custom_conf.h> #include <custom_conf.h>
#else #else
#define PROTOCOL_VERSION 10 #define PROTOCOL_VERSION 10
#define MYSQL_SERVER_VERSION "4.1.22" #define MYSQL_SERVER_VERSION "5.0.89"
#define MYSQL_BASE_VERSION "mysqld-4.1" #define MYSQL_BASE_VERSION "mysqld-5.0"
#define MYSQL_SERVER_SUFFIX_DEF "" #define MYSQL_SERVER_SUFFIX_DEF ""
#define FRM_VER 6 #define FRM_VER 6
#define MYSQL_VERSION_ID 40122 #define MYSQL_VERSION_ID 50089
#define MYSQL_PORT 3306 #define MYSQL_PORT 3306
#define MYSQL_PORT_DEFAULT 0
#define MYSQL_UNIX_ADDR "/tmp/mysql.sock" #define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
#define MYSQL_CONFIG_NAME "my" #define MYSQL_CONFIG_NAME "my"
#define MYSQL_COMPILATION_COMMENT "Source distribution" #define MYSQL_COMPILATION_COMMENT "Source distribution"
/* mysqld compile time options */ /* mysqld compile time options */
#endif /* _CUSTOMCONFIG_ */ #endif /* _CUSTOMCONFIG_ */
#ifndef LICENSE #ifndef LICENSE
#define LICENSE GPL #define LICENSE GPL
#endif /* LICENSE */ #endif /* LICENSE */
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added


 mysqld_error.h   mysqld_error.h 
/* Copyright (C) 2000 MySQL AB /* Autogenerated file, please don't edit */
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 US
A */
/* Definefile for error messagenumbers */
#define ER_ERROR_FIRST 1000
#define ER_HASHCHK 1000 #define ER_HASHCHK 1000
#define ER_NISAMCHK 1001 #define ER_NISAMCHK 1001
#define ER_NO 1002 #define ER_NO 1002
#define ER_YES 1003 #define ER_YES 1003
#define ER_CANT_CREATE_FILE 1004 #define ER_CANT_CREATE_FILE 1004
#define ER_CANT_CREATE_TABLE 1005 #define ER_CANT_CREATE_TABLE 1005
#define ER_CANT_CREATE_DB 1006 #define ER_CANT_CREATE_DB 1006
#define ER_DB_CREATE_EXISTS 1007 #define ER_DB_CREATE_EXISTS 1007
#define ER_DB_DROP_EXISTS 1008 #define ER_DB_DROP_EXISTS 1008
#define ER_DB_DROP_DELETE 1009 #define ER_DB_DROP_DELETE 1009
skipping to change at line 204 skipping to change at line 189
#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175 #define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175
#define ER_KEY_DOES_NOT_EXITS 1176 #define ER_KEY_DOES_NOT_EXITS 1176
#define ER_CHECK_NO_SUCH_TABLE 1177 #define ER_CHECK_NO_SUCH_TABLE 1177
#define ER_CHECK_NOT_IMPLEMENTED 1178 #define ER_CHECK_NOT_IMPLEMENTED 1178
#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179 #define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179
#define ER_ERROR_DURING_COMMIT 1180 #define ER_ERROR_DURING_COMMIT 1180
#define ER_ERROR_DURING_ROLLBACK 1181 #define ER_ERROR_DURING_ROLLBACK 1181
#define ER_ERROR_DURING_FLUSH_LOGS 1182 #define ER_ERROR_DURING_FLUSH_LOGS 1182
#define ER_ERROR_DURING_CHECKPOINT 1183 #define ER_ERROR_DURING_CHECKPOINT 1183
#define ER_NEW_ABORTING_CONNECTION 1184 #define ER_NEW_ABORTING_CONNECTION 1184
#define ER_DUMP_NOT_IMPLEMENTED 1185 #define ER_DUMP_NOT_IMPLEMENTED 1185
#define ER_FLUSH_MASTER_BINLOG_CLOSED 1186 #define ER_FLUSH_MASTER_BINLOG_CLOSED 1186
#define ER_INDEX_REBUILD 1187 #define ER_INDEX_REBUILD 1187
#define ER_MASTER 1188 #define ER_MASTER 1188
#define ER_MASTER_NET_READ 1189 #define ER_MASTER_NET_READ 1189
#define ER_MASTER_NET_WRITE 1190 #define ER_MASTER_NET_WRITE 1190
#define ER_FT_MATCHING_KEY_NOT_FOUND 1191 #define ER_FT_MATCHING_KEY_NOT_FOUND 1191
#define ER_LOCK_OR_ACTIVE_TRANSACTION 1192 #define ER_LOCK_OR_ACTIVE_TRANSACTION 1192
#define ER_UNKNOWN_SYSTEM_VARIABLE 1193 #define ER_UNKNOWN_SYSTEM_VARIABLE 1193
#define ER_CRASHED_ON_USAGE 1194 #define ER_CRASHED_ON_USAGE 1194
#define ER_CRASHED_ON_REPAIR 1195 #define ER_CRASHED_ON_REPAIR 1195
#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196 #define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196
#define ER_TRANS_CACHE_FULL 1197 #define ER_TRANS_CACHE_FULL 1197
skipping to change at line 254 skipping to change at line 239
#define ER_DUP_ARGUMENT 1225 #define ER_DUP_ARGUMENT 1225
#define ER_USER_LIMIT_REACHED 1226 #define ER_USER_LIMIT_REACHED 1226
#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227 #define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227
#define ER_LOCAL_VARIABLE 1228 #define ER_LOCAL_VARIABLE 1228
#define ER_GLOBAL_VARIABLE 1229 #define ER_GLOBAL_VARIABLE 1229
#define ER_NO_DEFAULT 1230 #define ER_NO_DEFAULT 1230
#define ER_WRONG_VALUE_FOR_VAR 1231 #define ER_WRONG_VALUE_FOR_VAR 1231
#define ER_WRONG_TYPE_FOR_VAR 1232 #define ER_WRONG_TYPE_FOR_VAR 1232
#define ER_VAR_CANT_BE_READ 1233 #define ER_VAR_CANT_BE_READ 1233
#define ER_CANT_USE_OPTION_HERE 1234 #define ER_CANT_USE_OPTION_HERE 1234
#define ER_NOT_SUPPORTED_YET 1235 #define ER_NOT_SUPPORTED_YET 1235
#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 #define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
#define ER_SLAVE_IGNORED_TABLE 1237 #define ER_SLAVE_IGNORED_TABLE 1237
#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238 #define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238
#define ER_WRONG_FK_DEF 1239 #define ER_WRONG_FK_DEF 1239
#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240 #define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240
#define ER_OPERAND_COLUMNS 1241 #define ER_OPERAND_COLUMNS 1241
#define ER_SUBQUERY_NO_1_ROW 1242 #define ER_SUBQUERY_NO_1_ROW 1242
#define ER_UNKNOWN_STMT_HANDLER 1243 #define ER_UNKNOWN_STMT_HANDLER 1243
#define ER_CORRUPT_HELP_DB 1244 #define ER_CORRUPT_HELP_DB 1244
#define ER_CYCLIC_REFERENCE 1245 #define ER_CYCLIC_REFERENCE 1245
skipping to change at line 284 skipping to change at line 269
#define ER_SLAVE_WAS_NOT_RUNNING 1255 #define ER_SLAVE_WAS_NOT_RUNNING 1255
#define ER_TOO_BIG_FOR_UNCOMPRESS 1256 #define ER_TOO_BIG_FOR_UNCOMPRESS 1256
#define ER_ZLIB_Z_MEM_ERROR 1257 #define ER_ZLIB_Z_MEM_ERROR 1257
#define ER_ZLIB_Z_BUF_ERROR 1258 #define ER_ZLIB_Z_BUF_ERROR 1258
#define ER_ZLIB_Z_DATA_ERROR 1259 #define ER_ZLIB_Z_DATA_ERROR 1259
#define ER_CUT_VALUE_GROUP_CONCAT 1260 #define ER_CUT_VALUE_GROUP_CONCAT 1260
#define ER_WARN_TOO_FEW_RECORDS 1261 #define ER_WARN_TOO_FEW_RECORDS 1261
#define ER_WARN_TOO_MANY_RECORDS 1262 #define ER_WARN_TOO_MANY_RECORDS 1262
#define ER_WARN_NULL_TO_NOTNULL 1263 #define ER_WARN_NULL_TO_NOTNULL 1263
#define ER_WARN_DATA_OUT_OF_RANGE 1264 #define ER_WARN_DATA_OUT_OF_RANGE 1264
#define ER_WARN_DATA_TRUNCATED 1265 #define WARN_DATA_TRUNCATED 1265
#define ER_WARN_USING_OTHER_HANDLER 1266 #define ER_WARN_USING_OTHER_HANDLER 1266
#define ER_CANT_AGGREGATE_2COLLATIONS 1267 #define ER_CANT_AGGREGATE_2COLLATIONS 1267
#define ER_DROP_USER 1268 #define ER_DROP_USER 1268
#define ER_REVOKE_GRANTS 1269 #define ER_REVOKE_GRANTS 1269
#define ER_CANT_AGGREGATE_3COLLATIONS 1270 #define ER_CANT_AGGREGATE_3COLLATIONS 1270
#define ER_CANT_AGGREGATE_NCOLLATIONS 1271 #define ER_CANT_AGGREGATE_NCOLLATIONS 1271
#define ER_VARIABLE_IS_NOT_STRUCT 1272 #define ER_VARIABLE_IS_NOT_STRUCT 1272
#define ER_UNKNOWN_COLLATION 1273 #define ER_UNKNOWN_COLLATION 1273
#define ER_SLAVE_IGNORED_SSL_PARAMS 1274 #define ER_SLAVE_IGNORED_SSL_PARAMS 1274
#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275 #define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275
skipping to change at line 322 skipping to change at line 307
#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293 #define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293
#define ER_INVALID_ON_UPDATE 1294 #define ER_INVALID_ON_UPDATE 1294
#define ER_UNSUPPORTED_PS 1295 #define ER_UNSUPPORTED_PS 1295
#define ER_GET_ERRMSG 1296 #define ER_GET_ERRMSG 1296
#define ER_GET_TEMPORARY_ERRMSG 1297 #define ER_GET_TEMPORARY_ERRMSG 1297
#define ER_UNKNOWN_TIME_ZONE 1298 #define ER_UNKNOWN_TIME_ZONE 1298
#define ER_WARN_INVALID_TIMESTAMP 1299 #define ER_WARN_INVALID_TIMESTAMP 1299
#define ER_INVALID_CHARACTER_STRING 1300 #define ER_INVALID_CHARACTER_STRING 1300
#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301 #define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301
#define ER_CONFLICTING_DECLARATIONS 1302 #define ER_CONFLICTING_DECLARATIONS 1302
/* Attention: 1302 must be the last error code in 4.1 */ #define ER_SP_NO_RECURSIVE_CREATE 1303
#define ER_ERROR_MESSAGES 303 #define ER_SP_ALREADY_EXISTS 1304
#define ER_SP_DOES_NOT_EXIST 1305
#define ER_SP_DROP_FAILED 1306
#define ER_SP_STORE_FAILED 1307
#define ER_SP_LILABEL_MISMATCH 1308
#define ER_SP_LABEL_REDEFINE 1309
#define ER_SP_LABEL_MISMATCH 1310
#define ER_SP_UNINIT_VAR 1311
#define ER_SP_BADSELECT 1312
#define ER_SP_BADRETURN 1313
#define ER_SP_BADSTATEMENT 1314
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1315
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1316
#define ER_QUERY_INTERRUPTED 1317
#define ER_SP_WRONG_NO_OF_ARGS 1318
#define ER_SP_COND_MISMATCH 1319
#define ER_SP_NORETURN 1320
#define ER_SP_NORETURNEND 1321
#define ER_SP_BAD_CURSOR_QUERY 1322
#define ER_SP_BAD_CURSOR_SELECT 1323
#define ER_SP_CURSOR_MISMATCH 1324
#define ER_SP_CURSOR_ALREADY_OPEN 1325
#define ER_SP_CURSOR_NOT_OPEN 1326
#define ER_SP_UNDECLARED_VAR 1327
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1328
#define ER_SP_FETCH_NO_DATA 1329
#define ER_SP_DUP_PARAM 1330
#define ER_SP_DUP_VAR 1331
#define ER_SP_DUP_COND 1332
#define ER_SP_DUP_CURS 1333
#define ER_SP_CANT_ALTER 1334
#define ER_SP_SUBSELECT_NYI 1335
#define ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 1336
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1337
#define ER_SP_CURSOR_AFTER_HANDLER 1338
#define ER_SP_CASE_NOT_FOUND 1339
#define ER_FPARSER_TOO_BIG_FILE 1340
#define ER_FPARSER_BAD_HEADER 1341
#define ER_FPARSER_EOF_IN_COMMENT 1342
#define ER_FPARSER_ERROR_IN_PARAMETER 1343
#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1344
#define ER_VIEW_NO_EXPLAIN 1345
#define ER_FRM_UNKNOWN_TYPE 1346
#define ER_WRONG_OBJECT 1347
#define ER_NONUPDATEABLE_COLUMN 1348
#define ER_VIEW_SELECT_DERIVED 1349
#define ER_VIEW_SELECT_CLAUSE 1350
#define ER_VIEW_SELECT_VARIABLE 1351
#define ER_VIEW_SELECT_TMPTABLE 1352
#define ER_VIEW_WRONG_LIST 1353
#define ER_WARN_VIEW_MERGE 1354
#define ER_WARN_VIEW_WITHOUT_KEY 1355
#define ER_VIEW_INVALID 1356
#define ER_SP_NO_DROP_SP 1357
#define ER_SP_GOTO_IN_HNDLR 1358
#define ER_TRG_ALREADY_EXISTS 1359
#define ER_TRG_DOES_NOT_EXIST 1360
#define ER_TRG_ON_VIEW_OR_TEMP_TABLE 1361
#define ER_TRG_CANT_CHANGE_ROW 1362
#define ER_TRG_NO_SUCH_ROW_IN_TRG 1363
#define ER_NO_DEFAULT_FOR_FIELD 1364
#define ER_DIVISION_BY_ZERO 1365
#define ER_TRUNCATED_WRONG_VALUE_FOR_FIELD 1366
#define ER_ILLEGAL_VALUE_FOR_TYPE 1367
#define ER_VIEW_NONUPD_CHECK 1368
#define ER_VIEW_CHECK_FAILED 1369
#define ER_PROCACCESS_DENIED_ERROR 1370
#define ER_RELAY_LOG_FAIL 1371
#define ER_PASSWD_LENGTH 1372
#define ER_UNKNOWN_TARGET_BINLOG 1373
#define ER_IO_ERR_LOG_INDEX_READ 1374
#define ER_BINLOG_PURGE_PROHIBITED 1375
#define ER_FSEEK_FAIL 1376
#define ER_BINLOG_PURGE_FATAL_ERR 1377
#define ER_LOG_IN_USE 1378
#define ER_LOG_PURGE_UNKNOWN_ERR 1379
#define ER_RELAY_LOG_INIT 1380
#define ER_NO_BINARY_LOGGING 1381
#define ER_RESERVED_SYNTAX 1382
#define ER_WSAS_FAILED 1383
#define ER_DIFF_GROUPS_PROC 1384
#define ER_NO_GROUP_FOR_PROC 1385
#define ER_ORDER_WITH_PROC 1386
#define ER_LOGGING_PROHIBIT_CHANGING_OF 1387
#define ER_NO_FILE_MAPPING 1388
#define ER_WRONG_MAGIC 1389
#define ER_PS_MANY_PARAM 1390
#define ER_KEY_PART_0 1391
#define ER_VIEW_CHECKSUM 1392
#define ER_VIEW_MULTIUPDATE 1393
#define ER_VIEW_NO_INSERT_FIELD_LIST 1394
#define ER_VIEW_DELETE_MERGE_VIEW 1395
#define ER_CANNOT_USER 1396
#define ER_XAER_NOTA 1397
#define ER_XAER_INVAL 1398
#define ER_XAER_RMFAIL 1399
#define ER_XAER_OUTSIDE 1400
#define ER_XAER_RMERR 1401
#define ER_XA_RBROLLBACK 1402
#define ER_NONEXISTING_PROC_GRANT 1403
#define ER_PROC_AUTO_GRANT_FAIL 1404
#define ER_PROC_AUTO_REVOKE_FAIL 1405
#define ER_DATA_TOO_LONG 1406
#define ER_SP_BAD_SQLSTATE 1407
#define ER_STARTUP 1408
#define ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR 1409
#define ER_CANT_CREATE_USER_WITH_GRANT 1410
#define ER_WRONG_VALUE_FOR_TYPE 1411
#define ER_TABLE_DEF_CHANGED 1412
#define ER_SP_DUP_HANDLER 1413
#define ER_SP_NOT_VAR_ARG 1414
#define ER_SP_NO_RETSET 1415
#define ER_CANT_CREATE_GEOMETRY_OBJECT 1416
#define ER_FAILED_ROUTINE_BREAK_BINLOG 1417
#define ER_BINLOG_UNSAFE_ROUTINE 1418
#define ER_BINLOG_CREATE_ROUTINE_NEED_SUPER 1419
#define ER_EXEC_STMT_WITH_OPEN_CURSOR 1420
#define ER_STMT_HAS_NO_OPEN_CURSOR 1421
#define ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG 1422
#define ER_NO_DEFAULT_FOR_VIEW_FIELD 1423
#define ER_SP_NO_RECURSION 1424
#define ER_TOO_BIG_SCALE 1425
#define ER_TOO_BIG_PRECISION 1426
#define ER_M_BIGGER_THAN_D 1427
#define ER_WRONG_LOCK_OF_SYSTEM_TABLE 1428
#define ER_CONNECT_TO_FOREIGN_DATA_SOURCE 1429
#define ER_QUERY_ON_FOREIGN_DATA_SOURCE 1430
#define ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST 1431
#define ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE 1432
#define ER_FOREIGN_DATA_STRING_INVALID 1433
#define ER_CANT_CREATE_FEDERATED_TABLE 1434
#define ER_TRG_IN_WRONG_SCHEMA 1435
#define ER_STACK_OVERRUN_NEED_MORE 1436
#define ER_TOO_LONG_BODY 1437
#define ER_WARN_CANT_DROP_DEFAULT_KEYCACHE 1438
#define ER_TOO_BIG_DISPLAYWIDTH 1439
#define ER_XAER_DUPID 1440
#define ER_DATETIME_FUNCTION_OVERFLOW 1441
#define ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG 1442
#define ER_VIEW_PREVENT_UPDATE 1443
#define ER_PS_NO_RECURSION 1444
#define ER_SP_CANT_SET_AUTOCOMMIT 1445
#define ER_MALFORMED_DEFINER 1446
#define ER_VIEW_FRM_NO_USER 1447
#define ER_VIEW_OTHER_USER 1448
#define ER_NO_SUCH_USER 1449
#define ER_FORBID_SCHEMA_CHANGE 1450
#define ER_ROW_IS_REFERENCED_2 1451
#define ER_NO_REFERENCED_ROW_2 1452
#define ER_SP_BAD_VAR_SHADOW 1453
#define ER_TRG_NO_DEFINER 1454
#define ER_OLD_FILE_FORMAT 1455
#define ER_SP_RECURSION_LIMIT 1456
#define ER_SP_PROC_TABLE_CORRUPT 1457
#define ER_SP_WRONG_NAME 1458
#define ER_TABLE_NEEDS_UPGRADE 1459
#define ER_SP_NO_AGGREGATE 1460
#define ER_MAX_PREPARED_STMT_COUNT_REACHED 1461
#define ER_VIEW_RECURSIVE 1462
#define ER_NON_GROUPING_FIELD_USED 1463
#define ER_TABLE_CANT_HANDLE_SPKEYS 1464
#define ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA 1465
#define ER_REMOVED_SPACES 1466
#define ER_AUTOINC_READ_FAILED 1467
#define ER_USERNAME 1468
#define ER_HOSTNAME 1469
#define ER_WRONG_STRING_LENGTH 1470
#define ER_NON_INSERTABLE_TABLE 1471
#define ER_ADMIN_WRONG_MRG_TABLE 1472
#define ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT 1473
#define ER_NAME_BECOMES_EMPTY 1474
#define ER_AMBIGUOUS_FIELD_TERM 1475
#define ER_LOAD_DATA_INVALID_COLUMN 1476
#define ER_LOG_PURGE_NO_FILE 1477
#define ER_XA_RBTIMEOUT 1478
#define ER_XA_RBDEADLOCK 1479
#define ER_TOO_MANY_CONCURRENT_TRXS 1480
#define ER_ERROR_LAST 1480
 End of changes. 7 change blocks. 
22 lines changed or deleted 6 lines changed or added


 raid.h   raid.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
skipping to change at line 144 skipping to change at line 143
my_off_t _position; my_off_t _position;
my_off_t _size; /* Cached file size for faster seek(SEEK_END) */ my_off_t _size; /* Cached file size for faster seek(SEEK_END) */
File _fd; File _fd;
File *_fd_vector; /* Array of File */ File *_fd_vector; /* Array of File */
off_t *_seek_vector; /* Array of cached seek positions */ off_t *_seek_vector; /* Array of cached seek positions */
inline void Calculate() inline void Calculate()
{ {
DBUG_ENTER("RaidFd::_Calculate"); DBUG_ENTER("RaidFd::_Calculate");
DBUG_PRINT("info",("_position: %lu _raid_chunksize: %d, _size: %lu", DBUG_PRINT("info",("_position: %lu _raid_chunksize: %lu _size: %lu" ,
(ulong) _position, _raid_chunksize, (ulong) _size)) ; (ulong) _position, _raid_chunksize, (ulong) _size)) ;
_total_block = (ulong) (_position / _raid_chunksize); _total_block = (ulong) (_position / _raid_chunksize);
_this_block = _total_block % _raid_chunks; /* can be 0.._raid_chun ks */ _this_block = _total_block % _raid_chunks; /* can be 0.._raid_chun ks */
_remaining_bytes = (uint) (_raid_chunksize - _remaining_bytes = (uint) (_raid_chunksize -
(_position - _total_block * _raid_chunksize )); (_position - _total_block * _raid_chunksize ));
DBUG_PRINT("info", DBUG_PRINT("info",
("_total_block: %d this_block: %d _remaining_bytes:%d", ("_total_block: %lu this_block: %d _remaining_bytes: %d",
_total_block, _this_block, _remaining_bytes)); _total_block, _this_block, _remaining_bytes));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
}; };
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* USE_RAID */ #endif /* USE_RAID */
 End of changes. 3 change blocks. 
4 lines changed or deleted 3 lines changed or added


 readline.h   readline.h 
/* $NetBSD: readline.h,v 1.12 2004/09/08 18:15:37 christos Exp $ */ /* $NetBSD: readline.h,v 1.24 2009/02/05 19:15:26 christos Exp $ */
/*- /*-
* Copyright (c) 1997 The NetBSD Foundation, Inc. * Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved. * All rights reserved.
* *
* This code is derived from software contributed to The NetBSD Foundation * This code is derived from software contributed to The NetBSD Foundation
* by Jaromir Dolecek. * by Jaromir Dolecek.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTOR S * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTOR S
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMI TED * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMI TED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICUL AR * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICUL AR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTOR S * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTOR S
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
skipping to change at line 48 skipping to change at line 41
#ifndef _READLINE_H_ #ifndef _READLINE_H_
#define _READLINE_H_ #define _READLINE_H_
#include <sys/types.h> #include <sys/types.h>
/* list of readline stuff supported by editline library's readline wrapper */ /* list of readline stuff supported by editline library's readline wrapper */
/* typedefs */ /* typedefs */
typedef int Function(const char *, int); typedef int Function(const char *, int);
typedef void VFunction(void); typedef void VFunction(void);
typedef void VCPFunction(char *);
typedef char *CPFunction(const char *, int); typedef char *CPFunction(const char *, int);
typedef char **CPPFunction(const char *, int, int); typedef char **CPPFunction(const char *, int, int);
typedef char *rl_compentry_func_t(const char *, int);
typedef void *histdata_t;
typedef struct _hist_entry { typedef struct _hist_entry {
const char *line; const char *line;
histdata_t *data; const char *data;
} HIST_ENTRY; } HIST_ENTRY;
typedef struct _keymap_entry { typedef struct _keymap_entry {
char type; char type;
#define ISFUNC 0 #define ISFUNC 0
#define ISKMAP 1 #define ISKMAP 1
#define ISMACR 2 #define ISMACR 2
Function *function; Function *function;
} KEYMAP_ENTRY; } KEYMAP_ENTRY;
#define KEYMAP_SIZE 256 #define KEYMAP_SIZE 256
typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE]; typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE];
typedef KEYMAP_ENTRY *Keymap; typedef KEYMAP_ENTRY *Keymap;
#define control_character_threshold 0x20 #define control_character_threshold 0x20
#define control_character_bit 0x40 #define control_character_bit 0x40
#ifndef CTRL #ifndef CTRL
#include <sys/ioctl.h> #include <sys/ioctl.h>
#if defined(__GLIBC__) || defined(__MWERKS__) #if !defined(__sun) && !defined(__hpux) && !defined(_AIX) && !defined(__QNX NTO__) && !defined(__USLC__)
#include <sys/ttydefaults.h> #include <sys/ttydefaults.h>
#endif #endif
#ifndef CTRL #ifndef CTRL
#define CTRL(c) ((c) & 037) #define CTRL(c) ((c) & 037)
#endif #endif
#endif #endif
#ifndef UNCTRL #ifndef UNCTRL
#define UNCTRL(c) (((c) - 'a' + 'A')|control_character_bit) #define UNCTRL(c) (((c) - 'a' + 'A')|control_character_bit)
#endif #endif
skipping to change at line 107 skipping to change at line 100
extern FILE *rl_outstream; extern FILE *rl_outstream;
extern char *rl_line_buffer; extern char *rl_line_buffer;
extern int rl_point, rl_end; extern int rl_point, rl_end;
extern int history_base, history_length; extern int history_base, history_length;
extern int max_input_history; extern int max_input_history;
extern char *rl_basic_word_break_characters; extern char *rl_basic_word_break_characters;
extern char *rl_completer_word_break_characters; extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters; extern char *rl_completer_quote_characters;
extern Function *rl_completion_entry_function; extern Function *rl_completion_entry_function;
extern CPPFunction *rl_attempted_completion_function; extern CPPFunction *rl_attempted_completion_function;
extern int rl_attempted_completion_over;
extern int rl_completion_type; extern int rl_completion_type;
extern int rl_completion_query_items; extern int rl_completion_query_items;
extern char *rl_special_prefixes; extern char *rl_special_prefixes;
extern int rl_completion_append_character; extern int rl_completion_append_character;
extern int rl_inhibit_completion; extern int rl_inhibit_completion;
extern Function *rl_pre_input_hook; extern Function *rl_pre_input_hook;
extern Function *rl_startup_hook; extern Function *rl_startup_hook;
extern char *rl_terminal_name; extern char *rl_terminal_name;
extern int rl_already_prompted; extern int rl_already_prompted;
extern char *rl_prompt; extern char *rl_prompt;
/* /*
* The following is not implemented * The following is not implemented
*/ */
extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
emacs_meta_keymap, emacs_meta_keymap,
emacs_ctlx_keymap; emacs_ctlx_keymap;
extern int rl_filename_completion_desired; extern int rl_filename_completion_desired;
extern int rl_ignore_completion_duplicates; extern int rl_ignore_completion_duplicates;
extern Function *rl_getc_function; extern int (*rl_getc_function)(FILE *);
extern VFunction *rl_redisplay_function; extern VFunction *rl_redisplay_function;
extern VFunction *rl_completion_display_matches_hook; extern VFunction *rl_completion_display_matches_hook;
extern VFunction *rl_prep_term_function; extern VFunction *rl_prep_term_function;
extern VFunction *rl_deprep_term_function; extern VFunction *rl_deprep_term_function;
extern int readline_echoing_p;
extern int _rl_print_completions_horizontally;
/* supported functions */ /* supported functions */
char *readline(const char *); char *readline(const char *);
int rl_initialize(void); int rl_initialize(void);
void using_history(void); void using_history(void);
int add_history(const char *); int add_history(const char *);
void clear_history(void); void clear_history(void);
void stifle_history(int); void stifle_history(int);
int unstifle_history(void); int unstifle_history(void);
int history_is_stifled(void); int history_is_stifled(void);
int where_history(void); int where_history(void);
HIST_ENTRY *current_history(void); HIST_ENTRY *current_history(void);
HIST_ENTRY *history_get(int); HIST_ENTRY *history_get(int);
HIST_ENTRY *remove_history(int);
int history_total_bytes(void); int history_total_bytes(void);
int history_set_pos(int); int history_set_pos(int);
HIST_ENTRY *previous_history(void); HIST_ENTRY *previous_history(void);
HIST_ENTRY *next_history(void); HIST_ENTRY *next_history(void);
int history_search(const char *, int); int history_search(const char *, int);
int history_search_prefix(const char *, int); int history_search_prefix(const char *, int);
int history_search_pos(const char *, int, int); int history_search_pos(const char *, int, int);
int read_history(const char *); int read_history(const char *);
int write_history(const char *); int write_history(const char *);
int history_expand(char *, char **); int history_expand(char *, char **);
skipping to change at line 171 skipping to change at line 168
int rl_complete(int, int); int rl_complete(int, int);
int rl_read_key(void); int rl_read_key(void);
char **completion_matches(const char *, CPFunction *); char **completion_matches(const char *, CPFunction *);
void rl_display_match_list(char **, int, int); void rl_display_match_list(char **, int, int);
int rl_insert(int, int); int rl_insert(int, int);
void rl_reset_terminal(const char *); void rl_reset_terminal(const char *);
int rl_bind_key(int, int (*)(int, int)); int rl_bind_key(int, int (*)(int, int));
int rl_newline(int, int); int rl_newline(int, int);
void rl_callback_read_char(void); void rl_callback_read_char(void);
void rl_callback_handler_install(const char *, VFunction *); void rl_callback_handler_install(const char *, VCPFunction *);
void rl_callback_handler_remove(void); void rl_callback_handler_remove(void);
void rl_redisplay(void); void rl_redisplay(void);
int rl_get_previous_history(int, int); int rl_get_previous_history(int, int);
void rl_prep_terminal(int); void rl_prep_terminal(int);
void rl_deprep_terminal(void); void rl_deprep_terminal(void);
int rl_read_init_file(const char *); int rl_read_init_file(const char *);
int rl_parse_and_bind(const char *); int rl_parse_and_bind(const char *);
int rl_variable_bind(const char *, const char *);
void rl_stuff_char(int); void rl_stuff_char(int);
int rl_add_defun(const char *, Function *, int); int rl_add_defun(const char *, Function *, int);
void rl_get_screen_size(int *, int *);
void rl_set_screen_size(int, int);
char *rl_filename_completion_function (const char *, int);
int _rl_abort_internal(void);
int _rl_qsort_string_compare(char **, char **);
char **rl_completion_matches(const char *, rl_compentry_func_t *);
void rl_forced_update_display(void);
int rl_set_prompt(const char *);
/* /*
* The following are not implemented * The following are not implemented
*/ */
int rl_kill_text(int, int);
Keymap rl_get_keymap(void); Keymap rl_get_keymap(void);
void rl_set_keymap(Keymap);
Keymap rl_make_bare_keymap(void); Keymap rl_make_bare_keymap(void);
int rl_generic_bind(int, const char *, const char *, Keymap); int rl_generic_bind(int, const char *, const char *, Keymap);
int rl_bind_key_in_map(int, Function *, Keymap); int rl_bind_key_in_map(int, Function *, Keymap);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _READLINE_H_ */ #endif /* _READLINE_H_ */
 End of changes. 15 change blocks. 
14 lines changed or deleted 22 lines changed or added


 sql_common.h   sql_common.h 
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB /* Copyright (C) 2003-2004, 2006 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
extern const char *unknown_sqlstate; extern const char *unknown_sqlstate;
extern const char *cant_connect_sqlstate;
extern const char *not_error_sqlstate; extern const char *not_error_sqlstate;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
extern CHARSET_INFO *default_client_charset_info; extern CHARSET_INFO *default_client_charset_info;
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
my_bool default_value, uint server_capabilities); my_bool default_value, uint server_capabilities);
void free_rows(MYSQL_DATA *cur); void free_rows(MYSQL_DATA *cur);
void free_old_query(MYSQL *mysql); void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql); void end_server(MYSQL *mysql);
my_bool mysql_reconnect(MYSQL *mysql); my_bool mysql_reconnect(MYSQL *mysql);
void mysql_read_default_options(struct st_mysql_options *options, void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group); const char *filename,const char *group);
my_bool my_bool
cli_advanced_command(MYSQL *mysql, enum enum_server_command command, cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
const char *header, ulong header_length, const char *header, ulong header_length,
const char *arg, ulong arg_length, my_bool skip_check, const char *arg, ulong arg_length, my_bool skip_check,
MYSQL_STMT *stmt); MYSQL_STMT *stmt);
unsigned long cli_safe_read(MYSQL *mysql);
void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode,
const char *sqlstate); const char *sqlstate);
void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate); void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41) #define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 sql_state.h   sql_state.h 
/* Copyright (C) 2000-2003 MySQL AB /* Autogenerated file, please don't edit */
This program is free software; you can redistribute it and/or modify ER_DUP_KEY ,"23000", "",
it under the terms of the GNU General Public License as published by ER_OUTOFMEMORY ,"HY001", "S1001",
the Free Software Foundation; either version 2 of the License, or ER_OUT_OF_SORTMEMORY ,"HY001", "S1001",
(at your option) any later version. ER_CON_COUNT_ERROR ,"08004", "",
ER_BAD_HOST_ERROR ,"08S01", "",
This program is distributed in the hope that it will be useful, ER_HANDSHAKE_ERROR ,"08S01", "",
but WITHOUT ANY WARRANTY; without even the implied warranty of ER_DBACCESS_DENIED_ERROR ,"42000", "",
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ER_ACCESS_DENIED_ERROR ,"28000", "",
GNU General Public License for more details. ER_NO_DB_ERROR ,"3D000", "",
ER_UNKNOWN_COM_ERROR ,"08S01", "",
You should have received a copy of the GNU General Public License ER_BAD_NULL_ERROR ,"23000", "",
along with this program; if not, write to the Free Software ER_BAD_DB_ERROR ,"42000", "",
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US ER_TABLE_EXISTS_ERROR ,"42S01", "",
A */ ER_BAD_TABLE_ERROR ,"42S02", "",
ER_NON_UNIQ_ERROR ,"23000", "",
/* ER_SERVER_SHUTDOWN ,"08S01", "",
This file includes a mapping from mysql_errno.h to sql_state (as used by ER_BAD_FIELD_ERROR ,"42S22", "S0022",
MyODBC) and jdbc_state. ER_WRONG_FIELD_WITH_GROUP ,"42000", "S1009",
It's suitable to include into a C struct for further processing ER_WRONG_GROUP_FIELD ,"42000", "S1009",
ER_WRONG_SUM_SELECT ,"42000", "S1009",
The first column is the mysqld server error (declared in mysqld_error.h), ER_WRONG_VALUE_COUNT ,"21S01", "",
the second column is the ODBC state (which the 4.1 server sends out by ER_TOO_LONG_IDENT ,"42000", "S1009",
default) and the last is the state used by the JDBC driver. ER_DUP_FIELDNAME ,"42S21", "S1009",
If the last column is "" then it means that the JDBC driver is using the ER_DUP_KEYNAME ,"42000", "S1009",
ODBC state. ER_DUP_ENTRY ,"23000", "S1009",
ER_WRONG_FIELD_SPEC ,"42000", "S1009",
The errors in this file are sorted in the same order as in mysqld_error.h ER_PARSE_ERROR ,"42000", "",
to allow one to do binary searches for the sqlstate. ER_EMPTY_QUERY ,"42000", "",
*/ ER_NONUNIQ_TABLE ,"42000", "S1009",
ER_INVALID_DEFAULT ,"42000", "S1009",
ER_DUP_KEY, "23000", "", ER_MULTIPLE_PRI_KEY ,"42000", "S1009",
ER_OUTOFMEMORY, "HY001", "S1001", ER_TOO_MANY_KEYS ,"42000", "S1009",
ER_OUT_OF_SORTMEMORY, "HY001", "S1001", ER_TOO_MANY_KEY_PARTS ,"42000", "S1009",
ER_CON_COUNT_ERROR, "08004", "", ER_TOO_LONG_KEY ,"42000", "S1009",
ER_BAD_HOST_ERROR, "08S01", "", ER_KEY_COLUMN_DOES_NOT_EXITS ,"42000", "S1009",
ER_HANDSHAKE_ERROR, "08S01", "", ER_BLOB_USED_AS_KEY ,"42000", "S1009",
ER_DBACCESS_DENIED_ERROR, "42000", "", ER_TOO_BIG_FIELDLENGTH ,"42000", "S1009",
ER_ACCESS_DENIED_ERROR, "28000", "", ER_WRONG_AUTO_KEY ,"42000", "S1009",
ER_NO_DB_ERROR, "3D000", "", ER_FORCING_CLOSE ,"08S01", "",
ER_UNKNOWN_COM_ERROR, "08S01", "", ER_IPSOCK_ERROR ,"08S01", "",
ER_BAD_NULL_ERROR, "23000", "", ER_NO_SUCH_INDEX ,"42S12", "S1009",
ER_BAD_DB_ERROR, "42000", "", ER_WRONG_FIELD_TERMINATORS ,"42000", "S1009",
ER_TABLE_EXISTS_ERROR, "42S01", "", ER_BLOBS_AND_NO_TERMINATED ,"42000", "S1009",
ER_BAD_TABLE_ERROR, "42S02", "", ER_CANT_REMOVE_ALL_FIELDS ,"42000", "",
ER_NON_UNIQ_ERROR, "23000", "", ER_CANT_DROP_FIELD_OR_KEY ,"42000", "",
ER_SERVER_SHUTDOWN, "08S01", "", ER_BLOB_CANT_HAVE_DEFAULT ,"42000", "",
ER_BAD_FIELD_ERROR, "42S22", "S0022", ER_WRONG_DB_NAME ,"42000", "",
ER_WRONG_FIELD_WITH_GROUP, "42000", "S1009", ER_WRONG_TABLE_NAME ,"42000", "",
ER_WRONG_GROUP_FIELD, "42000", "S1009", ER_TOO_BIG_SELECT ,"42000", "",
ER_WRONG_SUM_SELECT, "42000", "S1009", ER_UNKNOWN_PROCEDURE ,"42000", "",
ER_WRONG_VALUE_COUNT, "21S01", "", ER_WRONG_PARAMCOUNT_TO_PROCEDURE ,"42000", "",
ER_TOO_LONG_IDENT, "42000", "S1009", ER_UNKNOWN_TABLE ,"42S02", "",
ER_DUP_FIELDNAME, "42S21", "S1009", ER_FIELD_SPECIFIED_TWICE ,"42000", "",
ER_DUP_KEYNAME, "42000", "S1009", ER_UNSUPPORTED_EXTENSION ,"42000", "",
ER_DUP_ENTRY, "23000", "S1009", ER_TABLE_MUST_HAVE_COLUMNS ,"42000", "",
ER_WRONG_FIELD_SPEC, "42000", "S1009", ER_UNKNOWN_CHARACTER_SET ,"42000", "",
ER_PARSE_ERROR, "42000", "", ER_TOO_BIG_ROWSIZE ,"42000", "",
ER_EMPTY_QUERY, "42000" , "", ER_WRONG_OUTER_JOIN ,"42000", "",
ER_NONUNIQ_TABLE, "42000", "S1009", ER_NULL_COLUMN_IN_INDEX ,"42000", "",
ER_INVALID_DEFAULT, "42000", "S1009", ER_PASSWORD_ANONYMOUS_USER ,"42000", "",
ER_MULTIPLE_PRI_KEY, "42000", "S1009", ER_PASSWORD_NOT_ALLOWED ,"42000", "",
ER_TOO_MANY_KEYS, "42000", "S1009", ER_PASSWORD_NO_MATCH ,"42000", "",
ER_TOO_MANY_KEY_PARTS, "42000", "S1009", ER_WRONG_VALUE_COUNT_ON_ROW ,"21S01", "",
ER_TOO_LONG_KEY, "42000", "S1009", ER_INVALID_USE_OF_NULL ,"22004", "",
ER_KEY_COLUMN_DOES_NOT_EXITS, "42000", "S1009", ER_REGEXP_ERROR ,"42000", "",
ER_BLOB_USED_AS_KEY, "42000", "S1009", ER_MIX_OF_GROUP_FUNC_AND_FIELDS ,"42000", "",
ER_TOO_BIG_FIELDLENGTH, "42000", "S1009", ER_NONEXISTING_GRANT ,"42000", "",
ER_WRONG_AUTO_KEY, "42000", "S1009", ER_TABLEACCESS_DENIED_ERROR ,"42000", "",
ER_FORCING_CLOSE, "08S01", "", ER_COLUMNACCESS_DENIED_ERROR ,"42000", "",
ER_IPSOCK_ERROR, "08S01", "", ER_ILLEGAL_GRANT_FOR_TABLE ,"42000", "",
ER_NO_SUCH_INDEX, "42S12", "S1009", ER_GRANT_WRONG_HOST_OR_USER ,"42000", "",
ER_WRONG_FIELD_TERMINATORS, "42000", "S1009", ER_NO_SUCH_TABLE ,"42S02", "",
ER_BLOBS_AND_NO_TERMINATED, "42000", "S1009", ER_NONEXISTING_TABLE_GRANT ,"42000", "",
ER_CANT_REMOVE_ALL_FIELDS, "42000", "", ER_NOT_ALLOWED_COMMAND ,"42000", "",
ER_CANT_DROP_FIELD_OR_KEY, "42000", "", ER_SYNTAX_ERROR ,"42000", "",
ER_BLOB_CANT_HAVE_DEFAULT, "42000", "", ER_ABORTING_CONNECTION ,"08S01", "",
ER_WRONG_DB_NAME, "42000", "", ER_NET_PACKET_TOO_LARGE ,"08S01", "",
ER_WRONG_TABLE_NAME, "42000", "", ER_NET_READ_ERROR_FROM_PIPE ,"08S01", "",
ER_TOO_BIG_SELECT, "42000", "", ER_NET_FCNTL_ERROR ,"08S01", "",
ER_UNKNOWN_PROCEDURE, "42000", "", ER_NET_PACKETS_OUT_OF_ORDER ,"08S01", "",
ER_WRONG_PARAMCOUNT_TO_PROCEDURE, "42000", "", ER_NET_UNCOMPRESS_ERROR ,"08S01", "",
ER_UNKNOWN_TABLE, "42S02", "", ER_NET_READ_ERROR ,"08S01", "",
ER_FIELD_SPECIFIED_TWICE, "42000", "", ER_NET_READ_INTERRUPTED ,"08S01", "",
ER_UNSUPPORTED_EXTENSION, "42000", "", ER_NET_ERROR_ON_WRITE ,"08S01", "",
ER_TABLE_MUST_HAVE_COLUMNS, "42000", "", ER_NET_WRITE_INTERRUPTED ,"08S01", "",
ER_UNKNOWN_CHARACTER_SET, "42000", "", ER_TOO_LONG_STRING ,"42000", "",
ER_TOO_BIG_ROWSIZE, "42000", "", ER_TABLE_CANT_HANDLE_BLOB ,"42000", "",
ER_WRONG_OUTER_JOIN, "42000", "", ER_TABLE_CANT_HANDLE_AUTO_INCREMENT ,"42000", "",
ER_NULL_COLUMN_IN_INDEX, "42000", "", ER_WRONG_COLUMN_NAME ,"42000", "",
ER_PASSWORD_ANONYMOUS_USER, "42000", "", ER_WRONG_KEY_COLUMN ,"42000", "",
ER_PASSWORD_NOT_ALLOWED, "42000", "", ER_DUP_UNIQUE ,"23000", "",
ER_PASSWORD_NO_MATCH, "42000", "", ER_BLOB_KEY_WITHOUT_LENGTH ,"42000", "",
ER_WRONG_VALUE_COUNT_ON_ROW, "21S01", "", ER_PRIMARY_CANT_HAVE_NULL ,"42000", "",
ER_INVALID_USE_OF_NULL, "42000", "", ER_TOO_MANY_ROWS ,"42000", "",
ER_REGEXP_ERROR, "42000", "", ER_REQUIRES_PRIMARY_KEY ,"42000", "",
ER_MIX_OF_GROUP_FUNC_AND_FIELDS,"42000", "", ER_CHECK_NO_SUCH_TABLE ,"42000", "",
ER_NONEXISTING_GRANT, "42000", "", ER_CHECK_NOT_IMPLEMENTED ,"42000", "",
ER_TABLEACCESS_DENIED_ERROR, "42000", "", ER_CANT_DO_THIS_DURING_AN_TRANSACTION ,"25000", "",
ER_COLUMNACCESS_DENIED_ERROR, "42000", "", ER_NEW_ABORTING_CONNECTION ,"08S01", "",
ER_ILLEGAL_GRANT_FOR_TABLE, "42000", "", ER_MASTER_NET_READ ,"08S01", "",
ER_GRANT_WRONG_HOST_OR_USER, "42000", "", ER_MASTER_NET_WRITE ,"08S01", "",
ER_NO_SUCH_TABLE, "42S02", "", ER_TOO_MANY_USER_CONNECTIONS ,"42000", "",
ER_NONEXISTING_TABLE_GRANT, "42000", "", ER_READ_ONLY_TRANSACTION ,"25000", "",
ER_NOT_ALLOWED_COMMAND, "42000", "", ER_NO_PERMISSION_TO_CREATE_USER ,"42000", "",
ER_SYNTAX_ERROR, "42000", "", ER_LOCK_DEADLOCK ,"40001", "",
ER_ABORTING_CONNECTION, "08S01", "", ER_NO_REFERENCED_ROW ,"23000", "",
ER_NET_PACKET_TOO_LARGE, "08S01", "", ER_ROW_IS_REFERENCED ,"23000", "",
ER_NET_READ_ERROR_FROM_PIPE, "08S01", "", ER_CONNECT_TO_MASTER ,"08S01", "",
ER_NET_FCNTL_ERROR, "08S01", "", ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT ,"21000", "",
ER_NET_PACKETS_OUT_OF_ORDER, "08S01", "", ER_USER_LIMIT_REACHED ,"42000", "",
ER_NET_UNCOMPRESS_ERROR, "08S01", "", ER_SPECIFIC_ACCESS_DENIED_ERROR ,"42000", "",
ER_NET_READ_ERROR, "08S01", "", ER_NO_DEFAULT ,"42000", "",
ER_NET_READ_INTERRUPTED, "08S01", "", ER_WRONG_VALUE_FOR_VAR ,"42000", "",
ER_NET_ERROR_ON_WRITE, "08S01", "", ER_WRONG_TYPE_FOR_VAR ,"42000", "",
ER_NET_WRITE_INTERRUPTED, "08S01", "", ER_CANT_USE_OPTION_HERE ,"42000", "",
ER_TOO_LONG_STRING, "42000", "", ER_NOT_SUPPORTED_YET ,"42000", "",
ER_TABLE_CANT_HANDLE_BLOB, "42000", "", ER_WRONG_FK_DEF ,"42000", "",
ER_TABLE_CANT_HANDLE_AUTO_INCREMENT, "42000", "", ER_OPERAND_COLUMNS ,"21000", "",
ER_WRONG_COLUMN_NAME, "42000", "", ER_SUBQUERY_NO_1_ROW ,"21000", "",
ER_WRONG_KEY_COLUMN, "42000", "", ER_ILLEGAL_REFERENCE ,"42S22", "",
ER_DUP_UNIQUE, "23000", "", ER_DERIVED_MUST_HAVE_ALIAS ,"42000", "",
ER_BLOB_KEY_WITHOUT_LENGTH, "42000", "", ER_SELECT_REDUCED ,"01000", "",
ER_PRIMARY_CANT_HAVE_NULL, "42000", "", ER_TABLENAME_NOT_ALLOWED_HERE ,"42000", "",
ER_TOO_MANY_ROWS, "42000", "", ER_NOT_SUPPORTED_AUTH_MODE ,"08004", "",
ER_REQUIRES_PRIMARY_KEY, "42000", "", ER_SPATIAL_CANT_HAVE_NULL ,"42000", "",
ER_CHECK_NO_SUCH_TABLE, "42000", "", ER_COLLATION_CHARSET_MISMATCH ,"42000", "",
ER_CHECK_NOT_IMPLEMENTED, "42000", "", ER_WARN_TOO_FEW_RECORDS ,"01000", "",
ER_CANT_DO_THIS_DURING_AN_TRANSACTION, "25000", "", ER_WARN_TOO_MANY_RECORDS ,"01000", "",
ER_NEW_ABORTING_CONNECTION, "08S01", "", ER_WARN_NULL_TO_NOTNULL ,"22004", "",
ER_MASTER_NET_READ, "08S01", "", ER_WARN_DATA_OUT_OF_RANGE ,"22003", "",
ER_MASTER_NET_WRITE, "08S01", "", WARN_DATA_TRUNCATED ,"01000", "",
ER_TOO_MANY_USER_CONNECTIONS, "42000", "", ER_WRONG_NAME_FOR_INDEX ,"42000", "",
ER_READ_ONLY_TRANSACTION, "25000", "", ER_WRONG_NAME_FOR_CATALOG ,"42000", "",
ER_NO_PERMISSION_TO_CREATE_USER,"42000", "", ER_UNKNOWN_STORAGE_ENGINE ,"42000", "",
ER_LOCK_DEADLOCK, "40001", "", ER_TRUNCATED_WRONG_VALUE ,"22007", "",
ER_NO_REFERENCED_ROW, "23000", "", ER_SP_NO_RECURSIVE_CREATE ,"2F003", "",
ER_ROW_IS_REFERENCED, "23000", "", ER_SP_ALREADY_EXISTS ,"42000", "",
ER_CONNECT_TO_MASTER, "08S01", "", ER_SP_DOES_NOT_EXIST ,"42000", "",
ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT,"21000", "", ER_SP_LILABEL_MISMATCH ,"42000", "",
ER_USER_LIMIT_REACHED, "42000", "", ER_SP_LABEL_REDEFINE ,"42000", "",
ER_NO_DEFAULT, "42000", "", ER_SP_LABEL_MISMATCH ,"42000", "",
ER_WRONG_VALUE_FOR_VAR, "42000", "", ER_SP_UNINIT_VAR ,"01000", "",
ER_WRONG_TYPE_FOR_VAR, "42000", "", ER_SP_BADSELECT ,"0A000", "",
ER_CANT_USE_OPTION_HERE, "42000", "", ER_SP_BADRETURN ,"42000", "",
ER_NOT_SUPPORTED_YET, "42000", "", ER_SP_BADSTATEMENT ,"0A000", "",
ER_WRONG_FK_DEF, "42000", "", ER_UPDATE_LOG_DEPRECATED_IGNORED ,"42000", "",
ER_OPERAND_COLUMNS, "21000", "", ER_UPDATE_LOG_DEPRECATED_TRANSLATED ,"42000", "",
ER_SUBQUERY_NO_1_ROW, "21000", "", ER_QUERY_INTERRUPTED ,"70100", "",
ER_ILLEGAL_REFERENCE, "42S22", "", ER_SP_WRONG_NO_OF_ARGS ,"42000", "",
ER_DERIVED_MUST_HAVE_ALIAS, "42000", "", ER_SP_COND_MISMATCH ,"42000", "",
ER_SELECT_REDUCED, "01000", "", ER_SP_NORETURN ,"42000", "",
ER_TABLENAME_NOT_ALLOWED_HERE, "42000", "", ER_SP_NORETURNEND ,"2F005", "",
ER_NOT_SUPPORTED_AUTH_MODE, "08004", "", ER_SP_BAD_CURSOR_QUERY ,"42000", "",
ER_SPATIAL_CANT_HAVE_NULL, "42000", "", ER_SP_BAD_CURSOR_SELECT ,"42000", "",
ER_COLLATION_CHARSET_MISMATCH, "42000", "", ER_SP_CURSOR_MISMATCH ,"42000", "",
ER_WARN_TOO_FEW_RECORDS, "01000", "", ER_SP_CURSOR_ALREADY_OPEN ,"24000", "",
ER_WARN_TOO_MANY_RECORDS, "01000", "", ER_SP_CURSOR_NOT_OPEN ,"24000", "",
ER_WARN_NULL_TO_NOTNULL, "01000", "", ER_SP_UNDECLARED_VAR ,"42000", "",
ER_WARN_DATA_OUT_OF_RANGE, "01000", "", ER_SP_FETCH_NO_DATA ,"02000", "",
ER_WARN_DATA_TRUNCATED, "01000", "", ER_SP_DUP_PARAM ,"42000", "",
ER_WRONG_NAME_FOR_INDEX, "42000", "", ER_SP_DUP_VAR ,"42000", "",
ER_WRONG_NAME_FOR_CATALOG, "42000", "", ER_SP_DUP_COND ,"42000", "",
ER_UNKNOWN_STORAGE_ENGINE, "42000", "", ER_SP_DUP_CURS ,"42000", "",
ER_SP_SUBSELECT_NYI ,"0A000", "",
ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG ,"0A000", "",
ER_SP_VARCOND_AFTER_CURSHNDLR ,"42000", "",
ER_SP_CURSOR_AFTER_HANDLER ,"42000", "",
ER_SP_CASE_NOT_FOUND ,"20000", "",
ER_DIVISION_BY_ZERO ,"22012", "",
ER_ILLEGAL_VALUE_FOR_TYPE ,"22007", "",
ER_PROCACCESS_DENIED_ERROR ,"42000", "",
ER_XAER_NOTA ,"XAE04", "",
ER_XAER_INVAL ,"XAE05", "",
ER_XAER_RMFAIL ,"XAE07", "",
ER_XAER_OUTSIDE ,"XAE09", "",
ER_XAER_RMERR ,"XAE03", "",
ER_XA_RBROLLBACK ,"XA100", "",
ER_NONEXISTING_PROC_GRANT ,"42000", "",
ER_DATA_TOO_LONG ,"22001", "",
ER_SP_BAD_SQLSTATE ,"42000", "",
ER_CANT_CREATE_USER_WITH_GRANT ,"42000", "",
ER_SP_DUP_HANDLER ,"42000", "",
ER_SP_NOT_VAR_ARG ,"42000", "",
ER_SP_NO_RETSET ,"0A000", "",
ER_CANT_CREATE_GEOMETRY_OBJECT ,"22003", "",
ER_TOO_BIG_SCALE ,"42000", "S1009",
ER_TOO_BIG_PRECISION ,"42000", "S1009",
ER_M_BIGGER_THAN_D ,"42000", "S1009",
ER_TOO_LONG_BODY ,"42000", "S1009",
ER_TOO_BIG_DISPLAYWIDTH ,"42000", "S1009",
ER_XAER_DUPID ,"XAE08", "",
ER_DATETIME_FUNCTION_OVERFLOW ,"22008", "",
ER_ROW_IS_REFERENCED_2 ,"23000", "",
ER_NO_REFERENCED_ROW_2 ,"23000", "",
ER_SP_BAD_VAR_SHADOW ,"42000", "",
ER_SP_WRONG_NAME ,"42000", "",
ER_SP_NO_AGGREGATE ,"42000", "",
ER_MAX_PREPARED_STMT_COUNT_REACHED ,"42000", "",
ER_NON_GROUPING_FIELD_USED ,"42000", "",
ER_XA_RBTIMEOUT ,"XA106", "",
ER_XA_RBDEADLOCK ,"XA102", "",
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added


 sslopt-case.h   sslopt-case.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
 End of changes. 1 change blocks. 
2 lines changed or deleted 1 lines changed or added


 sslopt-longopts.h   sslopt-longopts.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
{"ssl", OPT_SSL_SSL, {"ssl", OPT_SSL_SSL,
"Enable SSL for connection (automatically enabled with other flags). Dis able with --skip-ssl.", "Enable SSL for connection (automatically enabled with other flags). Dis able with --skip-ssl.",
(gptr*) &opt_use_ssl, (gptr*) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, (gptr*) &opt_use_ssl, (gptr*) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
(gptr*) &opt_ssl_key, (gptr*) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
(gptr*) &opt_ssl_cert, (gptr*) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-ca", OPT_SSL_CA, {"ssl-ca", OPT_SSL_CA,
"CA file in PEM format (check OpenSSL docs, implies --ssl).", "CA file in PEM format (check OpenSSL docs, implies --ssl).",
(gptr*) &opt_ssl_ca, (gptr*) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, (gptr*) &opt_ssl_ca, (gptr*) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"ssl-capath", OPT_SSL_CAPATH, {"ssl-capath", OPT_SSL_CAPATH,
"CA directory (check OpenSSL docs, implies --ssl).", "CA directory (check OpenSSL docs, implies --ssl).",
(gptr*) &opt_ssl_capath, (gptr*) &opt_ssl_capath, 0, GET_STR, REQUIRED_A RG, (gptr*) &opt_ssl_capath, (gptr*) &opt_ssl_capath, 0, GET_STR, REQUIRED_A RG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
(gptr*) &opt_ssl_cert, (gptr*) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).", {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
(gptr*) &opt_ssl_cipher, (gptr*) &opt_ssl_cipher, 0, GET_STR, REQUIRED_A RG, (gptr*) &opt_ssl_cipher, (gptr*) &opt_ssl_cipher, 0, GET_STR, REQUIRED_A RG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
(gptr*) &opt_ssl_key, (gptr*) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef MYSQL_CLIENT
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
"Verify server's \"Common Name\" in its cert against hostname used when
connecting. This option is disabled by default.",
(gptr*) &opt_ssl_verify_server_cert, (gptr*) &opt_ssl_verify_server_cert
,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#endif /* HAVE_OPENSSL */ #endif /* HAVE_OPENSSL */
 End of changes. 4 change blocks. 
9 lines changed or deleted 15 lines changed or added


 sslopt-vars.h   sslopt-vars.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
static my_bool opt_use_ssl = 0; #ifdef SSL_VARS_NOT_STATIC
static char *opt_ssl_key = 0; #define SSL_STATIC
static char *opt_ssl_cert = 0; #else
static char *opt_ssl_ca = 0; #define SSL_STATIC static
static char *opt_ssl_capath = 0; #endif
static char *opt_ssl_cipher = 0; SSL_STATIC my_bool opt_use_ssl = 0;
SSL_STATIC char *opt_ssl_ca = 0;
SSL_STATIC char *opt_ssl_capath = 0;
SSL_STATIC char *opt_ssl_cert = 0;
SSL_STATIC char *opt_ssl_cipher = 0;
SSL_STATIC char *opt_ssl_key = 0;
#ifdef MYSQL_CLIENT
SSL_STATIC my_bool opt_ssl_verify_server_cert= 0;
#endif
#endif #endif
 End of changes. 2 change blocks. 
8 lines changed or deleted 15 lines changed or added


 typelib.h   typelib.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; version 2 of the License.
(at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
#ifndef _typelib_h #ifndef _typelib_h
#define _typelib_h #define _typelib_h
#include "my_alloc.h"
typedef struct st_typelib { /* Different types saved here */ typedef struct st_typelib { /* Different types saved here */
unsigned int count; /* How many types */ unsigned int count; /* How many types */
const char *name; /* Name of typelib */ const char *name; /* Name of typelib */
const char **type_names; const char **type_names;
unsigned int *type_lengths; unsigned int *type_lengths;
} TYPELIB; } TYPELIB;
extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name); extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
extern TYPELIB sql_protocol_typelib; extern TYPELIB sql_protocol_typelib;
#endif /* _typelib_h */ #endif /* _typelib_h */
 End of changes. 3 change blocks. 
2 lines changed or deleted 4 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/