summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/config-netware.h28
-rw-r--r--include/heap.h14
-rw-r--r--include/help_end.h6
-rw-r--r--include/help_start.h7
-rw-r--r--include/m_ctype.h3
-rw-r--r--include/m_string.h1
-rw-r--r--include/my_base.h12
-rw-r--r--include/my_bitmap.h6
-rw-r--r--include/my_global.h14
-rw-r--r--include/my_sys.h2
-rw-r--r--include/myisam.h5
-rw-r--r--include/myisammrg.h5
-rw-r--r--include/mysql.h9
-rw-r--r--include/mysql_com.h12
-rw-r--r--include/mysql_embed.h3
-rw-r--r--include/mysql_version.h.in6
-rw-r--r--include/thr_alarm.h2
-rw-r--r--include/violite.h10
18 files changed, 94 insertions, 51 deletions
diff --git a/include/config-netware.h b/include/config-netware.h
index 6a7f6291e26..c4e63056353 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -35,7 +35,7 @@
#include <pthread.h>
#include <termios.h>
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -45,12 +45,18 @@ extern "C" {
#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 */
+
/* include the old function apis */
#define USE_OLD_FUNCTIONS 1
@@ -66,6 +72,9 @@ extern "C" {
/* 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"
@@ -87,15 +96,20 @@ extern "C" {
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE
-/* kernal call on NetWare that will only yield if our time slice is up */
+/* 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; }
+/* Some macros for portability */
+
+#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }
-#ifdef __cplusplus
+/* 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 c5f2be81fb7..63f2abbabc7 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000,2004 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -107,6 +107,7 @@ typedef struct st_heap_share
uint reclength; /* Length of one record */
uint changed;
uint keys,max_key_length;
+ uint currently_disabled_keys; /* saved value from "keys" when disabled */
uint open_count;
byte *del_link; /* Link to next block with del. rec */
my_string name; /* Name of "memory-file" */
@@ -176,12 +177,13 @@ extern int heap_rprev(HP_INFO *info,byte *record);
extern int heap_rfirst(HP_INFO *info,byte *record,int inx);
extern int heap_rlast(HP_INFO *info,byte *record,int inx);
extern void heap_clear(HP_INFO *info);
+extern void heap_clear_keys(HP_INFO *info);
+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..371e20d130f 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -238,6 +238,7 @@ 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 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 54c739bde23..f912cb4278c 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -191,7 +191,7 @@ enum ha_base_keytype {
#define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */
#define HA_SPATIAL 1024 /* For spatial search */
#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */
-
+#define HA_GENERATED_KEY 8192 /* Automaticly generated key */
/* Automatic bits in key-flag */
@@ -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 760b196ca8d..af58139fb29 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -73,11 +73,10 @@
#endif
#endif /* _WIN32... */
-/* extra protection against CPU Hogs on NetWare */
-#ifdef __NETWARE__
- #define NETWARE_YIELD { kYieldIfTimeSliceUp(); }
-#else
- #define NETWARE_YIELD { }
+/* Some defines to avoid ifdefs in the code */
+#ifndef NETWARE_YIELD
+#define NETWARE_YIELD
+#define NETWARE_SET_SCREEN_MODE(A)
#endif
/*
@@ -345,6 +344,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
@@ -389,7 +391,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)
diff --git a/include/my_sys.h b/include/my_sys.h
index 89dee5b713d..e05df3b6a07 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -770,6 +770,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 537467336f8..51540a7d89f 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -188,10 +188,11 @@ struct st_mysql_options {
my_bool secure_auth;
/* function pointers for local infile support */
- int (*local_infile_init)(void **, const char *);
+ int (*local_infile_init)(void **, const char *, void *);
int (*local_infile_read)(void *, char *, unsigned int);
void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, unsigned int);
+ void *local_infile_userdata;
};
enum mysql_status
@@ -397,12 +398,14 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
void
mysql_set_local_infile_handler(MYSQL *mysql,
- int (*local_infile_init)(void **, const char *),
+ int (*local_infile_init)(void **, const char *,
+ void *),
int (*local_infile_read)(void *, char *,
unsigned int),
void (*local_infile_end)(void *),
int (*local_infile_error)(void *, char*,
- unsigned int));
+ unsigned int),
+ void *);
void
mysql_set_local_infile_default(MYSQL *mysql);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 9604f4c0b59..b4947a64236 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -36,6 +36,12 @@
#define MYSQL_SERVICENAME "MySQL"
#endif /* __WIN__ */
+#if defined(__WIN__) && !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) && !defined(EMBEDDED_LIBRARY)
+#define dll_import_spec __declspec( dllimport )
+#else
+#define dll_import_spec
+#endif
+
enum enum_server_command
{
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
@@ -311,8 +317,8 @@ typedef struct st_udf_init
extern "C" {
#endif
-extern unsigned long max_allowed_packet;
-extern unsigned long net_buffer_length;
+dll_import_spec extern unsigned long max_allowed_packet;
+dll_import_spec extern unsigned long net_buffer_length;
/*
These functions are used for authentication by client and server and
@@ -364,6 +370,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/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__)
diff --git a/include/violite.h b/include/violite.h
index e8f30288d34..b4b9f724d89 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -55,14 +55,8 @@ int vio_close_pipe(Vio * vio);
void vio_delete(Vio* vio);
int vio_close(Vio* vio);
-
-#ifdef EMBEDDED_LIBRARY
-void vio_reset(Vio *vio);
-#else
-void vio_reset(Vio* vio, enum enum_vio_type type,
- my_socket sd, HANDLE hPipe, my_bool localhost);
-#endif
-
+void vio_reset(Vio* vio, enum enum_vio_type type,
+ my_socket sd, HANDLE hPipe, my_bool localhost);
int vio_read(Vio *vio, gptr buf, int size);
int vio_write(Vio *vio, const gptr buf, int size);
int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode);