summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-11-10 19:14:47 -0200
committerDavi Arnaut <davi.arnaut@oracle.com>2010-11-10 19:14:47 -0200
commitcd1c6e220de1730615c145b5337f7cce554dfdae (patch)
tree47ce960f9bf094be0d4331b1cf1e69691bf1b3a9 /sql
parent6780abfce617d6fca9fa027445bb1c95e4f535c0 (diff)
downloadmariadb-git-cd1c6e220de1730615c145b5337f7cce554dfdae.tar.gz
Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure
Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c Bug#57994: Compiler flag change build error : my_redel.c Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc Fix assorted compiler generated warnings. cmd-line-utils/readline/bind.c: Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c Initialize variable to work around a false positive warning. include/m_string.h: Bug#57994: Compiler flag change build error : my_redel.c The expansion of stpcpy (in glibc) causes warnings if the return value of strmov is not being used. Since stpcpy is a GNU extension and the expansion ends up using a built-in provided by GCC, use the compiler provided built-in directly when possible. include/my_compiler.h: Define a dummy MY_GNUC_PREREQ when not compiling with GCC. libmysql/libmysql.c: Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure Variable might not be used in some cases. So, tag it as unused. mysys/mf_keycache.c: Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c Use UNINIT_VAR to work around a false positive warning. mysys/my_getncpus.c: Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c Declare variable in the same block where it is used. regex/regexec.c: Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c Work around a compiler bug which causes the cast to not be enforced. sql/debug_sync.cc: Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc Use UNINIT_VAR to work around a false positive warning. sql/handler.cc: Use UNINIT_VAR to work around a false positive warning. sql/slave.cc: Use UNINIT_VAR to work around a false positive warning. sql/sql_partition.cc: Use UNINIT_VAR to work around a false positive warning. storage/myisam/ft_nlq_search.c: Use UNINIT_VAR to work around a false positive warning. storage/myisam/mi_create.c: Use UNINIT_VAR to work around a false positive warning. storage/myisammrg/myrg_open.c: Use UNINIT_VAR to work around a false positive warning. tests/mysql_client_test.c: Change function to take a pointer to const, no need for a cast.
Diffstat (limited to 'sql')
-rw-r--r--sql/debug_sync.cc2
-rw-r--r--sql/handler.cc2
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/sql_partition.cc4
4 files changed, 5 insertions, 5 deletions
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index 23a649a89fa..91c850c6009 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -1718,7 +1718,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 a47a5fd8a3c..1525ca53bca 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -4141,7 +4141,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 57d673ea1f4..644aade517c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2321,7 +2321,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 702c3d99fda..44ed9e759c6 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -6747,8 +6747,8 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
{
DBUG_ASSERT(!is_subpart);
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();
part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;