Merge of mysql-5.1-bugteam into mysql-5.5-bugteam.
This commit is contained in:
commit
1e1985eba7
@ -5398,8 +5398,13 @@ void do_connect(struct st_command *command)
|
|||||||
opt_charsets_dir);
|
opt_charsets_dir);
|
||||||
|
|
||||||
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
|
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
|
||||||
if (opt_use_ssl || con_ssl)
|
if (opt_use_ssl)
|
||||||
|
con_ssl= 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (con_ssl)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
|
||||||
mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
||||||
opt_ssl_capath, opt_ssl_cipher);
|
opt_ssl_capath, opt_ssl_cipher);
|
||||||
#if MYSQL_VERSION_ID >= 50000
|
#if MYSQL_VERSION_ID >= 50000
|
||||||
@ -5408,36 +5413,37 @@ void do_connect(struct st_command *command)
|
|||||||
mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
|
mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
|
||||||
&opt_ssl_verify_server_cert);
|
&opt_ssl_verify_server_cert);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __WIN__
|
|
||||||
if (con_pipe)
|
if (con_pipe)
|
||||||
{
|
{
|
||||||
|
#ifdef __WIN__
|
||||||
opt_protocol= MYSQL_PROTOCOL_PIPE;
|
opt_protocol= MYSQL_PROTOCOL_PIPE;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (opt_protocol)
|
if (opt_protocol)
|
||||||
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
|
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
|
||||||
|
|
||||||
#ifdef HAVE_SMEM
|
|
||||||
if (con_shm)
|
if (con_shm)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_SMEM
|
||||||
uint protocol= MYSQL_PROTOCOL_MEMORY;
|
uint protocol= MYSQL_PROTOCOL_MEMORY;
|
||||||
if (!ds_shm.length)
|
if (!ds_shm.length)
|
||||||
die("Missing shared memory base name");
|
die("Missing shared memory base name");
|
||||||
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str);
|
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str);
|
||||||
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
|
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(shared_memory_base_name)
|
#ifdef HAVE_SMEM
|
||||||
|
else if (shared_memory_base_name)
|
||||||
{
|
{
|
||||||
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
|
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
|
||||||
shared_memory_base_name);
|
shared_memory_base_name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Use default db name */
|
/* Use default db name */
|
||||||
if (ds_database.length == 0)
|
if (ds_database.length == 0)
|
||||||
dynstr_set(&ds_database, opt_db);
|
dynstr_set(&ds_database, opt_db);
|
||||||
|
@ -1839,8 +1839,11 @@ rl_username_completion_function (text, state)
|
|||||||
#else /* !__WIN32__ && !__OPENNT) */
|
#else /* !__WIN32__ && !__OPENNT) */
|
||||||
static char *username = (char *)NULL;
|
static char *username = (char *)NULL;
|
||||||
static struct passwd *entry;
|
static struct passwd *entry;
|
||||||
static int namelen, first_char, first_char_loc;
|
static int first_char, first_char_loc;
|
||||||
char *value;
|
char *value;
|
||||||
|
#if defined (HAVE_GETPWENT)
|
||||||
|
static int namelen;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (state == 0)
|
if (state == 0)
|
||||||
{
|
{
|
||||||
@ -1850,7 +1853,9 @@ rl_username_completion_function (text, state)
|
|||||||
first_char_loc = first_char == '~';
|
first_char_loc = first_char == '~';
|
||||||
|
|
||||||
username = savestring (&text[first_char_loc]);
|
username = savestring (&text[first_char_loc]);
|
||||||
|
#if defined (HAVE_GETPWENT)
|
||||||
namelen = strlen (username);
|
namelen = strlen (username);
|
||||||
|
#endif
|
||||||
setpwent ();
|
setpwent ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -693,7 +693,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
|
|||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
char *new_event;
|
char *new_event;
|
||||||
int delimiter, failed, si, l_temp, ws, we;
|
int delimiter, failed, si, l_temp, we;
|
||||||
|
|
||||||
if (c == 's')
|
if (c == 's')
|
||||||
{
|
{
|
||||||
@ -792,7 +792,6 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
|
|||||||
{
|
{
|
||||||
for (; temp[si] && whitespace (temp[si]); si++)
|
for (; temp[si] && whitespace (temp[si]); si++)
|
||||||
;
|
;
|
||||||
ws = si;
|
|
||||||
we = history_tokenize_word (temp, si);
|
we = history_tokenize_word (temp, si);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,6 +402,7 @@ history_truncate_file (fname, lines)
|
|||||||
if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
|
if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
|
||||||
{
|
{
|
||||||
bytes_written= write (file, bp, chars_read - (bp - buffer));
|
bytes_written= write (file, bp, chars_read - (bp - buffer));
|
||||||
|
(void) bytes_written;
|
||||||
|
|
||||||
#if defined (__BEOS__)
|
#if defined (__BEOS__)
|
||||||
/* BeOS ignores O_TRUNC. */
|
/* BeOS ignores O_TRUNC. */
|
||||||
|
@ -617,7 +617,7 @@ rl_search_history (direction, invoking_key)
|
|||||||
int direction, invoking_key __attribute__((unused));
|
int direction, invoking_key __attribute__((unused));
|
||||||
{
|
{
|
||||||
_rl_search_cxt *cxt; /* local for now, but saved globally */
|
_rl_search_cxt *cxt; /* local for now, but saved globally */
|
||||||
int c, r;
|
int r;
|
||||||
|
|
||||||
RL_SETSTATE(RL_STATE_ISEARCH);
|
RL_SETSTATE(RL_STATE_ISEARCH);
|
||||||
cxt = _rl_isearch_init (direction);
|
cxt = _rl_isearch_init (direction);
|
||||||
@ -632,7 +632,7 @@ rl_search_history (direction, invoking_key)
|
|||||||
r = -1;
|
r = -1;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
c = _rl_search_getchar (cxt);
|
_rl_search_getchar (cxt);
|
||||||
/* We might want to handle EOF here (c == 0) */
|
/* We might want to handle EOF here (c == 0) */
|
||||||
r = _rl_isearch_dispatch (cxt, cxt->lastc);
|
r = _rl_isearch_dispatch (cxt, cxt->lastc);
|
||||||
if (r <= 0)
|
if (r <= 0)
|
||||||
@ -655,9 +655,9 @@ int
|
|||||||
_rl_isearch_callback (cxt)
|
_rl_isearch_callback (cxt)
|
||||||
_rl_search_cxt *cxt;
|
_rl_search_cxt *cxt;
|
||||||
{
|
{
|
||||||
int c, r;
|
int r;
|
||||||
|
|
||||||
c = _rl_search_getchar (cxt);
|
_rl_search_getchar (cxt);
|
||||||
/* We might want to handle EOF here */
|
/* We might want to handle EOF here */
|
||||||
r = _rl_isearch_dispatch (cxt, cxt->lastc);
|
r = _rl_isearch_dispatch (cxt, cxt->lastc);
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ rl_insert_close (count, invoking_key)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined (HAVE_SELECT)
|
#if defined (HAVE_SELECT)
|
||||||
int orig_point, match_point, ready;
|
int orig_point, match_point;
|
||||||
struct timeval timer;
|
struct timeval timer;
|
||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ rl_insert_close (count, invoking_key)
|
|||||||
orig_point = rl_point;
|
orig_point = rl_point;
|
||||||
rl_point = match_point;
|
rl_point = match_point;
|
||||||
(*rl_redisplay_function) ();
|
(*rl_redisplay_function) ();
|
||||||
ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
|
select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
|
||||||
rl_point = orig_point;
|
rl_point = orig_point;
|
||||||
#else /* !HAVE_SELECT */
|
#else /* !HAVE_SELECT */
|
||||||
_rl_insert_char (count, invoking_key);
|
_rl_insert_char (count, invoking_key);
|
||||||
|
@ -447,11 +447,10 @@ readline_internal_char ()
|
|||||||
readline_internal_charloop ()
|
readline_internal_charloop ()
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
static int lastc, eof_found;
|
static int lastc;
|
||||||
int c, code, lk;
|
int c, code, lk;
|
||||||
|
|
||||||
lastc = -1;
|
lastc = -1;
|
||||||
eof_found = 0;
|
|
||||||
|
|
||||||
#if !defined (READLINE_CALLBACKS)
|
#if !defined (READLINE_CALLBACKS)
|
||||||
while (rl_done == 0)
|
while (rl_done == 0)
|
||||||
|
@ -811,11 +811,10 @@ _rl_overwrite_char (count, c)
|
|||||||
int i;
|
int i;
|
||||||
#if defined (HANDLE_MULTIBYTE)
|
#if defined (HANDLE_MULTIBYTE)
|
||||||
char mbkey[MB_LEN_MAX];
|
char mbkey[MB_LEN_MAX];
|
||||||
int k;
|
|
||||||
|
|
||||||
/* Read an entire multibyte character sequence to insert COUNT times. */
|
/* Read an entire multibyte character sequence to insert COUNT times. */
|
||||||
if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||||
k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
|
_rl_read_mbstring (c, mbkey, MB_LEN_MAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rl_begin_undo_group ();
|
rl_begin_undo_group ();
|
||||||
|
@ -32,8 +32,15 @@
|
|||||||
|
|
||||||
/* GNU C/C++ */
|
/* GNU C/C++ */
|
||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
|
/* Convenience macro to test the minimum required GCC version. */
|
||||||
|
# define MY_GNUC_PREREQ(maj, min) \
|
||||||
|
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||||
/* Any after 2.95... */
|
/* Any after 2.95... */
|
||||||
# define MY_ALIGN_EXT
|
# define MY_ALIGN_EXT
|
||||||
|
/* Comunicate to the compiler the unreachability of the code. */
|
||||||
|
# if MY_GNUC_PREREQ(4,5)
|
||||||
|
# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
|
||||||
|
# endif
|
||||||
|
|
||||||
/* Microsoft Visual C++ */
|
/* Microsoft Visual C++ */
|
||||||
#elif defined _MSC_VER
|
#elif defined _MSC_VER
|
||||||
@ -67,7 +74,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Generic compiler-dependent features.
|
Generic (compiler-independent) features.
|
||||||
*/
|
*/
|
||||||
#ifndef MY_ALIGNOF
|
#ifndef MY_ALIGNOF
|
||||||
# ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
@ -79,6 +86,10 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef MY_ASSERT_UNREACHABLE
|
||||||
|
# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
C++ Type Traits
|
C++ Type Traits
|
||||||
*/
|
*/
|
||||||
|
@ -1362,7 +1362,7 @@ void LOGGER::deactivate_log_handler(THD *thd, uint log_type)
|
|||||||
file_log= file_log_handler->get_mysql_log();
|
file_log= file_log_handler->get_mysql_log();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0); // Impossible
|
MY_ASSERT_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(*tmp_opt))
|
if (!(*tmp_opt))
|
||||||
|
@ -6068,7 +6068,7 @@ static int handle_grant_struct(uint struct_no, bool drop,
|
|||||||
host= acl_proxy_user->get_host();
|
host= acl_proxy_user->get_host();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
MY_ASSERT_UNREACHABLE();
|
||||||
}
|
}
|
||||||
if (! user)
|
if (! user)
|
||||||
user= "";
|
user= "";
|
||||||
|
@ -699,7 +699,7 @@ bool mysqld_help(THD *thd, const char *mask)
|
|||||||
|
|
||||||
if (count_topics == 0)
|
if (count_topics == 0)
|
||||||
{
|
{
|
||||||
int key_id;
|
int UNINIT_VAR(key_id);
|
||||||
if (!(select=
|
if (!(select=
|
||||||
prepare_select_for_name(thd,mask,mlen,tables,tables[3].table,
|
prepare_select_for_name(thd,mask,mlen,tables,tables[3].table,
|
||||||
used_fields[help_keyword_name].field,
|
used_fields[help_keyword_name].field,
|
||||||
|
@ -7528,7 +7528,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
assert(0);
|
MY_ASSERT_UNREACHABLE();
|
||||||
|
|
||||||
can_match_multiple_values= (flags || !min_value || !max_value ||
|
can_match_multiple_values= (flags || !min_value || !max_value ||
|
||||||
memcmp(min_value, max_value, field_len));
|
memcmp(min_value, max_value, field_len));
|
||||||
|
@ -176,7 +176,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
|
|||||||
SELECT_LEX *sl, *first_sl= first_select();
|
SELECT_LEX *sl, *first_sl= first_select();
|
||||||
select_result *tmp_result;
|
select_result *tmp_result;
|
||||||
bool is_union_select;
|
bool is_union_select;
|
||||||
TABLE *empty_table= 0;
|
|
||||||
DBUG_ENTER("st_select_lex_unit::prepare");
|
DBUG_ENTER("st_select_lex_unit::prepare");
|
||||||
|
|
||||||
describe= test(additional_options & SELECT_DESCRIBE);
|
describe= test(additional_options & SELECT_DESCRIBE);
|
||||||
@ -278,14 +277,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
|
|||||||
types= first_sl->item_list;
|
types= first_sl->item_list;
|
||||||
else if (sl == first_sl)
|
else if (sl == first_sl)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
We need to create an empty table object. It is used
|
|
||||||
to create tmp_table fields in Item_type_holder.
|
|
||||||
The main reason of this is that we can't create
|
|
||||||
field object without table.
|
|
||||||
*/
|
|
||||||
DBUG_ASSERT(!empty_table);
|
|
||||||
empty_table= (TABLE*) thd->calloc(sizeof(TABLE));
|
|
||||||
types.empty();
|
types.empty();
|
||||||
List_iterator_fast<Item> it(sl->item_list);
|
List_iterator_fast<Item> it(sl->item_list);
|
||||||
Item *item_tmp;
|
Item *item_tmp;
|
||||||
|
@ -671,8 +671,7 @@ get_one_option(int optid,
|
|||||||
case OPT_STATS_METHOD:
|
case OPT_STATS_METHOD:
|
||||||
{
|
{
|
||||||
int method;
|
int method;
|
||||||
enum_mi_stats_method method_conv;
|
enum_mi_stats_method UNINIT_VAR(method_conv);
|
||||||
LINT_INIT(method_conv);
|
|
||||||
myisam_stats_method_str= argument;
|
myisam_stats_method_str= argument;
|
||||||
if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
|
if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
|
||||||
{
|
{
|
||||||
|
@ -1205,12 +1205,10 @@ my_strnncoll_utf16(CHARSET_INFO *cs,
|
|||||||
my_bool t_is_prefix)
|
my_bool t_is_prefix)
|
||||||
{
|
{
|
||||||
int s_res, t_res;
|
int s_res, t_res;
|
||||||
my_wc_t s_wc,t_wc;
|
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
|
||||||
const uchar *se= s + slen;
|
const uchar *se= s + slen;
|
||||||
const uchar *te= t + tlen;
|
const uchar *te= t + tlen;
|
||||||
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
||||||
LINT_INIT(s_wc);
|
|
||||||
LINT_INIT(t_wc);
|
|
||||||
|
|
||||||
while (s < se && t < te)
|
while (s < se && t < te)
|
||||||
{
|
{
|
||||||
@ -1271,11 +1269,9 @@ my_strnncollsp_utf16(CHARSET_INFO *cs,
|
|||||||
my_bool diff_if_only_endspace_difference)
|
my_bool diff_if_only_endspace_difference)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
my_wc_t s_wc, t_wc;
|
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
|
||||||
const uchar *se= s + slen, *te= t + tlen;
|
const uchar *se= s + slen, *te= t + tlen;
|
||||||
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
||||||
LINT_INIT(s_wc);
|
|
||||||
LINT_INIT(t_wc);
|
|
||||||
|
|
||||||
DBUG_ASSERT((slen % 2) == 0);
|
DBUG_ASSERT((slen % 2) == 0);
|
||||||
DBUG_ASSERT((tlen % 2) == 0);
|
DBUG_ASSERT((tlen % 2) == 0);
|
||||||
@ -1451,11 +1447,9 @@ my_strnncoll_utf16_bin(CHARSET_INFO *cs,
|
|||||||
my_bool t_is_prefix)
|
my_bool t_is_prefix)
|
||||||
{
|
{
|
||||||
int s_res,t_res;
|
int s_res,t_res;
|
||||||
my_wc_t s_wc,t_wc;
|
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
|
||||||
const uchar *se=s+slen;
|
const uchar *se=s+slen;
|
||||||
const uchar *te=t+tlen;
|
const uchar *te=t+tlen;
|
||||||
LINT_INIT(s_wc);
|
|
||||||
LINT_INIT(t_wc);
|
|
||||||
|
|
||||||
while ( s < se && t < te )
|
while ( s < se && t < te )
|
||||||
{
|
{
|
||||||
@ -1486,10 +1480,8 @@ my_strnncollsp_utf16_bin(CHARSET_INFO *cs,
|
|||||||
my_bool diff_if_only_endspace_difference)
|
my_bool diff_if_only_endspace_difference)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
my_wc_t s_wc, t_wc;
|
my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
|
||||||
const uchar *se= s + slen, *te= t + tlen;
|
const uchar *se= s + slen, *te= t + tlen;
|
||||||
LINT_INIT(s_wc);
|
|
||||||
LINT_INIT(t_wc);
|
|
||||||
|
|
||||||
DBUG_ASSERT((slen % 2) == 0);
|
DBUG_ASSERT((slen % 2) == 0);
|
||||||
DBUG_ASSERT((tlen % 2) == 0);
|
DBUG_ASSERT((tlen % 2) == 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user