Skip to content

Commit 6bc9bc9

Browse files
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.1-wl2936
2 parents 3f72507 + c53037a commit 6bc9bc9

72 files changed

Lines changed: 5091 additions & 2601 deletions

Some content is hidden

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

client/mysql.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ static struct my_option my_long_options[] =
739739
"Number of seconds before connection timeout.",
740740
(gptr*) &opt_connect_timeout,
741741
(gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
742-
0, 1},
742+
0, 0},
743743
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
744744
"Max packet length to send to, or receive from server",
745745
(gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, GET_ULONG,

include/hash.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ extern "C" {
2727
*/
2828
#define HASH_OVERHEAD (sizeof(char*)*2)
2929

30+
/* flags for hash_init */
31+
#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */
32+
3033
typedef byte *(*hash_get_key)(const byte *,uint*,my_bool);
3134
typedef void (*hash_free_key)(void *);
3235

include/my_getopt.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,40 @@ C_MODE_START
2929
#define GET_STR 9
3030
#define GET_STR_ALLOC 10
3131
#define GET_DISABLED 11
32+
#define GET_ENUM 12
33+
#define GET_SET 13
3234

3335
#define GET_ASK_ADDR 128
3436
#define GET_TYPE_MASK 127
3537

3638
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
3739

40+
struct st_typelib;
41+
3842
struct my_option
3943
{
4044
const char *name; /* Name of the option */
4145
int id; /* unique id or short option */
4246
const char *comment; /* option comment, for autom. --help */
4347
gptr *value; /* The variable value */
4448
gptr *u_max_value; /* The user def. max variable value */
45-
const char **str_values; /* Pointer to possible values */
49+
struct st_typelib *typelib; /* Pointer to possible values */
4650
ulong var_type;
4751
enum get_opt_arg_type arg_type;
4852
longlong def_value; /* Default value */
4953
longlong min_value; /* Min allowed value */
5054
longlong max_value; /* Max allowed value */
5155
longlong sub_size; /* Subtract this from given value */
5256
long block_size; /* Value should be a mult. of this */
53-
int app_type; /* To be used by an application */
57+
void *app_type; /* To be used by an application */
5458
};
5559

5660
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
5761
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
5862

5963
extern char *disabled_my_option;
6064
extern my_bool my_getopt_print_errors;
65+
extern my_bool my_getopt_skip_unknown;
6166
extern my_error_reporter my_getopt_error_reporter;
6267

6368
extern int handle_options (int *argc, char ***argv,

include/my_global.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,14 @@ C_MODE_END
458458
*/
459459
#include <assert.h>
460460

461+
/* an assert that works at compile-time. only for constant expression */
462+
#define compile_time_assert(X) \
463+
do \
464+
{ \
465+
char compile_time_assert[(X) ? 1 : -1] \
466+
__attribute__ ((unused)); \
467+
} while(0)
468+
461469
/* Go around some bugs in different OS and compilers */
462470
#if defined (HPUX11) && defined(_LARGEFILE_SOURCE)
463471
#define _LARGEFILE64_SOURCE

include/my_sys.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,15 @@ extern my_bool real_open_cached_file(IO_CACHE *cache);
759759
extern void close_cached_file(IO_CACHE *cache);
760760
File create_temp_file(char *to, const char *dir, const char *pfx,
761761
int mode, myf MyFlags);
762-
#define my_init_dynamic_array(A,B,C,D) init_dynamic_array(A,B,C,D CALLER_INFO)
763-
#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_CALLER_INFO)
762+
#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D CALLER_INFO)
763+
#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D ORIG_CALLER_INFO)
764+
#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E CALLER_INFO)
765+
#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E ORIG_CALLER_INFO)
766+
extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint element_size,
767+
void *init_buffer, uint init_alloc,
768+
uint alloc_increment
769+
CALLER_INFO_PROTO);
770+
/* init_dynamic_array() function is deprecated */
764771
extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
765772
uint init_alloc,uint alloc_increment
766773
CALLER_INFO_PROTO);

include/mysql.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ typedef int my_socket;
6767
#include "mysql_version.h"
6868
#include "mysql_com.h"
6969
#include "mysql_time.h"
70-
#include "typelib.h"
7170

7271
#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
7372

@@ -126,6 +125,8 @@ typedef unsigned long long my_ulonglong;
126125
#endif
127126
#endif
128127

128+
#include "typelib.h"
129+
129130
#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0)
130131

131132
/* backward compatibility define - to be removed eventually */

0 commit comments

Comments
 (0)