summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-02-28 19:39:30 +0200
committerMichael Widenius <monty@askmonty.org>2011-02-28 19:39:30 +0200
commit3358cdd5048671ee6cbbf50c291f7e0d0fda8e1e (patch)
treeda0e622896425203d23ecdfd1bc77b57e3502edf /include
parent869f5d0e81d5cbecaec3605f292fbb363b9ccbf6 (diff)
parentf83e594218a6d19da2fa1ea2a01d860c30fe2913 (diff)
downloadmariadb-git-3358cdd5048671ee6cbbf50c291f7e0d0fda8e1e.tar.gz
Merge with 5.1 to get in changes from MySQL 5.1.55
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am4
-rw-r--r--include/config-netware.h1
-rw-r--r--include/config-win.h1
-rw-r--r--include/m_ctype.h2
-rw-r--r--include/m_string.h4
-rw-r--r--include/my_compiler.h7
-rw-r--r--include/my_dbug.h5
-rw-r--r--include/my_global.h1
-rw-r--r--include/my_pthread.h10
-rw-r--r--include/my_stacktrace.h2
-rw-r--r--include/my_sys.h1
-rw-r--r--include/mysql_embed.h1
-rw-r--r--include/mysys_err.h7
-rw-r--r--include/thr_lock.h3
14 files changed, 33 insertions, 16 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index d423e500aae..4c0ed25e2c8 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,11 +1,11 @@
# Copyright (C) 2000-2006 MySQL AB
#
-# This library is free software; you can redistribute it and/or
+# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
-# This library 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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
diff --git a/include/config-netware.h b/include/config-netware.h
index 4b9e1437170..156b1eff0e4 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -122,6 +122,7 @@ extern "C" {
#define CANT_DELETE_OPEN_FILES 1
#define FN_LIBCHAR '\\'
+#define FN_DIRSEP "/\\" /* Valid directory separators */
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
diff --git a/include/config-win.h b/include/config-win.h
index 3d83871270d..b4958243abc 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -364,6 +364,7 @@ inline ulonglong double2ulonglong(double d)
/* File name handling */
#define FN_LIBCHAR '\\'
+#define FN_DIRSEP "/\\" /* Valid directory separators */
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
diff --git a/include/m_ctype.h b/include/m_ctype.h
index c2551b5d309..5f21ece044f 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -490,6 +490,8 @@ extern my_bool my_parse_charset_xml(const char *bug, size_t len,
int (*add)(struct charset_info_st *cs));
extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
pchar c);
+extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end,
+ const char *accept);
my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len);
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
diff --git a/include/m_string.h b/include/m_string.h
index 26fa41d9cc4..47dfb679d32 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -77,7 +77,9 @@ extern "C" {
extern void *(*my_str_malloc)(size_t);
extern void (*my_str_free)(void *);
-#if defined(HAVE_STPCPY)
+#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
+#define strmov(A,B) __builtin_stpcpy((A),(B))
+#elif defined(HAVE_STPCPY)
#define strmov(A,B) stpcpy((A),(B))
#ifndef stpcpy
extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
diff --git a/include/my_compiler.h b/include/my_compiler.h
index c7d334999d0..b5ccdb212d6 100644
--- a/include/my_compiler.h
+++ b/include/my_compiler.h
@@ -1,7 +1,7 @@
#ifndef MY_COMPILER_INCLUDED
#define MY_COMPILER_INCLUDED
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, Oracle and/or its affiliates.
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
@@ -76,6 +76,11 @@
/**
Generic (compiler-independent) features.
*/
+
+#ifndef MY_GNUC_PREREQ
+# define MY_GNUC_PREREQ(maj, min) (0)
+#endif
+
#ifndef MY_ALIGNOF
# ifdef __cplusplus
template<typename type> struct my_alignof_helper { char m1; type m2; };
diff --git a/include/my_dbug.h b/include/my_dbug.h
index e1cd4e2b7dc..ef30c95e32a 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -126,7 +126,7 @@ extern void _db_flush_();
#define DBUG_END() _db_end_ ()
#define DBUG_LOCK_FILE _db_lock_file_()
#define DBUG_UNLOCK_FILE _db_unlock_file_()
-#define DBUG_ASSERT(A) assert(A)
+#define DBUG_ASSERT(A) do { _db_flush_(); assert(A); } while(0)
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
@@ -157,7 +157,8 @@ extern void _db_flush_();
#ifdef __WIN__
#define DBUG_SUICIDE() DBUG_ABORT()
#else
-#define DBUG_SUICIDE() (_db_flush_(), kill(getpid(), SIGKILL), pause())
+extern void _db_suicide_();
+#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
#endif
#else /* No debugger */
diff --git a/include/my_global.h b/include/my_global.h
index 9281e9cc13e..8b71410dbf0 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -781,6 +781,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#ifndef FN_LIBCHAR
#define FN_LIBCHAR '/'
+#define FN_DIRSEP "/" /* Valid directory separators */
#define FN_ROOTDIR "/"
#endif
#define MY_NFILE 64 /* This is only used to save filenames */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 5cf6c5d5fac..fffb883912a 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc,
+ 2010-2011 Oracle and/or its affiliates, 2009-2010 Monty Program 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
@@ -125,11 +126,10 @@ int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void));
struct tm *localtime_r(const time_t *timep,struct tm *tmp);
struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
-
void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#ifndef ETIMEDOUT
-#define ETIMEDOUT 145 /* Win32 doesn't have this */
+#define ETIMEDOUT 145 /* Win32 might not have this */
#endif
#define getpid() GetCurrentThreadId()
#define HAVE_LOCALTIME_R 1
@@ -224,7 +224,11 @@ extern int my_pthread_getprio(pthread_t thread_id);
typedef void *(* pthread_handler)(void *);
#define my_pthread_once_t pthread_once_t
+#if defined(PTHREAD_ONCE_INITIALIZER)
+#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INITIALIZER
+#else
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#endif
#define my_pthread_once(C,F) pthread_once(C,F)
/* Test first for RTS or FSU threads */
diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h
index 9250fd4579e..b64d5d798a5 100644
--- a/include/my_stacktrace.h
+++ b/include/my_stacktrace.h
@@ -47,7 +47,7 @@ C_MODE_START
#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
void my_init_stacktrace();
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack);
-void my_safe_print_str(const char* name, const char* val, int max_len);
+void my_safe_print_str(const char* val, int max_len);
void my_write_core(int sig);
#if BACKTRACE_DEMANGLE
char *my_demangle(const char *mangled_name, int *status);
diff --git a/include/my_sys.h b/include/my_sys.h
index f5e38c5858e..d391492983d 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -673,6 +673,7 @@ 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_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
+extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
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_chmod(const char *name, mode_t mode, myf my_flags);
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index 4a7fd3ef63c..a7d6e610918 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -20,7 +20,6 @@
/* 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 */
-#undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_OPENSSL
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
diff --git a/include/mysys_err.h b/include/mysys_err.h
index bbb7f6de7d8..215863462cc 100644
--- a/include/mysys_err.h
+++ b/include/mysys_err.h
@@ -64,10 +64,11 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_FILE_NOT_CLOSED 30
#define EE_CHANGE_OWNERSHIP 31
#define EE_CHANGE_PERMISSIONS 32
-#define EE_CANT_CHMOD 33
-#define EE_CANT_SEEK 34
+#define EE_CANT_SEEK 33
+#define EE_CANT_CHMOD 34
#define EE_CANT_COPY_OWNERSHIP 35
#define EE_ERROR_LAST 35 /* Copy last error nr */
+
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* exit codes for all MySQL programs */
@@ -86,9 +87,7 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EXIT_OPTION_DISABLED 12
#define EXIT_ARGUMENT_INVALID 13
-
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/include/thr_lock.h b/include/thr_lock.h
index 08cc8bd5408..111fd5f4cf2 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -123,7 +123,7 @@ typedef struct st_thr_lock_data {
struct st_thr_lock *lock;
pthread_cond_t *cond;
void *status_param; /* Param to status functions */
- void *debug_print_param;
+ void *debug_print_param; /* Used by MariaDB for TABLE ref */
enum thr_lock_type type;
uint priority;
} THR_LOCK_DATA;
@@ -149,6 +149,7 @@ typedef struct st_thr_lock {
my_bool (*start_trans)(void*); /* When all locks are taken */
my_bool (*check_status)(void *);
void (*fix_status)(void *, void *);/* For thr_merge_locks() */
+ const char *name; /* Used for error reporting */
my_bool allow_multiple_concurrent_insert;
} THR_LOCK;