summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-04-19 16:09:44 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-04-19 16:09:44 +0400
commitee09f9721165ff04c645516651a4ae3892ce7231 (patch)
treeb055b8d1c4471f9f8daad623d14e1af7b793f04c /include
parent54f3f65601142d7d942c4a81e953ae5439d0014f (diff)
parent2283e1b510998ea904f118b0da50986ec4047de2 (diff)
downloadmariadb-git-ee09f9721165ff04c645516651a4ae3892ce7231.tar.gz
Manual merge of mysql-5.1-bugteam to
mysql-trunk-merge. Conflicts: Text conflict in sql/sql_priv.h
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am2
-rw-r--r--include/hash.h15
-rw-r--r--include/keycache.h3
-rw-r--r--include/m_ctype.h8
-rw-r--r--include/m_string.h16
-rw-r--r--include/my_dbug.h18
-rw-r--r--include/my_dir.h18
-rw-r--r--include/my_getopt.h2
-rw-r--r--include/my_global.h30
-rw-r--r--include/my_handler.h2
-rw-r--r--include/my_net.h3
-rw-r--r--include/my_pthread.h2
-rw-r--r--include/my_sys.h3
-rw-r--r--include/my_tree.h1
-rw-r--r--include/mysql/innodb_priv.h35
-rw-r--r--include/mysql/psi/mysql_file.h2
-rw-r--r--include/mysys_err.h3
-rw-r--r--include/password.h32
-rw-r--r--include/queues.h3
-rw-r--r--include/violite.h4
20 files changed, 182 insertions, 20 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index 1a0bc9c9df3..c60965fd385 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -34,7 +34,7 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
$(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h
noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
- heap.h my_bitmap.h my_uctype.h \
+ heap.h my_bitmap.h my_uctype.h password.h \
myisam.h myisampack.h myisammrg.h ft_global.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 \
diff --git a/include/hash.h b/include/hash.h
index 515c764214d..7b4ec1b4685 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -17,6 +17,21 @@
#ifndef _hash_h
#define _hash_h
+
+#include "my_global.h" /* uchar */
+#include "my_sys.h" /* DYNAMIC_ARRAY */
+
+/*
+ This forward declaration is used from C files where the real
+ definition is included before. Since C does not allow repeated
+ typedef declarations, even when identical, the definition may not be
+ repeated.
+*/
+#ifndef CHARSET_INFO_DEFINED
+#define CHARSET_INFO_DEFINED
+typedef struct charset_info_st CHARSET_INFO;
+#endif /* CHARSET_INFO_DEFINED */
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/include/keycache.h b/include/keycache.h
index baec7f40dcd..fefa31afd87 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -17,6 +17,9 @@
#ifndef _keycache_h
#define _keycache_h
+
+#include "my_sys.h" /* flush_type */
+
C_MODE_START
/* declare structures that is used by st_key_cache */
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 7c01ebe7e5a..06cbfd779c8 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -15,13 +15,13 @@
/*
A better inplementation of the UNIX ctype(3) library.
- Notes: my_global.h should be included before ctype.h
*/
#ifndef _m_ctype_h
#define _m_ctype_h
#include <my_attribute.h>
+#include "my_global.h" /* uint16, uchar */
#ifdef __cplusplus
extern "C" {
@@ -265,6 +265,12 @@ extern MY_CHARSET_HANDLER my_charset_8bit_handler;
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
+/*
+ We define this CHARSET_INFO_DEFINED here to prevent a repeat of the
+ typedef in hash.c, which will cause a compiler error.
+*/
+#define CHARSET_INFO_DEFINED
+
/* See strings/CHARSET_INFO.txt about information on this structure */
typedef struct charset_info_st
{
diff --git a/include/m_string.h b/include/m_string.h
index a118144d310..7bd39e7483f 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -20,6 +20,9 @@
#ifndef _m_string_h
#define _m_string_h
+
+#include "my_global.h" /* HAVE_* */
+
#ifndef __USE_GNU
#define __USE_GNU /* We want to use stpcpy */
#endif
@@ -266,13 +269,6 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
#endif
#define longlong2str(A,B,C) ll2str((A),(B),(C),1)
-/* my_vsnprintf.c */
-
-extern size_t my_vsnprintf(char *str, size_t n,
- const char *format, va_list ap);
-extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 3, 4);
-
#if defined(__cplusplus)
}
#endif
@@ -365,4 +361,10 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
return (end);
}
+static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
+{
+ lex_str->str= (char *) c_str;
+ lex_str->length= strlen(c_str);
+}
+
#endif
diff --git a/include/my_dbug.h b/include/my_dbug.h
index 956a5504e86..34681fbc633 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -145,7 +145,23 @@ extern const char* _db_get_func_(void);
#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
#endif
-#ifdef __cplusplus
+
+#ifdef EXTRA_DEBUG
+/**
+ Sync points allow us to force the server to reach a certain line of code
+ and block there until the client tells the server it is ok to go on.
+ The client tells the server to block with SELECT GET_LOCK()
+ and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
+ concurrency problems
+*/
+#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
+ debug_sync_point(lock_name,lock_timeout)
+void debug_sync_point(const char* lock_name, uint lock_timeout);
+#else
+#define DBUG_SYNC_POINT(lock_name,lock_timeout)
+#endif /* EXTRA_DEBUG */
+
+#ifdef __cplusplus
}
#endif
#endif
diff --git a/include/my_dir.h b/include/my_dir.h
index 90d708ac811..de21bee7385 100644
--- a/include/my_dir.h
+++ b/include/my_dir.h
@@ -13,17 +13,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef _my_dir_h
-#define _my_dir_h
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifndef MY_DIR_H
#define MY_DIR_H
+#include "my_global.h"
+
#include <sys/stat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Defines for my_dir and my_stat */
#define MY_S_IFMT S_IFMT /* type of file */
@@ -101,9 +101,9 @@ extern void my_dirend(MY_DIR *buffer);
extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags);
extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags);
-#endif /* MY_DIR_H */
-
#ifdef __cplusplus
}
#endif
-#endif
+
+#endif /* MY_DIR_H */
+
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 32380efe289..54ae5982ea1 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -16,6 +16,8 @@
#ifndef _my_getopt_h
#define _my_getopt_h
+#include "my_sys.h" /* loglevel */
+
C_MODE_START
#define GET_NO_ARG 1
diff --git a/include/my_global.h b/include/my_global.h
index a0e1c747032..540fabee6dd 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1205,6 +1205,12 @@ typedef unsigned long my_off_t;
#endif /*_WIN32*/
#define MY_FILEPOS_ERROR (~(my_off_t) 0)
+/*
+ TODO Convert these to use Bitmap class.
+ */
+typedef ulonglong table_map; /* Used for table bits in join */
+typedef ulong nesting_map; /* Used for flags of nesting constructs */
+
#if defined(__WIN__)
#define socket_errno WSAGetLastError()
#define SOCKET_EINTR WSAEINTR
@@ -1675,7 +1681,13 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
#if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
+#endif
+
+#define x_free(A) \
+ do { my_free((uchar*)(A), MYF(MY_WME|MY_FAE|MY_ALLOW_ZERO_PTR)); } while (0)
+#define safeFree(X) \
+ do { if (X) { my_free((uchar*)(X), MYF(0)); (X) = NULL; } } while (0)
+
/*
Only Linux is known to need an explicit sync of the directory to make sure a
file creation/deletion/renaming in(from,to) this directory durable.
@@ -1755,4 +1767,20 @@ static inline double rint(double x)
#endif
#endif
+/* Defines that are unique to the embedded version of MySQL */
+
+#ifdef EMBEDDED_LIBRARY
+
+/* 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 */
+
+#define DONT_USE_RAID
+
+#endif /* EMBEDDED_LIBRARY */
+
#endif /* my_global_h */
diff --git a/include/my_handler.h b/include/my_handler.h
index ae56331df86..977c0042938 100644
--- a/include/my_handler.h
+++ b/include/my_handler.h
@@ -23,6 +23,8 @@
extern "C" {
#endif
+#include "m_ctype.h" /* CHARSET_INFO */
+
/*
There is a hard limit for the maximum number of keys as there are only
8 bits in the index file header for the number of keys in a table.
diff --git a/include/my_net.h b/include/my_net.h
index 18fb3db8e88..8617f180431 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -24,6 +24,9 @@
#ifndef _my_net_h
#define _my_net_h
+
+#include "my_global.h" /* C_MODE_START, C_MODE_END */
+
C_MODE_START
#include <errno.h>
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 0b55c70b0fa..e41abba950e 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -18,6 +18,8 @@
#ifndef _my_pthread_h
#define _my_pthread_h
+#include "my_global.h" /* myf */
+
#ifndef ETIME
#define ETIME ETIMEDOUT /* For FreeBSD */
#endif
diff --git a/include/my_sys.h b/include/my_sys.h
index 8e56ef27c2d..ac10628f943 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -15,6 +15,9 @@
#ifndef _my_sys_h
#define _my_sys_h
+
+#include "my_global.h" /* C_MODE_START, C_MODE_END */
+
C_MODE_START
#ifdef HAVE_AIOWAIT
diff --git a/include/my_tree.h b/include/my_tree.h
index 24bbdd54019..0958a37fb4c 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -20,6 +20,7 @@ extern "C" {
#endif
#include "my_base.h" /* get 'enum ha_rkey_function' */
+#include "my_alloc.h" /* MEM_ROOT */
/* Worst case tree is half full. This gives use 2^(MAX_TREE_HEIGHT/2) leafs */
#define MAX_TREE_HEIGHT 64
diff --git a/include/mysql/innodb_priv.h b/include/mysql/innodb_priv.h
new file mode 100644
index 00000000000..56d8434f9b0
--- /dev/null
+++ b/include/mysql/innodb_priv.h
@@ -0,0 +1,35 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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
+ the Free Software Foundation; version 2 of the License.
+
+ 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef INNODB_PRIV_INCLUDED
+#define INNODB_PRIV_INCLUDED
+
+/** @file Declaring server-internal functions that are used by InnoDB. */
+
+#include <sql_priv.h>
+
+class THD;
+
+uint filename_to_tablename(const char *from, char *to, uint to_length);
+int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
+bool check_global_access(THD *thd, ulong want_access);
+
+uint strconvert(CHARSET_INFO *from_cs, const char *from,
+ CHARSET_INFO *to_cs, char *to, uint to_length,
+ uint *errors);
+void sql_print_error(const char *format, ...);
+
+
+#endif /* INNODB_PRIV_INCLUDED */
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index 18220a8dd4e..0a998aaa76c 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -20,6 +20,8 @@
#include <string.h>
/* For MY_STAT */
#include <my_dir.h>
+/* For my_chsize */
+#include <my_sys.h>
/**
@file mysql/psi/mysql_file.h
diff --git a/include/mysys_err.h b/include/mysys_err.h
index 09e77248c17..6c18055b31b 100644
--- a/include/mysys_err.h
+++ b/include/mysys_err.h
@@ -16,6 +16,9 @@
#ifndef _mysys_err_h
#define _mysys_err_h
#ifdef __cplusplus
+
+#include "my_global.h" /* NEAR */
+
extern "C" {
#endif
diff --git a/include/password.h b/include/password.h
new file mode 100644
index 00000000000..e75b09297a3
--- /dev/null
+++ b/include/password.h
@@ -0,0 +1,32 @@
+/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+
+ 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
+ the Free Software Foundation; version 2 of the License.
+
+ 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#ifndef PASSWORD_INCLUDED
+#define PASSWORD_INCLUDED
+
+#include "my_global.h"
+
+C_MODE_START
+
+void my_make_scrambled_password_323(char *to, const char *password,
+ size_t pass_len);
+void my_make_scrambled_password(char *to, const char *password,
+ size_t pass_len);
+
+void hash_password(ulong *result, const char *password, uint password_len);
+
+C_MODE_END
+
+#endif /* PASSWORD_INCLUDED */
diff --git a/include/queues.h b/include/queues.h
index d01b73ba999..07962f09201 100644
--- a/include/queues.h
+++ b/include/queues.h
@@ -22,6 +22,9 @@
#ifndef _queues_h
#define _queues_h
+
+#include "my_global.h" /* uchar */
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/include/violite.h b/include/violite.h
index 34dc6511b3d..904c383d64a 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -30,6 +30,10 @@
extern "C" {
#endif /* __cplusplus */
+#ifdef __cplusplus
+typedef struct st_vio Vio;
+#endif /* __cplusplus */
+
enum enum_vio_type
{
VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE,