diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 2 | ||||
-rw-r--r-- | include/config-netware.h | 40 | ||||
-rw-r--r-- | include/heap.h | 7 | ||||
-rw-r--r-- | include/help_end.h | 6 | ||||
-rw-r--r-- | include/help_start.h | 7 | ||||
-rw-r--r-- | include/m_ctype.h | 3 | ||||
-rw-r--r-- | include/m_string.h | 16 | ||||
-rw-r--r-- | include/my_base.h | 10 | ||||
-rw-r--r-- | include/my_bitmap.h | 6 | ||||
-rw-r--r-- | include/my_global.h | 29 | ||||
-rw-r--r-- | include/my_sys.h | 2 | ||||
-rw-r--r-- | include/myisam.h | 5 | ||||
-rw-r--r-- | include/myisammrg.h | 5 | ||||
-rw-r--r-- | include/mysql.h | 13 | ||||
-rw-r--r-- | include/mysql_com.h | 5 | ||||
-rw-r--r-- | include/mysql_embed.h | 3 | ||||
-rw-r--r-- | include/mysql_version.h.in | 6 | ||||
-rw-r--r-- | include/mysqld_error.h | 4 | ||||
-rw-r--r-- | include/thr_alarm.h | 2 |
19 files changed, 120 insertions, 51 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index 01b8f295be4..10e1b12a770 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -26,7 +26,7 @@ pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \ noinst_HEADERS = config-win.h config-os2.h config-netware.h \ nisam.h heap.h merge.h my_bitmap.h\ myisam.h myisampack.h myisammrg.h ft_global.h\ - mysys_err.h my_base.h \ + mysys_err.h my_base.h help_start.h help_end.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_aes.h my_tree.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h \ diff --git a/include/config-netware.h b/include/config-netware.h index dab365a7127..3e145f566a1 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -14,7 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Defines for netware compatible with MySQL */ +/* Header for NetWare compatible with MySQL */ + +#ifndef _config_netware_h +#define _config_netware_h /* required headers */ #include <unistd.h> @@ -32,18 +35,32 @@ #include <pthread.h> #include <termios.h> +#ifdef __cplusplus +extern "C" { +#endif + /* required adjustments */ #undef HAVE_READDIR_R #undef HAVE_RWLOCK_INIT #undef HAVE_SCHED_H #undef HAVE_SYS_MMAN_H #undef HAVE_SYNCH_H -#undef HAVE_CRYPT #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 #define HAVE_PTHREAD_SIGMASK 1 #define HAVE_PTHREAD_YIELD_ZERO_ARG 1 #define HAVE_BROKEN_REALPATH 1 +/* no libc crypt() function */ +#ifdef HAVE_OPENSSL + #define HAVE_CRYPT 1 +#else + #undef HAVE_CRYPT +#endif /* HAVE_OPENSSL */ + +/* Configure can't detect this because it uses AC_TRY_RUN */ +#undef HAVE_COMPRESS +#define HAVE_COMPRESS + /* include the old function apis */ #define USE_OLD_FUNCTIONS 1 @@ -59,6 +76,9 @@ /* signal by closing the sockets */ #define SIGNAL_WITH_VIO_CLOSE 1 +/* On NetWare, stack grows towards lower address*/ +#define STACK_DIRECTION -1 + /* default directory information */ #define DEFAULT_MYSQL_HOME "sys:/mysql" #define PACKAGE "mysql" @@ -80,6 +100,20 @@ /* do not use the extended time in LibC sys\stat.h */ #define _POSIX_SOURCE +/* Kernel call on NetWare that will only yield if our time slice is up */ +void kYieldIfTimeSliceUp(void); + /* Some macros for portability */ -#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=(SEC); (ABSTIME).tv_nsec=0; } +#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; } + +/* extra protection against CPU Hogs on NetWare */ +#define NETWARE_YIELD kYieldIfTimeSliceUp() +/* Screen mode for help texts */ +#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A) + +#ifdef __cplusplus +} +#endif + +#endif /* _config_netware_h */ diff --git a/include/heap.h b/include/heap.h index b536937c8c0..63f2abbabc7 100644 --- a/include/heap.h +++ b/include/heap.h @@ -182,11 +182,8 @@ extern int heap_disable_indexes(HP_INFO *info); extern int heap_enable_indexes(HP_INFO *info); extern int heap_indexes_are_disabled(HP_INFO *info); extern void heap_update_auto_increment(HP_INFO *info, const byte *record); -ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag); +ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, + key_range *max_key); int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, uint key_len, enum ha_rkey_function find_flag); extern gptr heap_find(HP_INFO *info,int inx,const byte *key); diff --git a/include/help_end.h b/include/help_end.h new file mode 100644 index 00000000000..a63d9e7ca9f --- /dev/null +++ b/include/help_end.h @@ -0,0 +1,6 @@ +#ifdef __NETWARE__ +#undef printf +#undef puts +#undef fputs +#undef putchar +#endif diff --git a/include/help_start.h b/include/help_start.h new file mode 100644 index 00000000000..38bb91f7655 --- /dev/null +++ b/include/help_start.h @@ -0,0 +1,7 @@ +/* Divert all help information on NetWare to logger screen. */ + +#ifdef __NETWARE__ +#define printf consoleprintf +#define puts(s) consoleprintf("%s\n",s) +#define fputs(s,f) puts(s) +#endif diff --git a/include/m_ctype.h b/include/m_ctype.h index 9e69a3c8f91..9502805b017 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -188,7 +188,7 @@ typedef struct my_charset_handler_st } MY_CHARSET_HANDLER; extern MY_CHARSET_HANDLER my_charset_8bit_handler; - +extern MY_CHARSET_HANDLER my_charset_ucs2_handler; typedef struct charset_info_st @@ -204,6 +204,7 @@ typedef struct charset_info_st uchar *to_lower; uchar *to_upper; uchar *sort_order; + uint16 **sort_order_big; uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; uchar state_map[256]; diff --git a/include/m_string.h b/include/m_string.h index c86801ae2d2..7fc35dc2e48 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -95,7 +95,9 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ #endif #endif -extern char NEAR _dig_vec[]; /* Declared in int2str() */ +/* Declared in int2str() */ +extern char NEAR _dig_vec_upper[]; +extern char NEAR _dig_vec_lower[]; #ifdef BAD_STRING_COMPILER #define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1) @@ -113,8 +115,6 @@ extern char NEAR _dig_vec[]; /* Declared in int2str() */ #ifdef MSDOS #undef bmove_align #define bmove512(A,B,C) bmove_align(A,B,C) -#define my_itoa(A,B,C) itoa(A,B,C) -#define my_ltoa(A,B,C) ltoa(A,B,C) extern void bmove_align(gptr dst,const gptr src,uint len); #endif @@ -219,25 +219,21 @@ extern int is_prefix(const char *, const char *); double my_strtod(const char *str, char **end); double my_atof(const char *nptr); -#ifdef USE_MY_ITOA -extern char *my_itoa(int val,char *dst,int radix); -extern char *my_ltoa(long val,char *dst,int radix); -#endif - extern char *llstr(longlong value,char *buff); #ifndef HAVE_STRTOUL extern long strtol(const char *str, char **ptr, int base); extern ulong strtoul(const char *str, char **ptr, int base); #endif -extern char *int2str(long val,char *dst,int radix); +extern char *int2str(long val, char *dst, int radix, int upcase); extern char *int10_to_str(long val,char *dst,int radix); extern char *str2int(const char *src,int radix,long lower,long upper, long *val); longlong my_strtoll10(const char *nptr, char **endptr, int *error); #if SIZEOF_LONG == SIZEOF_LONG_LONG -#define longlong2str(A,B,C) int2str((A),(B),(C)) +#define longlong2str(A,B,C) int2str((A),(B),(C),1) #define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) +#undef strtoll #define strtoll(A,B,C) strtol((A),(B),(C)) #define strtoull(A,B,C) strtoul((A),(B),(C)) #ifndef HAVE_STRTOULL diff --git a/include/my_base.h b/include/my_base.h index 4a2f3f85083..f912cb4278c 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -349,6 +349,16 @@ enum data_file_type { STATIC_RECORD,DYNAMIC_RECORD,COMPRESSED_RECORD }; +/* For key ranges */ + +typedef struct st_key_range +{ + const byte *key; + uint length; + enum ha_rkey_function flag; +} key_range; + + /* For number of records */ #ifdef BIG_TABLES #define rows2double(A) ulonglong2double(A) diff --git a/include/my_bitmap.h b/include/my_bitmap.h index 5b3da011f54..a4511bf3414 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -55,6 +55,12 @@ extern void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit); extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size); extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2); extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2); + +/* Fast, not thread safe, bitmap functions */ +#define bitmap_fast_set_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] |= (1 << ((BIT) & 7)) +#define bitmap_fast_clear_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] &= ~ (1 << ((BIT) & 7)) +#define bitmap_fast_is_set(MAP, BIT) (MAP)->bitmap[(BIT) / 8] & (1 << ((BIT) & 7)) + #ifdef __cplusplus } #endif diff --git a/include/my_global.h b/include/my_global.h index e7d924eb0ca..3d1a770d877 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -73,6 +73,12 @@ #endif #endif /* _WIN32... */ +/* Some defines to avoid ifdefs in the code */ +#ifndef NETWARE_YIELD +#define NETWARE_YIELD +#define NETWARE_SET_SCREEN_MODE(A) +#endif + /* The macros below are borrowed from include/linux/compiler.h in the Linux kernel. Use them to indicate the likelyhood of the truthfulness @@ -172,7 +178,11 @@ C_MODE_END #ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */ #undef HAVE_SNPRINTF #endif -#ifdef HAVE_BROKEN_PREAD /* These doesn't work on HPUX 11.x */ +#ifdef HAVE_BROKEN_PREAD +/* + pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without + installing the kernel patch PHKL_20349 or greater +*/ #undef HAVE_PREAD #undef HAVE_PWRITE #endif @@ -338,6 +348,9 @@ C_MODE_END #define USE_BMOVE512 1 /* Use this unless system bmove is faster */ #endif +#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ +#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */ + /* Paranoid settings. Define I_AM_PARANOID if you are paranoid */ #ifdef I_AM_PARANOID #define DONT_ALLOW_USER_CHANGE 1 @@ -382,7 +395,7 @@ typedef unsigned short ushort; #define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) -#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; } +#define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dummy; } #define test(a) ((a) ? 1 : 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) @@ -578,12 +591,6 @@ typedef SOCKET_SIZE_TYPE size_socket; #define USE_MY_STAT_STRUCT /* For my_lib */ #endif -/* Some things that this system does have */ - -#ifndef HAVE_ITOA -#define USE_MY_ITOA /* There is no itoa */ -#endif - /* Some defines of functions for portability */ #undef remove /* Crashes MySQL on SCO 5.0.0 */ @@ -1187,6 +1194,8 @@ do { doubleget_union _tmp; \ #define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME #endif -#define HAVE_SPATIAL -#define HAVE_RTREE_KEYS +#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL) +#define NO_EMBEDDED_ACCESS_CHECKS +#endif + #endif /* my_global_h */ diff --git a/include/my_sys.h b/include/my_sys.h index 8beaa00eb16..922e6d8cff4 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -762,6 +762,8 @@ extern char *get_charsets_dir(char *buf); extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); extern my_bool init_compiled_charsets(myf flags); extern void add_compiled_collation(CHARSET_INFO *cs); +extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, + const char *from, ulong length); #ifdef __WIN__ extern my_bool have_tcpip; /* Is set if tcpip is used */ diff --git a/include/myisam.h b/include/myisam.h index 93e2dc15574..c99e9a30b08 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -231,10 +231,7 @@ extern int mi_extra(struct st_myisam_info *file, enum ha_extra_function function, void *extra_arg); extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + key_range *min_key, key_range *max_key); extern int mi_log(int activate_log); extern int mi_is_changed(struct st_myisam_info *info); extern int mi_delete_all_rows(struct st_myisam_info *info); diff --git a/include/myisammrg.h b/include/myisammrg.h index 8b09e1a9231..de8a36c2d0a 100644 --- a/include/myisammrg.h +++ b/include/myisammrg.h @@ -101,10 +101,7 @@ extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function, void *extra_arg); extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv); extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + key_range *min_key, key_range *max_key); extern ulonglong myrg_position(MYRG_INFO *info); #ifdef __cplusplus diff --git a/include/mysql.h b/include/mysql.h index 51540a7d89f..e2d0acd7839 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -317,6 +317,17 @@ typedef struct st_mysql_manager char last_error[MAX_MYSQL_MANAGER_ERR]; } MYSQL_MANAGER; +typedef struct st_mysql_parameters +{ + unsigned long *p_max_allowed_packet; + unsigned long *p_net_buffer_length; +} MYSQL_PARAMETERS; + +#if !defined(MYSQL_CLIENT) && !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) +#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet) +#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length) +#endif + /* Set up and bring down the server; to ensure that applications will work when linked against either the standard client library or the @@ -325,6 +336,8 @@ typedef struct st_mysql_manager int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); +MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void); + /* Set up and bring down a thread; these function should be called for each thread in an application which opens at least one MySQL diff --git a/include/mysql_com.h b/include/mysql_com.h index ada2bd1f679..d354a979cd1 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -306,9 +306,6 @@ typedef struct st_udf_init extern "C" { #endif -extern unsigned long max_allowed_packet; -extern unsigned long net_buffer_length; - /* These functions are used for authentication by client and server and implemented in sql/password.c @@ -359,6 +356,6 @@ char *net_store_length(char *pkg, ulonglong length); #define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */ #define MYSQL_STMT_HEADER 4 -#define MYSQL_LONG_DATA_HEADER 6 +#define MYSQL_LONG_DATA_HEADER 6 #endif diff --git a/include/mysql_embed.h b/include/mysql_embed.h index 8e65087c566..603af8e83b8 100644 --- a/include/mysql_embed.h +++ b/include/mysql_embed.h @@ -30,7 +30,4 @@ #define DONT_USE_RAID -#undef MYSQL_SERVER_SUFFIX -#define MYSQL_SERVER_SUFFIX "-embedded" - #endif /* EMBEDDED_LIBRARY */ diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in index c440c1298d4..dac7ca661d1 100644 --- a/include/mysql_version.h.in +++ b/include/mysql_version.h.in @@ -11,9 +11,7 @@ #define PROTOCOL_VERSION @PROTOCOL_VERSION@ #define MYSQL_SERVER_VERSION "@VERSION@" #define MYSQL_BASE_VERSION "mysqld-@MYSQL_BASE_VERSION@" -#ifndef MYSQL_SERVER_SUFFIX -#define MYSQL_SERVER_SUFFIX "@MYSQL_SERVER_SUFFIX@" -#endif +#define MYSQL_SERVER_SUFFIX_DEF "@MYSQL_SERVER_SUFFIX@" #define FRM_VER @DOT_FRM_VERSION@ #define MYSQL_VERSION_ID @MYSQL_VERSION_ID@ #define MYSQL_PORT @MYSQL_TCP_PORT@ @@ -25,7 +23,7 @@ #endif /* _CUSTOMCONFIG_ */ #ifndef LICENSE -#define LICENSE "GPL" +#define LICENSE GPL #endif /* LICENSE */ #endif /* _mysql_version_h */ diff --git a/include/mysqld_error.h b/include/mysqld_error.h index 3dabd226ae6..f341041fc75 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -312,4 +312,6 @@ #define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293 #define ER_INVALID_ON_UPDATE 1294 #define ER_UNSUPPORTED_PS 1295 -#define ER_ERROR_MESSAGES 296 +#define ER_GET_ERRMSG 1296 +#define ER_GET_TEMPORARY_ERRMSG 1297 +#define ER_ERROR_MESSAGES 298 diff --git a/include/thr_alarm.h b/include/thr_alarm.h index 0dbb700b4fc..7a10d6886ce 100644 --- a/include/thr_alarm.h +++ b/include/thr_alarm.h @@ -64,7 +64,7 @@ typedef my_bool ALARM; #define init_thr_alarm(A) #define thr_alarm_kill(A) #define resize_thr_alarm(N) -#define end_thr_alarm() +#define end_thr_alarm(A) #else #if defined(__WIN__) |