summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/my_getopt.h5
-rw-r--r--include/my_global.h4
-rw-r--r--include/my_sys.h12
-rw-r--r--include/my_time.h2
-rw-r--r--include/mysql/plugin.h10
-rw-r--r--include/mysql_com.h4
-rw-r--r--include/mysql_h.ic84
-rw-r--r--include/thr_alarm.h2
-rw-r--r--include/thr_lock.h2
9 files changed, 70 insertions, 55 deletions
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 14f8e6df95b..50ebe9190d8 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -75,8 +75,9 @@ extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint
const struct my_option *));
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
- bool *fix);
-longlong getopt_ll_limit_value(longlong, const struct my_option *,bool *fix);
+ my_bool *fix);
+longlong getopt_ll_limit_value(longlong, const struct my_option *,
+ my_bool *fix);
my_bool getopt_compare_strings(const char *s, const char *t, uint length);
C_MODE_END
diff --git a/include/my_global.h b/include/my_global.h
index 4b0786aa826..ab960a9e6cd 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1508,4 +1508,8 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
+#if !defined(__cplusplus) && !defined(bool)
+#define bool In_C_you_should_use_my_bool_instead()
+#endif
+
#endif /* my_global_h */
diff --git a/include/my_sys.h b/include/my_sys.h
index ee79806c40e..57711b7ae82 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -919,12 +919,12 @@ extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
uint cs_flags, myf my_flags);
-extern bool resolve_charset(const char *cs_name,
- CHARSET_INFO *default_cs,
- CHARSET_INFO **cs);
-extern bool resolve_collation(const char *cl_name,
- CHARSET_INFO *default_cl,
- CHARSET_INFO **cl);
+extern my_bool resolve_charset(const char *cs_name,
+ CHARSET_INFO *default_cs,
+ CHARSET_INFO **cs);
+extern my_bool resolve_collation(const char *cl_name,
+ CHARSET_INFO *default_cl,
+ CHARSET_INFO **cl);
extern void free_charsets(void);
extern char *get_charsets_dir(char *buf);
diff --git a/include/my_time.h b/include/my_time.h
index e3bdb58e5c2..af3fc103530 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -111,7 +111,7 @@ void init_time(void);
TRUE The MYSQL_TIME value is definitely out of range
*/
-static inline bool validate_timestamp_range(const MYSQL_TIME *t)
+static inline my_bool validate_timestamp_range(const MYSQL_TIME *t)
{
if ((t->year > TIMESTAMP_MAX_YEAR || t->year < TIMESTAMP_MIN_YEAR) ||
(t->year == TIMESTAMP_MAX_YEAR && (t->month > 1 || t->day > 19)) ||
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 5094f65cb59..a978d44b918 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -714,6 +714,16 @@ int mysql_tmpfile(const char *prefix);
*/
int thd_killed(const MYSQL_THD thd);
+
+/**
+ Return the thread id of a user thread
+
+ @param thd user thread connection handle
+ @return thread id
+*/
+unsigned long thd_get_thread_id(const MYSQL_THD thd);
+
+
/**
Allocate memory in the connection's local memory pool
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 7eefad44716..cea98cebc61 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -217,12 +217,12 @@ typedef struct st_net {
functions and methods to maintain proper locking.
*/
unsigned char *query_cache_query;
- unsigned int client_last_errno;
+ unsigned int last_errno;
unsigned char error;
my_bool unused2; /* Please remove with the next incompatible ABI change. */
my_bool return_errno;
/** Client library error message buffer. Actually belongs to struct MYSQL. */
- char client_last_error[MYSQL_ERRMSG_SIZE];
+ char last_error[MYSQL_ERRMSG_SIZE];
/** Client library sqlstate buffer. Set along with the error message. */
char sqlstate[SQLSTATE_LENGTH+1];
void *extension;
diff --git a/include/mysql_h.ic b/include/mysql_h.ic
index 4f138d9a229..832678a106b 100644
--- a/include/mysql_h.ic
+++ b/include/mysql_h.ic
@@ -106,9 +106,9 @@ typedef struct st_mysql_ftparser_param MYSQL_FTPARSER_PARAM;
typedef struct st_mysql_methods MYSQL_METHODS;
# 47 "mysql_time.h"
typedef struct st_mysql_time MYSQL_TIME;
-# 384 "mysql_com.h"
+# 383 "mysql_com.h"
typedef struct st_udf_args UDF_ARGS;
-# 398 "mysql_com.h"
+# 397 "mysql_com.h"
typedef struct st_udf_init UDF_INIT;
# 26 "my_alloc.h"
typedef struct st_used_mem USED_MEM;
@@ -130,7 +130,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
unsigned int mbminlen;
unsigned int mbmaxlen;
};
-# 370 "mysql_com.h"
+# 369 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(double)))) rand_struct
{
unsigned long int seed1;
@@ -542,11 +542,11 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
my_bool compress;
my_bool unused1;
unsigned char * query_cache_query;
- unsigned int client_last_errno;
+ unsigned int last_errno;
unsigned char error;
my_bool unused2;
my_bool return_errno;
- char client_last_error[512];
+ char last_error[512];
char sqlstate[(5 + 1)];
void * extension;
};
@@ -558,7 +558,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
char const * * type_names;
unsigned int * type_lengths;
};
-# 384 "mysql_com.h"
+# 383 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_udf_args
{
unsigned int arg_count;
@@ -570,7 +570,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
unsigned long int * attribute_lengths;
void * extension;
};
-# 398 "mysql_com.h"
+# 397 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_udf_init
{
my_bool maybe_null;
@@ -587,7 +587,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned int left;
unsigned int size;
};
-# 381 "mysql_com.h"
+# 380 "mysql_com.h"
enum Item_result
{
STRING_RESULT = 0,
@@ -596,7 +596,7 @@ enum Item_result
ROW_RESULT = 3,
DECIMAL_RESULT = 4,
};
-# 322 "mysql_com.h"
+# 321 "mysql_com.h"
enum enum_cursor_type
{
CURSOR_TYPE_NO_CURSOR = 0,
@@ -604,7 +604,7 @@ enum enum_cursor_type
CURSOR_TYPE_FOR_UPDATE = 2,
CURSOR_TYPE_SCROLLABLE = 4,
};
-# 235 "mysql_com.h"
+# 234 "mysql_com.h"
enum enum_field_types
{
MYSQL_TYPE_DECIMAL = 0,
@@ -651,7 +651,7 @@ enum enum_ftparser_mode
MYSQL_FTPARSER_WITH_STOPWORDS = 1,
MYSQL_FTPARSER_FULL_BOOLEAN_INFO = 2,
};
-# 332 "mysql_com.h"
+# 331 "mysql_com.h"
enum enum_mysql_set_option
{
MYSQL_OPTION_MULTI_STATEMENTS_ON = 0,
@@ -730,7 +730,7 @@ enum enum_stmt_attr_type
STMT_ATTR_CURSOR_TYPE = 1,
STMT_ATTR_PREFETCH_ROWS = 2,
};
-# 297 "mysql_com.h"
+# 296 "mysql_com.h"
enum mysql_enum_shutdown_level
{
SHUTDOWN_DEFAULT = 0,
@@ -790,13 +790,13 @@ enum mysql_status
MYSQL_STATUS_GET_RESULT = 1,
MYSQL_STATUS_USE_RESULT = 2,
};
-# 439 "mysql_com.h"
+# 441 "mysql_com.h"
extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2);
-# 432 "mysql_com.h"
+# 434 "mysql_com.h"
extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt);
# 35 "typelib.h"
extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from);
-# 427 "mysql_com.h"
+# 429 "mysql_com.h"
extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st);
# 32 "typelib.h"
extern int find_type(char * x, TYPELIB const * typelib, unsigned int);
@@ -804,15 +804,15 @@ extern int find_type(char * x, TYPELIB const * typelib, unsigned int);
extern int find_type_or_exit(char const * x, TYPELIB * typelib, char const * option);
# 29 "typelib.h"
extern my_ulonglong find_typeset(char * x, TYPELIB * typelib, int * error_position);
-# 441 "mysql_com.h"
+# 443 "mysql_com.h"
extern void get_salt_from_password(unsigned char * res, char const * password);
-# 434 "mysql_com.h"
+# 436 "mysql_com.h"
extern void get_salt_from_password_323(unsigned long int * res, char const * password);
-# 447 "mysql_com.h"
+# 449 "mysql_com.h"
extern char * get_tty_password(char const * opt_message);
# 34 "typelib.h"
extern char const * get_type(TYPELIB * typelib, unsigned int);
-# 429 "mysql_com.h"
+# 431 "mysql_com.h"
extern void hash_password(unsigned long int * to, char const * password, unsigned int);
# 30 "my_list.h"
extern LIST * list_add(LIST * root, LIST * element);
@@ -828,31 +828,31 @@ extern unsigned int list_length(LIST *);
extern LIST * list_reverse(LIST * root);
# 36 "my_list.h"
extern int list_walk(LIST *, list_walk_action, unsigned char * argument);
-# 442 "mysql_com.h"
+# 444 "mysql_com.h"
extern void make_password_from_salt(char * to, unsigned char const * hash_stage2);
-# 435 "mysql_com.h"
-extern void make_password_from_salt_323(char * to, unsigned long int const * salt);
# 437 "mysql_com.h"
+extern void make_password_from_salt_323(char * to, unsigned long int const * salt);
+# 439 "mysql_com.h"
extern void make_scrambled_password(char * to, char const * password);
-# 430 "mysql_com.h"
+# 432 "mysql_com.h"
extern void make_scrambled_password_323(char * to, char const * password);
# 33 "typelib.h"
extern void make_type(char * to, unsigned int, TYPELIB * typelib);
-# 367 "mysql_com.h"
+# 366 "mysql_com.h"
extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int);
-# 344 "mysql_com.h"
+# 343 "mysql_com.h"
extern my_bool my_net_init(NET * net, Vio * vio);
-# 345 "mysql_com.h"
+# 344 "mysql_com.h"
extern void my_net_local_init(NET * net);
-# 355 "mysql_com.h"
+# 354 "mysql_com.h"
extern unsigned long int my_net_read(NET * net);
-# 350 "mysql_com.h"
+# 349 "mysql_com.h"
extern my_bool my_net_write(NET * net, unsigned char const * packet, size_t);
-# 426 "mysql_com.h"
+# 428 "mysql_com.h"
extern double my_rnd(struct rand_struct *);
-# 453 "mysql_com.h"
+# 455 "mysql_com.h"
extern void my_thread_end(void);
-# 452 "mysql_com.h"
+# 454 "mysql_com.h"
extern my_bool my_thread_init(void);
# 560 "mysql.h"
extern void myodbc_remove_escape(MYSQL * mysql, char * name);
@@ -890,7 +890,7 @@ extern void mysql_enable_rpl_parse(MYSQL * mysql);
extern my_bool mysql_eof(MYSQL_RES * res);
# 423 "mysql.h"
extern unsigned int mysql_errno(MYSQL * mysql);
-# 448 "mysql_com.h"
+# 450 "mysql_com.h"
extern char const * mysql_errno_to_sqlstate(unsigned int);
# 424 "mysql.h"
extern char const * mysql_error(MYSQL * mysql);
@@ -1108,25 +1108,25 @@ extern char * mysql_unix_port;
extern MYSQL_RES * mysql_use_result(MYSQL * mysql);
# 426 "mysql.h"
extern unsigned int mysql_warning_count(MYSQL * mysql);
-# 347 "mysql_com.h"
-extern void net_clear(NET * net, my_bool);
# 346 "mysql_com.h"
+extern void net_clear(NET * net, my_bool);
+# 345 "mysql_com.h"
extern void net_end(NET * net);
-# 349 "mysql_com.h"
+# 348 "mysql_com.h"
extern my_bool net_flush(NET * net);
-# 354 "mysql_com.h"
+# 353 "mysql_com.h"
extern int net_real_write(NET * net, unsigned char const * packet, size_t);
-# 348 "mysql_com.h"
+# 347 "mysql_com.h"
extern my_bool net_realloc(NET * net, size_t);
-# 351 "mysql_com.h"
+# 350 "mysql_com.h"
extern my_bool net_write_command(NET * net, unsigned char, unsigned char const * header, size_t, unsigned char const * packet, size_t);
-# 443 "mysql_com.h"
+# 445 "mysql_com.h"
extern char * octet2hex(char * to, char const * str, unsigned int);
-# 424 "mysql_com.h"
+# 426 "mysql_com.h"
extern void randominit(struct rand_struct *, unsigned long int, unsigned long int);
-# 438 "mysql_com.h"
+# 440 "mysql_com.h"
extern void scramble(char * to, char const * message, char const * password);
-# 431 "mysql_com.h"
+# 433 "mysql_com.h"
extern void scramble_323(char * to, char const * message, char const * password);
# 37 "typelib.h"
extern TYPELIB sql_protocol_typelib;
diff --git a/include/thr_alarm.h b/include/thr_alarm.h
index a2694ba105b..fb906039269 100644
--- a/include/thr_alarm.h
+++ b/include/thr_alarm.h
@@ -98,7 +98,7 @@ void thr_end_alarm(thr_alarm_t *alarmed);
void end_thr_alarm(my_bool free_structures);
sig_handler process_alarm(int);
#ifndef thr_got_alarm
-bool thr_got_alarm(thr_alarm_t *alrm);
+my_bool thr_got_alarm(thr_alarm_t *alrm);
#endif
diff --git a/include/thr_lock.h b/include/thr_lock.h
index 74d65c2fa7a..a4ca6e6ddf2 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -148,7 +148,7 @@ void thr_unlock(THR_LOCK_DATA *data);
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
uint count, THR_LOCK_OWNER *owner);
void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
-void thr_abort_locks(THR_LOCK *lock, bool upgrade_lock);
+void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
void thr_print_locks(void); /* For debugging */
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data);