Skip to content

Commit 265b18e

Browse files
committed
include updates windows binaries
1 parent a5c443c commit 265b18e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+459
-962
lines changed
6 KB
Binary file not shown.

windows/mariadb-client-2.0/include/dbug.h renamed to windows/libmariadbclient-2.1.0/include/dbug.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
#ifdef __cplusplus
2121
extern "C" {
2222
#endif
23+
24+
/* unsupported macros (used by async) */
25+
#define DBUG_SWAP_CODE_STATE(a) {}
26+
#define DBUG_FREE_CODE_STATE(a) {}
27+
2328
#if !defined(DBUG_OFF) && !defined(_lint)
2429

2530
struct _db_stack_frame_ {
@@ -120,7 +125,6 @@ extern const char* _db_get_func_(void);
120125
#endif
121126

122127
#else /* No debugger */
123-
124128
#define DBUG_ENTER(a1)
125129
#define DBUG_END() {}
126130
#define DBUG_RETURN(a1) return(a1)

windows/mariadb-client-2.0/include/errmsg.h renamed to windows/libmariadbclient-2.1.0/include/errmsg.h

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ extern const char *client_errors[]; /* Error messages */
6666
#define CR_PARAMS_NOT_BOUND 2031
6767
#define CR_INVALID_PARAMETER_NO 2034
6868
#define CR_UNSUPPORTED_PARAM_TYPE 2036
69+
#define CR_SECURE_AUTH 2049
6970
#define CR_NO_DATA 2051
7071
#define CR_NO_STMT_METADATA 2052
7172
#define CR_NOT_IMPLEMENTED 2054

windows/mariadb-client-2.0/include/ma_common.h renamed to windows/libmariadbclient-2.1.0/include/ma_common.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ typedef struct st_mariadb_db_driver
3131
void *buffer;
3232
} MARIADB_DB_DRIVER;
3333

34-
struct st_mysql_options_extention {
34+
struct mysql_async_context;
35+
36+
struct st_mysql_options_extension {
3537
char *plugin_dir;
3638
char *default_auth;
3739
char *ssl_crl;
3840
char *ssl_crlpath;
3941
char *server_public_key_path;
42+
struct mysql_async_context *async_context;
4043
HASH connect_attrs;
4144
size_t connect_attrs_len;
4245
void (*report_progress)(const MYSQL *mysql,

windows/mariadb-client-2.0/include/my_config.h renamed to windows/libmariadbclient-2.1.0/include/my_config.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define HAVE_FLOAT_H 1
1414
/* #undef HAVE_FPU_CONTROL_H */
1515
/* #undef HAVE_GRP_H */
16-
/* #undef HAVE_IEEEFP_H */
16+
#define HAVE_IEEEFP_H 1
1717
#define HAVE_LIMITS_H 1
1818
#define HAVE_MALLOC_H 1
1919
#define HAVE_MEMORY_H 1
@@ -97,7 +97,7 @@
9797
/* #undef HAVE_MEMALIGN */
9898
#define HAVE_MEMCPY 1
9999
#define HAVE_MEMMOVE 1
100-
/* #undef HAVE_MKSTEMP */
100+
#define HAVE_MKSTEMP 1
101101
/* #undef HAVE_MLOCK */
102102
/* #undef HAVE_MLOCKALL */
103103
/* #undef HAVE_MMAP */
@@ -273,6 +273,6 @@
273273
*/
274274
#define HAVE_THREADS 1
275275
#define SHAREDIR "share"
276-
#define DEFAULT_CHARSET_HOME "C:/Program Files (x86)/mariadb-client"
277-
#define PLUGINDIR "C:/Program Files (x86)/mariadb-client/lib/plugin"
276+
#define DEFAULT_CHARSET_HOME "C:/msys64-x86_64/home/Jeroen/mingw-packages/mingw-w64-libmariadbclient/pkg/mingw-w64-x86_64-libmariadbclient/mingw64"
277+
#define PLUGINDIR "/lib/plugin"
278278

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
/*
2+
Copyright 2011 Kristian Nielsen and Monty Program Ab
3+
4+
This file is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
/*
19+
Simple API for spawning a co-routine, to be used for async libmysqlclient.
20+
21+
Idea is that by implementing this interface using whatever facilities are
22+
available for given platform, we can use the same code for the generic
23+
libmysqlclient-async code.
24+
25+
(This particular implementation uses Posix ucontext swapcontext().)
26+
*/
27+
28+
#ifdef _WIN32
29+
#define MY_CONTEXT_USE_WIN32_FIBERS 1
30+
#elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__x86_64__) && !defined(__ILP32__)
31+
#define MY_CONTEXT_USE_X86_64_GCC_ASM
32+
#elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__)
33+
#define MY_CONTEXT_USE_I386_GCC_ASM
34+
#elif defined(HAVE_UCONTEXT)
35+
#define MY_CONTEXT_USE_UCONTEXT
36+
#else
37+
#define MY_CONTEXT_DISABLE
38+
#endif
39+
40+
#ifdef MY_CONTEXT_USE_WIN32_FIBERS
41+
struct my_context {
42+
void (*user_func)(void *);
43+
void *user_arg;
44+
void *app_fiber;
45+
void *lib_fiber;
46+
int return_value;
47+
#ifndef DBUG_OFF
48+
void *dbug_state;
49+
#endif
50+
};
51+
#endif
52+
53+
54+
#ifdef MY_CONTEXT_USE_UCONTEXT
55+
#include <ucontext.h>
56+
57+
struct my_context {
58+
void (*user_func)(void *);
59+
void *user_data;
60+
void *stack;
61+
size_t stack_size;
62+
ucontext_t base_context;
63+
ucontext_t spawned_context;
64+
int active;
65+
#ifdef HAVE_VALGRIND
66+
unsigned int valgrind_stack_id;
67+
#endif
68+
#ifndef DBUG_OFF
69+
void *dbug_state;
70+
#endif
71+
};
72+
#endif
73+
74+
75+
#ifdef MY_CONTEXT_USE_X86_64_GCC_ASM
76+
#include <stdint.h>
77+
78+
struct my_context {
79+
uint64_t save[9];
80+
void *stack_top;
81+
void *stack_bot;
82+
#ifdef HAVE_VALGRIND
83+
unsigned int valgrind_stack_id;
84+
#endif
85+
#ifndef DBUG_OFF
86+
void *dbug_state;
87+
#endif
88+
};
89+
#endif
90+
91+
92+
#ifdef MY_CONTEXT_USE_I386_GCC_ASM
93+
#include <stdint.h>
94+
95+
struct my_context {
96+
uint64_t save[7];
97+
void *stack_top;
98+
void *stack_bot;
99+
#ifdef HAVE_VALGRIND
100+
unsigned int valgrind_stack_id;
101+
#endif
102+
#ifndef DBUG_OFF
103+
void *dbug_state;
104+
#endif
105+
};
106+
#endif
107+
108+
109+
#ifdef MY_CONTEXT_DISABLE
110+
struct my_context {
111+
int dummy;
112+
};
113+
#endif
114+
115+
116+
/*
117+
Initialize an asynchroneous context object.
118+
Returns 0 on success, non-zero on failure.
119+
*/
120+
extern int my_context_init(struct my_context *c, size_t stack_size);
121+
122+
/* Free an asynchroneous context object, deallocating any resources used. */
123+
extern void my_context_destroy(struct my_context *c);
124+
125+
/*
126+
Spawn an asynchroneous context. The context will run the supplied user
127+
function, passing the supplied user data pointer.
128+
129+
The context must have been initialised with my_context_init() prior to
130+
this call.
131+
132+
The user function may call my_context_yield(), which will cause this
133+
function to return 1. Then later my_context_continue() may be called, which
134+
will resume the asynchroneous context by returning from the previous
135+
my_context_yield() call.
136+
137+
When the user function returns, this function returns 0.
138+
139+
In case of error, -1 is returned.
140+
*/
141+
extern int my_context_spawn(struct my_context *c, void (*f)(void *), void *d);
142+
143+
/*
144+
Suspend an asynchroneous context started with my_context_spawn.
145+
146+
When my_context_yield() is called, execution immediately returns from the
147+
last my_context_spawn() or my_context_continue() call. Then when later
148+
my_context_continue() is called, execution resumes by returning from this
149+
my_context_yield() call.
150+
151+
Returns 0 if ok, -1 in case of error.
152+
*/
153+
extern int my_context_yield(struct my_context *c);
154+
155+
/*
156+
Resume an asynchroneous context. The context was spawned by
157+
my_context_spawn(), and later suspended inside my_context_yield().
158+
159+
The asynchroneous context may be repeatedly suspended with
160+
my_context_yield() and resumed with my_context_continue().
161+
162+
Each time it is suspended, this function returns 1. When the originally
163+
spawned user function returns, this function returns 0.
164+
165+
In case of error, -1 is returned.
166+
*/
167+
extern int my_context_continue(struct my_context *c);
168+
169+
170+
struct mysql_async_context {
171+
/*
172+
This is set to the value that should be returned from foo_start() or
173+
foo_cont() when a call is suspended.
174+
*/
175+
unsigned int events_to_wait_for;
176+
/*
177+
It is also set to the event(s) that triggered when a suspended call is
178+
resumed, eg. whether we woke up due to connection completed or timeout
179+
in mysql_real_connect_cont().
180+
*/
181+
unsigned int events_occured;
182+
/*
183+
This is set to the result of the whole asynchronous operation when it
184+
completes. It uses a union, as different calls have different return
185+
types.
186+
*/
187+
union {
188+
void *r_ptr;
189+
const void *r_const_ptr;
190+
int r_int;
191+
my_bool r_my_bool;
192+
} ret_result;
193+
/*
194+
The timeout value (in millisecods), for suspended calls that need to wake
195+
up on a timeout (eg. mysql_real_connect_start().
196+
*/
197+
unsigned int timeout_value;
198+
/*
199+
This flag is set when we are executing inside some asynchronous call
200+
foo_start() or foo_cont(). It is used to decide whether to use the
201+
synchronous or asynchronous version of calls that may block such as
202+
recv().
203+
204+
Note that this flag is not set when a call is suspended, eg. after
205+
returning from foo_start() and before re-entering foo_cont().
206+
*/
207+
my_bool active;
208+
/*
209+
This flag is set when an asynchronous operation is in progress, but
210+
suspended. Ie. it is set when foo_start() or foo_cont() returns because
211+
the operation needs to block, suspending the operation.
212+
213+
It is used to give an error (rather than crash) if the application
214+
attempts to call some foo_cont() method when no suspended operation foo is
215+
in progress.
216+
*/
217+
my_bool suspended;
218+
/*
219+
If non-NULL, this is a pointer to a callback hook that will be invoked with
220+
the user data argument just before the context is suspended, and just after
221+
it is resumed.
222+
*/
223+
void (*suspend_resume_hook)(my_bool suspend, void *user_data);
224+
void *suspend_resume_hook_user_data;
225+
/*
226+
This is used to save the execution contexts so that we can suspend an
227+
operation and switch back to the application context, to resume the
228+
suspended context later when the application re-invokes us with
229+
foo_cont().
230+
*/
231+
struct my_context async_context;
232+
};

windows/mariadb-client-2.0/include/my_global.h renamed to windows/libmariadbclient-2.1.0/include/my_global.h

+23-8
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ typedef unsigned short ushort;
318318
*/
319319
#define _VARARGS(X) X
320320
#define _STATIC_VARARGS(X) X
321-
#define _PC(X) X
322321

323322
#if defined(DBUG_ON) && defined(DBUG_OFF)
324323
#undef DBUG_OFF
@@ -364,14 +363,11 @@ typedef int (*qsort_cmp)(const void *,const void *);
364363
#else
365364
#define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */
366365
#endif
367-
#ifdef HAVE_mit_thread
368-
#define size_socket socklen_t /* Type of last arg to accept */
369-
#else
366+
370367
#ifdef HAVE_SYS_SOCKET_H
371368
#include <sys/socket.h>
372369
#endif
373-
374-
#endif
370+
typedef SOCKET_SIZE_TYPE size_socket;
375371

376372
#ifndef SOCKOPT_OPTLEN_TYPE
377373
#define SOCKOPT_OPTLEN_TYPE size_socket
@@ -455,9 +451,12 @@ typedef int (*qsort_cmp)(const void *,const void *);
455451
#define NO_PISAM /* Not needed anymore */
456452
#define NO_MISAM /* Not needed anymore */
457453
#define NO_HASH /* Not needed anymore */
458-
#ifdef _WIN32
454+
#if defined(_WIN32) && !defined(__MINGW32__)
459455
#define NO_DIR_LIBRARY /* Not standar dir-library */
460456
#define USE_MY_STAT_STRUCT /* For my_lib */
457+
#ifdef _SIZE_T_DEFINED
458+
typedef SSIZE_T ssize_t;
459+
#endif
461460
#endif
462461

463462
/* Some things that this system does have */
@@ -1080,11 +1079,27 @@ do { doubleget_union _tmp; \
10801079
#elif defined(HAVE_DLFCN_H)
10811080
#include <dlfcn.h>
10821081
#endif
1083-
#if HAVE_DLERROR
1082+
#ifndef HAVE_DLERROR
10841083
#define dlerror() ""
10851084
#endif
10861085
#endif
10871086

1087+
#if SIZEOF_CHARP == SIZEOF_INT
1088+
typedef unsigned int intptr;
1089+
#elif SIZEOF_CHARP == SIZEOF_LONG
1090+
typedef unsigned long intptr;
1091+
#elif SIZEOF_CHARP == SIZEOF_LONG_LONG
1092+
typedef unsigned long long intptr;
1093+
#else
1094+
#error sizeof(void *) is not sizeof(int, long or long long)
1095+
#endif
1096+
1097+
#ifdef _WIN32
1098+
#define IF_WIN(A,B) A
1099+
#else
1100+
#define IF_WIN(A,B) B
1101+
#endif
1102+
10881103
#ifndef RTLD_NOW
10891104
#define RTLD_NOW 1
10901105
#endif

0 commit comments

Comments
 (0)