diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field_conv.cc | 2 | ||||
-rw-r--r-- | sql/filesort.cc | 4 | ||||
-rw-r--r-- | sql/ha_partition.cc | 4 | ||||
-rw-r--r-- | sql/hostname.cc | 2 | ||||
-rw-r--r-- | sql/item_timefunc.cc | 4 | ||||
-rw-r--r-- | sql/log_event.cc | 10 | ||||
-rw-r--r-- | sql/log_event_old.cc | 12 | ||||
-rw-r--r-- | sql/my_decimal.h | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 16 | ||||
-rw-r--r-- | sql/opt_range.cc | 2 | ||||
-rw-r--r-- | sql/opt_range.h | 4 | ||||
-rw-r--r-- | sql/records.cc | 2 | ||||
-rw-r--r-- | sql/rpl_rli.cc | 2 | ||||
-rw-r--r-- | sql/rpl_rli.h | 2 | ||||
-rw-r--r-- | sql/set_var.cc | 4 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 4 | ||||
-rw-r--r-- | sql/sql_binlog.cc | 6 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 | ||||
-rw-r--r-- | sql/sql_list.h | 2 | ||||
-rw-r--r-- | sql/sql_load.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 12 | ||||
-rw-r--r-- | sql/table.cc | 4 |
23 files changed, 50 insertions, 56 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc index ae690594718..9a53f258754 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -773,7 +773,7 @@ int field_conv(Field *to,Field *from) ((Field_varstring*)from)->length_bytes == ((Field_varstring*)to)->length_bytes)) { // Identical fields -#ifdef HAVE_purify +#ifdef HAVE_valgrind /* This may happen if one does 'UPDATE ... SET x=x' */ if (to->ptr != from->ptr) #endif diff --git a/sql/filesort.cc b/sql/filesort.cc index dc59f1c8fcd..f5fe17e6ff1 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -953,13 +953,13 @@ static void make_sortkey(register SORTPARAM *param, if (addonf->null_bit && field->is_null()) { nulls[addonf->null_offset]|= addonf->null_bit; -#ifdef HAVE_purify +#ifdef HAVE_valgrind bzero(to, addonf->length); #endif } else { -#ifdef HAVE_purify +#ifdef HAVE_valgrind uchar *end= field->pack(to, field->ptr); uint length= (uint) ((to + addonf->length) - end); DBUG_ASSERT((int) length >= 0); diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 1aa43fd6a51..79724ebcc60 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3548,10 +3548,10 @@ void ha_partition::position(const uchar *record) (ref_length - PARTITION_BYTES_IN_POS)); #ifdef SUPPORTING_PARTITION_OVER_DIFFERENT_ENGINES -#ifdef HAVE_purify +#ifdef HAVE_valgrind bzero(ref + PARTITION_BYTES_IN_POS + ref_length, max_ref_length-ref_length); -#endif /* HAVE_purify */ +#endif /* HAVE_valgrind */ #endif DBUG_VOID_RETURN; } diff --git a/sql/hostname.cc b/sql/hostname.cc index c8cf46383a9..ec090cbe02f 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -175,7 +175,7 @@ char * ip_to_hostname(struct in_addr *in, uint *errors) char buff[GETHOSTBYADDR_BUFF_SIZE],buff2[GETHOSTBYNAME_BUFF_SIZE]; int tmp_errno; struct hostent tmp_hostent, tmp_hostent2; -#ifdef HAVE_purify +#ifdef HAVE_valgrind bzero(buff,sizeof(buff)); // Bug in purify #endif if (!(hp=gethostbyaddr_r((char*) in,sizeof(*in), diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index c1b8cab600b..c313c3338d1 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -290,8 +290,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, LINT_INIT(strict_week_number); /* Remove valgrind varnings when using gcc 3.3 and -O1 */ - PURIFY_OR_LINT_INIT(strict_week_number_year_type); - PURIFY_OR_LINT_INIT(sunday_first_n_first_week_non_iso); + VALGRIND_OR_LINT_INIT(strict_week_number_year_type); + VALGRIND_OR_LINT_INIT(sunday_first_n_first_week_non_iso); if (!sub_pattern_end) bzero((char*) l_time, sizeof(*l_time)); diff --git a/sql/log_event.cc b/sql/log_event.cc index 4c82d686d5a..87917b6ac86 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7029,7 +7029,7 @@ int Rows_log_event::do_add_row_data(uchar *row_data, size_t length) Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_DUMP("row_data", row_data, min(length, 32)); #endif @@ -7845,7 +7845,7 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len, Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_DUMP("event buffer", (uchar*) buf, event_len); #endif @@ -8748,7 +8748,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_DUMP("key data", m_key, table->key_info->key_length); #endif @@ -8778,7 +8778,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_PRINT("info",("found first matching record")); DBUG_DUMP("record[0]", table->record[0], table->s->reclength); #endif @@ -9141,7 +9141,7 @@ Update_rows_log_event::do_exec_row(const Relay_log_info *const rli) Now we have the right row to update. The old row (the one we're looking for) is in record[1] and the new row is in record[0]. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind /* Don't print debug messages when running valgrind since they can trigger false warnings. diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 37eeee05a4d..6c3b368eccd 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -724,7 +724,7 @@ static int find_and_fetch_row(TABLE *table, uchar *key) Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength); DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength); #endif @@ -750,7 +750,7 @@ static int find_and_fetch_row(TABLE *table, uchar *key) Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength); DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength); #endif @@ -1404,7 +1404,7 @@ int Old_rows_log_event::do_add_row_data(uchar *row_data, size_t length) Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_DUMP("row_data", row_data, min(length, 32)); #endif @@ -2353,7 +2353,7 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_DUMP("key data", m_key, table->key_info->key_length); #endif @@ -2383,7 +2383,7 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_PRINT("info",("found first matching record")); DBUG_DUMP("record[0]", table->record[0], table->s->reclength); #endif @@ -2878,7 +2878,7 @@ Update_rows_log_event_old::do_exec_row(const Relay_log_info *const rli) Now we have the right row to update. The old row (the one we're looking for) is in record[1] and the new row is in record[0]. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind /* Don't print debug messages when running valgrind since they can trigger false warnings. diff --git a/sql/my_decimal.h b/sql/my_decimal.h index 0e79f70ab4e..ae081ce5617 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -99,7 +99,7 @@ public: { len= DECIMAL_BUFF_LENGTH; buf= buffer; -#if !defined (HAVE_purify) && !defined(DBUG_OFF) +#if !defined (HAVE_valgrind) && !defined(DBUG_OFF) /* Set buffer to 'random' value to find wrong buffer usage */ for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++) buffer[i]= i; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 44e1cafcb87..4a5a207ca1c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -57,12 +57,6 @@ #define mysqld_charset &my_charset_latin1 -#ifdef HAVE_purify -#define IF_PURIFY(A,B) (A) -#else -#define IF_PURIFY(A,B) (B) -#endif - #if SIZEOF_CHARP == 4 #define MAX_MEM_TABLE_SIZE ~(ulong) 0 #else @@ -76,9 +70,9 @@ char pstack_file_name[80]; #endif /* __linux__ */ -/* We have HAVE_purify below as this speeds up the shutdown of MySQL */ +/* We have HAVE_valgrind below as this speeds up the shutdown of MySQL */ -#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_purify) && defined(__linux__) +#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_valgrind) && defined(__linux__) #define HAVE_CLOSE_SERVER_SOCK 1 #endif @@ -6565,7 +6559,7 @@ log and this option does nothing anymore.", purify. These are not suppressed: instead we disable symlinks option if compiled with valgrind support. */ - IF_PURIFY(0,1), 0, 0, 0, 0, 0}, + IF_VALGRIND(0,1), 0, 0, 0, 0, 0}, {"sysdate-is-now", OPT_SYSDATE_IS_NOW, "Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement.", (uchar**) &global_system_variables.sysdate_is_now, @@ -6606,7 +6600,7 @@ log and this option does nothing anymore.", 0, 0, 0, 0, 0}, {"use-symbolic-links", 's', "Enable symbolic link support. Deprecated option; use --symbolic-links instead.", (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG, - IF_PURIFY(0,1), 0, 0, 0, 0, 0}, + IF_VALGRIND(0,1), 0, 0, 0, 0, 0}, {"user", 'u', "Run mysqld daemon as user.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Used with --help option for detailed help", @@ -7722,7 +7716,7 @@ static int mysql_init_variables(void) /* Things reset to zero */ opt_skip_slave_start= opt_reckless_slave = 0; mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0; -#if defined(HAVE_REALPATH) && !defined(HAVE_purify) && !defined(HAVE_BROKEN_REALPATH) +#if defined(HAVE_REALPATH) && !defined(HAVE_valgrind) && !defined(HAVE_BROKEN_REALPATH) /* We can only test for sub paths if my_symlink.c is using realpath */ myisam_test_invalid_symlink= test_if_data_home_dir; #endif diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 220d281cf33..1d6ea404900 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -8368,7 +8368,7 @@ int QUICK_RANGE_SELECT::reset() multi_range_buff->buffer= mrange_buff; multi_range_buff->buffer_end= mrange_buff + mrange_bufsiz; multi_range_buff->end_of_used_area= mrange_buff; -#ifdef HAVE_purify +#ifdef HAVE_valgrind /* We need this until ndb will use the buffer efficiently (Now ndb stores complete row in here, instead of only the used fields diff --git a/sql/opt_range.h b/sql/opt_range.h index 8d2ba1bb0a6..225af276e55 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -44,7 +44,7 @@ class QUICK_RANGE :public Sql_alloc { uint16 min_length,max_length,flag; key_part_map min_keypart_map, // bitmap of used keyparts in min_key max_keypart_map; // bitmap of used keyparts in max_key -#ifdef HAVE_purify +#ifdef HAVE_valgrind uint16 dummy; /* Avoid warnings on 'flag' */ #endif QUICK_RANGE(); /* Full range */ @@ -61,7 +61,7 @@ class QUICK_RANGE :public Sql_alloc { min_keypart_map(min_keypart_map_arg), max_keypart_map(max_keypart_map_arg) { -#ifdef HAVE_purify +#ifdef HAVE_valgrind dummy=0; #endif } diff --git a/sql/records.cc b/sql/records.cc index 9e040de3fda..8bab6fd46a4 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -520,7 +520,7 @@ static int init_rr_cache(THD *thd, READ_RECORD *info) info->struct_length+1, MYF(0)))) DBUG_RETURN(1); -#ifdef HAVE_purify +#ifdef HAVE_valgrind // Avoid warnings in qsort bzero(info->cache,rec_cache_size+info->cache_records* info->struct_length+1); #endif diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 03ea244c4e5..82628143bea 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -34,7 +34,7 @@ Relay_log_info::Relay_log_info() no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id), info_fd(-1), cur_log_fd(-1), save_temporary_tables(0), cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0), -#if HAVE_purify +#if HAVE_valgrind is_fake(FALSE), #endif group_master_log_pos(0), log_space_total(0), ignore_log_space_limit(0), diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index 171778d9675..49186091496 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -154,7 +154,7 @@ public: ulonglong event_relay_log_pos; ulonglong future_event_relay_log_pos; -#ifdef HAVE_purify +#ifdef HAVE_valgrind bool is_fake; /* Mark that this is a fake relay log info structure */ #endif diff --git a/sql/set_var.cc b/sql/set_var.cc index 21500666f49..a3ea5fa8029 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -648,8 +648,8 @@ static sys_var_long_ptr sys_table_lock_wait_timeout(&vars, "table_lock_wait_time static sys_var_long_ptr sys_thread_cache_size(&vars, "thread_cache_size", &thread_cache_size); #if HAVE_POOL_OF_THREADS == 1 -sys_var_long_ptr sys_thread_pool_size(&vars, "thread_pool_size", - &thread_pool_size); +static sys_var_long_ptr sys_thread_pool_size(&vars, "thread_pool_size", + &thread_pool_size); #endif static sys_var_thd_enum sys_tx_isolation(&vars, "tx_isolation", &SV::tx_isolation, diff --git a/sql/slave.cc b/sql/slave.cc index f5e8a11efe9..ec86a4c48e0 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2014,7 +2014,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli, if (exec_res == 0) { int error= ev->update_pos(rli); -#ifdef HAVE_purify +#ifdef HAVE_valgrind if (!rli->is_fake) #endif { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 0973e83ed32..ac4be080123 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3001,7 +3001,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, table->pos_in_table_list= table_list; table_list->updatable= 1; // It is not derived table nor non-updatable VIEW table->clear_column_bitmaps(); -#if !defined(DBUG_OFF) && !defined(HAVE_purify) +#if !defined(DBUG_OFF) && !defined(HAVE_valgrind) /* Fill record with random values to find bugs where we access fields without first reading them. @@ -7371,7 +7371,7 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields, /* make * substituting permanent */ SELECT_LEX *select_lex= thd->lex->current_select; select_lex->with_wild= 0; -#ifdef HAVE_purify +#ifdef HAVE_valgrind if (&select_lex->item_list != &fields) // Avoid warning #endif select_lex->item_list= fields; diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index 96e99b57e3c..67f2912fe7b 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -59,7 +59,7 @@ void mysql_client_binlog_statement(THD* thd) if (!thd->rli_fake) { thd->rli_fake= new Relay_log_info; -#ifdef HAVE_purify +#ifdef HAVE_valgrind thd->rli_fake->is_fake= TRUE; #endif have_fd_event= FALSE; @@ -95,7 +95,7 @@ void mysql_client_binlog_statement(THD* thd) char const *endptr= 0; int bytes_decoded= base64_decode(strptr, coded_len, buf, &endptr); -#ifndef HAVE_purify +#ifndef HAVE_valgrind /* This debug printout should not be used for valgrind builds since it will read from unassigned memory. @@ -188,7 +188,7 @@ void mysql_client_binlog_statement(THD* thd) bufptr += event_len; DBUG_PRINT("info",("ev->get_type_code()=%d", ev->get_type_code())); -#ifndef HAVE_purify +#ifndef HAVE_valgrind /* This debug printout should not be used for valgrind builds since it will read from unassigned memory. diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 6b990aea537..f0c7fc8c85d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3496,7 +3496,7 @@ int THD::binlog_update_row(TABLE* table, bool is_trans, Don't print debug messages when running valgrind since they can trigger false warnings. */ -#ifndef HAVE_purify +#ifndef HAVE_valgrind DBUG_DUMP("before_record", before_record, table->s->reclength); DBUG_DUMP("after_record", after_record, table->s->reclength); DBUG_DUMP("before_row", before_row, before_size); diff --git a/sql/sql_list.h b/sql/sql_list.h index 0d267111dad..6edf9a00b87 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -43,7 +43,7 @@ public: static void operator delete[](void *ptr, MEM_ROOT *mem_root) { /* never called */ } static void operator delete[](void *ptr, size_t size) { TRASH(ptr, size); } -#ifdef HAVE_purify +#ifdef HAVE_valgrind bool dummy; inline Sql_alloc() :dummy(0) {} inline ~Sql_alloc() {} diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 278e01d4de6..771aef33434 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -604,7 +604,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, } it.rewind(); uchar *pos=read_info.row_start; -#ifdef HAVE_purify +#ifdef HAVE_valgrind read_info.row_end[0]=0; #endif diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5cf6c9b1dbe..302b23124cf 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1817,7 +1817,7 @@ JOIN::exec() curr_join->having= curr_join->tmp_having= 0; // Allready done /* Change sum_fields reference to calculated fields in tmp_table */ -#ifdef HAVE_purify +#ifdef HAVE_valgrind if (curr_join != this) #endif curr_join->all_fields= *curr_all_fields; @@ -1839,7 +1839,7 @@ JOIN::exec() fields_list.elements, all_fields)) DBUG_VOID_RETURN; } -#ifdef HAVE_purify +#ifdef HAVE_valgrind if (curr_join != this) #endif { @@ -1993,7 +1993,7 @@ JOIN::exec() tmp_fields_list2, tmp_all_fields2, fields_list.elements, tmp_all_fields1)) DBUG_VOID_RETURN; -#ifdef HAVE_purify +#ifdef HAVE_valgrind /* Some GCCs use memcpy() for struct assignment, even for x=x. GCC bug 19410: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19410 @@ -2058,7 +2058,7 @@ JOIN::exec() tmp_table_param.save_copy_field= curr_join->tmp_table_param.copy_field; tmp_table_param.save_copy_field_end= curr_join->tmp_table_param.copy_field_end; -#ifdef HAVE_purify +#ifdef HAVE_valgrind if (curr_join != this) #endif { @@ -3860,7 +3860,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, continue; } -#ifdef HAVE_purify +#ifdef HAVE_valgrind /* Valgrind complains about overlapped memcpy when save_pos==use. */ if (save_pos != use) #endif @@ -15154,7 +15154,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, DBUG_ASSERT (param->field_count > (uint) (copy - copy_start)); copy->set(tmp, item->result_field); item->result_field->move_field(copy->to_ptr,copy->to_null_ptr,1); -#ifdef HAVE_purify +#ifdef HAVE_valgrind copy->to_ptr[copy->from_length]= 0; #endif copy++; diff --git a/sql/table.cc b/sql/table.cc index 787709e1f25..399ba32b7d5 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1695,7 +1695,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, outparam->record[1]= outparam->record[0]; // Safety } -#ifdef HAVE_purify +#ifdef HAVE_valgrind /* We need this because when we read var-length rows, we are not updating bytes after end of varchar @@ -1917,7 +1917,7 @@ partititon_err: } } -#if defined(HAVE_purify) && !defined(DBUG_OFF) +#if defined(HAVE_valgrind) && !defined(DBUG_OFF) bzero((char*) bitmaps, bitmap_size*3); #endif |