summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.local>2006-11-29 11:44:37 +0300
committerunknown <kostja@bodhi.local>2006-11-29 11:44:37 +0300
commit0e978328ae3055a55f9e21cc7b395cf2581925b9 (patch)
treef6410b9231112e66043c0eb7edc1b33fbff6e760 /include
parent0534b679b70d34db1a9ff3d5ae0c6dd39560636f (diff)
parentfe99bda872fd51b07e1ebb0dc506e26d195edec7 (diff)
downloadmariadb-git-0e978328ae3055a55f9e21cc7b395cf2581925b9.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge libmysql/libmysql.c: Auto merged mysql-test/r/ps.result: Auto merged mysql-test/t/func_str.test: Auto merged mysql-test/t/ps.test: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_sum.cc: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_yacc.yy: Auto merged server-tools/instance-manager/mysql_connection.cc: Rollback Monty's removals of explicit casts tests/mysql_client_test.c: SCCS merged
Diffstat (limited to 'include')
-rw-r--r--include/errmsg.h3
-rw-r--r--include/m_ctype.h12
-rw-r--r--include/my_global.h21
3 files changed, 26 insertions, 10 deletions
diff --git a/include/errmsg.h b/include/errmsg.h
index dc7adb3b501..f24ea2bf396 100644
--- a/include/errmsg.h
+++ b/include/errmsg.h
@@ -95,6 +95,7 @@ extern const char *client_errors[]; /* Error messages */
#define CR_NO_STMT_METADATA 2052
#define CR_NO_RESULT_SET 2053
#define CR_NOT_IMPLEMENTED 2054
-#define CR_ERROR_LAST /*Copy last error nr:*/ 2054
+#define CR_SERVER_LOST_EXTENDED 2055
+#define CR_ERROR_LAST /*Copy last error nr:*/ 2055
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 5f946a3b443..0d586030735 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -190,8 +190,8 @@ typedef struct my_charset_handler_st
const unsigned char *s, const unsigned char *e);
/* Functions for case and sort conversion */
- void (*caseup_str)(struct charset_info_st *, char *);
- void (*casedn_str)(struct charset_info_st *, char *);
+ uint (*caseup_str)(struct charset_info_st *, char *);
+ uint (*casedn_str)(struct charset_info_st *, char *);
uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
char *dst, uint dstlen);
uint (*casedn)(struct charset_info_st *, char *src, uint srclen,
@@ -324,8 +324,8 @@ extern uint my_instr_simple(struct charset_info_st *,
/* Functions for 8bit */
-extern void my_caseup_str_8bit(CHARSET_INFO *, char *);
-extern void my_casedn_str_8bit(CHARSET_INFO *, char *);
+extern uint my_caseup_str_8bit(CHARSET_INFO *, char *);
+extern uint my_casedn_str_8bit(CHARSET_INFO *, char *);
extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen,
char *dst, uint dstlen);
extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen,
@@ -415,8 +415,8 @@ int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
/* Functions for multibyte charsets */
-extern void my_caseup_str_mb(CHARSET_INFO *, char *);
-extern void my_casedn_str_mb(CHARSET_INFO *, char *);
+extern uint my_caseup_str_mb(CHARSET_INFO *, char *);
+extern uint my_casedn_str_mb(CHARSET_INFO *, char *);
extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen,
char *dst, uint dstlen);
extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen,
diff --git a/include/my_global.h b/include/my_global.h
index a7ec41068b3..c182ef7b799 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -869,9 +869,8 @@ typedef long my_ptrdiff_t;
typedef long long my_ptrdiff_t;
#endif
-#if HAVE_SIZE_T
-typedef size_t my_size_t;
-#elif SIZEOF_CHARP <= SIZEOF_LONG
+/* We can't set my_size_t to size_t as we want my_size_t to be unsigned */
+#if SIZEOF_CHARP <= SIZEOF_LONG
typedef unsigned long my_size_t;
#else
typedef unsigned long long my_size_t;
@@ -886,6 +885,22 @@ typedef unsigned long long my_size_t;
#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B))
+/*
+ Custom version of standard offsetof() macro which can be used to get
+ offsets of members in class for non-POD types (according to the current
+ version of C++ standard offsetof() macro can't be used in such cases and
+ attempt to do so causes warnings to be emitted, OTOH in many cases it is
+ still OK to assume that all instances of the class has the same offsets
+ for the same members).
+
+ This is temporary solution which should be removed once File_parser class
+ and related routines are refactored.
+*/
+
+#define my_offsetof(TYPE, MEMBER) \
+ ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
+
+
#define NullS (char *) 0
/* Nowdays we do not support MessyDos */
#ifndef NEAR