Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.1-build

into  gbichot4.local:/home/mysql_src/mysql-5.1-build-gca
This commit is contained in:
guilhem@gbichot4.local 2008-02-18 23:36:57 +01:00
commit 045f3c4a5d
28 changed files with 82 additions and 78 deletions

View File

@ -1042,7 +1042,7 @@ static int fetch_db_collation(const char *db_name,
char *db_cl_name,
int db_cl_size)
{
bool err_status= FALSE;
my_bool err_status= FALSE;
char query[QUERY_LENGTH];
MYSQL_RES *db_cl_res;
MYSQL_ROW db_cl_row;

View File

@ -4260,7 +4260,7 @@ void do_connect(struct st_command *command)
{
int con_port= opt_port;
char *con_options;
bool con_ssl= 0, con_compress= 0;
my_bool con_ssl= 0, con_compress= 0;
struct st_connection* con_slot;
static DYNAMIC_STRING ds_connection_name;
@ -5552,7 +5552,7 @@ void fix_win_paths(const char *val, int len)
*/
void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
const char* val, ulonglong len, bool is_null)
const char* val, ulonglong len, my_bool is_null)
{
if (col_idx < max_replace_column && replace_column[col_idx])
{
@ -7478,12 +7478,12 @@ void free_replace()
typedef struct st_replace {
bool found;
my_bool found;
struct st_replace *next[256];
} REPLACE;
typedef struct st_replace_found {
bool found;
my_bool found;
char *replace_string;
uint to_offset;
int from_offset;

View File

@ -67,7 +67,7 @@ typedef struct st_replace {
} REPLACE;
typedef struct st_replace_found {
bool found;
my_bool found;
char *replace_string;
uint to_offset;
int from_offset;

View File

@ -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

View File

@ -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 */

View File

@ -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);

View File

@ -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)) ||

View File

@ -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);

View File

