summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2018-02-01 14:09:48 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2018-02-01 14:09:48 +0200
commitc7e5feb2596e2a032207191320dbf1387d440959 (patch)
treeb4a5f850c3ab553a9a3c6b1b58bc5280ed42a861 /include
parent08b2c516da4df91082ae9fbe5e060959c4bb5faa (diff)
parentd01dbe66a8bf9cb6031f95159c49100f9299a768 (diff)
downloadmariadb-git-c7e5feb2596e2a032207191320dbf1387d440959.tar.gz
Merge tag 'mariadb-10.0.34' into 10.0-galeramariadb-galera-10.0.34
Conflicts: storage/innobase/lock/lock0lock.cc storage/xtradb/lock/lock0lock.cc storage/xtradb/lock/lock0wait.cc support-files/mysql.server.sh
Diffstat (limited to 'include')
-rw-r--r--include/ma_dyncol.h9
-rw-r--r--include/my_compare.h24
-rw-r--r--include/my_global.h8
-rw-r--r--include/my_sys.h4
-rw-r--r--include/my_valgrind.h26
-rw-r--r--include/welcome_copyright_notice.h2
6 files changed, 51 insertions, 22 deletions
diff --git a/include/ma_dyncol.h b/include/ma_dyncol.h
index cb03ccb5382..4f05b425afd 100644
--- a/include/ma_dyncol.h
+++ b/include/ma_dyncol.h
@@ -63,6 +63,15 @@ typedef struct st_mysql_lex_string LEX_STRING;
/* NO and OK is the same used just to show semantics */
#define ER_DYNCOL_NO ER_DYNCOL_OK
+#ifdef HAVE_CHARSET_utf8mb4
+#define DYNCOL_UTF (&my_charset_utf8mb4_general_ci)
+#else
+#define DYNCOL_UTF (&my_charset_utf8_general_ci)
+#endif
+
+/* escape json strings */
+#define DYNCOL_JSON_ESC ((char)1)
+
enum enum_dyncol_func_result
{
ER_DYNCOL_OK= 0,
diff --git a/include/my_compare.h b/include/my_compare.h
index 0db22b593f4..87f0aa8f3ca 100644
--- a/include/my_compare.h
+++ b/include/my_compare.h
@@ -91,17 +91,19 @@ typedef struct st_HA_KEYSEG /* Key-portion */
#define size_to_store_key_length(length) ((length) < 255 ? 1 : 3)
-#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \
- (((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \
- ((1 << (bit_len)) - 1))
-
-#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \
-{ \
- (bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \
- ((bits) << (bit_ofs)); \
- if ((bit_ofs) + (bit_len) > 8) \
- (bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \
- ((bits) >> (8 - (bit_ofs))); \
+static inline uint16 get_rec_bits(const uchar *ptr, uchar ofs, uint len)
+{
+ uint16 val= ptr[0];
+ if (ofs + len > 8)
+ val|= (uint16)(ptr[1]) << 8;
+ return (val >> ofs) & ((1 << len) - 1);
+}
+
+static inline void set_rec_bits(uint16 bits, uchar *ptr, uchar ofs, uint len)
+{
+ ptr[0]= (ptr[0] & ~(((1 << len) - 1) << ofs)) | (bits << ofs);
+ if (ofs + len > 8)
+ ptr[1]= (ptr[1] & ~((1 << (len - 8 + ofs)) - 1)) | (bits >> (8 - ofs));
}
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
diff --git a/include/my_global.h b/include/my_global.h
index b43ba93e080..5ea761d587e 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1099,11 +1099,19 @@ static inline char *dlerror(void)
#ifndef HAVE_DLERROR
#define dlerror() ""
#endif
+#ifndef HAVE_DLADDR
+#define dladdr(A, B) 0
+/* Dummy definition in case we're missing dladdr() */
+typedef struct { const char *dli_fname, dli_fbase; } Dl_info;
+#endif
#else
#define dlerror() "No support for dynamic loading (static build?)"
#define dlopen(A,B) 0
#define dlsym(A,B) 0
#define dlclose(A) 0
+#define dladdr(A, B) 0
+/* Dummy definition in case we're missing dladdr() */
+typedef struct { const char *dli_fname, dli_fbase; } Dl_info;
#endif
/*
diff --git a/include/my_sys.h b/include/my_sys.h
index 9e18373fe15..69daf09311e 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -667,9 +667,7 @@ extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
extern const char *my_get_err_msg(uint nr);
extern void my_error(uint nr,myf MyFlags, ...);
-extern void my_printf_error(uint my_err, const char *format,
- myf MyFlags, ...)
- ATTRIBUTE_FORMAT(printf, 2, 4);
+extern void my_printf_error(uint my_err, const char *format, myf MyFlags, ...);
extern void my_printv_error(uint error, const char *format, myf MyFlags,
va_list ap);
extern int my_error_register(const char** (*get_errmsgs) (void),
diff --git a/include/my_valgrind.h b/include/my_valgrind.h
index 4531ec78f9a..983dce8e75a 100644
--- a/include/my_valgrind.h
+++ b/include/my_valgrind.h
@@ -13,6 +13,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/* clang -> gcc */
+#ifndef __has_feature
+# define __has_feature(x) 0
+#endif
+#if __has_feature(address_sanitizer)
+# define __SANITIZE_ADDRESS__ 1
+#endif
+
#ifdef HAVE_valgrind
#define IF_VALGRIND(A,B) A
#else
@@ -25,7 +33,13 @@
# 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 */
+#elif defined(__SANITIZE_ADDRESS__)
+# include <sanitizer/asan_interface.h>
+# define MEM_UNDEFINED(a,len) ASAN_UNPOISON_MEMORY_REGION(a,len)
+# define MEM_NOACCESS(a,len) ASAN_POISON_MEMORY_REGION(a,len)
+# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
+# define MEM_CHECK_DEFINED(a,len) ((void) 0)
+#else
# define MEM_UNDEFINED(a,len) ((void) 0)
# define MEM_NOACCESS(a,len) ((void) 0)
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
@@ -33,11 +47,9 @@
#endif /* HAVE_VALGRIND */
#ifndef DBUG_OFF
-#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); memset(A, C, trash_tmp); MEM_UNDEFINED(A, trash_tmp); } while (0)
+#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
#else
-#define TRASH_FILL(A,B,C) do{ const size_t trash_tmp __attribute__((unused)) = (B) ; MEM_CHECK_ADDRESSABLE(A,trash_tmp);MEM_UNDEFINED(A,trash_tmp);} while (0)
+#define TRASH_FILL(A,B,C) do { const size_t trash_tmp __attribute__((unused))= (B); MEM_UNDEFINED(A,trash_tmp); } while (0)
#endif
-#define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5)
-#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F)
-#define TRASH(A,B) TRASH_FREE(A,B)
-
+#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
+#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)
diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h
index cd7cd6692be..1b4b17cfc0d 100644
--- a/include/welcome_copyright_notice.h
+++ b/include/welcome_copyright_notice.h
@@ -17,7 +17,7 @@
#ifndef _welcome_copyright_notice_h_
#define _welcome_copyright_notice_h_
-#define COPYRIGHT_NOTICE_CURRENT_YEAR "2017"
+#define COPYRIGHT_NOTICE_CURRENT_YEAR "2018"
/*
This define specifies copyright notice which is displayed by every MySQL