summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2009-11-16 21:49:51 +0100
committerunknown <knielsen@knielsen-hq.org>2009-11-16 21:49:51 +0100
commita962160eec233c265900e2754ed2a63ef5e27c5a (patch)
treef1b33a7aed53016189b17cd3f50243b3c8a022de /include
parent166e0683c0d45a79716d8913ec9ecaf3177343fa (diff)
parent9b7a7f06c1a56f49a4528f019ec821d3a01934b6 (diff)
downloadmariadb-git-a962160eec233c265900e2754ed2a63ef5e27c5a.tar.gz
Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs - Did changes in pbxt and maria storage engines becasue of changes in thd->query - Reverted wrong code in sql_table.cc for how ROW_FORMAT is used. This is a re-commit of Monty's merge to eliminate an extra commit from MySQL-5.1.42 that was accidentally included in the merge. This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In case there are any extra changes done before final MySQL 5.1.41 release, these will need to be merged later before MariaDB 5.1.41 release.
Diffstat (limited to 'include')
-rw-r--r--include/my_dbug.h87
-rw-r--r--include/my_sys.h12
-rw-r--r--include/myisamchk.h4
-rw-r--r--include/mysql.h10
-rw-r--r--include/mysql.h.pp10
-rw-r--r--include/violite.h8
6 files changed, 98 insertions, 33 deletions
diff --git a/include/my_dbug.h b/include/my_dbug.h
index 5c185d5eef2..109a1a4eb19 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000 MySQL AB & 2009 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
@@ -16,7 +16,30 @@
#ifndef _dbug_h
#define _dbug_h
-#ifdef __cplusplus
+#if defined(__cplusplus) && !defined(DBUG_OFF)
+class Dbug_violation_helper
+{
+public:
+ inline Dbug_violation_helper() :
+ _entered(TRUE)
+ { }
+
+ inline ~Dbug_violation_helper()
+ {
+ assert(!_entered);
+ }
+
+ inline void leave()
+ {
+ _entered= FALSE;
+ }
+
+private:
+ bool _entered;
+};
+#endif /* C++ */
+
+#ifdef __cplusplus
extern "C" {
#endif
#if !defined(DBUG_OFF) && !defined(_lint)
@@ -30,34 +53,51 @@ struct _db_stack_frame_ {
struct _db_code_state_;
extern my_bool _dbug_on_;
-extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int);
+extern my_bool _db_keyword_(struct _db_code_state_ *cs, const char *keyword,
+ int strict_flag);
+extern int _db_strict_keyword_(const char *keyword);
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
extern int _db_explain_init_(char *buf, size_t len);
extern int _db_is_pushed_(void);
extern void _db_setjmp_(void);
extern void _db_longjmp_(void);
extern void _db_process_(const char *name);
-extern void _db_push_(const char *control);
-extern void _db_pop_(void);
+extern void _db_push_(const char *control);
+extern void _db_pop_(void);
extern void _db_set_(const char *control);
extern void _db_set_init_(const char *control);
-extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
- struct _db_stack_frame_ *_stack_frame_);
+extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
+ struct _db_stack_frame_ *_stack_frame_);
extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_);
extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ _VARARGS((const char *format,...))
ATTRIBUTE_FORMAT(printf, 1, 2);
-extern void _db_dump_(uint _line_,const char *keyword,
+extern void _db_dump_(uint _line_,const char *keyword,
const unsigned char *memory, size_t length);
-extern void _db_end_(void);
-extern void _db_lock_file_(void);
-extern void _db_unlock_file_(void);
-extern FILE *_db_fp_(void);
+extern void _db_end_(void);
+extern void _db_lock_file_(void);
+extern void _db_unlock_file_(void);
+extern FILE *_db_fp_(void);
extern void _db_flush_();
+#ifdef __cplusplus
+
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \
+ Dbug_violation_helper dbug_violation_helper; \
_db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
-#define DBUG_LEAVE _db_return_ (__LINE__, &_db_stack_frame_)
+#define DBUG_VIOLATION_HELPER_LEAVE dbug_violation_helper.leave()
+
+#else /* C */
+
+#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \
+ _db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
+#define DBUG_VIOLATION_HELPER_LEAVE do { } while(0)
+
+#endif /* C++ */
+
+#define DBUG_LEAVE \
+ DBUG_VIOLATION_HELPER_LEAVE; \
+ _db_return_ (__LINE__, &_db_stack_frame_)
#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
#define DBUG_EXECUTE(keyword,a1) \
@@ -88,28 +128,15 @@ extern void _db_flush_();
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
#define IF_DBUG(A) A
-#ifndef __WIN__
#define DBUG_ABORT() (_db_flush_(), abort())
-#else
-/*
- Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
- call abort() instead of _exit(3) (now it would cause a "test signal" popup).
-*/
-#include <crtdbg.h>
-#define DBUG_ABORT() (_db_flush_(),\
- (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
- (void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
- _exit(3))
-#endif
-
#else /* No debugger */
#define DBUG_ENTER(a1)
#define DBUG_LEAVE
-#define DBUG_RETURN(a1) do { return(a1); } while(0)
-#define DBUG_VOID_RETURN do { return; } while(0)
-#define DBUG_EXECUTE(keyword,a1) do { } while(0)
-#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
+#define DBUG_RETURN(a1) do { return(a1); } while(0)
+#define DBUG_VOID_RETURN do { return; } while(0)
+#define DBUG_EXECUTE(keyword,a1) do { } while(0)
+#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
#define DBUG_EVALUATE(keyword,a1,a2) (a2)
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
#define DBUG_PRINT(keyword,arglist) do { } while(0)
diff --git a/include/my_sys.h b/include/my_sys.h
index 315454062f1..fcd319d3e95 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -69,6 +69,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
#define MY_DONT_OVERWRITE_FILE 2048 /* my_copy: Don't overwrite file */
#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
+#define MY_SYNC 4096 /* my_copy(): sync dst file */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/
@@ -175,6 +176,16 @@ extern char *my_strndup(const char *from, size_t length,
#define TRASH(A,B) /* nothing */
#endif
+#if defined(ENABLED_DEBUG_SYNC)
+extern void (*debug_sync_C_callback_ptr)(const char *, size_t);
+#define DEBUG_SYNC_C(_sync_point_name_) do { \
+ if (debug_sync_C_callback_ptr != NULL) \
+ (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \
+ while(0)
+#else
+#define DEBUG_SYNC_C(_sync_point_name_)
+#endif /* defined(ENABLED_DEBUG_SYNC) */
+
#ifdef HAVE_LARGE_PAGES
extern uint my_get_large_page_size(void);
extern uchar * my_large_malloc(size_t size, myf my_flags);
@@ -727,7 +738,6 @@ extern int wild_compare(const char *str,const char *wildstr,
extern WF_PACK *wf_comp(char * str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer);
-extern size_t strip_sp(char * str);
extern my_bool array_append_string_unique(const char *str,
const char **array, size_t size);
extern void get_date(char * to,int timeflag,time_t use_time);
diff --git a/include/myisamchk.h b/include/myisamchk.h
index 6d2d887cf68..057c06652a1 100644
--- a/include/myisamchk.h
+++ b/include/myisamchk.h
@@ -154,6 +154,10 @@ typedef struct st_handler_check_param
char temp_filename[FN_REFLEN];
IO_CACHE read_cache;
enum_handler_stats_method stats_method;
+#ifdef THREAD
+ pthread_mutex_t print_msg_mutex;
+ my_bool need_print_msg_lock;
+#endif
} HA_CHECK;
diff --git a/include/mysql.h b/include/mysql.h
index 074098aef1b..b4b399eccc1 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -558,6 +558,16 @@ unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
char *to,const char *from,
unsigned long length);
void STDCALL mysql_debug(const char *debug);
+char * STDCALL mysql_odbc_escape_string(MYSQL *mysql,
+ char *to,
+ unsigned long to_length,
+ const char *from,
+ unsigned long from_length,
+ void *param,
+ char *
+ (*extend_buffer)
+ (void *, char *to,
+ unsigned long *length));
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int STDCALL mysql_thread_safe(void);
my_bool STDCALL mysql_embedded(void);
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index c333cb2bec5..c6a64ccb96e 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -518,6 +518,16 @@ unsigned long mysql_real_escape_string(MYSQL *mysql,
char *to,const char *from,
unsigned long length);
void mysql_debug(const char *debug);
+char * mysql_odbc_escape_string(MYSQL *mysql,
+ char *to,
+ unsigned long to_length,
+ const char *from,
+ unsigned long from_length,
+ void *param,
+ char *
+ (*extend_buffer)
+ (void *, char *to,
+ unsigned long *length));
void myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int mysql_thread_safe(void);
my_bool mysql_embedded(void);
diff --git a/include/violite.h b/include/violite.h
index 7f017635f31..9d104a0b23f 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -44,7 +44,7 @@ enum enum_vio_type
Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
#ifdef __WIN__
Vio* vio_new_win32pipe(HANDLE hPipe);
-Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map,
+Vio* vio_new_win32shared_memory(HANDLE handle_file_map,
HANDLE handle_map,
HANDLE event_server_wrote,
HANDLE event_server_read,
@@ -222,7 +222,11 @@ struct st_vio
HANDLE event_conn_closed;
size_t shared_memory_remain;
char *shared_memory_pos;
- NET *net;
#endif /* HAVE_SMEM */
+#ifdef _WIN32
+ OVERLAPPED pipe_overlapped;
+ DWORD read_timeout_millis;
+ DWORD write_timeout_millis;
+#endif
};
#endif /* vio_violite_h_ */