@ -3388,7 +3388,7 @@ static void read_binary_time(MYSQL_TIME *tm, uchar **pos)
if (length)
{
uchar *to= *pos;
tm->neg= (bool) to[0];
tm->neg= to[0];
tm->day= (ulong) sint4korr(to+1);
tm->hour= (uint) to[5];
@ -4218,7 +4218,7 @@ static my_bool is_binary_compatible(enum enum_field_types type1,
for (range= range_list; range != range_list_end; ++range)
{
/* check that both type1 and type2 are in the same range */
bool type1_found= FALSE, type2_found= FALSE;
my_bool type1_found= FALSE, type2_found= FALSE;
for (type= *range; *type != MYSQL_TYPE_NULL; type++)
{
type1_found|= type1 == *type;

View File

@ -606,9 +606,9 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name,
is no character set with given name.
*/
bool resolve_charset(const char *cs_name,
CHARSET_INFO *default_cs,
CHARSET_INFO **cs)
my_bool resolve_charset(const char *cs_name,
CHARSET_INFO *default_cs,
CHARSET_INFO **cs)
{
*cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0));
@ -638,9 +638,9 @@ bool resolve_charset(const char *cs_name,
collation with given name.
*/
bool resolve_collation(const char *cl_name,
CHARSET_INFO *default_cl,
CHARSET_INFO **cl)
my_bool resolve_collation(const char *cl_name,
CHARSET_INFO *default_cl,
CHARSET_INFO **cl)
{
*cl= get_charset_by_name(cl_name, MYF(0));

View File

@ -795,10 +795,10 @@ static longlong getopt_ll(char *arg, const struct my_option *optp, int *err)
*/
longlong getopt_ll_limit_value(longlong num, const struct my_option *optp,
bool *fix)
my_bool *fix)
{
longlong old= num;
bool adjusted= FALSE;
my_bool adjusted= FALSE;
char buf1[255], buf2[255];
ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L);
@ -864,9 +864,9 @@ static ulonglong getopt_ull(char *arg, const struct my_option *optp, int *err)
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
bool *fix)
my_bool *fix)
{
bool adjusted= FALSE;
my_bool adjusted= FALSE;
ulonglong old= num;
char buf1[255], buf2[255];

View File

@ -276,7 +276,7 @@ void _downheap(register QUEUE *queue, uint idx)
{
uchar *element;
uint elements,half_queue,offset_to_key, next_index;
bool first= TRUE;
my_bool first= TRUE;
uint start_idx= idx;
offset_to_key=queue->offset_to_key;

View File

@ -121,7 +121,7 @@ thr_lock_owner_equal(THR_LOCK_OWNER *rhs, THR_LOCK_OWNER *lhs)
static uint found_errors=0;
static int check_lock(struct st_lock_list *list, const char* lock_type,
const char *where, my_bool same_owner, bool no_cond)
const char *where, my_bool same_owner, my_bool no_cond)
{
THR_LOCK_DATA *data,**prev;
uint count=0;
@ -709,7 +709,7 @@ end:
static inline void free_all_read_locks(THR_LOCK *lock,
bool using_concurrent_insert)
my_bool using_concurrent_insert)
{
THR_LOCK_DATA *data=lock->read_wait.data;
@ -1063,7 +1063,7 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count)
TL_WRITE_ONLY to abort any new accesses to the lock
*/
void thr_abort_locks(THR_LOCK *lock, bool upgrade_lock)
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock)
{
THR_LOCK_DATA *data;
DBUG_ENTER("thr_abort_locks");

View File

@ -5,7 +5,7 @@
#include <m_string.h>
#include "cclass.h"
static bool regex_inited=0;
static my_bool regex_inited=0;
void my_regex_init(CHARSET_INFO *cs)
{

View File

@ -1219,7 +1219,7 @@ static void throw_bounds_warning(THD *thd, const char *name, ulonglong num)
static ulonglong fix_unsigned(THD *thd, ulonglong num,
const struct my_option *option_limits)
{
bool fixed= FALSE;
my_bool fixed= FALSE;
ulonglong out= getopt_ull_limit_value(num, option_limits, &fixed);
if (fixed)
@ -1279,7 +1279,7 @@ bool sys_var_long_ptr_global::update(THD *thd, set_var *var)
void sys_var_long_ptr_global::set_default(THD *thd, enum_var_type type)
{
bool not_used;
my_bool not_used;
pthread_mutex_lock(guard);
*value= (ulong) getopt_ull_limit_value((ulong) option_limits->def_value,
option_limits, &not_used);
@ -1302,7 +1302,7 @@ bool sys_var_ulonglong_ptr::update(THD *thd, set_var *var)
void sys_var_ulonglong_ptr::set_default(THD *thd, enum_var_type type)
{
bool not_used;
my_bool not_used;
pthread_mutex_lock(&LOCK_global_system_variables);
*value= getopt_ull_limit_value((ulonglong) option_limits->def_value,
option_limits, &not_used);
@ -1382,7 +1382,7 @@ void sys_var_thd_ulong::set_default(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
{
bool not_used;
my_bool not_used;
/* We will not come here if option_limits is not set */
global_system_variables.*offset=
(ulong) getopt_ull_limit_value((ulong) option_limits->def_value,
@ -1429,7 +1429,7 @@ void sys_var_thd_ha_rows::set_default(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
{
bool not_used;
my_bool not_used;
/* We will not come here if option_limits is not set */
pthread_mutex_lock(&LOCK_global_system_variables);
global_system_variables.*offset=
@ -1481,7 +1481,7 @@ void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
{
bool not_used;
my_bool not_used;
pthread_mutex_lock(&LOCK_global_system_variables);
global_system_variables.*offset=
getopt_ull_limit_value((ulonglong) option_limits->def_value,

View File

@ -1876,7 +1876,7 @@ err:
static int check_func_int(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
bool fixed;
my_bool fixed;
long long tmp;
struct my_option options;
value->val_int(value, &tmp);
@ -1904,7 +1904,7 @@ static int check_func_int(THD *thd, struct st_mysql_sys_var *var,
static int check_func_long(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
bool fixed;
my_bool fixed;
long long tmp;
struct my_option options;
value->val_int(value, &tmp);
@ -1932,12 +1932,11 @@ static int check_func_long(THD *thd, struct st_mysql_sys_var *var,
static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var,
void *save, st_mysql_value *value)
{
bool fixed;
my_bool fixed;
long long tmp;
struct my_option options;
value->val_int(value, &tmp);
plugin_opt_set_limits(&options, var);
*(ulonglong *)save= getopt_ull_limit_value(tmp, &options, &fixed);
if (var->flags & PLUGIN_VAR_UNSIGNED)
*(ulonglong *)save= getopt_ull_limit_value((ulonglong) tmp, &options,

View File

@ -21,7 +21,7 @@ int heap_update(HP_INFO *info, const uchar *old, const uchar *heap_new)
{
HP_KEYDEF *keydef, *end, *p_lastinx;
uchar *pos;
bool auto_key_changed= 0;
my_bool auto_key_changed= 0;
HP_SHARE *share= info->s;
DBUG_ENTER("heap_update");

View File

@ -3363,7 +3363,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
}
if (b_type & BLOCK_DELETED)
{
bool error=0;
my_bool error=0;
if (block_info.block_len+ (uint) (block_info.filepos-pos) <
share->base.min_block_length)
{

View File

@ -430,7 +430,7 @@ static int _mi_find_writepos(MI_INFO *info,
a big block.
*/
static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
static my_bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
{
DBUG_ENTER("unlink_deleted_block");
if (block_info->filepos == info->s->state.dellink)

View File

@ -1469,7 +1469,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
uint key_length,ref_length,org_key_length=0,
length_pack,new_key_length,diff_flag,pack_marker;
uchar *start,*end,*key_end,*sort_order;
bool same_length;
my_bool same_length;
length_pack=s_temp->ref_length=s_temp->n_ref_length=s_temp->n_length=0;
same_length=0; keyseg=keyinfo->seg;

View File

@ -24,7 +24,7 @@ int mi_update(register MI_INFO *info, const uchar *oldrec, uchar *newrec)
reg3 my_off_t pos;
uint i;
uchar old_key[MI_MAX_KEY_BUFF],*new_key;
bool auto_key_changed=0;
my_bool auto_key_changed=0;
ulonglong changed;
MYISAM_SHARE *share=info->s;
ha_checksum old_checksum;

View File

@ -102,9 +102,9 @@ int mi_write(MI_INFO *info, uchar *record)
{
if (mi_is_key_active(share->state.key_map, i))
{
bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
is_tree_inited(&info->bulk_insert[i])));
my_bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
is_tree_inited(&info->bulk_insert[i])));
if (local_lock_tree)
{
rw_wrlock(&share->key_root_lock[i]);
@ -193,9 +193,9 @@ err:
{
if (mi_is_key_active(share->state.key_map, i))
{
bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
is_tree_inited(&info->bulk_insert[i])));
my_bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
is_tree_inited(&info->bulk_insert[i])));
if (local_lock_tree)
rw_wrlock(&share->key_root_lock[i]);
if (share->keyinfo[i].flag & HA_FULLTEXT)

View File

@ -493,7 +493,7 @@ typedef struct st_mi_s_param
totlength,
part_of_prev_key,prev_length,pack_marker;
uchar *key, *prev_key,*next_key_pos;
bool store_not_null;
my_bool store_not_null;
} MI_KEY_PARAM;
/* Prototypes for intern functions */

View File

@ -35,7 +35,7 @@ struct file_info {
char *name, *show_name;
uchar *record;
MI_INFO *isam;
bool closed,used;
my_bool closed, used;
ulong accessed;
};
@ -67,7 +67,7 @@ static int close_some_file(TREE *tree);
static int reopen_closed_file(TREE *tree,struct file_info *file_info);
static int find_record_with_key(struct file_info *file_info,uchar *record);
static void printf_log(const char *str,...);
static bool cmp_filename(struct file_info *file_info,char * name);
static my_bool cmp_filename(struct file_info *file_info,char * name);
static uint verbose=0,update=0,test_info=0,max_files=0,re_open_count=0,
recover=0,prefix_remove=0,opt_processes=0;
@ -839,7 +839,7 @@ static void printf_log(const char *format,...)
}
static bool cmp_filename(struct file_info *file_info, char * name)
static my_bool cmp_filename(struct file_info *file_info, char * name)
{
if (!file_info)
return 1;

View File

@ -123,7 +123,7 @@ typedef struct st_isam_mrg {
extern int main(int argc,char * *argv);
static void get_options(int *argc,char ***argv);
static MI_INFO *open_isam_file(char *name,int mode);
static bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count);
static my_bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count);
static int compress(PACK_MRG_INFO *file,char *join_name);
static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records);
static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees,
@ -436,7 +436,7 @@ static MI_INFO *open_isam_file(char *name,int mode)
}
static bool open_isam_files(PACK_MRG_INFO *mrg,char **names,uint count)
static my_bool open_isam_files(PACK_MRG_INFO *mrg, char **names, uint count)
{
uint i,j;
mrg->count=0;

View File

@ -16861,16 +16861,16 @@ static void bug20023_change_user(MYSQL *con)
opt_db ? opt_db : "test"));
}
static bool query_int_variable(MYSQL *con,
const char *var_name,
int *var_value)
static my_bool query_int_variable(MYSQL *con,
const char *var_name,
int *var_value)
{
MYSQL_RES *rs;
MYSQL_ROW row;
char query_buffer[MAX_TEST_QUERY_LENGTH];
bool is_null;
my_bool is_null;
my_snprintf(query_buffer,
sizeof (query_buffer),
@ -17049,7 +17049,7 @@ static void bug31418_impl()
{
MYSQL con;
bool is_null;
my_bool is_null;
int rc;
/* Create a new connection. */

View File

@ -29,7 +29,7 @@ uint get_rand_bit(uint bitsize)
return (rand() % bitsize);
}
bool test_set_get_clear_bit(MY_BITMAP *map, uint bitsize)
my_bool test_set_get_clear_bit(MY_BITMAP *map, uint bitsize)
{
uint i, test_bit;
uint no_loops= bitsize > 128 ? 128 : bitsize;
@ -52,7 +52,7 @@ error2:
return TRUE;
}
bool test_flip_bit(MY_BITMAP *map, uint bitsize)
my_bool test_flip_bit(MY_BITMAP *map, uint bitsize)
{
uint i, test_bit;
uint no_loops= bitsize > 128 ? 128 : bitsize;
@ -75,13 +75,13 @@ error2:
return TRUE;
}
bool test_operators(MY_BITMAP *map __attribute__((unused)),
uint bitsize __attribute__((unused)))
my_bool test_operators(MY_BITMAP *map __attribute__((unused)),
uint bitsize __attribute__((unused)))
{
return FALSE;
}
bool test_get_all_bits(MY_BITMAP *map, uint bitsize)
my_bool test_get_all_bits(MY_BITMAP *map, uint bitsize)
{
uint i;
bitmap_set_all(map);
@ -123,7 +123,7 @@ error6:
return TRUE;
}
bool test_compare_operators(MY_BITMAP *map, uint bitsize)
my_bool test_compare_operators(MY_BITMAP *map, uint bitsize)
{
uint i, j, test_bit1, test_bit2, test_bit3,test_bit4;
uint no_loops= bitsize > 128 ? 128 : bitsize;
@ -229,7 +229,7 @@ error5:
return TRUE;
}
bool test_count_bits_set(MY_BITMAP *map, uint bitsize)
my_bool test_count_bits_set(MY_BITMAP *map, uint bitsize)
{
uint i, bit_count=0, test_bit;
uint no_loops= bitsize > 128 ? 128 : bitsize;
@ -255,7 +255,7 @@ error2:
return TRUE;
}
bool test_get_first_bit(MY_BITMAP *map, uint bitsize)
my_bool test_get_first_bit(MY_BITMAP *map, uint bitsize)
{
uint i, test_bit;
uint no_loops= bitsize > 128 ? 128 : bitsize;
@ -280,7 +280,7 @@ error2:
return TRUE;
}
bool test_get_next_bit(MY_BITMAP *map, uint bitsize)
my_bool test_get_next_bit(MY_BITMAP *map, uint bitsize)
{
uint i, j, test_bit;
uint no_loops= bitsize > 128 ? 128 : bitsize;
@ -299,7 +299,7 @@ error1:
return TRUE;
}
bool test_prefix(MY_BITMAP *map, uint bitsize)
my_bool test_prefix(MY_BITMAP *map, uint bitsize)
{
uint i, j, test_bit;
uint no_loops= bitsize > 128 ? 128 : bitsize;
@ -334,7 +334,7 @@ error3:
}
bool do_test(uint bitsize)
my_bool do_test(uint bitsize)
{
MY_BITMAP map;
uint32 buf[1024];

View File

@ -17,8 +17,8 @@
#ifdef HAVE_OPENSSL
static bool ssl_algorithms_added = FALSE;
static bool ssl_error_strings_loaded= FALSE;
static my_bool ssl_algorithms_added = FALSE;
static my_bool ssl_error_strings_loaded= FALSE;
static int verify_depth = 0;
static unsigned char dh512_p[]=