diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2010-11-16 07:45:07 -0200 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2010-11-16 07:45:07 -0200 |
commit | 0d0b3f8aca8afd10268b1305e94b87f17f07d3b2 (patch) | |
tree | 8bb3c24e83c5645c346086318667a4d0cdb7b6a2 | |
parent | d6d16303cd5e2ba623f51a115f12954fe4a0ce2c (diff) | |
parent | cd1c6e220de1730615c145b5337f7cce554dfdae (diff) | |
download | mariadb-git-0d0b3f8aca8afd10268b1305e94b87f17f07d3b2.tar.gz |
Merge of mysql-5.1-bugteam into mysql-5.5-bugteam.
-rw-r--r-- | cmd-line-utils/readline/bind.c | 2 | ||||
-rw-r--r-- | include/m_string.h | 4 | ||||
-rw-r--r-- | include/my_compiler.h | 5 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 10 | ||||
-rw-r--r-- | regex/regexec.c | 5 | ||||
-rw-r--r-- | sql/debug_sync.cc | 2 | ||||
-rw-r--r-- | sql/handler.cc | 2 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/sql_partition.cc | 4 | ||||
-rw-r--r-- | storage/myisam/ft_nlq_search.c | 2 | ||||
-rw-r--r-- | storage/myisammrg/myrg_open.c | 2 | ||||
-rw-r--r-- | tests/mysql_client_test.c | 6 |
12 files changed, 27 insertions, 19 deletions
diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c index c669322f436..0ea8b1ca126 100644 --- a/cmd-line-utils/readline/bind.c +++ b/cmd-line-utils/readline/bind.c @@ -855,7 +855,7 @@ _rl_read_init_file (filename, include_level) { register int i; char *buffer, *openname, *line, *end; - size_t file_size; + size_t file_size = 0; current_readline_init_file = filename; current_readline_init_include_level = include_level; diff --git a/include/m_string.h b/include/m_string.h index 2ec4eb64c8e..bfe632e192d 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -76,7 +76,9 @@ extern "C" { extern void *(*my_str_malloc)(size_t); extern void (*my_str_free)(void *); -#if defined(HAVE_STPCPY) +#if MY_GNUC_PREREQ(3, 4) +#define strmov(dest, src) __builtin_stpcpy(dest, src) +#elif defined(HAVE_STPCPY) #define strmov(A,B) stpcpy((A),(B)) #ifndef stpcpy extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ diff --git a/include/my_compiler.h b/include/my_compiler.h index c7d334999d0..5f898621159 100644 --- a/include/my_compiler.h +++ b/include/my_compiler.h @@ -76,6 +76,11 @@ /** Generic (compiler-independent) features. */ + +#ifndef MY_GNUC_PREREQ +# define MY_GNUC_PREREQ(maj, min) (0) +#endif + #ifndef MY_ALIGNOF # ifdef __cplusplus template<typename type> struct my_alignof_helper { char m1; type m2; }; diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index fc62d3d8a8e..9993c636fb1 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -3963,11 +3963,11 @@ restart: if (!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH | BLOCK_REASSIGNED))) { - struct st_hash_link *next_hash_link; - my_off_t next_diskpos; - File next_file; - uint next_status; - uint hash_requests; + struct st_hash_link *UNINIT_VAR(next_hash_link); + my_off_t UNINIT_VAR(next_diskpos); + File UNINIT_VAR(next_file); + uint UNINIT_VAR(next_status); + uint UNINIT_VAR(hash_requests); total_found++; found++; diff --git a/regex/regexec.c b/regex/regexec.c index 338c1bfa7fe..c0d03335b41 100644 --- a/regex/regexec.c +++ b/regex/regexec.c @@ -117,6 +117,7 @@ size_t nmatch; my_regmatch_t pmatch[]; int eflags; { + char *pstr = (char *) str; register struct re_guts *g = preg->re_g; #ifdef REDEBUG # define GOODFLAGS(f) (f) @@ -133,7 +134,7 @@ int eflags; if ((size_t) g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags®_LARGE)) - return(smatcher(preg->charset, g, (char *)str, nmatch, pmatch, eflags)); + return(smatcher(preg->charset, g, pstr, nmatch, pmatch, eflags)); else - return(lmatcher(preg->charset, g, (char *)str, nmatch, pmatch, eflags)); + return(lmatcher(preg->charset, g, pstr, nmatch, pmatch, eflags)); } diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 74e5b2c70f3..4f353597d6d 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1691,7 +1691,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) if (action->execute) { - const char *old_proc_info; + const char *UNINIT_VAR(old_proc_info); action->execute--; diff --git a/sql/handler.cc b/sql/handler.cc index eb060002f48..3552a53972d 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4160,7 +4160,7 @@ int handler::read_multi_range_first(KEY_MULTI_RANGE **found_range_p, */ int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p) { - int result; + int UNINIT_VAR(result); DBUG_ENTER("handler::read_multi_range_next"); /* We should not be called after the last call returned EOF. */ diff --git a/sql/slave.cc b/sql/slave.cc index ab8952069fb..9978b4cb0e2 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2513,7 +2513,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) if (slave_trans_retries) { - int temp_err; + int UNINIT_VAR(temp_err); if (exec_res && (temp_err= has_temporary_error(thd))) { const char *errmsg; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 70b200bf3cd..cec047d11fc 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -7484,8 +7484,8 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info, PARTITION_ITERATOR *part_iter) { Field *field= part_info->part_field_array[0]; - uint32 max_endpoint_val; - get_endpoint_func get_endpoint; + uint32 UNINIT_VAR(max_endpoint_val); + get_endpoint_func UNINIT_VAR(get_endpoint); bool can_match_multiple_values; /* is not '=' */ uint field_len= field->pack_length_in_rec(); DBUG_ENTER("get_part_iter_for_interval_via_mapping"); diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c index 937bb6ffe19..a2e29d90897 100644 --- a/storage/myisam/ft_nlq_search.c +++ b/storage/myisam/ft_nlq_search.c @@ -63,7 +63,7 @@ static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)), static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) { - int subkeys, r; + int UNINIT_VAR(subkeys), r; uint keylen, doc_cnt; FT_SUPERDOC sdoc, *sptr; TREE_ELEMENT *selem; diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index b8e86b89181..c545aff912f 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -220,7 +220,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, int (*callback)(void*, const char*), void *callback_param) { - MYRG_INFO *m_info; + MYRG_INFO *UNINIT_VAR(m_info); int rc; int errpos; int save_errno; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 5ddf428602b..2030e128c04 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -1199,7 +1199,7 @@ my_bool fetch_n(const char **query_list, unsigned query_count, /* Separate thread query to test some cases */ -static my_bool thread_query(char *query) +static my_bool thread_query(const char *query) { MYSQL *l_mysql; my_bool error; @@ -1221,7 +1221,7 @@ static my_bool thread_query(char *query) goto end; } l_mysql->reconnect= 1; - if (mysql_query(l_mysql, (char *)query)) + if (mysql_query(l_mysql, query)) { fprintf(stderr, "Query failed (%s)\n", mysql_error(l_mysql)); error= 1; @@ -6447,7 +6447,7 @@ static void test_prepare_alter() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - if (thread_query((char *)"ALTER TABLE test_prep_alter change id id_new varchar(20)")) + if (thread_query("ALTER TABLE test_prep_alter change id id_new varchar(20)")) exit(1); is_null= 1; |