summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-08-02 12:01:24 +0300
committerMichael Widenius <monty@askmonty.org>2010-08-02 12:01:24 +0300
commite0a6b02c5d0a311e7167295494786077009743d1 (patch)
tree72c934fe42261ad5de3139961e092f57e9d147df /include
parentd2f8b7d04503478ab6b6998194a2070891f0c2bb (diff)
parent6ad06b15222300e4eed4fe3972d1ad249c4c42a2 (diff)
downloadmariadb-git-e0a6b02c5d0a311e7167295494786077009743d1.tar.gz
Merge with MySQL 5.1.49
Fixed Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins' in a better way (patch from Sergey Petrunya)
Diffstat (limited to 'include')
-rw-r--r--include/m_string.h3
-rw-r--r--include/my_alarm.h4
-rw-r--r--include/my_getopt.h21
-rw-r--r--include/my_global.h8
-rw-r--r--include/my_sys.h2
-rw-r--r--include/my_valgrind.h24
-rw-r--r--include/myisam.h2
-rw-r--r--include/sslopt-longopts.h21
8 files changed, 48 insertions, 37 deletions
diff --git a/include/m_string.h b/include/m_string.h
index a86a2d66135..6af7c7f9fa2 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -124,9 +124,6 @@ extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
#undef bcmp
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
-#define bzero_if_valgrind(A,B) bzero(A,B)
-#else
-#define bzero_if_valgrind(A,B)
#endif /* HAVE_valgrind */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
diff --git a/include/my_alarm.h b/include/my_alarm.h
index 750135d64ed..c41c1d65e27 100644
--- a/include/my_alarm.h
+++ b/include/my_alarm.h
@@ -36,14 +36,14 @@ extern ulong my_time_to_wait_for_lock;
#define ALARM_END VOID(signal(SIGALRM,alarm_signal)); \
VOID(alarm(alarm_old));
#define ALARM_TEST my_have_got_alarm
-#ifdef DONT_REMEMBER_SIGNAL
+#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
#define ALARM_REINIT VOID(alarm(MY_HOW_OFTEN_TO_ALARM)); \
VOID(signal(SIGALRM,my_set_alarm_variable));\
my_have_got_alarm=0;
#else
#define ALARM_REINIT VOID(alarm((uint) MY_HOW_OFTEN_TO_ALARM)); \
my_have_got_alarm=0;
-#endif /* DONT_REMEMBER_SIGNAL */
+#endif /* SIGNAL_HANDLER_RESET_ON_DELIVERY */
#else
#define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1
#define ALARM_INIT
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 7cbad607aac..d7c996302fd 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -45,10 +45,10 @@ struct my_option
const char *name; /* Name of the option */
int id; /* unique id or short option */
const char *comment; /* option comment, for autom. --help */
- uchar **value; /* The variable value */
- uchar **u_max_value; /* The user def. max variable value */
+ void *value; /* The variable value */
+ void *u_max_value; /* The user def. max variable value */
struct st_typelib *typelib; /* Pointer to possible values */
- ulong var_type;
+ ulong var_type; /* Must match the variable type */
enum get_opt_arg_type arg_type;
longlong def_value; /* Default value */
longlong min_value; /* Min allowed value */
@@ -58,8 +58,16 @@ struct my_option
void *app_type; /* To be used by an application */
};
-typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
-typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
+typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
+typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...);
+/**
+ Used to retrieve a reference to the object (variable) that holds the value
+ for the given option. For example, if var_type is GET_UINT, the function
+ must return a pointer to a variable of type uint. A argument is stored in
+ the location pointed to by the returned pointer.
+*/
+typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *,
+ int *);
extern char *disabled_my_option;
extern my_bool my_getopt_print_errors;
@@ -71,8 +79,7 @@ extern int handle_options (int *argc, char ***argv,
extern void my_cleanup_options(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_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint,
- const struct my_option *, int *));
+extern void my_getopt_register_get_addr(my_getopt_value);
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
my_bool *fix);
diff --git a/include/my_global.h b/include/my_global.h
index 9d9daf5aa1a..b4579248dfa 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -55,6 +55,10 @@
#define USE_PRAGMA_INTERFACE
#endif
+#if defined(__OpenBSD__) && (OpenBSD >= 200411)
+#define HAVE_ERRNO_AS_DEFINE
+#endif
+
#if defined(i386) && !defined(__i386__)
#define __i386__
#endif
@@ -548,8 +552,8 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#endif
/* Does the system remember a signal handler after a signal ? */
-#ifndef HAVE_BSD_SIGNALS
-#define DONT_REMEMBER_SIGNAL
+#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
+#define SIGNAL_HANDLER_RESET_ON_DELIVERY
#endif
/* Define void to stop lint from generating "null effekt" comments */
diff --git a/include/my_sys.h b/include/my_sys.h
index aa0e8d7f20d..c5b3008e8bc 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -37,7 +37,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; }
#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 MY_FILE_ERROR ((size_t) -1)
diff --git a/include/my_valgrind.h b/include/my_valgrind.h
index 301f9f85464..da434454565 100644
--- a/include/my_valgrind.h
+++ b/include/my_valgrind.h
@@ -24,15 +24,19 @@
#if defined(HAVE_valgrind)&& defined(HAVE_VALGRIND_MEMCHECK_H)
#include <valgrind/memcheck.h>
-#else
-#define VALGRIND_MAKE_MEM_DEFINED(addr, size) do { } while(0)
-#define VALGRIND_MAKE_MEM_NOACCESS(addr, size) do { } while(0)
+#define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
+#define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
+#define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
+#define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
+#else /* HAVE_VALGRIND */
+# define MEM_UNDEFINED(a,len) ((void) 0)
+# define MEM_NOACCESS(a,len) ((void) 0)
+# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
+# define MEM_CHECK_DEFINED(a,len) ((void) 0)
+#endif /* HAVE_VALGRIND */
+
#ifdef SAFEMALLOC
-#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) bfill(addr, size, 0x8F)
+#define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0)
#else
-#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) do { } while(0)
-#endif /* SAFEMALLOC */
-#endif /* HAVE_valgrind */
-
-/* Compatibility with old source */
-#define TRASH(A,B) VALGRIND_MAKE_MEM_UNDEFINED(A, B)
+#define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0)
+#endif
diff --git a/include/myisam.h b/include/myisam.h
index 3d2a326363d..8413b7936e3 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -48,8 +48,6 @@ extern "C" {
#define MI_NAME_IEXT ".MYI"
#define MI_NAME_DEXT ".MYD"
-/* Max extra space to use when sorting keys */
-#define MI_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
/* Possible values for myisam_block_size (must be power of 2) */
#define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */
diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h
index c76b5dcd252..c038ece1644 100644
--- a/include/sslopt-longopts.h
+++ b/include/sslopt-longopts.h
@@ -16,30 +16,31 @@
#ifdef HAVE_OPENSSL
{"ssl", OPT_SSL_SSL,
- "Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.",
- (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
- 0, 0, 0},
+ "Enable SSL for connection (automatically enabled with other flags)."
+ "Disable with --skip-ssl.", &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL,
+ NO_ARG, 0, 0, 0, 0, 0, 0},
{"ssl-ca", OPT_SSL_CA,
"CA file in PEM format (check OpenSSL docs, implies --ssl).",
- (uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
+ &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-capath", OPT_SSL_CAPATH,
"CA directory (check OpenSSL docs, implies --ssl).",
- (uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
+ &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
- (uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
+ &opt_ssl_cert, &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).",
- (uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
+ &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
- (uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
+ &opt_ssl_key, &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.",
- (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert,
+ "Verify server's \"Common Name\" in its cert against hostname used "
+ "when connecting. This option is disabled by default.",
+ &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#endif /* HAVE_OPENSSL */