3122 Tor Didriksen 2011-05-26
Bug#11765003 - 57912 Use memset() rather than the deprecated bfill() and bzero()
@ support-files/build-tags
Extend filter to tag .cpp files as well.
modified:
client/completion_hash.cc
client/mysql.cc
client/mysql_upgrade.c
client/mysqlbinlog.cc
client/mysqldump.c
client/mysqlslap.c
client/mysqltest.cc
client/sql_string.cc
cmake/os/WindowsCache.cmake
config.h.cmake
configure.cmake
dbug/dbug.c
extra/comp_err.c
extra/replace.c
include/hash.h
include/m_string.h
include/myisampack.h
libmysql/libmysql.c
libmysqld/lib_sql.cc
mysys/array.c
mysys/charset.c
mysys/default.c
mysys/lf_dynarray.c
mysys/mf_iocache.c
mysys/mf_keycache.c
mysys/mf_radix.c
mysys/my_aes.c
mysys/my_alloc.c
mysys/my_bitmap.c
mysys/my_chsize.c
mysys/my_file.c
mysys/my_gethwaddr.c
mysys/my_init.c
mysys/my_lib.c
mysys/my_malloc.c
mysys/my_once.c
mysys/my_wincond.c
mysys/my_windac.c
mysys/sha1.c
mysys/testhash.c
mysys/thr_alarm.c
mysys/thr_lock.c
mysys/thr_mutex.c
mysys/tree.c
mysys/waiting_threads.c
regex/regexp.c
regex/reginit.c
sql-common/client.c
sql-common/client_plugin.c
sql-common/my_time.c
sql/binlog.cc
sql/debug_sync.cc
sql/des_key_file.cc
sql/event_data_objects.cc
sql/field.cc
sql/field.h
sql/field_conv.cc
sql/filesort.cc
sql/gcalc_tools.h
sql/ha_ndbcluster.cc
sql/ha_ndbcluster_binlog.cc
sql/ha_partition.cc
sql/handler.cc
sql/hash_filo.h
sql/item.cc
sql/item.h
sql/item_cmpfunc.h
sql/item_inetfunc.cc
sql/item_strfunc.cc
sql/item_sum.cc
sql/item_timefunc.cc
sql/item_xmlfunc.cc
sql/key.cc
sql/log.cc
sql/log_event.cc
sql/mysqld.cc
sql/opt_range.cc
sql/partition_info.cc
sql/password.c
sql/protocol.cc
sql/records.cc
sql/rpl_info_file.cc
sql/rpl_master.cc
sql/rpl_rli.cc
sql/rpl_utility.cc
sql/rpl_utility.h
sql/set_var.cc
sql/sp.cc
sql/sp_head.cc
sql/sql_acl.cc
sql/sql_alter.cc
sql/sql_analyse.cc
sql/sql_audit.cc
sql/sql_base.cc
sql/sql_cache.cc
sql/sql_class.cc
sql/sql_class.h
sql/sql_connect.cc
sql/sql_db.cc
sql/sql_delete.cc
sql/sql_error.cc
sql/sql_insert.cc
sql/sql_join_cache.cc
sql/sql_lex.cc
sql/sql_list.h
sql/sql_load.cc
sql/sql_parse.cc
sql/sql_partition_admin.cc
sql/sql_plugin.cc
sql/sql_prepare.cc
sql/sql_select.cc
sql/sql_select.h
sql/sql_show.cc
sql/sql_string.cc
sql/sql_table.cc
sql/sql_trigger.cc
sql/sql_trigger.h
sql/sql_udf.cc
sql/sql_union.cc
sql/sql_update.cc
sql/sql_view.cc
sql/sql_yacc.yy
sql/table.cc
sql/table.h
sql/thr_malloc.cc
sql/tztime.cc
sql/udf_example.c
sql/unireg.cc
sql/unireg.h
storage/blackhole/ha_blackhole.cc
storage/federated/ha_federated.cc
storage/heap/ha_heap.cc
storage/heap/hp_create.c
storage/heap/hp_hash.c
storage/heap/hp_test1.c
storage/heap/hp_test2.c
storage/innobase/handler/ha_innodb.cc
storage/myisam/ft_boolean_search.c
storage/myisam/ft_nlq_search.c
storage/myisam/ft_update.c
storage/myisam/ha_myisam.cc
storage/myisam/mi_cache.c
storage/myisam/mi_check.c
storage/myisam/mi_create.c
storage/myisam/mi_dynrec.c
storage/myisam/mi_key.c
storage/myisam/mi_log.c
storage/myisam/mi_open.c
storage/myisam/mi_packrec.c
storage/myisam/mi_rkey.c
storage/myisam/mi_statrec.c
storage/myisam/mi_test1.c
storage/myisam/mi_test2.c
storage/myisam/mi_test3.c
storage/myisam/myisamchk.c
storage/myisam/myisamlog.c
storage/myisam/myisampack.c
storage/myisam/rt_test.c
storage/myisam/sort.c
storage/myisam/sp_key.c
storage/myisam/sp_test.c
storage/myisammrg/ha_myisammrg.cc
storage/myisammrg/myrg_open.c
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
storage/ndb/src/kernel/blocks/tsman.cpp
storage/ndb/src/kernel/vm/RWPool.cpp
storage/ndb/src/kernel/vm/WOPool.cpp
storage/ndb/src/kernel/vm/bench_pool.cpp
storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
storage/ndb/test/ndbapi/testNodeRestart.cpp
storage/ndb/test/run-test/setup.cpp
storage/ndb/test/src/DbUtil.cpp
strings/conf_to_src.c
strings/ctype-czech.c
strings/ctype-mb.c
strings/ctype-simple.c
strings/ctype-uca.c
strings/ctype-win1250ch.c
strings/ctype.c
strings/decimal.c
strings/dump_map.c
strings/my_vsnprintf.c
strings/uca-dump.c
strings/uctypedump.c
strings/xml.c
support-files/build-tags
tests/mysql_client_test.c
unittest/mysys/waiting_threads-t.c
vio/vio.c
3121 Tatjana Azundris Nuernberg 2011-05-27 [merge]
-Werror fixes for 11745920 via 5.5
modified:
vio/viossl.c
=== modified file 'client/completion_hash.cc'
--- a/client/completion_hash.cc 2010-07-08 21:20:08 +0000
+++ b/client/completion_hash.cc 2011-05-26 15:20:09 +0000
@@ -205,7 +205,7 @@ Bucket *find_longest_match(HashTable *ht
void completion_hash_clean(HashTable *ht)
{
free_root(&ht->mem_root,MYF(0));
- bzero((char*) ht->arBuckets,ht->nTableSize*sizeof(Bucket *));
+ memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *));
}
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc 2011-05-18 14:36:45 +0000
+++ b/client/mysql.cc 2011-05-26 15:20:09 +0000
@@ -1209,7 +1209,7 @@ int main(int argc,char *argv[])
glob_buffer.realloc(512);
completion_hash_init(&ht, 128);
init_alloc_root(&hash_mem_root, 16384, 0);
- bzero((char*) &mysql, sizeof(mysql));
+ memset(&mysql, 0, sizeof(mysql));
if (sql_connect(current_host,current_db,current_user,opt_password,
opt_silent))
{
@@ -3989,7 +3989,7 @@ com_connect(String *buffer, char *line)
bool save_rehash= opt_rehash;
int error;
- bzero(buff, sizeof(buff));
+ memset(buff, 0, sizeof(buff));
if (buffer)
{
/*
@@ -4075,7 +4075,7 @@ static int com_source(String *buffer __a
/* Save old status */
old_status=status;
- bfill((char*) &status,sizeof(status),(char) 0);
+ memset(&status, 0, sizeof(status));
status.batch=old_status.batch; // Run in batch mode
status.line_buff=line_buff;
@@ -4125,7 +4125,7 @@ com_use(String *buffer __attribute__((un
char *tmp, buff[FN_REFLEN + 1];
int select_db;
- bzero(buff, sizeof(buff));
+ memset(buff, 0, sizeof(buff));
strmake(buff, line, sizeof(buff) - 1);
tmp= get_arg(buff, 0);
if (!tmp || !*tmp)
=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c 2011-01-16 04:02:29 +0000
+++ b/client/mysql_upgrade.c 2011-05-26 15:20:09 +0000
@@ -608,7 +608,7 @@ static int upgrade_already_done(void)
Read from file, don't care if it fails since it
will be detected by the strncmp
*/
- bzero(buf, sizeof(buf));
+ memset(buf, 0, sizeof(buf));
res= fgets(buf, sizeof(buf), in);
my_fclose(in, MYF(0));
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc 2011-05-05 23:59:11 +0000
+++ b/client/mysqlbinlog.cc 2011-05-26 15:20:09 +0000
@@ -226,7 +226,7 @@ public:
{
my_free(ptr->fname);
delete ptr->event;
- bzero((char *)ptr, sizeof(File_name_record));
+ memset(ptr, 0, sizeof(File_name_record));
}
}
@@ -257,7 +257,7 @@ public:
return 0;
ptr= dynamic_element(&file_names, file_id, File_name_record*);
if ((res= ptr->event))
- bzero((char *)ptr, sizeof(File_name_record));
+ memset(ptr, 0, sizeof(File_name_record));
return res;
}
@@ -287,7 +287,7 @@ public:
if (!ptr->event)
{
res= ptr->fname;
- bzero((char *)ptr, sizeof(File_name_record));
+ memset(ptr, 0, sizeof(File_name_record));
}
return res;
}
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c 2011-03-17 09:47:50 +0000
+++ b/client/mysqldump.c 2011-05-26 15:20:09 +0000
@@ -5185,7 +5185,7 @@ int main(int argc, char **argv)
compatible_mode_normal_str[0]= 0;
default_charset= (char *)mysql_universal_client_charset;
- bzero((char*) &ignore_table, sizeof(ignore_table));
+ memset(&ignore_table, 0, sizeof(ignore_table));
exit_code= get_options(&argc, &argv);
if (exit_code)
=== modified file 'client/mysqlslap.c'
--- a/client/mysqlslap.c 2011-04-08 07:07:57 +0000
+++ b/client/mysqlslap.c 2011-05-26 15:20:09 +0000
@@ -434,7 +434,7 @@ void concurrency_loop(MYSQL *mysql, uint
head_sptr= (stats *)my_malloc(sizeof(stats) * iterations,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- bzero(&conclusion, sizeof(conclusions));
+ memset(&conclusion, 0, sizeof(conclusions));
if (auto_actual_queries)
client_limit= auto_actual_queries;
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2011-05-05 23:52:44 +0000
+++ b/client/mysqltest.cc 2011-05-26 15:20:09 +0000
@@ -542,7 +542,7 @@ class LogFile {
size_t m_bytes_written;
public:
LogFile() : m_file(NULL), m_bytes_written(0) {
- bzero(m_file_name, sizeof(m_file_name));
+ memset(m_file_name, 0, sizeof(m_file_name));
}
~LogFile() {
@@ -9057,8 +9057,8 @@ void do_get_replace(struct st_command *c
free_replace();
- bzero((char*) &to_array,sizeof(to_array));
- bzero((char*) &from_array,sizeof(from_array));
+ memset(&to_array, 0, sizeof(to_array));
+ memset(&from_array, 0, sizeof(from_array));
if (!*from)
die("Missing argument in %s", command->query);
start= buff= (char*)my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE));
@@ -9264,7 +9264,7 @@ struct st_replace_regex* init_replace_re
/* for each regexp substitution statement */
while (p < expr_end)
{
- bzero(®,sizeof(reg));
+ memset(®, 0, sizeof(reg));
/* find the start of the statement */
while (p < expr_end)
{
@@ -9717,7 +9717,7 @@ REPLACE *init_replace(char * *from, char
if (len > max_length)
max_length=len;
}
- bzero((char*) is_word_end,sizeof(is_word_end));
+ memset(is_word_end, 0, sizeof(is_word_end));
for (i=0 ; word_end_chars[i] ; i++)
is_word_end[(uchar) word_end_chars[i]]=1;
@@ -9808,7 +9808,7 @@ REPLACE *init_replace(char * *from, char
or_bits(sets.set+used_sets,sets.set); /* Can restart from start */
/* Find all chars that follows current sets */
- bzero((char*) used_chars,sizeof(used_chars));
+ memset(used_chars, 0, sizeof(used_chars));
for (i= (uint) ~0; (i=get_next_bit(sets.set+used_sets,i)) ;)
{
used_chars[follow[i].chr]=1;
@@ -9942,7 +9942,7 @@ REPLACE *init_replace(char * *from, char
int init_sets(REP_SETS *sets,uint states)
{
- bzero((char*) sets,sizeof(*sets));
+ memset(sets, 0, sizeof(*sets));
sets->size_of_bits=((states+7)/8);
if (!(sets->set_buffer=(REP_SET*) my_malloc(sizeof(REP_SET)*SET_MALLOC_HUNC,
MYF(MY_WME))))
@@ -9973,8 +9973,8 @@ REP_SET *make_new_set(REP_SETS *sets)
{
sets->extra--;
set=sets->set+ sets->count++;
- bzero((char*) set->bits,sizeof(uint)*sets->size_of_bits);
- bzero((char*) &set->next[0],sizeof(set->next[0])*LAST_CHAR_CODE);
+ memset(set->bits, 0, sizeof(uint)*sets->size_of_bits);
+ memset(&set->next[0], 0, sizeof(set->next[0])*LAST_CHAR_CODE);
set->found_offset=0;
set->found_len=0;
set->table_offset= (uint) ~0;
=== modified file 'client/sql_string.cc'
--- a/client/sql_string.cc 2011-03-22 11:44:40 +0000
+++ b/client/sql_string.cc 2011-05-26 15:20:09 +0000
@@ -237,7 +237,7 @@ bool String::copy_aligned(const char *st
If we add big-endian UCS-2 sometimes, this code
will be more complicated. But it's OK for now.
*/
- bzero((char*) Ptr, offset);
+ memset(Ptr, 0, offset);
memcpy(Ptr + offset, str, arg_length);
Ptr[aligned_length]=0;
/* str_length is always >= 0 as arg_length is != 0 */
@@ -328,7 +328,7 @@ bool String::fill(uint32 max_length,char
{
if (realloc(max_length))
return TRUE;
- bfill(Ptr+str_length,max_length-str_length,fill_char);
+ memset(Ptr+str_length, fill_char, max_length-str_length);
str_length=max_length;
}
return FALSE;
@@ -465,7 +465,7 @@ bool String::append_with_prefill(const c
t_length= full_length - arg_length;
if (t_length > 0)
{
- bfill(Ptr+str_length, t_length, fill_char);
+ memset(Ptr+str_length, fill_char, t_length);
str_length=str_length + t_length;
}
append(s, arg_length);
=== modified file 'cmake/os/WindowsCache.cmake'
--- a/cmake/os/WindowsCache.cmake 2011-05-26 08:14:09 +0000
+++ b/cmake/os/WindowsCache.cmake 2011-05-26 15:20:09 +0000
@@ -30,12 +30,10 @@ SET(HAVE_ASM_MSR_H CACHE INTERNAL "")
SET(HAVE_BACKTRACE CACHE INTERNAL "")
SET(HAVE_BACKTRACE_SYMBOLS CACHE INTERNAL "")
SET(HAVE_BACKTRACE_SYMBOLS_FD CACHE INTERNAL "")
-SET(HAVE_BFILL CACHE INTERNAL "")
SET(HAVE_BMOVE CACHE INTERNAL "")
SET(HAVE_BSD_SIGNALS CACHE INTERNAL "")
SET(HAVE_BSEARCH 1 CACHE INTERNAL "")
SET(HAVE_BSS_START CACHE INTERNAL "")
-SET(HAVE_BZERO CACHE INTERNAL "")
SET(HAVE_CHOWN CACHE INTERNAL "")
SET(HAVE_CLOCK_GETTIME CACHE INTERNAL "")
SET(HAVE_COMPRESS CACHE INTERNAL "")
=== modified file 'config.h.cmake'
--- a/config.h.cmake 2011-04-30 05:36:44 +0000
+++ b/config.h.cmake 2011-05-26 15:20:09 +0000
@@ -130,9 +130,7 @@
#cmakedefine HAVE_AIOWAIT 1
#cmakedefine HAVE_ALARM 1
#cmakedefine HAVE_ALLOCA 1
-#cmakedefine HAVE_BFILL 1
#cmakedefine HAVE_BMOVE 1
-#cmakedefine HAVE_BZERO 1
#cmakedefine HAVE_INDEX 1
#cmakedefine HAVE_CHOWN 1
#cmakedefine HAVE_CLOCK_GETTIME 1
=== modified file 'configure.cmake'
--- a/configure.cmake 2011-04-30 05:36:44 +0000
+++ b/configure.cmake 2011-05-26 15:20:09 +0000
@@ -314,11 +314,9 @@ CHECK_FUNCTION_EXISTS (backtrace HAVE_BA
CHECK_FUNCTION_EXISTS (backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
CHECK_FUNCTION_EXISTS (backtrace_symbols_fd HAVE_BACKTRACE_SYMBOLS_FD)
CHECK_FUNCTION_EXISTS (printstack HAVE_PRINTSTACK)
-CHECK_FUNCTION_EXISTS (bfill HAVE_BFILL)
CHECK_FUNCTION_EXISTS (bmove HAVE_BMOVE)
CHECK_FUNCTION_EXISTS (bsearch HAVE_BSEARCH)
CHECK_FUNCTION_EXISTS (index HAVE_INDEX)
-CHECK_FUNCTION_EXISTS (bzero HAVE_BZERO)
CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME)
CHECK_FUNCTION_EXISTS (cuserid HAVE_CUSERID)
CHECK_FUNCTION_EXISTS (directio HAVE_DIRECTIO)
=== modified file 'dbug/dbug.c'
--- a/dbug/dbug.c 2011-03-08 19:14:42 +0000
+++ b/dbug/dbug.c 2011-05-26 15:20:09 +0000
@@ -364,7 +364,7 @@ static CODE_STATE *code_state(void)
{
init_done=TRUE;
pthread_mutex_init(&THR_LOCK_dbug, NULL);
- bzero(&init_settings, sizeof(init_settings));
+ memset(&init_settings, 0, sizeof(init_settings));
init_settings.out_file=stderr;
init_settings.flags=OPEN_APPEND;
}
@@ -374,7 +374,7 @@ static CODE_STATE *code_state(void)
if (!(cs= *cs_ptr))
{
cs=(CODE_STATE*) DbugMalloc(sizeof(*cs));
- bzero((uchar*) cs,sizeof(*cs));
+ memset(cs, 0, sizeof(*cs));
cs->process= db_process ? db_process : "dbug";
cs->func="?func";
cs->file="?file";
@@ -860,7 +860,7 @@ int _db_is_pushed_()
void _db_set_init_(const char *control)
{
CODE_STATE tmp_cs;
- bzero((uchar*) &tmp_cs, sizeof(tmp_cs));
+ memset(&tmp_cs, 0, sizeof(tmp_cs));
tmp_cs.stack= &init_settings;
tmp_cs.process= db_process ? db_process : "dbug";
DbugParse(&tmp_cs, control);
@@ -1052,7 +1052,7 @@ overflow:
int _db_explain_init_(char *buf, size_t len)
{
CODE_STATE cs;
- bzero((uchar*) &cs,sizeof(cs));
+ memset(&cs, 0, sizeof(cs));
cs.stack=&init_settings;
return _db_explain_(&cs, buf, len);
}
@@ -1548,7 +1548,7 @@ static void PushState(CODE_STATE *cs)
struct settings *new_malloc;
new_malloc= (struct settings *) DbugMalloc(sizeof(struct settings));
- bzero(new_malloc, sizeof(struct settings));
+ memset(new_malloc, 0, sizeof(struct settings));
new_malloc->next= cs->stack;
cs->stack= new_malloc;
}
=== modified file 'extra/comp_err.c'
--- a/extra/comp_err.c 2011-02-16 13:49:26 +0000
+++ b/extra/comp_err.c 2011-05-26 15:20:09 +0000
@@ -353,7 +353,7 @@ static int create_sys_files(struct langu
/* continue with header of the errmsg.sys file */
length= ftell(to) - HEADER_LENGTH - row_count * 2;
- bzero((uchar*) head, HEADER_LENGTH);
+ memset(head, 0, HEADER_LENGTH);
bmove((uchar *) head, (uchar *) file_head, 4);
head[4]= 1;
int2store(head + 6, length);
=== modified file 'extra/replace.c'
--- a/extra/replace.c 2011-05-05 23:50:31 +0000
+++ b/extra/replace.c 2011-05-26 15:20:09 +0000
@@ -222,8 +222,8 @@ POINTER_ARRAY *from_array,*to_array;
{
char *pos;
- bzero((char*) from_array,sizeof(from_array[0]));
- bzero((char*) to_array,sizeof(to_array[0]));
+ memset(from_array, 0, sizeof(from_array[0]));
+ memset(to_array, 0, sizeof(to_array[0]));
while (*argc > 0 && (*(pos = *(*argv)) != '-' || pos[1] != '-' || pos[2]))
{
insert_pointer_name(from_array,pos);
@@ -421,7 +421,7 @@ static REPLACE *init_replace(char * *fro
if (len > max_length)
max_length=len;
}
- bzero((char*) is_word_end,sizeof(is_word_end));
+ memset(is_word_end, 0, sizeof(is_word_end));
for (i=0 ; word_end_chars[i] ; i++)
is_word_end[(uchar) word_end_chars[i]]=1;
@@ -540,7 +540,7 @@ static REPLACE *init_replace(char * *fro
or_bits(sets.set+used_sets,sets.set); /* Can restart from start */
/* Find all chars that follows current sets */
- bzero((char*) used_chars,sizeof(used_chars));
+ memset(used_chars, 0, sizeof(used_chars));
for (i= (uint) ~0; (i=get_next_bit(sets.set+used_sets,i)) ;)
{
used_chars[follow[i].chr]=1;
@@ -674,7 +674,7 @@ static REPLACE *init_replace(char * *fro
static int init_sets(REP_SETS *sets,uint states)
{
- bzero((char*) sets,sizeof(*sets));
+ memset(sets, 0, sizeof(*sets));
sets->size_of_bits=((states+7)/8);
if (!(sets->set_buffer=(REP_SET*) my_malloc(sizeof(REP_SET)*SET_MALLOC_HUNC,
MYF(MY_WME))))
@@ -705,8 +705,8 @@ static REP_SET *make_new_set(REP_SETS *s
{
sets->extra--;
set=sets->set+ sets->count++;
- bzero((char*) set->bits,sizeof(uint)*sets->size_of_bits);
- bzero((char*) &set->next[0],sizeof(set->next[0])*LAST_CHAR_CODE);
+ memset(set->bits, 0, sizeof(uint)*sets->size_of_bits);
+ memset(&set->next[0], 0, sizeof(set->next[0])*LAST_CHAR_CODE);
set->found_offset=0;
set->found_len=0;
set->table_offset= (uint) ~0;
=== modified file 'include/hash.h'
--- a/include/hash.h 2010-07-08 21:20:08 +0000
+++ b/include/hash.h 2011-05-26 15:20:09 +0000
@@ -97,7 +97,7 @@ my_bool my_hash_update(HASH *hash, uchar
void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row);
my_bool my_hash_check(HASH *hash); /* Only in debug library */
-#define my_hash_clear(H) bzero((char*) (H), sizeof(*(H)))
+#define my_hash_clear(H) memset((H), 0, sizeof(*(H)))
#define my_hash_inited(H) ((H)->blength != 0)
#define my_hash_init_opt(A,B,C,D,E,F,G,H) \
(!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G,H))
=== modified file 'include/m_string.h'
--- a/include/m_string.h 2010-11-22 10:02:01 +0000
+++ b/include/m_string.h 2011-05-26 15:20:09 +0000
@@ -36,33 +36,21 @@
/* need by my_vsnprintf */
#include <stdarg.h>
-/* This is needed for the definitions of bzero... on solaris */
-#if defined(HAVE_STRINGS_H)
-#include <strings.h>
-#endif
-
/* This is needed for the definitions of memcpy... on solaris */
#if defined(HAVE_MEMORY_H) && !defined(__cplusplus)
#include <memory.h>
#endif
+#define bfill please_use_memset_rather_than_bfill()
+#define bzero please_use_memset_rather_than_bzero()
+
#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE)
# define memcpy(d, s, n) bcopy ((s), (d), (n))
-# define memset(A,C,B) bfill((A),(B),(C))
# define memmove(d, s, n) bmove ((d), (s), (n))
#elif defined(HAVE_MEMMOVE)
# define bmove(d, s, n) memmove((d), (s), (n))
#endif
-/* Unixware 7 */
-#if !defined(HAVE_BFILL)
-# define bfill(A,B,C) memset((A),(C),(B))
-#endif
-
-#if !defined(bzero) && !defined(HAVE_BZERO)
-# define bzero(A,B) memset((A),0,(B))
-#endif
-
#if defined(__cplusplus)
extern "C" {
#endif
=== modified file 'include/myisampack.h'
--- a/include/myisampack.h 2009-09-23 21:32:31 +0000
+++ b/include/myisampack.h 2011-05-26 15:20:09 +0000
@@ -234,7 +234,7 @@
#define mi_sizekorr(T) mi_uint8korr(T)
#else
#define mi_sizestore(T,A) { if ((A) == HA_OFFSET_ERROR)\
- bfill((char*) (T), 8, 255);\
+ memset((T), 255, 8);\
else { mi_int4store((T), 0);\
mi_int4store(((T) + 4), A); }}
#define mi_sizekorr(T) mi_uint4korr((uchar*) (T) + 4)
=== modified file 'libmysql/libmysql.c'
--- a/libmysql/libmysql.c 2011-05-06 13:46:57 +0000
+++ b/libmysql/libmysql.c 2011-05-26 15:20:09 +0000
@@ -1500,7 +1500,7 @@ mysql_stmt_init(MYSQL *mysql)
stmt->read_row_func= stmt_read_row_no_result_set;
stmt->prefetch_rows= DEFAULT_PREFETCH_ROWS;
strmov(stmt->sqlstate, not_error_sqlstate);
- /* The rest of statement members was bzeroed inside malloc */
+ /* The rest of statement members was zeroed inside malloc */
init_alloc_root(&stmt->extension->fields_mem_root, 2048, 0);
@@ -1799,7 +1799,7 @@ mysql_stmt_result_metadata(MYSQL_STMT *s
result->eof= 1; /* Marker for buffered */
result->fields= stmt->fields;
result->field_count= stmt->field_count;
- /* The rest of members of 'result' was bzeroed inside malloc */
+ /* The rest of members of 'result' was zeroed inside malloc */
DBUG_RETURN(result);
}
@@ -2108,7 +2108,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
set_stmt_errmsg(stmt, net);
DBUG_RETURN(1);
}
- bzero((char*) net->write_pos, null_count);
+ memset(net->write_pos, 0, null_count);
net->write_pos+= null_count;
param_end= stmt->params + stmt->param_count;
@@ -3312,7 +3312,7 @@ static void fetch_long_with_conversion(M
field->length < 21)
{
bmove_upp(buff+field->length,buff+length, length);
- bfill(buff, field->length - length,'0');
+ memset(buff, '0', field->length - length);
length= field->length;
}
fetch_string_with_conversion(param, (char*) buff, length);
@@ -3433,7 +3433,7 @@ static void fetch_float_with_conversion(
{
bmove_upp((uchar*) buff + field->length, (uchar*) buff + len,
len);
- bfill((char*) buff, field->length - len, '0');
+ memset(buff, '0', field->length - len);
len= field->length;
}
fetch_string_with_conversion(param, buff, len);
@@ -4417,7 +4417,7 @@ int STDCALL mysql_stmt_store_result(MYSQ
*/
MYSQL_BIND *my_bind, *end;
MYSQL_FIELD *field;
- bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count);
+ memset(stmt->bind, 0, sizeof(*stmt->bind) * stmt->field_count);
for (my_bind= stmt->bind, end= my_bind + stmt->field_count,
field= stmt->fields;
=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc 2011-05-24 09:21:24 +0000
+++ b/libmysqld/lib_sql.cc 2011-05-26 15:20:09 +0000
@@ -687,7 +687,7 @@ void *create_embedded_thd(int client_fla
thd->cur_data= 0;
thd->first_data= 0;
thd->data_tail= &thd->first_data;
- bzero((char*) &thd->net, sizeof(thd->net));
+ memset(&thd->net, 0, sizeof(thd->net));
thread_count++;
threads.append(thd);
=== modified file 'mysys/array.c'
--- a/mysys/array.c 2010-11-05 22:14:29 +0000
+++ b/mysys/array.c 2011-05-26 15:20:09 +0000
@@ -202,7 +202,7 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array
{
if (idx >= array->max_element && allocate_dynamic(array, idx))
return TRUE;
- bzero((uchar*) (array->buffer+array->elements*array->size_of_element),
+ memset((array->buffer+array->elements*array->size_of_element), 0,
(idx - array->elements)*array->size_of_element);
array->elements=idx+1;
}
@@ -279,7 +279,7 @@ void get_dynamic(DYNAMIC_ARRAY *array, u
{
DBUG_PRINT("warning",("To big array idx: %d, array size is %d",
idx,array->elements));
- bzero(element,array->size_of_element);
+ memset(element, 0, array->size_of_element);
return;
}
memcpy(element,array->buffer+idx*array->size_of_element,
=== modified file 'mysys/charset.c'
--- a/mysys/charset.c 2011-03-21 20:16:05 +0000
+++ b/mysys/charset.c 2011-05-26 15:20:09 +0000
@@ -230,7 +230,7 @@ static int add_collation(CHARSET_INFO *c
if (!(all_charsets[cs->number]=
(CHARSET_INFO*) my_once_alloc(sizeof(CHARSET_INFO),MYF(0))))
return MY_XML_ERROR;
- bzero((void*)all_charsets[cs->number],sizeof(CHARSET_INFO));
+ memset(all_charsets[cs->number], 0, sizeof(CHARSET_INFO));
}
if (cs->primary_number == cs->number)
@@ -487,7 +487,7 @@ static void init_available_charsets(void
CHARSET_INFO **cs;
MY_CHARSET_LOADER loader;
- bzero(&all_charsets,sizeof(all_charsets));
+ memset(&all_charsets, 0, sizeof(all_charsets));
init_compiled_charsets(MYF(0));
/* Copy compiled charsets */
=== modified file 'mysys/default.c'
--- a/mysys/default.c 2011-04-26 00:21:47 +0000
+++ b/mysys/default.c 2011-05-26 15:20:09 +0000
@@ -1208,7 +1208,7 @@ static const char **init_default_directo
dirs= (const char **)alloc_root(alloc, DEFAULT_DIRS_SIZE * sizeof(char *));
if (dirs == NULL)
return NULL;
- bzero((char *) dirs, DEFAULT_DIRS_SIZE * sizeof(char *));
+ memset(dirs, 0, DEFAULT_DIRS_SIZE * sizeof(char *));
#ifdef __WIN__
=== modified file 'mysys/lf_dynarray.c'
--- a/mysys/lf_dynarray.c 2010-07-08 21:20:08 +0000
+++ b/mysys/lf_dynarray.c 2011-05-26 15:20:09 +0000
@@ -42,7 +42,7 @@
void lf_dynarray_init(LF_DYNARRAY *array, uint element_size)
{
- bzero(array, sizeof(*array));
+ memset(array, 0, sizeof(*array));
array->size_of_element= element_size;
my_atomic_rwlock_init(&array->lock);
}
=== modified file 'mysys/mf_iocache.c'
--- a/mysys/mf_iocache.c 2011-01-11 09:09:21 +0000
+++ b/mysys/mf_iocache.c 2011-05-26 15:20:09 +0000
@@ -259,7 +259,7 @@ int init_io_cache(IO_CACHE *info, File f
else
{
/* Clear mutex so that safe_mutex will notice that it's not initialized */
- bzero((char*) &info->append_buffer_lock, sizeof(info));
+ memset(&info->append_buffer_lock, 0, sizeof(info));
}
#endif
=== modified file 'mysys/mf_keycache.c'
--- a/mysys/mf_keycache.c 2011-01-11 09:09:21 +0000
+++ b/mysys/mf_keycache.c 2011-05-26 15:20:09 +0000
@@ -457,11 +457,11 @@ int init_key_cache(KEY_CACHE *keycache,
keycache->hash_link_root= (HASH_LINK*) ((char*) keycache->hash_root +
ALIGN_SIZE((sizeof(HASH_LINK*) *
keycache->hash_entries)));
- bzero((uchar*) keycache->block_root,
+ memset(keycache->block_root, 0,
keycache->disk_blocks * sizeof(BLOCK_LINK));
- bzero((uchar*) keycache->hash_root,
+ memset(keycache->hash_root, 0,
keycache->hash_entries * sizeof(HASH_LINK*));
- bzero((uchar*) keycache->hash_link_root,
+ memset(keycache->hash_link_root, 0,
keycache->hash_links * sizeof(HASH_LINK));
keycache->hash_links_used= 0;
keycache->free_hash_list= NULL;
@@ -493,9 +493,9 @@ int init_key_cache(KEY_CACHE *keycache,
keycache->disk_blocks, (long) keycache->block_root,
keycache->hash_entries, (long) keycache->hash_root,
keycache->hash_links, (long) keycache->hash_link_root));
- bzero((uchar*) keycache->changed_blocks,
+ memset(keycache->changed_blocks, 0,
sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH);
- bzero((uchar*) keycache->file_blocks,
+ memset(keycache->file_blocks, 0,
sizeof(keycache->file_blocks[0]) * CHANGED_BLOCKS_HASH);
}
else
=== modified file 'mysys/mf_radix.c'
--- a/mysys/mf_radix.c 2007-05-10 09:59:39 +0000
+++ b/mysys/mf_radix.c 2011-05-26 15:20:09 +0000
@@ -34,7 +34,7 @@ void radixsort_for_str_ptr(uchar **base,
end=base+number_of_elements; count_end=count+256;
for (pass=(int) size_of_element-1 ; pass >= 0 ; pass--)
{
- bzero((uchar*) count,sizeof(uint32)*256);
+ memset(count, 0, sizeof(uint32)*256);
for (ptr= base ; ptr < end ; ptr++)
count[ptr[0][pass]]++;
if (count[0] == number_of_elements)
=== modified file 'mysys/my_aes.c'
--- a/mysys/my_aes.c 2006-12-31 00:02:27 +0000
+++ b/mysys/my_aes.c 2011-05-26 15:20:09 +0000
@@ -65,7 +65,7 @@ static int my_aes_create_key(KEYINSTANCE
const char *sptr; /* Start of the working key */
const char *key_end=key+key_length; /* Working key boundary*/
- bzero((char*) rkey,AES_KEY_LENGTH/8); /* Set initial key */
+ memset(rkey, 0, AES_KEY_LENGTH/8); /* Set initial key */
for (ptr= rkey, sptr= key; sptr < key_end; ptr++,sptr++)
{
@@ -149,7 +149,7 @@ int my_aes_encrypt(const char* source, i
/* Encode the rest. We always have incomplete block */
pad_len = AES_BLOCK_SIZE - (source_length - AES_BLOCK_SIZE*num_blocks);
memcpy(block, source, 16 - pad_len);
- bfill(block + AES_BLOCK_SIZE - pad_len, pad_len, pad_len);
+ memset(block + AES_BLOCK_SIZE - pad_len, pad_len, pad_len);
rijndaelEncrypt(aes_key.rk, aes_key.nr, block, (uint8*) dest);
return AES_BLOCK_SIZE*(num_blocks + 1);
}
=== modified file 'mysys/my_alloc.c'
--- a/mysys/my_alloc.c 2010-07-08 21:20:08 +0000
+++ b/mysys/my_alloc.c 2011-05-26 15:20:09 +0000
@@ -340,7 +340,7 @@ static inline void mark_blocks_free(MEM_
NOTES
One can call this function either with root block initialised with
- init_alloc_root() or with a bzero()-ed block.
+ init_alloc_root() or with a zero()-ed block.
It's also safe to call this multiple times with the same mem_root.
*/
=== modified file 'mysys/my_bitmap.c'
--- a/mysys/my_bitmap.c 2011-02-16 16:19:28 +0000
+++ b/mysys/my_bitmap.c 2011-05-26 15:20:09 +0000
@@ -294,7 +294,7 @@ void bitmap_set_prefix(MY_BITMAP *map, u
if ((prefix_bits= prefix_size & 7))
*(m++)= (1 << prefix_bits)-1;
if ((d= no_bytes_in_map(map)-prefix_bytes))
- bzero(m, d);
+ memset(m, 0, d);
}
=== modified file 'mysys/my_chsize.c'
--- a/mysys/my_chsize.c 2009-09-11 20:26:35 +0000
+++ b/mysys/my_chsize.c 2011-05-26 15:20:09 +0000
@@ -88,7 +88,7 @@ int my_chsize(File fd, my_off_t newlengt
}
/* Full file with 'filler' until it's as big as requested */
- bfill(buff, IO_SIZE, filler);
+ memset(buff, filler, IO_SIZE);
while (newlength-oldsize > IO_SIZE)
{
if (my_write(fd, buff, IO_SIZE, MYF(MY_NABP)))
=== modified file 'mysys/my_file.c'
--- a/mysys/my_file.c 2010-07-08 21:20:08 +0000
+++ b/mysys/my_file.c 2011-05-26 15:20:09 +0000
@@ -109,7 +109,7 @@ uint my_set_max_open_files(uint files)
/* Copy any initialized files */
memcpy((char*) tmp, (char*) my_file_info,
sizeof(*tmp) * min(my_file_limit, files));
- bzero((char*) (tmp + my_file_limit),
+ memset((tmp + my_file_limit), 0,
max((int) (files- my_file_limit), 0)*sizeof(*tmp));
my_free_open_file_info(); /* Free if already allocated */
my_file_info= tmp;
=== modified file 'mysys/my_gethwaddr.c'
--- a/mysys/my_gethwaddr.c 2010-10-20 21:34:37 +0000
+++ b/mysys/my_gethwaddr.c 2011-05-26 15:20:09 +0000
@@ -78,7 +78,7 @@ my_bool my_gethwaddr(uchar *to)
if (fd < 0)
goto err;
- bzero(&ifr, sizeof(ifr));
+ memset(&ifr, 0, sizeof(ifr));
strnmov(ifr.ifr_name, "eth0", sizeof(ifr.ifr_name) - 1);
do
=== modified file 'mysys/my_init.c'
--- a/mysys/my_init.c 2011-04-19 03:29:06 +0000
+++ b/mysys/my_init.c 2011-05-26 15:20:09 +0000
@@ -170,7 +170,7 @@ void my_end(int infoflag)
struct rusage rus;
#ifdef HAVE_purify
/* Purify assumes that rus is uninitialized after getrusage call */
- bzero((char*) &rus, sizeof(rus));
+ memset(&rus, 0, sizeof(rus));
#endif
if (!getrusage(RUSAGE_SELF, &rus))
fprintf(info_file,"\n\
=== modified file 'mysys/my_lib.c'
--- a/mysys/my_lib.c 2011-01-11 09:09:21 +0000
+++ b/mysys/my_lib.c 2011-05-26 15:20:09 +0000
@@ -147,7 +147,7 @@ MY_DIR *my_dir(const char *path, myf MyF
sizeof(MY_STAT))))
goto error;
- bzero(finfo.mystat, sizeof(MY_STAT));
+ memset(finfo.mystat, 0, sizeof(MY_STAT));
(void) strmov(tmp_file,dp->d_name);
(void) my_stat(tmp_path, finfo.mystat, MyFlags);
if (!(finfo.mystat->st_mode & MY_S_IREAD))
@@ -318,7 +318,7 @@ MY_DIR *my_dir(const char *path, myf MyF
sizeof(MY_STAT))))
goto error;
- bzero(finfo.mystat, sizeof(MY_STAT));
+ memset(finfo.mystat, 0, sizeof(MY_STAT));
#ifdef __BORLANDC__
finfo.mystat->st_size=find.ff_fsize;
#else
=== modified file 'mysys/my_malloc.c'
--- a/mysys/my_malloc.c 2010-07-08 21:20:08 +0000
+++ b/mysys/my_malloc.c 2011-05-26 15:20:09 +0000
@@ -55,7 +55,7 @@ void *my_malloc(size_t size, myf my_flag
exit(1);
}
else if (my_flags & MY_ZEROFILL)
- bzero(point, size);
+ memset(point, 0, size);
DBUG_PRINT("exit",("ptr: %p", point));
DBUG_RETURN(point);
}
=== modified file 'mysys/my_once.c'
--- a/mysys/my_once.c 2010-07-08 21:20:08 +0000
+++ b/mysys/my_once.c 2011-05-26 15:20:09 +0000
@@ -72,7 +72,7 @@ void* my_once_alloc(size_t Size, myf MyF
next->left-= Size;
if (MyFlags & MY_ZEROFILL)
- bzero(point, Size);
+ memset(point, 0, Size);
return((void*) point);
} /* my_once_alloc */
=== modified file 'mysys/my_wincond.c'
--- a/mysys/my_wincond.c 2010-10-04 11:03:11 +0000
+++ b/mysys/my_wincond.c 2011-05-26 15:20:09 +0000
@@ -340,7 +340,7 @@ int pthread_attr_setstacksize(pthread_at
int pthread_attr_destroy(pthread_attr_t *connect_att)
{
- bzero((uchar*) connect_att,sizeof(*connect_att));
+ memset(connect_att, 0, sizeof(*connect_att));
return 0;
}
@@ -352,14 +352,14 @@ struct tm *localtime_r(const time_t *tim
{
if (*timep == (time_t) -1) /* This will crash win32 */
{
- bzero(tmp,sizeof(*tmp));
+ memset(tmp, 0, sizeof(*tmp));
}
else
{
struct tm *res=localtime(timep);
if (!res) /* Wrong date */
{
- bzero(tmp,sizeof(*tmp)); /* Keep things safe */
+ memset(tmp, 0, sizeof(*tmp)); /* Keep things safe */
return 0;
}
*tmp= *res;
=== modified file 'mysys/my_windac.c'
--- a/mysys/my_windac.c 2010-07-08 21:20:08 +0000
+++ b/mysys/my_windac.c 2011-05-26 15:20:09 +0000
@@ -127,7 +127,7 @@ int my_security_attr_create(SECURITY_ATT
*perror= "Failed to allocate memory for SECURITY_ATTRIBUTES";
goto error;
}
- bzero(owner_token, owner_token_length);
+ memset(owner_token, 0, owner_token_length);
if (! GetTokenInformation(htoken, TokenUser, owner_token,
owner_token_length, &owner_token_length))
{
=== modified file 'mysys/sha1.c'
--- a/mysys/sha1.c 2010-10-05 14:03:04 +0000
+++ b/mysys/sha1.c 2011-05-26 15:20:09 +0000
@@ -179,7 +179,7 @@ int mysql_sha1_result(SHA1_CONTEXT *cont
{
SHA1PadMessage(context);
/* message may be sensitive, clear it out */
- bzero((char*) context->Message_Block,64);
+ memset(context->Message_Block, 0, 64);
context->Length = 0; /* and clear length */
context->Computed = 1;
}
@@ -386,21 +386,21 @@ static void SHA1PadMessage(SHA1_CONTEXT
if (i > 55)
{
context->Message_Block[i++] = 0x80;
- bzero((char*) &context->Message_Block[i],
+ memset(&context->Message_Block[i], 0,
sizeof(context->Message_Block[0])*(64-i));
context->Message_Block_Index=64;
/* This function sets context->Message_Block_Index to zero */
SHA1ProcessMessageBlock(context);
- bzero((char*) &context->Message_Block[0],
+ memset(&context->Message_Block[0], 0,
sizeof(context->Message_Block[0])*56);
context->Message_Block_Index=56;
}
else
{
context->Message_Block[i++] = 0x80;
- bzero((char*) &context->Message_Block[i],
+ memset(&context->Message_Block[i], 0,
sizeof(context->Message_Block[0])*(56-i));
context->Message_Block_Index=56;
}
=== modified file 'mysys/testhash.c'
--- a/mysys/testhash.c 2010-07-08 21:20:08 +0000
+++ b/mysys/testhash.c 2011-05-26 15:20:09 +0000
@@ -70,7 +70,7 @@ static int do_test()
write_count=update=delete=0;
key_check=0;
- bzero((char*) key1,sizeof(key1[0])*1000);
+ memset(key1, 0, sizeof(key1[0])*1000);
printf("- Creating hash\n");
if (hash_init(&hash, default_charset_info, recant/2, 0, 6, 0, free_record, 0))
=== modified file 'mysys/thr_alarm.c'
--- a/mysys/thr_alarm.c 2011-05-16 14:30:54 +0000
+++ b/mysys/thr_alarm.c 2011-05-26 15:20:09 +0000
@@ -591,7 +591,7 @@ static void *alarm_handler(void *arg __a
}
process_alarm(0);
}
- bzero((char*) &alarm_thread,sizeof(alarm_thread)); /* For easy debugging */
+ memset(&alarm_thread, 0, sizeof(alarm_thread)); /* For easy debugging */
alarm_thread_running= 0;
mysql_cond_signal(&COND_alarm);
mysql_mutex_unlock(&LOCK_alarm);
@@ -677,7 +677,7 @@ void init_thr_alarm(uint max_alarm)
void thr_alarm_info(ALARM_INFO *info)
{
- bzero((char*) info, sizeof(*info));
+ memset(info, 0, sizeof(*info));
}
void resize_thr_alarm(uint max_alarms)
=== modified file 'mysys/thr_lock.c'
--- a/mysys/thr_lock.c 2011-01-21 10:50:31 +0000
+++ b/mysys/thr_lock.c 2011-05-26 15:20:09 +0000
@@ -320,7 +320,8 @@ static void check_locks(THR_LOCK *lock,
void thr_lock_init(THR_LOCK *lock)
{
DBUG_ENTER("thr_lock_init");
- bzero((char*) lock,sizeof(*lock));
+ memset(lock, 0, sizeof(*lock));
+
mysql_mutex_init(key_THR_LOCK_mutex, &lock->mutex, MY_MUTEX_INIT_FAST);
lock->read.last= &lock->read.data;
lock->read_wait.last= &lock->read_wait.data;
=== modified file 'mysys/thr_mutex.c'
--- a/mysys/thr_mutex.c 2011-01-11 09:09:21 +0000
+++ b/mysys/thr_mutex.c 2011-05-26 15:20:09 +0000
@@ -57,7 +57,7 @@ int safe_mutex_init(safe_mutex_t *mp,
const char *file,
uint line)
{
- bzero((char*) mp,sizeof(*mp));
+ memset(mp, 0, sizeof(*mp));
pthread_mutex_init(&mp->global,MY_MUTEX_INIT_ERRCHK);
pthread_mutex_init(&mp->mutex,attr);
/* Mark that mutex is initialized */
=== modified file 'mysys/tree.c'
--- a/mysys/tree.c 2011-03-09 20:54:55 +0000
+++ b/mysys/tree.c 2011-05-26 15:20:09 +0000
@@ -93,7 +93,7 @@ void init_tree(TREE *tree, ulong default
if (default_alloc_size < DEFAULT_ALLOC_SIZE)
default_alloc_size= DEFAULT_ALLOC_SIZE;
default_alloc_size= MY_ALIGN(default_alloc_size, DEFAULT_ALIGN_SIZE);
- bzero((uchar*) &tree->null_element,sizeof(tree->null_element));
+ memset(&tree->null_element, 0, sizeof(tree->null_element));
tree->root= &tree->null_element;
tree->compare=compare;
tree->size_of_element=size > 0 ? (uint) size : 0;
=== modified file 'mysys/waiting_threads.c'
--- a/mysys/waiting_threads.c 2010-05-19 13:50:12 +0000
+++ b/mysys/waiting_threads.c 2011-05-26 15:20:09 +0000
@@ -499,7 +499,7 @@ static void wt_resource_init(uchar *arg)
WT_RESOURCE *rc= (WT_RESOURCE*)(arg+LF_HASH_OVERHEAD);
DBUG_ENTER("wt_resource_init");
- bzero(rc, sizeof(*rc));
+ memset(rc, 0, sizeof(*rc));
rc_rwlock_init(rc);
pthread_cond_init(&rc->cond, 0);
my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5);
@@ -541,8 +541,8 @@ void wt_init()
lock, condition, and dynamic array will be intact.
*/
reshash.element_size= offsetof(WT_RESOURCE, lock);
- bzero(wt_wait_stats, sizeof(wt_wait_stats));
- bzero(wt_cycle_stats, sizeof(wt_cycle_stats));
+ memset(wt_wait_stats, 0, sizeof(wt_wait_stats));
+ memset(wt_cycle_stats, 0, sizeof(wt_cycle_stats));
wt_success_stats= 0;
{ /* initialize wt_wait_table[]. from 1 us to 1 min, log e scale */
int i;
@@ -1041,7 +1041,7 @@ retry:
WT_RESOURCE tmp;
DBUG_PRINT("wt", ("failed to find rc in hash, inserting"));
- bzero(&tmp, sizeof(tmp));
+ memset(&tmp, 0, sizeof(tmp));
tmp.id= *resid;
tmp.state= ACTIVE;
=== modified file 'regex/regexp.c'
--- a/regex/regexp.c 2001-09-13 23:54:33 +0000
+++ b/regex/regexp.c 2011-05-26 15:20:09 +0000
@@ -325,7 +325,7 @@ int excompat; /* \( \) operators like i
r = (regexp *) malloc(sizeof(regexp) + (unsigned) regsize);
if (r == (regexp *) NULL)
FAIL("out of space");
- (void) bzero(r, sizeof(regexp) + (unsigned)regsize);
+ memset(r, 0, sizeof(regexp) + (unsigned)regsize);
/* Second pass: emit code. */
regparse = exp2;
=== modified file 'regex/reginit.c'
--- a/regex/reginit.c 2011-03-09 20:54:55 +0000
+++ b/regex/reginit.c 2011-05-26 15:20:09 +0000
@@ -19,7 +19,7 @@ void my_regex_init(const CHARSET_INFO *c
{
regex_inited=1;
my_regex_enough_mem_in_stack= func;
- bzero((uchar*) &count,sizeof(count));
+ memset(&count, 0, sizeof(count));
for (i=1 ; i<= 255; i++)
{
=== modified file 'sql-common/client.c'
--- a/sql-common/client.c 2011-05-26 12:36:57 +0000
+++ b/sql-common/client.c 2011-05-26 15:20:09 +0000
@@ -1449,7 +1449,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT
free_rows(data); /* Free old data */
DBUG_RETURN(0);
}
- bzero((char*) field, (uint) sizeof(MYSQL_FIELD)*fields);
+ memset(field, 0, sizeof(MYSQL_FIELD)*fields);
if (server_capabilities & CLIENT_PROTOCOL_41)
{
/* server is 4.1, and returns the new field result format */
@@ -1712,7 +1712,7 @@ mysql_init(MYSQL *mysql)
mysql->free_me=1;
}
else
- bzero((char*) (mysql), sizeof(*(mysql)));
+ memset(mysql, 0, sizeof(*(mysql)));
mysql->options.connect_timeout= CONNECT_TIMEOUT;
mysql->charset=default_client_charset_info;
strmov(mysql->net.sqlstate, not_error_sqlstate);
@@ -2498,7 +2498,7 @@ static int send_client_reply_packet(MCPV
int4store(buff,mysql->client_flag);
int4store(buff+4, net->max_packet_size);
buff[8]= (char) mysql->charset->number;
- bzero(buff+9, 32-9);
+ memset(buff+9, 0, 32-9);
end= buff+32;
}
else
@@ -2733,7 +2733,7 @@ static int client_mpvio_write_packet(str
*/
void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info)
{
- bzero(info, sizeof(*info));
+ memset(info, 0, sizeof(*info));
switch (vio->type) {
case VIO_TYPE_TCPIP:
info->protocol= MYSQL_VIO_TCP;
@@ -3102,7 +3102,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
host_info= (char*) ER(CR_LOCALHOST_CONNECTION);
DBUG_PRINT("info", ("Using UNIX sock '%s'", unix_socket));
- bzero((char*) &UNIXaddr, sizeof(UNIXaddr));
+ memset(&UNIXaddr, 0, sizeof(UNIXaddr));
UNIXaddr.sun_family= AF_UNIX;
strmake(UNIXaddr.sun_path, unix_socket, sizeof(UNIXaddr.sun_path)-1);
@@ -3615,7 +3615,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
if (mysql_set_character_set(&tmp_mysql, mysql->charset->csname))
{
DBUG_PRINT("error", ("mysql_set_character_set() failed"));
- bzero((char*) &tmp_mysql.options,sizeof(tmp_mysql.options));
+ memset(&tmp_mysql.options, 0, sizeof(tmp_mysql.options));
mysql_close(&tmp_mysql);
mysql->net.last_errno= tmp_mysql.net.last_errno;
strmov(mysql->net.last_error, tmp_mysql.net.last_error);
@@ -3632,7 +3632,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
mysql->stmts= 0;
/* Don't free options as these are now used in tmp_mysql */
- bzero((char*) &mysql->options,sizeof(mysql->options));
+ memset(&mysql->options, 0, sizeof(mysql->options));
mysql->free_me=0;
mysql_close(mysql);
*mysql=tmp_mysql;
@@ -3705,7 +3705,7 @@ static void mysql_close_free_options(MYS
my_free(mysql->options.extension->default_auth);
my_free(mysql->options.extension);
}
- bzero((char*) &mysql->options,sizeof(mysql->options));
+ memset(&mysql->options, 0, sizeof(mysql->options));
DBUG_VOID_RETURN;
}
@@ -3970,7 +3970,7 @@ MYSQL_RES * STDCALL mysql_store_result(M
result->fields= mysql->fields;
result->field_alloc= mysql->field_alloc;
result->field_count= mysql->field_count;
- /* The rest of result members is bzeroed in malloc */
+ /* The rest of result members is zerofilled in my_malloc */
mysql->fields=0; /* fields is now in result */
clear_alloc_root(&mysql->field_alloc);
/* just in case this was mistakenly called after mysql_stmt_execute() */
=== modified file 'sql-common/client_plugin.c'
--- a/sql-common/client_plugin.c 2011-04-29 08:37:43 +0000
+++ b/sql-common/client_plugin.c 2011-05-26 15:20:09 +0000
@@ -232,12 +232,12 @@ int mysql_client_plugin_init()
if (initialized)
return 0;
- bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */
+ memset(&mysql, 0, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */
pthread_mutex_init(&LOCK_load_client_plugin, MY_MUTEX_INIT_SLOW);
init_alloc_root(&mem_root, 128, 128);
- bzero(&plugin_list, sizeof(plugin_list));
+ memset(&plugin_list, 0, sizeof(plugin_list));
initialized= 1;
@@ -275,7 +275,7 @@ void mysql_client_plugin_deinit()
dlclose(p->dlhandle);
}
- bzero(&plugin_list, sizeof(plugin_list));
+ memset(&plugin_list, 0, sizeof(plugin_list));
initialized= 0;
free_root(&mem_root, MYF(0));
pthread_mutex_destroy(&LOCK_load_client_plugin);
=== modified file 'sql-common/my_time.c'
--- a/sql-common/my_time.c 2011-04-27 07:46:23 +0000
+++ b/sql-common/my_time.c 2011-05-26 15:20:09 +0000
@@ -451,7 +451,7 @@ str_to_datetime(const char *str, uint le
DBUG_RETURN(l_time->time_type);
err:
- bzero((char*) l_time, sizeof(*l_time));
+ memset(l_time, 0, sizeof(*l_time));
DBUG_RETURN(MYSQL_TIMESTAMP_ERROR);
}
@@ -575,10 +575,10 @@ my_bool str_to_time(const char *str, uin
{
bmove_upp((uchar*) (date+4), (uchar*) (date+state),
sizeof(long)*(state-1));
- bzero((uchar*) date, sizeof(long)*(4-state));
+ memset(date, 0, sizeof(long)*(4-state));
}
else
- bzero((uchar*) (date+state), sizeof(long)*(4-state));
+ memset((date+state), 0, sizeof(long)*(4-state));
}
fractional:
@@ -1004,7 +1004,7 @@ my_system_gmt_sec(const MYSQL_TIME *t_sr
void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type)
{
- bzero((void*) tm, sizeof(*tm));
+ memset(tm, 0, sizeof(*tm));
tm->time_type= time_type;
}
@@ -1106,7 +1106,7 @@ longlong number_to_datetime(longlong nr,
long part1,part2;
*was_cut= 0;
- bzero((char*) time_res, sizeof(*time_res));
+ memset(time_res, 0, sizeof(*time_res));
time_res->time_type=MYSQL_TIMESTAMP_DATE;
if (nr == LL(0) || nr >= LL(10000101000000))
=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc 2011-05-26 11:18:45 +0000
+++ b/sql/binlog.cc 2011-05-26 15:20:09 +0000
@@ -1611,9 +1611,9 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_
before main().
*/
index_file_name[0] = 0;
- bzero((char*) &index_file, sizeof(index_file));
- bzero((char*) &purge_index_file, sizeof(purge_index_file));
- bzero((char*) &crash_safe_index_file, sizeof(crash_safe_index_file));
+ memset(&index_file, 0, sizeof(index_file));
+ memset(&purge_index_file, 0, sizeof(purge_index_file));
+ memset(&crash_safe_index_file, 0, sizeof(crash_safe_index_file));
}
/* this is called only once */
@@ -2510,7 +2510,7 @@ int MYSQL_BIN_LOG::close_crash_safe_inde
end_io_cache(&crash_safe_index_file);
error= my_close(crash_safe_index_file.file, MYF(0));
}
- bzero((char*) &crash_safe_index_file, sizeof(crash_safe_index_file));
+ memset(&crash_safe_index_file, 0, sizeof(crash_safe_index_file));
DBUG_RETURN(error);
}
@@ -2872,7 +2872,7 @@ int MYSQL_BIN_LOG::close_purge_index_fil
error= my_close(purge_index_file.file, MYF(0));
}
my_delete(purge_index_file_name, MYF(0));
- bzero((char*) &purge_index_file, sizeof(purge_index_file));
+ memset(&purge_index_file, 0, sizeof(purge_index_file));
DBUG_RETURN(error);
}
=== modified file 'sql/debug_sync.cc'
--- a/sql/debug_sync.cc 2011-05-04 09:54:04 +0000
+++ b/sql/debug_sync.cc 2011-05-26 15:20:09 +0000
@@ -1008,7 +1008,7 @@ static st_debug_sync_action *debug_sync_
ds_control->ds_action= (st_debug_sync_action*) new_action;
ds_control->ds_allocated= new_alloc;
/* Clear memory as we do not run string constructors here. */
- bzero((uchar*) (ds_control->ds_action + dsp_idx),
+ memset((ds_control->ds_action + dsp_idx), 0,
(new_alloc - dsp_idx) * sizeof(st_debug_sync_action));
}
DBUG_PRINT("debug_sync", ("added action idx: %u", dsp_idx));
@@ -1395,7 +1395,7 @@ static bool debug_sync_eval_action(THD *
/*
Now check for actions that define a new action.
- Initialize action. Do not use bzero(). Strings may have malloced.
+ Initialize action. Do not use memset(). Strings may have malloced.
*/
action->activation_count= 0;
action->hit_limit= 0;
=== modified file 'sql/des_key_file.cc'
--- a/sql/des_key_file.cc 2010-07-02 02:58:51 +0000
+++ b/sql/des_key_file.cc 2011-05-26 15:20:09 +0000
@@ -52,7 +52,7 @@ load_des_key_file(const char *file_name)
init_io_cache(&io, file, IO_SIZE*2, READ_CACHE, 0, 0, MYF(MY_WME)))
goto error;
- bzero((char*) des_keyschedule,sizeof(struct st_des_keyschedule) * 10);
+ memset(des_keyschedule, 0, sizeof(struct st_des_keyschedule) * 10);
des_default_key=15; // Impossible key
for (;;)
{
@@ -76,7 +76,7 @@ load_des_key_file(const char *file_name)
if (start != end)
{
DES_cblock ivec;
- bzero((char*) &ivec,sizeof(ivec));
+ memset(&ivec, 0, sizeof(ivec));
// We make good 24-byte (168 bit) key from given plaintext key with MD5
EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL,
(uchar *) start, (int) (end-start),1,
=== modified file 'sql/event_data_objects.cc'
--- a/sql/event_data_objects.cc 2011-03-09 20:54:55 +0000
+++ b/sql/event_data_objects.cc 2011-05-26 15:20:09 +0000
@@ -753,7 +753,7 @@ bool get_next_time(const Time_zone *time
}
INTERVAL interval;
- bzero(&interval, sizeof(interval));
+ memset(&interval, 0, sizeof(interval));
my_time_t next_time= 0;
if (seconds)
=== modified file 'sql/field.cc'
--- a/sql/field.cc 2011-05-21 08:25:33 +0000
+++ b/sql/field.cc 2011-05-26 15:20:09 +0000
@@ -1124,7 +1124,7 @@ void Field_num::prepend_zeros(String *va
bmove_upp((uchar*) value->ptr()+field_length,
(uchar*) value->ptr()+value->length(),
value->length());
- bfill((uchar*) value->ptr(),diff,'0');
+ memset(const_cast<char*>(value->ptr()), '0', diff);
value->length(field_length);
(void) value->c_ptr_quick(); // Avoid warnings in purify
}
@@ -1885,14 +1885,14 @@ void Field_decimal::overflow(bool negati
*/
uint whole_part=field_length- (dec ? dec+2 : 1);
// Fill with spaces up to the first digit
- bfill(to, whole_part, ' ');
+ memset(to, ' ', whole_part);
to+= whole_part;
len-= whole_part;
// The main code will also handle the 0 before the decimal point
}
}
}
- bfill(to, len, filler);
+ memset(to, filler, len);
if (dec)
ptr[field_length-dec-1]='.';
return;
@@ -2335,7 +2335,7 @@ int Field_decimal::store(longlong nr, bo
if (dec)
{
to[length]='.';
- bfill(to+length+1,dec,'0');
+ memset(to + length + 1, '0', dec);
}
return 0;
}
@@ -4263,7 +4263,7 @@ void Field_float::sort_string(uchar *to,
if (nr == (float) 0.0)
{ /* Change to zero string */
tmp[0]=(uchar) 128;
- bzero((char*) tmp+1,sizeof(nr)-1);
+ memset(tmp+1, 0, sizeof(nr)-1);
}
else
{
@@ -4961,7 +4961,7 @@ bool Field_timestamp::get_date(MYSQL_TIM
{ /* Zero time is "000000" */
if (fuzzydate & TIME_NO_ZERO_DATE)
return 1;
- bzero((char*) ltime,sizeof(*ltime));
+ memset(ltime, 0, sizeof(*ltime));
}
else
{
@@ -5578,7 +5578,7 @@ String *Field_date::val_str(String *val_
bool Field_date::get_time(MYSQL_TIME *ltime)
{
- bzero((char *)ltime, sizeof(MYSQL_TIME));
+ memset(ltime, 0, sizeof(MYSQL_TIME));
return 0;
}
@@ -7132,7 +7132,7 @@ uint Field_varstring::get_key_image(ucha
Must clear this as we do a memcmp in opt_range.cc to detect
identical keys
*/
- bzero(buff+HA_KEY_BLOB_LENGTH+f_length, (length-f_length));
+ memset(buff+HA_KEY_BLOB_LENGTH+f_length, 0, (length-f_length));
}
return HA_KEY_BLOB_LENGTH+f_length;
}
@@ -7364,7 +7364,7 @@ int Field_blob::store(const char *from,u
if (!length)
{
- bzero(ptr,Field_blob::pack_length());
+ memset(ptr, 0, Field_blob::pack_length());
return 0;
}
@@ -7432,7 +7432,7 @@ int Field_blob::store(const char *from,u
oom_error:
/* Fatal OOM error */
- bzero(ptr,Field_blob::pack_length());
+ memset(ptr, 0, Field_blob::pack_length());
return -1;
}
@@ -7575,13 +7575,13 @@ uint Field_blob::get_key_image(uchar *bu
if (blob_length < SRID_SIZE)
{
- bzero(buff, image_length);
+ memset(buff, 0, image_length);
return image_length;
}
get_ptr(&blob);
gobj= Geometry::construct(&buffer, (char*) blob, blob_length);
if (!gobj || gobj->get_mbr(&mbr, &dummy))
- bzero(buff, image_length);
+ memset(buff, 0, image_length);
else
{
float8store(buff, mbr.xmin);
@@ -7605,7 +7605,7 @@ uint Field_blob::get_key_image(uchar *bu
Must clear this as we do a memcmp in opt_range.cc to detect
identical keys
*/
- bzero(buff+HA_KEY_BLOB_LENGTH+blob_length, (length-blob_length));
+ memset(buff+HA_KEY_BLOB_LENGTH+blob_length, 0, (length-blob_length));
length=(uint) blob_length;
}
int2store(buff,length);
@@ -7676,7 +7676,7 @@ void Field_blob::sort_string(uchar *to,u
uint blob_length=get_length();
if (!blob_length)
- bzero(to,length);
+ memset(to, 0, length);
else
{
if (field_charset == &my_charset_bin)
@@ -7890,7 +7890,7 @@ int Field_geom::store_decimal(const my_d
int Field_geom::store(const char *from, uint length, const CHARSET_INFO *cs)
{
if (!length)
- bzero(ptr, Field_blob::pack_length());
+ memset(ptr, 0, Field_blob::pack_length());
else
{
if (from == Geometry::bad_geometry_data.ptr())
@@ -7914,7 +7914,7 @@ int Field_geom::store(const char *from,
return 0;
err:
- bzero(ptr, Field_blob::pack_length());
+ memset(ptr, 0, Field_blob::pack_length());
my_message(ER_CANT_CREATE_GEOMETRY_OBJECT,
ER(ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0));
return -1;
@@ -8638,7 +8638,7 @@ int Field_bit::store(const char *from, u
{
if (bit_len)
clr_rec_bits(bit_ptr, bit_ofs, bit_len);
- bzero(ptr, delta);
+ memset(ptr, 0, delta);
memcpy(ptr + delta, from, length);
}
else if (delta == 0)
@@ -9006,7 +9006,7 @@ Field_bit::unpack(uchar *to, const uchar
*/
uint new_len= (field_length + 7) / 8;
char *value= (char *)my_alloca(new_len);
- bzero(value, new_len);
+ memset(value, 0, new_len);
uint len= from_len + ((from_bit_len > 0) ? 1 : 0);
memcpy(value + (new_len - len), from, len);
/*
@@ -9073,7 +9073,7 @@ int Field_bit_as_char::store(const char
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
return 1;
}
- bzero(ptr, delta);
+ memset(ptr, 0, delta);
memcpy(ptr + delta, from, length);
return 0;
}
=== modified file 'sql/field.h'
--- a/sql/field.h 2011-03-28 08:51:35 +0000
+++ b/sql/field.h 2011-05-26 15:20:09 +0000
@@ -225,7 +225,7 @@ public:
return pack_length();
};
- virtual int reset(void) { bzero(ptr,pack_length()); return 0; }
+ virtual int reset(void) { memset(ptr, 0, pack_length()); return 0; }
virtual void reset_fields() {}
virtual void set_default()
{
@@ -1257,7 +1257,7 @@ public:
int store(const char *to,uint length, const CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
- int reset(void) { bzero(ptr,sizeof(float)); return 0; }
+ int reset(void) { memset(ptr, 0, sizeof(float)); return 0; }
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
@@ -1305,7 +1305,7 @@ public:
int store(const char *to,uint length, const CHARSET_INFO *charset);
int store(double nr);
int store(longlong nr, bool unsigned_val);
- int reset(void) { bzero(ptr,sizeof(double)); return 0; }
+ int reset(void) { memset(ptr, 0, sizeof(double)); return 0; }
double val_real(void);
longlong val_int(void);
String *val_str(String*,String *);
@@ -1823,7 +1823,7 @@ public:
enum ha_base_keytype key_type() const;
uint row_pack_length() { return field_length; }
bool zero_pack() const { return 0; }
- int reset(void) { bzero(ptr,field_length+length_bytes); return 0; }
+ int reset(void) { memset(ptr, 0, field_length+length_bytes); return 0; }
uint32 pack_length() const { return (uint32) field_length+length_bytes; }
uint32 key_length() const { return (uint32) field_length; }
uint32 sort_length() const
@@ -1962,8 +1962,8 @@ public:
{
return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
}
- int reset(void) { bzero(ptr, packlength+sizeof(uchar*)); return 0; }
- void reset_fields() { bzero((uchar*) &value,sizeof(value)); }
+ int reset(void) { memset(ptr, 0, packlength+sizeof(uchar*)); return 0; }
+ void reset_fields() { memset(&value, 0, sizeof(value)); }
uint32 get_field_buffer_size(void) { return value.alloced_length(); }
#ifndef WORDS_BIGENDIAN
static
@@ -2049,7 +2049,7 @@ public:
uint packed_col_length(const uchar *col_ptr, uint length);
uint max_packed_col_length(uint max_length);
void free() { value.free(); }
- inline void clear_temporary() { bzero((uchar*) &value,sizeof(value)); }
+ inline void clear_temporary() { memset(&value, 0, sizeof(value)); }
friend int field_conv(Field *to,Field *from);
bool has_charset(void) const
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
@@ -2227,7 +2227,7 @@ public:
uint32 max_display_length() { return field_length; }
Item_result result_type () const { return INT_RESULT; }
int reset(void) {
- bzero(ptr, bytes_in_rec);
+ memset(ptr, 0, bytes_in_rec);
if (bit_ptr && (bit_len > 0)) // reset odd bits among null bits
clr_rec_bits(bit_ptr, bit_ofs, bit_len);
return 0;
=== modified file 'sql/field_conv.cc'
--- a/sql/field_conv.cc 2011-03-11 09:35:38 +0000
+++ b/sql/field_conv.cc 2011-05-26 15:20:09 +0000
@@ -86,7 +86,7 @@ static void do_field_to_null_str(Copy_fi
{
if (*copy->from_null_ptr & copy->from_bit)
{
- bzero(copy->to_ptr,copy->from_length);
+ memset(copy->to_ptr, 0, copy->from_length);
copy->to_null_ptr[0]=1; // Always bit 1
}
else
@@ -102,7 +102,7 @@ static void do_outer_field_to_null_str(C
if (*copy->null_row ||
(copy->from_null_ptr && (*copy->from_null_ptr & copy->from_bit)))
{
- bzero(copy->to_ptr,copy->from_length);
+ memset(copy->to_ptr, 0, copy->from_length);
copy->to_null_ptr[0]=1; // Always bit 1
}
else
=== modified file 'sql/filesort.cc'
--- a/sql/filesort.cc 2011-05-02 13:22:25 +0000
+++ b/sql/filesort.cc 2011-05-26 15:20:09 +0000
@@ -833,9 +833,9 @@ static void make_sortkey(register Sort_p
if (field->is_null())
{
if (sort_field->reverse)
- bfill(to,sort_field->length+1,(char) 255);
+ memset(to, 255, sort_field->length+1);
else
- bzero((char*) to,sort_field->length+1);
+ memset(to, 0, sort_field->length+1);
to+= sort_field->length+1;
continue;
}
@@ -864,7 +864,7 @@ static void make_sortkey(register Sort_p
if (!res)
{
if (maybe_null)
- bzero((char*) to-1,sort_field->length+1);
+ memset(to-1, 0, sort_field->length+1);
else
{
/* purecov: begin deadcode */
@@ -876,7 +876,7 @@ static void make_sortkey(register Sort_p
DBUG_ASSERT(0);
DBUG_PRINT("warning",
("Got null on something that shouldn't be null"));
- bzero((char*) to,sort_field->length); // Avoid crash
+ memset(to, 0, sort_field->length); // Avoid crash
/* purecov: end */
}
break;
@@ -928,12 +928,12 @@ static void make_sortkey(register Sort_p
if (item->null_value)
{
if (maybe_null)
- bzero((char*) to-1,sort_field->length+1);
+ memset(to-1, 0, sort_field->length+1);
else
{
DBUG_PRINT("warning",
("Got null on something that shouldn't be null"));
- bzero((char*) to,sort_field->length);
+ memset(to, 0, sort_field->length);
}
break;
}
@@ -968,7 +968,7 @@ static void make_sortkey(register Sort_p
{
if (item->null_value)
{
- bzero((char*)to, sort_field->length+1);
+ memset(to, 0, sort_field->length+1);
to++;
break;
}
@@ -986,7 +986,7 @@ static void make_sortkey(register Sort_p
{
if (item->null_value)
{
- bzero((char*) to,sort_field->length+1);
+ memset(to, 0, sort_field->length+1);
to++;
break;
}
@@ -1028,7 +1028,7 @@ static void make_sortkey(register Sort_p
SORT_ADDON_FIELD *addonf= param->addon_field;
uchar *nulls= to;
DBUG_ASSERT(addonf != 0);
- bzero((char *) nulls, addonf->offset);
+ memset(nulls, 0, addonf->offset);
to+= addonf->offset;
for ( ; (field= addonf->field) ; addonf++)
{
@@ -1036,7 +1036,7 @@ static void make_sortkey(register Sort_p
{
nulls[addonf->null_offset]|= addonf->null_bit;
#ifdef HAVE_purify
- bzero(to, addonf->length);
+ memset(to, 0, addonf->length);
#endif
}
else
@@ -1046,7 +1046,7 @@ static void make_sortkey(register Sort_p
uint length= (uint) ((to + addonf->length) - end);
DBUG_ASSERT((int) length >= 0);
if (length)
- bzero(end, length);
+ memset(end, 0, length);
#else
(void) field->pack(to, field->ptr);
#endif
@@ -1881,7 +1881,7 @@ void change_double_for_sort(double nr,uc
if (nr == 0.0)
{ /* Change to zero string */
tmp[0]=(uchar) 128;
- bzero((char*) tmp+1,sizeof(nr)-1);
+ memset(tmp+1, 0, sizeof(nr)-1);
}
else
{
=== modified file 'sql/gcalc_tools.h'
--- a/sql/gcalc_tools.h 2010-10-14 05:26:25 +0000
+++ b/sql/gcalc_tools.h 2011-05-26 15:20:09 +0000
@@ -96,7 +96,7 @@ public:
cur_func= function_buffer.ptr();
return count_internal();
}
- void clear_state() { bzero(i_states, n_shapes * sizeof(int)); }
+ void clear_state() { memset(i_states, 0, n_shapes * sizeof(int)); }
void reset();
int find_function(Gcalc_scan_iterator &scan_it);
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2011-05-26 08:39:40 +0000
+++ b/sql/ha_ndbcluster.cc 2011-05-26 15:20:09 +0000
@@ -672,7 +672,7 @@ int ha_ndbcluster::ndb_err(NdbTransactio
m_table->setStatusInvalid();
/* Close other open handlers not used by any thread */
TABLE_LIST table_list;
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
table_list.db= m_dbname;
table_list.alias= table_list.table_name= m_tabname;
close_cached_tables(thd, &table_list, FALSE, LONG_TIMEOUT);
@@ -4253,7 +4253,7 @@ void ha_ndbcluster::get_dynamic_partitio
implement ndb function which retrives the statistics
about ndb partitions.
*/
- bzero((char*) stat_info, sizeof(PARTITION_STATS));
+ memset(stat_info, 0, sizeof(PARTITION_STATS));
return;
}
@@ -8434,7 +8434,7 @@ int handle_trailing_share(NDB_SHARE *sha
mysql_mutex_unlock(&ndbcluster_mutex);
TABLE_LIST table_list;
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
table_list.db= share->db;
table_list.alias= table_list.table_name= share->table_name;
close_cached_tables(thd, &table_list, FALSE, LONG_TIMEOUT);
@@ -8730,8 +8730,8 @@ void ndbcluster_real_free_share(NDB_SHAR
// (*share)->table_share->mem_root is freed by free_table_share
free_table_share((*share)->table_share);
#ifndef DBUG_OFF
- bzero((uchar*)(*share)->table_share, sizeof(*(*share)->table_share));
- bzero((uchar*)(*share)->table, sizeof(*(*share)->table));
+ memset((*share)->table_share, 0, sizeof(*(*share)->table_share));
+ memset((*share)->table, 0, sizeof(*(*share)->table));
(*share)->table_share= 0;
(*share)->table= 0;
#endif
=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc 2011-05-21 08:25:33 +0000
+++ b/sql/ha_ndbcluster_binlog.cc 2011-05-26 15:20:09 +0000
@@ -264,7 +264,7 @@ static void run_query(THD *thd, char *bu
DBUG_ASSERT(sizeof(save_thd_options) == sizeof(thd->variables.option_bits));
NET save_thd_net= thd->net;
- bzero((char*) &thd->net, sizeof(NET));
+ memset(&thd->net, 0, sizeof(NET));
thd->set_query(buf, (uint) (end - buf));
thd->variables.pseudo_thread_id= thread_id;
thd->transaction.stmt.reset_unsafe_rollback_flags();
@@ -1357,7 +1357,7 @@ int ndbcluster_log_schema_op(THD *thd, N
MY_BITMAP schema_subscribers;
uint32 bitbuf[sizeof(ndb_schema_object->slock)/4];
char bitbuf_e[sizeof(bitbuf)];
- bzero(bitbuf_e, sizeof(bitbuf_e));
+ memset(bitbuf_e, 0, sizeof(bitbuf_e));
{
int i, updated= 0;
int no_storage_nodes= g_ndb_cluster_connection->no_db_nodes();
@@ -1734,7 +1734,7 @@ ndb_handle_schema_change(THD *thd, Ndb *
ndbcluster_binlog_close_table(thd, share);
TABLE_LIST table_list;
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
table_list.db= (char *)dbname;
table_list.alias= table_list.table_name= (char *)tabname;
close_cached_tables(thd, &table_list, FALSE, LONG_TIMEOUT);
@@ -1838,7 +1838,7 @@ ndb_handle_schema_change(THD *thd, Ndb *
if (do_close_cached_tables)
{
TABLE_LIST table_list;
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
table_list.db= (char *)dbname;
table_list.alias= table_list.table_name= (char *)tabname;
close_cached_tables(thd, &table_list, FALSE, LONG_TIMEOUT);
@@ -1959,7 +1959,7 @@ ndb_binlog_thread_handle_schema_event(TH
ndbtab_g.invalidate();
}
TABLE_LIST table_list;
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
table_list.db= schema->db;
table_list.alias= table_list.table_name= schema->name;
close_cached_tables(thd, &table_list, FALSE, LONG_TIMEOUT);
@@ -2231,7 +2231,7 @@ ndb_binlog_thread_handle_schema_event_po
ndbtab_g.invalidate();
}
TABLE_LIST table_list;
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
table_list.db= schema->db;
table_list.alias= table_list.table_name= schema->name;
close_cached_tables(thd, &table_list, FALSE, LONG_TIMEOUT);
@@ -4031,7 +4031,7 @@ restart:
setReportThreshEventGCISlip(opt_ndb_report_thresh_binlog_epoch_slip);
i_ndb->setReportThreshEventFreeMem(opt_ndb_report_thresh_binlog_mem_usage);
- bzero((char*) &row, sizeof(row));
+ memset(&row, 0, sizeof(row));
thd->variables.character_set_client= &my_charset_latin1;
injector::transaction trans;
// pass table map before epoch
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2011-05-21 08:25:33 +0000
+++ b/sql/ha_partition.cc 2011-05-26 15:20:09 +0000
@@ -2337,7 +2337,7 @@ bool ha_partition::create_handlers(MEM_R
if (!(m_file= (handler **) alloc_root(mem_root, alloc_len)))
DBUG_RETURN(TRUE);
m_file_tot_parts= m_tot_parts;
- bzero((char*) m_file, alloc_len);
+ memset(m_file, 0, alloc_len);
for (i= 0; i < m_tot_parts; i++)
{
handlerton *hton= plugin_data(m_engine_array[i], handlerton*);
@@ -2389,7 +2389,7 @@ bool ha_partition::new_handlers_from_par
goto error_end;
}
m_file_tot_parts= m_tot_parts;
- bzero((char*) m_file, alloc_len);
+ memset(m_file, 0, alloc_len);
DBUG_ASSERT(m_part_info->num_parts > 0);
i= 0;
@@ -2928,7 +2928,7 @@ int ha_partition::open(const char *name,
DBUG_PRINT("info", ("table_share->ha_part_data 0x%p",
table_share->ha_part_data));
/* zeros both auto_increment variables and partition_name_hash.records */
- bzero(table_share->ha_part_data, sizeof(HA_DATA_PARTITION));
+ memset(table_share->ha_part_data, 0, sizeof(HA_DATA_PARTITION));
table_share->ha_part_data_destroy= ha_data_partition_destroy;
mysql_mutex_init(key_PARTITION_LOCK_auto_inc,
&table_share->ha_part_data->LOCK_auto_inc,
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2011-05-26 08:39:40 +0000
+++ b/sql/handler.cc 2011-05-26 15:20:09 +0000
@@ -2034,8 +2034,8 @@ int ha_delete_table(THD *thd, handlerton
TABLE_SHARE dummy_share;
DBUG_ENTER("ha_delete_table");
- bzero((char*) &dummy_table, sizeof(dummy_table));
- bzero((char*) &dummy_share, sizeof(dummy_share));
+ memset(&dummy_table, 0, sizeof(dummy_table));
+ memset(&dummy_share, 0, sizeof(dummy_share));
dummy_table.s= &dummy_share;
/* DB_TYPE_UNKNOWN is used in ALTER TABLE when renaming only .frm files */
@@ -3954,7 +3954,7 @@ int ha_create_table_from_engine(THD* thd
DBUG_ENTER("ha_create_table_from_engine");
DBUG_PRINT("enter", ("name '%s'.'%s'", db, name));
- bzero((uchar*) &create_info,sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
if ((error= ha_discover(thd, db, name, &frmblob, &frmlen)))
{
/* Table could not be discovered and thus not created */
=== modified file 'sql/hash_filo.h'
--- a/sql/hash_filo.h 2011-03-22 11:44:40 +0000
+++ b/sql/hash_filo.h 2011-05-26 15:20:09 +0000
@@ -23,7 +23,7 @@
#define HASH_FILO_H
#include "hash.h" /* my_hash_get_key, my_hash_free_key, HASH */
-#include "m_string.h" /* bzero */
+#include "m_string.h"
#include "mysqld.h" /* key_hash_filo_lock */
class hash_filo_element
@@ -55,7 +55,7 @@ public:
get_key(get_key_arg), free_element(free_element_arg),init(0),
hash_charset(hash_charset_arg)
{
- bzero((char*) &cache,sizeof(cache));
+ memset(&cache, 0, sizeof(cache));
}
~hash_filo()
=== modified file 'sql/item.cc'
--- a/sql/item.cc 2011-05-26 05:50:01 +0000
+++ b/sql/item.cc 2011-05-26 15:20:09 +0000
@@ -1025,7 +1025,7 @@ bool Item::get_date(MYSQL_TIME *ltime,ui
return 0;
err:
- bzero((char*) ltime,sizeof(*ltime));
+ memset(ltime, 0, sizeof(*ltime));
return 1;
}
@@ -1042,7 +1042,7 @@ bool Item::get_time(MYSQL_TIME *ltime)
if (!(res=val_str_ascii(&tmp)) ||
str_to_time_with_warn(res->charset(), res->ptr(), res->length(), ltime))
{
- bzero((char*) ltime,sizeof(*ltime));
+ memset(ltime, 0, sizeof(*ltime));
return 1;
}
return 0;
@@ -2248,7 +2248,7 @@ bool Item_field::get_date(MYSQL_TIME *lt
{
if ((null_value=field->is_null()) || field->get_date(ltime,fuzzydate))
{
- bzero((char*) ltime,sizeof(*ltime));
+ memset(ltime, 0, sizeof(*ltime));
return 1;
}
return 0;
@@ -2259,7 +2259,7 @@ bool Item_field::get_date_result(MYSQL_T
if ((null_value=result_field->is_null()) ||
result_field->get_date(ltime,fuzzydate))
{
- bzero((char*) ltime,sizeof(*ltime));
+ memset(ltime, 0, sizeof(*ltime));
return 1;
}
return 0;
@@ -2269,7 +2269,7 @@ bool Item_field::get_time(MYSQL_TIME *lt
{
if ((null_value=field->is_null()) || field->get_time(ltime))
{
- bzero((char*) ltime,sizeof(*ltime));
+ memset(ltime, 0, sizeof(*ltime));
return 1;
}
return 0;
=== modified file 'sql/item.h'
--- a/sql/item.h 2011-04-08 13:41:38 +0000
+++ b/sql/item.h 2011-05-26 15:20:09 +0000
@@ -3567,7 +3567,7 @@ public:
DBUG_ENTER("Item_cache_row::cleanup");
Item_cache::cleanup();
if (save_array)
- bzero(values, item_count*sizeof(Item**));
+ memset(values, 0, item_count*sizeof(Item**));
else
values= 0;
DBUG_VOID_RETURN;
=== modified file 'sql/item_cmpfunc.h'
--- a/sql/item_cmpfunc.h 2011-03-22 11:44:40 +0000
+++ b/sql/item_cmpfunc.h 2011-05-26 15:20:09 +0000
@@ -1218,7 +1218,7 @@ public:
list.push_back(else_expr_arg);
}
set_arguments(list);
- bzero(&cmp_items, sizeof(cmp_items));
+ memset(&cmp_items, 0, sizeof(cmp_items));
}
double val_real();
longlong val_int();
@@ -1275,7 +1275,7 @@ public:
:Item_func_opt_neg(list), array(0), have_null(0),
arg_types_compatible(FALSE)
{
- bzero(&cmp_items, sizeof(cmp_items));
+ memset(&cmp_items, 0, sizeof(cmp_items));
allowed_arg_cols= 0; // Fetch this value from first argument
}
longlong val_int();
=== modified file 'sql/item_inetfunc.cc'
--- a/sql/item_inetfunc.cc 2011-05-03 18:06:21 +0000
+++ b/sql/item_inetfunc.cc 2011-05-26 15:20:09 +0000
@@ -358,7 +358,7 @@ static bool str_to_ipv6(const char *str,
return false;
}
- bzero(ipv6_address, IN6_ADDR_SIZE);
+ memset(ipv6_address, 0, IN6_ADDR_SIZE);
const char *p= str;
=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc 2011-05-25 14:19:53 +0000
+++ b/sql/item_strfunc.cc 2011-05-26 15:20:09 +0000
@@ -763,7 +763,7 @@ String *Item_func_des_encrypt::val_str(S
key_number=127; // User key string
/* We make good 24-byte (168 bit) key from given plaintext key with MD5 */
- bzero((char*) &ivec,sizeof(ivec));
+ memset(&ivec, 0, sizeof(ivec));
EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL,
(uchar*) keystr->ptr(), (int) keystr->length(),
1, (uchar*) &keyblock,ivec);
@@ -795,7 +795,7 @@ String *Item_func_des_encrypt::val_str(S
tmp_value.set_charset(&my_charset_bin);
tmp_value[0]=(char) (128 | key_number);
// Real encryption
- bzero((char*) &ivec,sizeof(ivec));
+ memset(&ivec, 0, sizeof(ivec));
DES_ede3_cbc_encrypt((const uchar*) (tmp_arg.ptr()),
(uchar*) (tmp_value.ptr()+1),
res_length,
@@ -855,7 +855,7 @@ String *Item_func_des_decrypt::val_str(S
if (!keystr)
goto error;
- bzero((char*) &ivec,sizeof(ivec));
+ memset(&ivec, 0, sizeof(ivec));
EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL,
(uchar*) keystr->ptr(),(int) keystr->length(),
1,(uchar*) &keyblock,ivec);
@@ -868,7 +868,7 @@ String *Item_func_des_decrypt::val_str(S
if (tmp_value.alloc(length-1))
goto error;
- bzero((char*) &ivec,sizeof(ivec));
+ memset(&ivec, 0, sizeof(ivec));
DES_ede3_cbc_encrypt((const uchar*) res->ptr()+1,
(uchar*) (tmp_value.ptr()),
length-1,
=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc 2011-04-12 10:31:30 +0000
+++ b/sql/item_sum.cc 2011-05-26 15:20:09 +0000
@@ -1843,7 +1843,7 @@ void Item_sum_variance::reset_field()
nr= args[0]->val_real(); /* sets null_value as side-effect */
if (args[0]->null_value)
- bzero(res,sizeof(double)*2+sizeof(longlong));
+ memset(res, 0, sizeof(double)*2+sizeof(longlong));
else
{
/* Serialize format is (double)m, (double)s, (longlong)count */
@@ -2231,7 +2231,7 @@ void Item_sum_avg::reset_field()
double nr= args[0]->val_real();
if (args[0]->null_value)
- bzero(res,sizeof(double)+sizeof(longlong));
+ memset(res, 0, sizeof(double)+sizeof(longlong));
else
{
longlong tmp= 1;
=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc 2011-05-18 07:07:52 +0000
+++ b/sql/item_timefunc.cc 2011-05-26 15:20:09 +0000
@@ -202,7 +202,7 @@ static bool sec_to_time(longlong seconds
{
uint sec;
- bzero((char *)ltime, sizeof(*ltime));
+ memset(ltime, 0, sizeof(*ltime));
if (seconds < 0)
{
@@ -306,7 +306,7 @@ static bool extract_date_time(DATE_TIME_
DBUG_ENTER("extract_date_time");
if (!sub_pattern_end)
- bzero((char*) l_time, sizeof(*l_time));
+ memset(l_time, 0, sizeof(*l_time));
for (; ptr != end && val != val_end; ptr++)
{
@@ -898,7 +898,7 @@ static bool get_interval_info(const char
/* Change values[0...i-1] -> values[0...count-1] */
bmove_upp((uchar*) (values+count), (uchar*) (values+i),
sizeof(*values)*i);
- bzero((uchar*) values, sizeof(*values)*(count-i));
+ memset(values, 0, sizeof(*values)*(count-i));
break;
}
}
@@ -1412,7 +1412,7 @@ bool get_interval_value(Item *args,inter
size_t UNINIT_VAR(length);
const CHARSET_INFO *cs=str_value->charset();
- bzero((char*) interval,sizeof(*interval));
+ memset(interval, 0, sizeof(*interval));
if ((int) int_type <= INTERVAL_MICROSECOND)
{
value= args->val_int();
@@ -1586,7 +1586,7 @@ bool Item_func_from_days::get_date(MYSQL
longlong value=args[0]->val_int();
if ((null_value=args[0]->null_value))
return 1;
- bzero(ltime, sizeof(MYSQL_TIME));
+ memset(ltime, 0, sizeof(MYSQL_TIME));
get_date_from_daynr((long) value, <ime->year, <ime->month, <ime->day);
if ((null_value= (fuzzy_date & TIME_NO_ZERO_DATE) &&
@@ -2597,8 +2597,8 @@ String *Item_char_typecast::val_str(Stri
str_value.copy(*res);
res= &str_value;
}
- bzero((char*) res->ptr() + res->length(),
- (uint) cast_length - res->length());
+ memset(const_cast<char*>(res->ptr() + res->length()), 0,
+ cast_length - res->length());
res->length(cast_length);
}
}
@@ -2732,7 +2732,7 @@ bool Item_date_typecast::get_date(MYSQL_
bool Item_date_typecast::get_time(MYSQL_TIME *ltime)
{
- bzero((char *)ltime, sizeof(MYSQL_TIME));
+ memset(ltime, 0, sizeof(MYSQL_TIME));
return args[0]->null_value;
}
@@ -2912,7 +2912,7 @@ MYSQL_TIME *Item_func_add_time::val_date
if (l_time1.neg != l_time2.neg)
l_sign= -l_sign;
- bzero((char *)time, sizeof(MYSQL_TIME));
+ memset(time, 0, sizeof(MYSQL_TIME));
time->neg= calc_time_diff(&l_time1, &l_time2, -l_sign,
&seconds, µseconds);
@@ -3029,7 +3029,7 @@ String *Item_func_timediff::val_str(Stri
if (l_time1.neg != l_time2.neg)
l_sign= -l_sign;
- bzero((char *)&l_time3, sizeof(l_time3));
+ memset(&l_time3, 0, sizeof(l_time3));
l_time3.neg= calc_time_diff(&l_time1, &l_time2, l_sign,
&seconds, µseconds);
@@ -3078,7 +3078,7 @@ String *Item_func_maketime::val_str(Stri
str->alloc(MAX_DATE_STRING_REP_LENGTH))))
return 0;
- bzero((char *)<ime, sizeof(ltime));
+ memset(<ime, 0, sizeof(ltime));
ltime.neg= 0;
/* Check for integer overflows */
@@ -3470,7 +3470,7 @@ bool Item_func_str_to_date::get_date(MYS
goto null_date;
null_value= 0;
- bzero((char*) ltime, sizeof(*ltime));
+ memset(ltime, 0, sizeof(*ltime));
date_time_format.format.str= (char*) format->ptr();
date_time_format.format.length= format->length();
if (extract_date_time(&date_time_format, val->ptr(), val->length(),
=== modified file 'sql/item_xmlfunc.cc'
--- a/sql/item_xmlfunc.cc 2011-05-16 11:32:07 +0000
+++ b/sql/item_xmlfunc.cc 2011-05-26 15:20:09 +0000
@@ -191,7 +191,7 @@ public:
fltend= (MY_XPATH_FLT*) (res->ptr() + res->length());
String active;
active.alloc(numnodes);
- bzero((char*) active.ptr(), numnodes);
+ memset(const_cast<char*>(active.ptr()), 0, numnodes);
for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++)
{
MY_XML_NODE *node;
@@ -580,7 +580,7 @@ String * Item_nodeset_func_union::val_no
String both_str;
both_str.alloc(num_nodes);
char *both= (char*) both_str.ptr();
- bzero((void*)both, num_nodes);
+ memset(both, 0, num_nodes);
MY_XPATH_FLT *flt;
fltbeg= (MY_XPATH_FLT*) s0->ptr();
@@ -667,7 +667,7 @@ String *Item_nodeset_func_ancestorbyname
prepare(nodeset);
active_str.alloc(numnodes);
active= (char*) active_str.ptr();
- bzero((void*)active, numnodes);
+ memset(active, 0, numnodes);
uint pos= 0;
for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++)
@@ -709,7 +709,7 @@ String *Item_nodeset_func_parentbyname::
prepare(nodeset);
active_str.alloc(numnodes);
active= (char*) active_str.ptr();
- bzero((void*)active, numnodes);
+ memset(active, 0, numnodes);
for (MY_XPATH_FLT *flt= fltbeg; flt < fltend; flt++)
{
uint j= nodebeg[flt->num].parent;
@@ -1333,7 +1333,7 @@ my_xpath_lex_init(MY_XPATH_LEX *lex,
static void
my_xpath_init(MY_XPATH *xpath)
{
- bzero((void*)xpath, sizeof(xpath[0]));
+ memset(xpath, 0, sizeof(xpath[0]));
}
=== modified file 'sql/key.cc'
--- a/sql/key.cc 2011-03-09 20:54:55 +0000
+++ b/sql/key.cc 2011-05-26 15:20:09 +0000
@@ -164,7 +164,7 @@ void key_zero_nulls(uchar *tuple, KEY *k
for (; key_part != key_part_end; key_part++)
{
if (key_part->null_bit && *tuple)
- bzero(tuple+1, key_part->store_length-1);
+ memset(tuple+1, 0, key_part->store_length-1);
tuple+= key_part->store_length;
}
}
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2011-05-26 11:18:45 +0000
+++ b/sql/log.cc 2011-05-26 15:20:09 +0000
@@ -1616,7 +1616,7 @@ MYSQL_LOG::MYSQL_LOG()
called only in main(). Doing initialization here would make it happen
before main().
*/
- bzero((char*) &log_file, sizeof(log_file));
+ memset(&log_file, 0, sizeof(log_file));
}
void MYSQL_LOG::init_pthread_objects()
@@ -2824,7 +2824,7 @@ int TC_LOG_MMAP::recover()
goto err2;
my_hash_free(&xids);
- bzero(data, (size_t)file_length);
+ memset(data, 0, (size_t)file_length);
return 0;
err2:
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2011-05-23 23:34:47 +0000
+++ b/sql/log_event.cc 2011-05-26 15:20:09 +0000
@@ -6761,7 +6761,7 @@ int Create_file_log_event::do_apply_even
int error = 1;
THD_STAGE_INFO(thd, stage_making_temp_file_create_before_load_data);
- bzero((char*)&file, sizeof(file));
+ memset(&file, 0, sizeof(file));
ext= slave_load_file_stem(fname_buf, file_id, server_id, ".info");
/* old copy may exist already */
mysql_file_delete(key_file_log_event_info, fname_buf, MYF(0));
@@ -8576,7 +8576,7 @@ Table_map_log_event::Table_map_log_event
&m_field_metadata, (m_colcnt * 2),
NULL);
- bzero(m_field_metadata, (m_colcnt * 2));
+ memset(m_field_metadata, 0, (m_colcnt * 2));
/*
Create an array for the field metadata and store it.
@@ -8594,7 +8594,7 @@ Table_map_log_event::Table_map_log_event
else
m_data_size+= m_field_metadata_size + 3;
- bzero(m_null_bits, num_null_bytes);
+ memset(m_null_bits, 0, num_null_bytes);
for (unsigned int i= 0 ; i < m_table->s->fields ; ++i)
if (m_table->field[i]->maybe_null())
m_null_bits[(i / 8)]+= 1 << (i % 8);
@@ -10604,12 +10604,12 @@ st_print_event_info::st_print_event_info
{
/*
Currently we only use static PRINT_EVENT_INFO objects, so zeroed at
- program's startup, but these explicit bzero() is for the day someone
+ program's startup, but these explicit memset() is for the day someone
creates dynamic instances.
*/
- bzero(db, sizeof(db));
- bzero(charset, sizeof(charset));
- bzero(time_zone_str, sizeof(time_zone_str));
+ memset(db, 0, sizeof(db));
+ memset(charset, 0, sizeof(charset));
+ memset(time_zone_str, 0, sizeof(time_zone_str));
delimiter[0]= ';';
delimiter[1]= 0;
myf const flags = MYF(MY_WME | MY_NABP);
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2011-05-26 11:18:45 +0000
+++ b/sql/mysqld.cc 2011-05-26 15:20:09 +0000
@@ -1787,7 +1787,7 @@ static void network_init(void)
int error;
DBUG_PRINT("general",("IP Socket is %d",mysqld_port));
- bzero(&hints, sizeof (hints));
+ memset(&hints, 0, sizeof (hints));
hints.ai_flags= AI_PASSIVE;
hints.ai_socktype= SOCK_STREAM;
hints.ai_family= AF_UNSPEC;
@@ -1883,8 +1883,8 @@ static void network_init(void)
{
strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\",
mysqld_unix_port, NullS);
- bzero((char*) &saPipeSecurity, sizeof(saPipeSecurity));
- bzero((char*) &sdPipeDescriptor, sizeof(sdPipeDescriptor));
+ memset(&saPipeSecurity, 0, sizeof(saPipeSecurity));
+ memset(&sdPipeDescriptor, 0, sizeof(sdPipeDescriptor));
if (!InitializeSecurityDescriptor(&sdPipeDescriptor,
SECURITY_DESCRIPTOR_REVISION))
{
@@ -1942,7 +1942,7 @@ static void network_init(void)
sql_perror("Can't start server : UNIX Socket "); /* purecov: inspected */
unireg_abort(1); /* purecov: inspected */
}
- bzero((char*) &UNIXaddr, sizeof(UNIXaddr));
+ memset(&UNIXaddr, 0, sizeof(UNIXaddr));
UNIXaddr.sun_family = AF_UNIX;
strmov(UNIXaddr.sun_path, mysqld_unix_port);
(void) unlink(mysqld_unix_port);
@@ -7218,8 +7218,8 @@ static int mysql_init_variables(void)
mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0;
prepared_stmt_count= 0;
mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
- bzero((uchar*) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
- bzero((char *) &global_status_var, sizeof(global_status_var));
+ memset(&mysql_tmpdir_list, 0, sizeof(mysql_tmpdir_list));
+ memset(&global_status_var, 0, sizeof(global_status_var));
opt_large_pages= 0;
opt_super_large_pages= 0;
#if defined(ENABLED_DEBUG_SYNC)
@@ -7565,7 +7565,7 @@ mysqld_get_one_option(int optid,
{
struct addrinfo *res_lst, hints;
- bzero(&hints, sizeof(struct addrinfo));
+ memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_socktype= SOCK_STREAM;
hints.ai_protocol= IPPROTO_TCP;
@@ -8132,7 +8132,7 @@ void refresh_status(THD *thd)
add_to_status(&global_status_var, &thd->status_var);
/* Reset thread's status variables */
- bzero((uchar*) &thd->status_var, sizeof(thd->status_var));
+ memset(&thd->status_var, 0, sizeof(thd->status_var));
/* Reset some global variables */
reset_status_vars();
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc 2011-05-26 08:39:40 +0000
+++ b/sql/opt_range.cc 2011-05-26 15:20:09 +0000
@@ -455,7 +455,7 @@ public:
if (maybe_null && *min_value)
{
**min_key=1;
- bzero(*min_key+1,length-1);
+ memset(*min_key+1, 0, length-1);
}
else
memcpy(*min_key,min_value,length);
@@ -473,7 +473,7 @@ public:
if (maybe_null && *max_value)
{
**max_key=1;
- bzero(*max_key+1,length-1);
+ memset(*max_key+1, 0, length-1);
}
else
memcpy(*max_key,max_value,length);
@@ -637,7 +637,7 @@ public:
SEL_TREE(enum Type type_arg) :type(type_arg) {}
SEL_TREE() :type(KEY)
{
- bzero((char*) keys,sizeof(keys));
+ memset(keys, 0, sizeof(keys));
}
SEL_TREE(SEL_TREE *arg, RANGE_OPT_PARAM *param);
/*
@@ -1203,7 +1203,7 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(T
thd->mem_root= &alloc;
}
else
- bzero((char*) &alloc,sizeof(alloc));
+ memset(&alloc, 0, sizeof(alloc));
file= head->file;
record= head->record[0];
save_read_set= head->read_set;
@@ -1284,7 +1284,7 @@ QUICK_INDEX_MERGE_SELECT::QUICK_INDEX_ME
DBUG_ENTER("QUICK_INDEX_MERGE_SELECT::QUICK_INDEX_MERGE_SELECT");
index= MAX_KEY;
head= table;
- bzero(&read_record, sizeof(read_record));
+ memset(&read_record, 0, sizeof(read_record));
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
DBUG_VOID_RETURN;
}
@@ -1348,7 +1348,7 @@ QUICK_ROR_INTERSECT_SELECT::QUICK_ROR_IN
if (!parent_alloc)
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
else
- bzero(&alloc, sizeof(MEM_ROOT));
+ memset(&alloc, 0, sizeof(MEM_ROOT));
last_rowid= (uchar*) alloc_root(parent_alloc? parent_alloc : &alloc,
head->file->ref_length);
}
@@ -1631,7 +1631,7 @@ int QUICK_ROR_UNION_SELECT::init()
FALSE , QUICK_ROR_UNION_SELECT_queue_cmp,
(void*) this))
{
- bzero(&queue, sizeof(QUEUE));
+ memset(&queue, 0, sizeof(QUEUE));
DBUG_RETURN(1);
}
@@ -9045,7 +9045,7 @@ int QUICK_RANGE_SELECT::reset()
(Now ndb stores complete row in here, instead of only the used fields
which gives us valgrind warnings in compare_record[])
*/
- bzero((char*) mrange_buff, buf_size);
+ memset(mrange_buff, 0, mrange_bufsiz);
#endif
}
@@ -10473,7 +10473,7 @@ check_group_min_max_predicates(Item *con
/* Check that pred compares min_max_arg_item with a constant. */
Item *args[3];
- bzero(args, 3 * sizeof(Item*));
+ memset(args, 0, 3 * sizeof(Item*));
bool inv;
/* Test if this is a comparison of a field and a constant. */
if (!simple_pred(pred, args, &inv))
@@ -10609,7 +10609,7 @@ get_constant_key_infix(KEY *index_info,
*/
DBUG_ASSERT (field_length > 0);
*key_ptr= 1;
- bzero(key_ptr+1,field_length-1);
+ memset(key_ptr+1, 0, field_length-1);
key_ptr+= field_length;
*key_infix_len+= field_length;
}
@@ -11014,7 +11014,7 @@ QUICK_GROUP_MIN_MAX_SELECT(TABLE *table,
join->thd->mem_root= &alloc;
}
else
- bzero(&alloc, sizeof(MEM_ROOT)); // ensure that it's not used
+ memset(&alloc, 0, sizeof(MEM_ROOT)); // ensure that it's not used
}
=== modified file 'sql/partition_info.cc'
--- a/sql/partition_info.cc 2011-03-22 11:44:40 +0000
+++ b/sql/partition_info.cc 2011-05-26 15:20:09 +0000
@@ -1518,7 +1518,7 @@ void partition_info::print_no_partition_
char *buf_ptr= (char*)&buf;
TABLE_LIST table_list;
- bzero(&table_list, sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
table_list.db= table_arg->s->db.str;
table_list.table_name= table_arg->s->table_name.str;
=== modified file 'sql/password.c'
--- a/sql/password.c 2010-08-09 08:32:50 +0000
+++ b/sql/password.c 2011-05-26 15:20:09 +0000
@@ -79,7 +79,7 @@
void randominit(struct rand_struct *rand_st, ulong seed1, ulong seed2)
{ /* For mysql 3.21.# */
#ifdef HAVE_purify
- bzero((char*) rand_st,sizeof(*rand_st)); /* Avoid UMC varnings */
+ memset(rand_st, 0, sizeof(*rand_st)); /* Avoid UMC varnings */
#endif
rand_st->max_value= 0x3FFFFFFFL;
rand_st->max_value_dbl=(double) rand_st->max_value;
=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc 2011-05-05 10:52:34 +0000
+++ b/sql/protocol.cc 2011-05-26 15:20:09 +0000
@@ -1264,7 +1264,7 @@ bool Protocol_binary::prepare_for_send(u
void Protocol_binary::prepare_for_resend()
{
packet->length(bit_fields+1);
- bzero((uchar*) packet->ptr(), 1+bit_fields);
+ memset(const_cast<char*>(packet->ptr()), 0, 1+bit_fields);
field_pos=0;
}
=== modified file 'sql/records.cc'
--- a/sql/records.cc 2011-03-22 11:44:40 +0000
+++ b/sql/records.cc 2011-05-26 15:20:09 +0000
@@ -64,7 +64,7 @@ void init_read_record_idx(READ_RECORD *i
bool print_error, uint idx, bool reverse)
{
empty_record(table);
- bzero((char*) info,sizeof(*info));
+ memset(info, 0, sizeof(*info));
info->thd= thd;
info->table= table;
info->file= table->file;
@@ -173,7 +173,7 @@ void init_read_record(READ_RECORD *info,
IO_CACHE *tempfile;
DBUG_ENTER("init_read_record");
- bzero((char*) info,sizeof(*info));
+ memset(info, 0, sizeof(*info));
info->thd=thd;
info->table=table;
info->file= table->file;
@@ -590,7 +590,8 @@ static int init_rr_cache(THD *thd, READ_
DBUG_RETURN(1);
#ifdef HAVE_purify
// Avoid warnings in qsort
- bzero(info->cache,rec_cache_size+info->cache_records* info->struct_length+1);
+ memset(info->cache, 0,
+ rec_cache_size+info->cache_records * info->struct_length + 1);
#endif
DBUG_PRINT("info",("Allocated buffert for %d records",info->cache_records));
info->read_positions=info->cache+rec_cache_size;
=== modified file 'sql/rpl_info_file.cc'
--- a/sql/rpl_info_file.cc 2011-05-16 17:26:11 +0000
+++ b/sql/rpl_info_file.cc 2011-05-26 15:20:09 +0000
@@ -33,7 +33,7 @@ Rpl_info_file::Rpl_info_file(const int n
{
DBUG_ENTER("Rpl_info_file::Rpl_info_file");
- bzero((char*) &info_file, sizeof(info_file));
+ memset(&info_file, 0, sizeof(info_file));
fn_format(info_fname, param_info_fname, mysql_data_home, "", 4 + 32);
DBUG_VOID_RETURN;
=== modified file 'sql/rpl_master.cc'
--- a/sql/rpl_master.cc 2011-05-16 14:30:54 +0000
+++ b/sql/rpl_master.cc 2011-05-26 15:20:09 +0000
@@ -655,7 +655,7 @@ void mysql_binlog_send(THD* thd, char* l
DBUG_ENTER("mysql_binlog_send");
DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos));
- bzero((char*) &log,sizeof(log));
+ memset(&log, 0, sizeof(log));
/*
heartbeat_period from @master_heartbeat_period user variable
*/
=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc 2011-05-23 23:34:47 +0000
+++ b/sql/rpl_rli.cc 2011-05-26 15:20:09 +0000
@@ -90,7 +90,7 @@ Relay_log_info::Relay_log_info(bool is_s
group_relay_log_name[0]= event_relay_log_name[0]=
group_master_log_name[0]= 0;
until_log_name[0]= ign_master_log_name_end[0]= 0;
- bzero((char*) &cache_buf, sizeof(cache_buf));
+ memset(&cache_buf, 0, sizeof(cache_buf));
cached_charset_invalidate();
mysql_mutex_init(key_relay_log_info_log_space_lock,
&log_space_lock, MY_MUTEX_INIT_FAST);
@@ -878,7 +878,7 @@ void Relay_log_info::cached_charset_inva
DBUG_ENTER("Relay_log_info::cached_charset_invalidate");
/* Full of zeroes means uninitialized. */
- bzero(cached_charset, sizeof(cached_charset));
+ memset(cached_charset, 0, sizeof(cached_charset));
DBUG_VOID_RETURN;
}
=== modified file 'sql/rpl_utility.cc'
--- a/sql/rpl_utility.cc 2011-03-09 20:54:55 +0000
+++ b/sql/rpl_utility.cc 2011-05-26 15:20:09 +0000
@@ -971,7 +971,7 @@ table_def::table_def(unsigned char *type
&m_null_bits, (size + 7) / 8,
NULL);
- bzero(m_field_metadata, size * sizeof(uint16));
+ memset(m_field_metadata, 0, size * sizeof(uint16));
if (m_type)
memcpy(m_type, types, size);
=== modified file 'sql/rpl_utility.h'
--- a/sql/rpl_utility.h 2010-07-02 18:15:21 +0000
+++ b/sql/rpl_utility.h 2011-05-26 15:20:09 +0000
@@ -21,7 +21,7 @@
#endif
#include "sql_priv.h"
-#include "m_string.h" /* bzero, memcpy */
+#include "m_string.h"
#ifdef MYSQL_SERVER
#include "table.h" /* TABLE_LIST */
#endif
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2011-05-21 08:25:33 +0000
+++ b/sql/set_var.cc 2011-05-26 15:20:09 +0000
@@ -163,7 +163,7 @@ sys_var::sys_var(sys_var_chain *chain, c
name.length= strlen(name_arg); // and so does this.
DBUG_ASSERT(name.length <= NAME_CHAR_LEN);
- bzero(&option, sizeof(option));
+ memset(&option, 0, sizeof(option));
option.name= name_arg;
option.id= getopt_id;
option.comment= comment;
@@ -501,7 +501,7 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, b
(qsort_cmp) show_cmp);
/* make last element empty */
- bzero(show, sizeof(SHOW_VAR));
+ memset(show, 0, sizeof(SHOW_VAR));
}
return result;
}
=== modified file 'sql/sp.cc'
--- a/sql/sp.cc 2011-04-22 12:59:10 +0000
+++ b/sql/sp.cc 2011-05-26 15:20:09 +0000
@@ -563,7 +563,7 @@ db_find_routine(THD *thd, int type, sp_n
goto done;
}
- bzero((char *)&chistics, sizeof(chistics));
+ memset(&chistics, 0, sizeof(chistics));
if ((ptr= get_field(thd->mem_root,
table->field[MYSQL_PROC_FIELD_ACCESS])) == NULL)
{
@@ -870,8 +870,8 @@ sp_returns_type(THD *thd, String &result
TABLE table;
TABLE_SHARE share;
Field *field;
- bzero((char*) &table, sizeof(table));
- bzero((char*) &share, sizeof(share));
+ memset(&table, 0, sizeof(table));
+ memset(&share, 0, sizeof(share));
table.in_use= thd;
table.s = &share;
field= sp->create_result_field(0, 0, &table);
@@ -2201,7 +2201,7 @@ sp_load_for_information_schema(THD *thd,
Stored_program_creation_ctx *creation_ctx=
Stored_routine_creation_ctx::load_from_db(thd, &sp_name_obj, proc_table);
sp_body= (type == TYPE_ENUM_FUNCTION ? "RETURN NULL" : "BEGIN END");
- bzero((char*) &sp_chistics, sizeof(sp_chistics));
+ memset(&sp_chistics, 0, sizeof(sp_chistics));
defstr.set_charset(creation_ctx->get_client_cs());
if (!create_string(thd, &defstr, type,
sp_db_str.str, sp_db_str.length,
=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc 2011-05-21 09:31:19 +0000
+++ b/sql/sp_head.cc 2011-05-26 15:20:09 +0000
@@ -2569,7 +2569,7 @@ sp_head::restore_thd_mem_root(THD *thd)
bool check_show_routine_access(THD *thd, sp_head *sp, bool *full_access)
{
TABLE_LIST tables;
- bzero((char*) &tables,sizeof(tables));
+ memset(&tables, 0, sizeof(tables));
tables.db= (char*) "mysql";
tables.table_name= tables.alias= (char*) "proc";
*full_access= (!check_table_access(thd, SELECT_ACL, &tables, FALSE,
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2011-05-26 12:36:57 +0000
+++ b/sql/sql_acl.cc 2011-05-26 15:20:09 +0000
@@ -811,7 +811,7 @@ static my_bool acl_load(THD *thd, TABLE_
while (!(read_record_info.read_record(&read_record_info)))
{
ACL_USER user;
- bzero(&user, sizeof(user));
+ memset(&user, 0, sizeof(user));
update_hostname(&user.host, get_field(&mem, table->field[0]));
user.user= get_field(&mem, table->field[1]);
if (check_no_resolve && hostname_requires_resolving(user.host.hostname))
@@ -1858,7 +1858,7 @@ bool change_password(THD *thd, const cha
account in tests. It's ok to leave 'updating' set after tables_ok.
*/
tables.updating= 1;
- /* Thanks to bzero, tables.next==0 */
+ /* Thanks to memset, tables.next==0 */
if (!(thd->spcont || rpl_filter->tables_ok(0, &tables)))
DBUG_RETURN(0);
}
@@ -5699,7 +5699,7 @@ void get_mqh(const char *user, const cha
if (initialized && (acl_user= find_acl_user(host,user, FALSE)))
uc->user_resources= acl_user->user_resource;
else
- bzero((char*) &uc->user_resources, sizeof(uc->user_resources));
+ memset(&uc->user_resources, 0, sizeof(uc->user_resources));
mysql_mutex_unlock(&acl_cache->lock);
}
@@ -7140,7 +7140,7 @@ bool sp_grant_privileges(THD *thd, const
found_acl:
mysql_mutex_unlock(&acl_cache->lock);
- bzero((char*)tables, sizeof(TABLE_LIST));
+ memset(tables, 0, sizeof(TABLE_LIST));
user_list.empty();
tables->db= (char*)sp_db;
@@ -7191,7 +7191,7 @@ bool sp_grant_privileges(THD *thd, const
thd->lex->ssl_type= SSL_TYPE_NOT_SPECIFIED;
thd->lex->ssl_cipher= thd->lex->x509_subject= thd->lex->x509_issuer= 0;
- bzero((char*) &thd->lex->mqh, sizeof(thd->lex->mqh));
+ memset(&thd->lex->mqh, 0, sizeof(thd->lex->mqh));
/*
Only care about whether the operation failed or succeeded
@@ -8092,7 +8092,7 @@ static bool send_server_handshake_packet
if a plugin provided less, we pad it to 20 with zeros
*/
memcpy(scramble_buf, data, data_len);
- bzero(scramble_buf + data_len, SCRAMBLE_LENGTH - data_len);
+ memset(scramble_buf + data_len, 0, SCRAMBLE_LENGTH - data_len);
data= scramble_buf;
}
else
@@ -8131,7 +8131,7 @@ static bool send_server_handshake_packet
int2store(end + 3, mpvio->server_status[0]);
int2store(end + 5, mpvio->client_capabilities >> 16);
end[7]= data_len;
- bzero(end + 8, 10);
+ memset(end + 8, 0, 10);
end+= 18;
/* write scramble tail */
end= (char*) memcpy(end, data + SCRAMBLE_LENGTH_323,
=== modified file 'sql/sql_alter.cc'
--- a/sql/sql_alter.cc 2011-04-01 18:08:48 +0000
+++ b/sql/sql_alter.cc 2011-05-26 15:20:09 +0000
@@ -107,7 +107,7 @@ bool Sql_cmd_alter_table::execute(THD *t
{
// Rename of table
TABLE_LIST tmp_table;
- bzero((char*) &tmp_table,sizeof(tmp_table));
+ memset(&tmp_table, 0, sizeof(tmp_table));
tmp_table.table_name= lex->name.str;
tmp_table.db= select_lex->db;
tmp_table.grant.privilege= priv;
=== modified file 'sql/sql_analyse.cc'
--- a/sql/sql_analyse.cc 2011-05-05 10:52:34 +0000
+++ b/sql/sql_analyse.cc 2011-05-26 15:20:09 +0000
@@ -320,12 +320,12 @@ void field_str::add()
if (can_be_still_num)
{
- bzero((char*) &num_info, sizeof(num_info));
+ memset(&num_info, 0, sizeof(num_info));
if (!test_if_number(&num_info, res->ptr(), (uint) length))
can_be_still_num = 0;
if (!found)
{
- bzero((char*) &ev_num_info, sizeof(ev_num_info));
+ memset(&ev_num_info, 0, sizeof(ev_num_info));
was_zero_fill = num_info.zerofill;
}
else if (num_info.zerofill != was_zero_fill && !was_maybe_zerofill)
@@ -371,7 +371,7 @@ void field_str::add()
}
else
{
- bzero((char*) &s, sizeof(s)); // Let tree handle free of this
+ memset(&s, 0, sizeof(s)); // Let tree handle free of this
if ((treemem += length) > pc->max_treemem)
{
room_in_tree = 0; // Remove tree, too big tree
=== modified file 'sql/sql_audit.cc'
--- a/sql/sql_audit.cc 2011-04-19 03:29:06 +0000
+++ b/sql/sql_audit.cc 2011-05-26 15:20:09 +0000
@@ -242,7 +242,7 @@ void mysql_audit_release(THD *thd)
/* Reset the state of thread values */
reset_dynamic(&thd->audit_class_plugins);
- bzero(thd->audit_class_mask, sizeof(thd->audit_class_mask));
+ memset(thd->audit_class_mask, 0, sizeof(thd->audit_class_mask));
}
@@ -255,8 +255,8 @@ void mysql_audit_release(THD *thd)
void mysql_audit_init_thd(THD *thd)
{
- bzero(&thd->audit_class_plugins, sizeof(thd->audit_class_plugins));
- bzero(thd->audit_class_mask, sizeof(thd->audit_class_mask));
+ memset(&thd->audit_class_plugins, 0, sizeof(thd->audit_class_plugins));
+ memset(thd->audit_class_mask, 0, sizeof(thd->audit_class_mask));
}
@@ -306,7 +306,7 @@ void mysql_audit_initialize()
#endif
mysql_mutex_init(key_LOCK_audit_mask, &LOCK_audit_mask, MY_MUTEX_INIT_FAST);
- bzero(mysql_global_audit_mask, sizeof(mysql_global_audit_mask));
+ memset(mysql_global_audit_mask, 0, sizeof(mysql_global_audit_mask));
}
@@ -398,7 +398,7 @@ int finalize_audit_plugin(st_plugin_int
}
plugin->data= NULL;
- bzero(&event_class_mask, sizeof(event_class_mask));
+ memset(&event_class_mask, 0, sizeof(event_class_mask));
/* Iterate through all the installed plugins to create new mask */
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc 2011-05-26 08:39:40 +0000
+++ b/sql/sql_base.cc 2011-05-26 15:20:09 +0000
@@ -822,7 +822,7 @@ OPEN_TABLE_LIST *list_open_tables(THD *t
DBUG_ENTER("list_open_tables");
mysql_mutex_lock(&LOCK_open);
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
start_list= &open_list;
open_list=0;
@@ -1169,7 +1169,7 @@ bool close_cached_connection_tables(THD
DBUG_ENTER("close_cached_connections");
DBUG_ASSERT(thd);
- bzero(&tmp, sizeof(TABLE_LIST));
+ memset(&tmp, 0, sizeof(TABLE_LIST));
mysql_mutex_lock(&LOCK_open);
@@ -8053,7 +8053,7 @@ bool setup_fields(THD *thd, Item **ref_p
ref_pointer_array
*/
if (ref_pointer_array)
- bzero(ref_pointer_array, sizeof(Item *) * fields.elements);
+ memset(ref_pointer_array, 0, sizeof(Item *) * fields.elements);
/*
We call set_entry() there (before fix_fields() of the whole list of field
=== modified file 'sql/sql_cache.cc'
--- a/sql/sql_cache.cc 2011-02-15 17:14:15 +0000
+++ b/sql/sql_cache.cc 2011-05-26 15:20:09 +0000
@@ -1186,7 +1186,7 @@ void Query_cache::store_query(THD *thd,
NET *net= &thd->net;
Query_cache_query_flags flags;
// fill all gaps between fields with 0 to get repeatable key
- bzero(&flags, QUERY_CACHE_FLAGS_SIZE);
+ memset(&flags, 0, QUERY_CACHE_FLAGS_SIZE);
flags.client_long_flag= test(thd->client_capabilities & CLIENT_LONG_FLAG);
flags.client_protocol_41= test(thd->client_capabilities &
CLIENT_PROTOCOL_41);
@@ -1537,7 +1537,7 @@ Query_cache::send_result_to_client(THD *
THD_STAGE_INFO(thd, stage_checking_query_cache_for_query);
// fill all gaps between fields with 0 to get repeatable key
- bzero(&flags, QUERY_CACHE_FLAGS_SIZE);
+ memset(&flags, 0, QUERY_CACHE_FLAGS_SIZE);
flags.client_long_flag= test(thd->client_capabilities & CLIENT_LONG_FLAG);
flags.client_protocol_41= test(thd->client_capabilities &
CLIENT_PROTOCOL_41);
@@ -1662,7 +1662,7 @@ def_week_frmt: %lu, in_trans: %d, autoco
}
}
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
table_list.db = table->db();
table_list.alias= table_list.table_name= table->table();
#ifndef NO_EMBEDDED_ACCESS_CHECKS
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2011-05-24 09:21:24 +0000
+++ b/sql/sql_class.cc 2011-05-26 15:20:09 +0000
@@ -793,14 +793,14 @@ THD::THD(bool enable_plugins)
utime_after_lock= 0L;
current_linfo = 0;
slave_thread = 0;
- bzero(&variables, sizeof(variables));
+ memset(&variables, 0, sizeof(variables));
thread_id= 0;
one_shot_set= 0;
file_id = 0;
query_id= 0;
query_name_consts= 0;
db_charset= global_system_variables.collation_database;
- bzero(ha_data, sizeof(ha_data));
+ memset(ha_data, 0, sizeof(ha_data));
mysys_var=0;
binlog_evt_union.do_union= FALSE;
enable_slow_log= 0;
@@ -851,7 +851,7 @@ THD::THD(bool enable_plugins)
my_init_dynamic_array(&user_var_events,
sizeof(BINLOG_USER_VAR_EVENT *), 16, 16);
else
- bzero((char*) &user_var_events, sizeof(user_var_events));
+ memset(&user_var_events, 0, sizeof(user_var_events));
/* Protocol */
protocol= &protocol_text; // Default protocol
@@ -1173,7 +1173,7 @@ void THD::init(void)
tx_isolation= (enum_tx_isolation) variables.tx_isolation;
update_charset();
reset_current_stmt_binlog_format_row();
- bzero((char *) &status_var, sizeof(status_var));
+ memset(&status_var, 0, sizeof(status_var));
if (variables.sql_log_bin)
variables.option_bits|= OPTION_BIN_LOG;
@@ -2632,7 +2632,7 @@ bool select_export::send_data(List<Item>
if (!space_inited)
{
space_inited=1;
- bfill(space,sizeof(space),' ');
+ memset(space, ' ', sizeof(space));
}
uint length=item->max_length-used_length;
for (; length > sizeof(space) ; length-=sizeof(space))
@@ -3295,7 +3295,7 @@ void thd_increment_net_big_packet_count(
void THD::set_status_var_init()
{
- bzero((char*) &status_var, sizeof(status_var));
+ memset(&status_var, 0, sizeof(status_var));
}
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2011-05-24 09:21:24 +0000
+++ b/sql/sql_class.h 2011-05-26 15:20:09 +0000
@@ -708,7 +708,7 @@ public:
{
void *ptr;
if ((ptr=alloc_root(mem_root,size)))
- bzero(ptr, size);
+ memset(ptr, 0, size);
return ptr;
}
inline char *strdup(const char *str)
@@ -1976,7 +1976,7 @@ public:
}
st_transactions()
{
- bzero((char*)this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
xid_state.xid.null();
init_sql_alloc(&mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0);
}
=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc 2011-05-21 09:31:19 +0000
+++ b/sql/sql_connect.cc 2011-05-26 15:20:09 +0000
@@ -510,7 +510,7 @@ static int check_connection(THD *thd)
thd->main_security_ctx.host_or_ip= thd->main_security_ctx.host;
thd->main_security_ctx.ip= 0;
/* Reset sin_addr */
- bzero((char*) &net->vio->remote, sizeof(net->vio->remote));
+ memset(&net->vio->remote, 0, sizeof(net->vio->remote));
}
vio_keepalive(net->vio, TRUE);
=== modified file 'sql/sql_db.cc'
--- a/sql/sql_db.cc 2011-05-04 07:51:15 +0000
+++ b/sql/sql_db.cc 2011-05-26 15:20:09 +0000
@@ -360,7 +360,7 @@ bool load_db_opt(THD *thd, const char *p
bool error=1;
uint nbytes;
- bzero((char*) create,sizeof(*create));
+ memset(create, 0, sizeof(*create));
create->default_table_charset= thd->variables.collation_server;
/* Check if options for this database are already in the hash */
=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc 2011-05-12 17:29:19 +0000
+++ b/sql/sql_delete.cc 2011-05-26 15:20:09 +0000
@@ -89,7 +89,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *
List<Item> fields;
List<Item> all_fields;
- bzero((char*) &tables,sizeof(tables));
+ memset(&tables, 0, sizeof(tables));
tables.table = table;
tables.alias = table_list->alias;
=== modified file 'sql/sql_error.cc'
--- a/sql/sql_error.cc 2011-04-15 12:14:35 +0000
+++ b/sql/sql_error.cc 2011-05-26 15:20:09 +0000
@@ -467,7 +467,7 @@ Warning_info::Warning_info(ulonglong war
/* Initialize sub structures */
init_sql_alloc(&m_warn_root, WARN_ALLOC_BLOCK_SIZE, WARN_ALLOC_PREALLOC_SIZE);
m_warn_list.empty();
- bzero((char*) m_warn_count, sizeof(m_warn_count));
+ memset(m_warn_count, 0, sizeof(m_warn_count));
}
@@ -485,7 +485,7 @@ void Warning_info::clear_warning_info(ul
{
m_warn_id= warn_id_arg;
free_root(&m_warn_root, MYF(0));
- bzero((char*) m_warn_count, sizeof(m_warn_count));
+ memset(m_warn_count, 0, sizeof(m_warn_count));
m_warn_list.empty();
m_statement_warn_count= 0;
m_current_row_for_warning= 1; /* Start counting from the first row */
=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc 2011-05-21 08:25:33 +0000
+++ b/sql/sql_insert.cc 2011-05-26 15:20:09 +0000
@@ -773,7 +773,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *t
/*
Fill in the given fields and dump it to the table file
*/
- bzero((char*) &info,sizeof(info));
+ memset(&info, 0, sizeof(info));
info.ignore= ignore;
info.handle_duplicates=duplic;
info.update_fields= &update_fields;
@@ -1914,11 +1914,11 @@ public:
*/
thd.variables.lock_wait_timeout= LONG_TIMEOUT;
- bzero((char*) &thd.net, sizeof(thd.net)); // Safety
- bzero((char*) &table_list, sizeof(table_list)); // Safety
+ memset(&thd.net, 0, sizeof(thd.net)); // Safety
+ memset(&table_list, 0, sizeof(table_list)); // Safety
thd.system_thread= SYSTEM_THREAD_DELAYED_INSERT;
thd.security_ctx->host_or_ip= "";
- bzero((char*) &info,sizeof(info));
+ memset(&info, 0, sizeof(info));
mysql_mutex_init(key_delayed_insert_mutex, &mutex, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_delayed_insert_cond, &cond, NULL);
mysql_cond_init(key_delayed_insert_cond_client, &cond_client, NULL);
@@ -2314,7 +2314,7 @@ TABLE *Delayed_insert::get_local_table(T
copy->def_write_set.bitmap= ((my_bitmap_map*)
(bitmap + share->column_bitmap_size));
copy->tmp_set.bitmap= 0; // To catch errors
- bzero((char*) bitmap, share->column_bitmap_size*2);
+ memset(bitmap, 0, share->column_bitmap_size*2);
copy->read_set= ©->def_read_set;
copy->write_set= ©->def_write_set;
@@ -3201,7 +3201,7 @@ select_insert::select_insert(TABLE_LIST
autoinc_value_of_last_inserted_row(0),
insert_into_view(table_list_par && table_list_par->view != 0)
{
- bzero((char*) &info,sizeof(info));
+ memset(&info, 0, sizeof(info));
info.handle_duplicates= duplic;
info.ignore= ignore_check_option_errors;
info.update_fields= update_fields;
=== modified file 'sql/sql_join_cache.cc'
--- a/sql/sql_join_cache.cc 2011-04-26 08:49:10 +0000
+++ b/sql/sql_join_cache.cc 2011-05-26 15:20:09 +0000
@@ -2876,7 +2876,7 @@ uint JOIN_CACHE_BKA_UNIQUE::get_hash_idx
void JOIN_CACHE_BKA_UNIQUE:: cleanup_hash_table()
{
last_key_entry= hash_table;
- bzero(hash_table, (buff+buff_size)-hash_table);
+ memset(hash_table, 0, (buff+buff_size)-hash_table);
key_entries= 0;
}
=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc 2011-04-01 14:04:52 +0000
+++ b/sql/sql_lex.cc 2011-05-26 15:20:09 +0000
@@ -3180,7 +3180,7 @@ bool LEX::is_partition_management() cons
*/
void st_lex_master_info::set_unspecified()
{
- bzero((char*) this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
sql_delay= -1;
}
=== modified file 'sql/sql_list.h'
--- a/sql/sql_list.h 2011-03-22 11:44:40 +0000
+++ b/sql/sql_list.h 2011-05-26 15:20:09 +0000
@@ -24,7 +24,7 @@ void *sql_alloc(size_t);
#include "my_sys.h" /* alloc_root, TRASH, MY_WME,
MY_FAE, MY_ALLOW_ZERO_PTR */
-#include "m_string.h" /* bfill */
+#include "m_string.h"
#include "thr_malloc.h" /* sql_alloc */
/* mysql standard class memory allocator */
=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc 2011-05-12 17:29:19 +0000
+++ b/sql/sql_load.cc 2011-05-26 15:20:09 +0000
@@ -419,7 +419,7 @@ int mysql_load(THD *thd,sql_exchange *ex
}
COPY_INFO info;
- bzero((char*) &info,sizeof(info));
+ memset(&info, 0, sizeof(info));
info.ignore= ignore;
info.handle_duplicates=handle_duplicates;
info.escape_char= (escaped->length() && (ex->escaped_given() ||
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2011-05-26 16:23:52 +0000
+++ b/sql/sql_parse.cc 2011-05-26 15:20:09 +0000
@@ -2694,7 +2694,7 @@ end_with_restore_list:
*/
thd->enable_slow_log= opt_log_slow_admin_statements;
- bzero((char*) &create_info, sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
create_info.db_type= 0;
create_info.row_type= ROW_TYPE_NOT_USED;
create_info.default_table_charset= thd->variables.collation_database;
@@ -5153,7 +5153,7 @@ check_routine_access(THD *thd, ulong wan
{
TABLE_LIST tables[1];
- bzero((char *)tables, sizeof(TABLE_LIST));
+ memset(tables, 0, sizeof(TABLE_LIST));
tables->db= db;
tables->table_name= tables->alias= name;
@@ -5586,7 +5586,7 @@ void create_select_for_variable(const ch
lex->sql_command= SQLCOM_SELECT;
tmp.str= (char*) var_name;
tmp.length=strlen(var_name);
- bzero((char*) &null_lex_string.str, sizeof(null_lex_string));
+ memset(&null_lex_string, 0, sizeof(null_lex_string));
/*
We set the name of Item to @@session.var_name because that then is used
as the column name in the output.
=== modified file 'sql/sql_partition_admin.cc'
--- a/sql/sql_partition_admin.cc 2011-05-21 08:25:33 +0000
+++ b/sql/sql_partition_admin.cc 2011-05-26 15:20:09 +0000
@@ -184,8 +184,8 @@ static bool compare_table_with_partition
DBUG_ENTER("compare_table_with_partition");
alter_change_level= ALTER_TABLE_METADATA_ONLY;
- bzero(&part_create_info, sizeof(HA_CREATE_INFO));
- bzero(&table_create_info, sizeof(HA_CREATE_INFO));
+ memset(&part_create_info, 0, sizeof(HA_CREATE_INFO));
+ memset(&table_create_info, 0, sizeof(HA_CREATE_INFO));
update_create_info_from_table(&table_create_info, table);
/* get the current auto_increment value */
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2011-05-21 08:25:33 +0000
+++ b/sql/sql_plugin.cc 2011-05-26 15:20:09 +0000
@@ -450,7 +450,7 @@ static st_plugin_dl *plugin_dl_add(const
tmp->ref_count++;
DBUG_RETURN(tmp);
}
- bzero(&plugin_dl, sizeof(plugin_dl));
+ memset(&plugin_dl, 0, sizeof(plugin_dl));
/* Compile dll path */
dlpathlen=
strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", dl->str, NullS) -
@@ -617,7 +617,7 @@ static void plugin_dl_del(const LEX_STRI
if (! --tmp->ref_count)
{
free_plugin_mem(tmp);
- bzero(tmp, sizeof(struct st_plugin_dl));
+ memset(tmp, 0, sizeof(struct st_plugin_dl));
}
break;
}
@@ -793,7 +793,7 @@ static bool plugin_add(MEM_ROOT *tmp_roo
DBUG_RETURN(TRUE);
}
/* Clear the whole struct to catch future extensions. */
- bzero((char*) &tmp, sizeof(tmp));
+ memset(&tmp, 0, sizeof(tmp));
if (! (tmp.plugin_dl= plugin_dl_add(dl, report)))
DBUG_RETURN(TRUE);
/* Find plugin by name */
@@ -1264,7 +1264,7 @@ int plugin_init(int *argc, char **argv,
!my_strnncoll(&my_charset_latin1, (const uchar*) plugin->name,
6, (const uchar*) "InnoDB", 6))
continue;
- bzero(&tmp, sizeof(tmp));
+ memset(&tmp, 0, sizeof(tmp));
tmp.plugin= plugin;
tmp.name.str= (char *)plugin->name;
tmp.name.length= strlen(plugin->name);
@@ -1436,7 +1436,7 @@ static void plugin_load(MEM_ROOT *tmp_ro
new_thd->store_globals();
new_thd->db= my_strdup("mysql", MYF(0));
new_thd->db_length= 5;
- bzero((char*) &thd.net, sizeof(thd.net));
+ memset(&thd.net, 0, sizeof(thd.net));
tables.init_one_table("mysql", 5, "plugin", 6, "plugin", TL_READ);
#ifdef EMBEDDED_LIBRARY
@@ -2434,12 +2434,12 @@ static st_bookmark *register_var(const c
variables. If their value is non-NULL, it must point to a valid
string.
*/
- bzero(global_system_variables.dynamic_variables_ptr +
- global_variables_dynamic_size,
- new_size - global_variables_dynamic_size);
- bzero(max_system_variables.dynamic_variables_ptr +
- global_variables_dynamic_size,
- new_size - global_variables_dynamic_size);
+ memset(global_system_variables.dynamic_variables_ptr +
+ global_variables_dynamic_size, 0,
+ new_size - global_variables_dynamic_size);
+ memset(max_system_variables.dynamic_variables_ptr +
+ global_variables_dynamic_size, 0,
+ new_size - global_variables_dynamic_size);
global_variables_dynamic_size= new_size;
}
@@ -3319,7 +3319,7 @@ static my_option *construct_help_options
if (!(opts= (my_option*) alloc_root(mem_root, sizeof(my_option) * count)))
DBUG_RETURN(NULL);
- bzero(opts, sizeof(my_option) * count);
+ memset(opts, 0, sizeof(my_option) * count);
/**
some plugin variables (those that don't have PLUGIN_VAR_NOSYSVAR flag)
@@ -3393,7 +3393,7 @@ static int test_plugin_options(MEM_ROOT
sql_print_error("Out of memory for plugin '%s'.", tmp->name.str);
DBUG_RETURN(-1);
}
- bzero(opts, sizeof(my_option) * count);
+ memset(opts, 0, sizeof(my_option) * count);
if (construct_options(tmp_root, tmp, opts))
{
=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc 2011-05-21 09:31:19 +0000
+++ b/sql/sql_prepare.cc 2011-05-26 15:20:09 +0000
@@ -4150,7 +4150,7 @@ bool Protocol_local::store_null()
if (m_current_column == NULL)
return TRUE; /* prepare_for_resend() failed to allocate memory. */
- bzero(m_current_column, sizeof(*m_current_column));
+ memset(m_current_column, 0, sizeof(*m_current_column));
++m_current_column;
return FALSE;
}
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2011-05-26 11:09:57 +0000
+++ b/sql/sql_select.cc 2011-05-26 15:20:09 +0000
@@ -4773,7 +4773,7 @@ make_join_statistics(JOIN *join, TABLE_L
table->quick_keys.clear_all();
table->reginfo.join_tab=s;
table->reginfo.not_exists_optimize=0;
- bzero((char*) table->const_key_parts, sizeof(key_part_map)*table->s->keys);
+ memset(table->const_key_parts, 0, sizeof(key_part_map)*table->s->keys);
join->all_table_map|= table->map;
s->join=join;
@@ -15647,10 +15647,10 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
strmov(tmpname,path);
/* make table according to fields */
- bzero((char*) table,sizeof(*table));
- bzero((char*) reg_field,sizeof(Field*)*(field_count+1));
- bzero((char*) default_field, sizeof(Field*) * (field_count));
- bzero((char*) from_field,sizeof(Field*)*field_count);
+ memset(table, 0, sizeof(*table));
+ memset(reg_field, 0, sizeof(Field*)*(field_count+1));
+ memset(default_field, 0, sizeof(Field*) * (field_count));
+ memset(from_field, 0, sizeof(Field*)*field_count);
table->mem_root= own_root;
mem_root_save= thd->mem_root;
@@ -15920,11 +15920,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
pos=table->record[0]+ null_pack_length;
if (null_pack_length)
{
- bzero((uchar*) recinfo,sizeof(*recinfo));
+ memset(recinfo, 0, sizeof(*recinfo));
recinfo->type=FIELD_NORMAL;
recinfo->length=null_pack_length;
recinfo++;
- bfill(null_flags,null_pack_length,255); // Set null fields
+ memset(null_flags, 255, null_pack_length); // Set null fields
table->null_flags= (uchar*) table->record[0];
share->null_fields= null_count+ hidden_null_count;
@@ -15936,7 +15936,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
{
Field *field= *reg_field;
uint length;
- bzero((uchar*) recinfo,sizeof(*recinfo));
+ memset(recinfo, 0, sizeof(*recinfo));
if (!(field->flags & NOT_NULL_FLAG))
{
@@ -15950,7 +15950,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
recinfo->length=1;
recinfo->type=FIELD_NORMAL;
recinfo++;
- bzero((uchar*) recinfo,sizeof(*recinfo));
+ memset(recinfo, 0, sizeof(*recinfo));
}
else
{
@@ -16138,7 +16138,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
alloc_root(&table->mem_root,
keyinfo->key_parts * sizeof(KEY_PART_INFO))))
goto err;
- bzero((void*) key_part_info, keyinfo->key_parts * sizeof(KEY_PART_INFO));
+ memset(key_part_info, 0, keyinfo->key_parts * sizeof(KEY_PART_INFO));
table->key_info=keyinfo;
keyinfo->key_part=key_part_info;
keyinfo->flags=HA_NOSAME | HA_NULL_ARE_EQUAL;
@@ -16337,8 +16337,8 @@ TABLE *create_duplicate_weedout_tmp_tabl
/* STEP 4: Create TABLE description */
- bzero((char*) table,sizeof(*table));
- bzero((char*) reg_field,sizeof(Field*)*2);
+ memset(table, 0, sizeof(*table));
+ memset(reg_field, 0, sizeof(Field*)*2);
table->mem_root= own_root;
mem_root_save= thd->mem_root;
@@ -16434,11 +16434,11 @@ TABLE *create_duplicate_weedout_tmp_tabl
pos=table->record[0]+ null_pack_length;
if (null_pack_length)
{
- bzero((uchar*) recinfo,sizeof(*recinfo));
+ memset(recinfo, 0, sizeof(*recinfo));
recinfo->type=FIELD_NORMAL;
recinfo->length=null_pack_length;
recinfo++;
- bfill(null_flags,null_pack_length,255); // Set null fields
+ memset(null_flags, 255, null_pack_length); // Set null fields
table->null_flags= (uchar*) table->record[0];
share->null_fields= null_count;
@@ -16449,7 +16449,7 @@ TABLE *create_duplicate_weedout_tmp_tabl
{
//Field *field= *reg_field;
uint length;
- bzero((uchar*) recinfo,sizeof(*recinfo));
+ memset(recinfo, 0, sizeof(*recinfo));
field->move_field(pos,(uchar*) 0,0);
field->reset();
@@ -16458,7 +16458,7 @@ TABLE *create_duplicate_weedout_tmp_tabl
'offset' fields generated by initalize_tables
*/
// Initialize the table field:
- bzero(field->ptr, field->pack_length());
+ memset(field->ptr, 0, field->pack_length());
length=field->pack_length();
pos+= length;
@@ -16594,8 +16594,8 @@ TABLE *create_virtual_tmp_table(THD *thd
NullS))
return 0;
- bzero(table, sizeof(*table));
- bzero(share, sizeof(*share));
+ memset(table, 0, sizeof(*table));
+ memset(share, 0, sizeof(*share));
table->field= field;
table->s= share;
table->temp_pool_slot= MY_BIT_NONE;
@@ -16756,7 +16756,7 @@ static bool create_myisam_tmp_table(TABL
if (!seg)
goto err;
- bzero(seg, sizeof(*seg) * keyinfo->key_parts);
+ memset(seg, 0, sizeof(*seg) * keyinfo->key_parts);
if (keyinfo->key_length >= table->file->max_key_length() ||
keyinfo->key_parts > table->file->max_key_parts() ||
share->uniques)
@@ -16765,13 +16765,13 @@ static bool create_myisam_tmp_table(TABL
share->keys= 0;
share->uniques= 1;
using_unique_constraint=1;
- bzero((char*) &uniquedef,sizeof(uniquedef));
+ memset(&uniquedef, 0, sizeof(uniquedef));
uniquedef.keysegs=keyinfo->key_parts;
uniquedef.seg=seg;
uniquedef.null_are_equal=1;
/* Create extra column for hash value */
- bzero((uchar*) *recinfo,sizeof(**recinfo));
+ memset(*recinfo, 0, sizeof(**recinfo));
(*recinfo)->type= FIELD_CHECK;
(*recinfo)->length=MI_UNIQUE_HASH_LENGTH;
(*recinfo)++;
@@ -16780,7 +16780,7 @@ static bool create_myisam_tmp_table(TABL
else
{
/* Create an unique key */
- bzero((char*) &keydef,sizeof(keydef));
+ memset(&keydef, 0, sizeof(keydef));
keydef.flag=HA_NOSAME | HA_BINARY_PACK_KEY | HA_PACK_KEY;
keydef.keysegs= keyinfo->key_parts;
keydef.seg= seg;
@@ -16824,7 +16824,7 @@ static bool create_myisam_tmp_table(TABL
}
}
MI_CREATE_INFO create_info;
- bzero((char*) &create_info,sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
if (big_tables && !(options & SELECT_SMALL_RESULT))
create_info.data_file_length= ~(ulonglong) 0;
@@ -17750,7 +17750,7 @@ int do_sj_dups_weedout(THD *thd, SJ_TMP_
// 2. Zero the null bytes
if (sjtbl->null_bytes)
{
- bzero(ptr, sjtbl->null_bytes);
+ memset(ptr, 0, sjtbl->null_bytes);
ptr += sjtbl->null_bytes;
}
@@ -17762,7 +17762,7 @@ int do_sj_dups_weedout(THD *thd, SJ_TMP_
{
/* It's a NULL-complemented row */
*(nulls_ptr + tab->null_byte) |= tab->null_bit;
- bzero(ptr + tab->rowid_offset, h->ref_length);
+ memset(ptr + tab->rowid_offset, 0, h->ref_length);
}
else
{
=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h 2011-05-26 06:03:02 +0000
+++ b/sql/sql_select.h 2011-05-26 15:20:09 +0000
@@ -580,10 +580,10 @@ st_join_table::st_join_table()
{
/**
@todo Add constructor to READ_RECORD.
- All users do init_read_record(), which does bzero(),
+ All users do init_read_record(), which does memset(),
rather than invoking a constructor.
*/
- bzero(&read_record, sizeof(read_record));
+ memset(&read_record, 0, sizeof(read_record));
}
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2011-05-25 16:48:28 +0000
+++ b/sql/sql_show.cc 2011-05-26 15:20:09 +0000
@@ -429,7 +429,7 @@ find_files(THD *thd, List<LEX_STRING> *f
- bzero((char*) &table_list,sizeof(table_list));
+ memset(&table_list, 0, sizeof(table_list));
if (!(dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0))))
{
@@ -1300,7 +1300,7 @@ int store_create_info(THD *thd, TABLE_LI
}
key_info= table->key_info;
- bzero((char*) &create_info, sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
/* Allow update_create_info to update row type */
create_info.row_type= share->row_type;
file->update_create_info(&create_info);
@@ -2014,7 +2014,7 @@ static void shrink_var_array(DYNAMIC_ARR
all[a++]= all[b];
if (a)
{
- bzero(all+a, sizeof(SHOW_VAR)); // writing NULL-element to the end
+ memset(all+a, 0, sizeof(SHOW_VAR)); // writing NULL-element to the end
array->elements= a;
}
else // array is completely empty - delete it
@@ -2676,7 +2676,7 @@ bool get_lookup_field_values(THD *thd, I
const char *wild= lex->wild ? lex->wild->ptr() : NullS;
bool rc= 0;
- bzero((char*) lookup_field_values, sizeof(LOOKUP_FIELD_VALUES));
+ memset(lookup_field_values, 0, sizeof(LOOKUP_FIELD_VALUES));
switch (lex->sql_command) {
case SQLCOM_SHOW_DATABASES:
if (wild)
@@ -3376,8 +3376,8 @@ static int fill_schema_table_from_frm(TH
uint key_length;
char db_name_buff[NAME_LEN + 1], table_name_buff[NAME_LEN + 1];
- bzero((char*) &table_list, sizeof(TABLE_LIST));
- bzero((char*) &tbl, sizeof(TABLE));
+ memset(&table_list, 0, sizeof(TABLE_LIST));
+ memset(&tbl, 0, sizeof(TABLE));
if (lower_case_table_names)
{
@@ -4605,7 +4605,7 @@ bool store_schema_params(THD *thd, TABLE
bool free_sp_head;
DBUG_ENTER("store_schema_params");
- bzero((char*) &tbl, sizeof(TABLE));
+ memset(&tbl, 0, sizeof(TABLE));
(void) build_table_filename(path, sizeof(path), "", "", "", 0);
init_tmp_table_share(thd, &share, "", 0, "", path);
@@ -4801,7 +4801,7 @@ bool store_schema_proc(THD *thd, TABLE *
Field *field;
Create_field *field_def= &sp->m_return_field_def;
- bzero((char*) &tbl, sizeof(TABLE));
+ memset(&tbl, 0, sizeof(TABLE));
(void) build_table_filename(path, sizeof(path), "", "", "", 0);
init_tmp_table_share(thd, &share, "", 0, "", path);
field= make_field(&share, (uchar*) 0, field_def->length,
@@ -4834,11 +4834,11 @@ bool store_schema_proc(THD *thd, TABLE *
copy_field_as_string(table->field[21],
proc_table->field[MYSQL_PROC_FIELD_SECURITY_TYPE]);
- bzero((char *)&time, sizeof(time));
+ memset(&time, 0, sizeof(time));
((Field_timestamp *) proc_table->field[MYSQL_PROC_FIELD_CREATED])->
get_time(&time);
table->field[22]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
- bzero((char *)&time, sizeof(time));
+ memset(&time, 0, sizeof(time));
((Field_timestamp *) proc_table->field[MYSQL_PROC_FIELD_MODIFIED])->
get_time(&time);
table->field[23]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
@@ -4881,7 +4881,7 @@ int fill_schema_proc(THD *thd, TABLE_LIS
strxmov(definer, thd->security_ctx->priv_user, "@",
thd->security_ctx->priv_host, NullS);
/* We use this TABLE_LIST instance only for checking of privileges. */
- bzero((char*) &proc_tables,sizeof(proc_tables));
+ memset(&proc_tables, 0, sizeof(proc_tables));
proc_tables.db= (char*) "mysql";
proc_tables.db_length= 5;
proc_tables.table_name= proc_tables.alias= (char*) "proc";
=== modified file 'sql/sql_string.cc'
--- a/sql/sql_string.cc 2011-03-22 11:44:40 +0000
+++ b/sql/sql_string.cc 2011-05-26 15:20:09 +0000
@@ -261,7 +261,7 @@ bool String::copy_aligned(const char *st
If we add little-endian UCS-2 sometimes, this code
will be more complicated. But it's OK for now.
*/
- bzero((char*) Ptr, offset);
+ memset(Ptr, 0, offset);
memcpy(Ptr + offset, str, arg_length);
Ptr[aligned_length]=0;
/* str_length is always >= 0 as arg_length is != 0 */
@@ -364,7 +364,7 @@ bool String::fill(uint32 max_length,char
{
if (realloc(max_length))
return TRUE;
- bfill(Ptr+str_length,max_length-str_length,fill_char);
+ memset(Ptr+str_length, fill_char, max_length-str_length);
str_length=max_length;
}
return FALSE;
@@ -463,7 +463,7 @@ bool String::append(const char *s,uint32
add_length= arg_length + offset;
if (realloc(str_length + add_length))
return TRUE;
- bzero((char*) Ptr + str_length, offset);
+ memset(Ptr + str_length, 0, offset);
memcpy(Ptr + str_length + offset, s, arg_length);
str_length+= add_length;
return FALSE;
@@ -509,7 +509,7 @@ bool String::append_with_prefill(const c
t_length= full_length - arg_length;
if (t_length > 0)
{
- bfill(Ptr+str_length, t_length, fill_char);
+ memset(Ptr+str_length, fill_char, t_length);
str_length=str_length + t_length;
}
append(s, arg_length);
@@ -883,7 +883,7 @@ well_formed_copy_nchars(const CHARSET_IN
0x01 -> 0x0001
*/
uint pad_length= to_cs->mbminlen - from_offset;
- bzero(to, pad_length);
+ memset(to, 0, pad_length);
memmove(to + pad_length, from, from_offset);
/*
In some cases left zero-padding can create an incorrect character.
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2011-05-21 09:30:35 +0000
+++ b/sql/sql_table.cc 2011-05-26 15:20:09 +0000
@@ -1650,7 +1650,7 @@ void execute_ddl_log_recovery()
/*
Initialise global_ddl_log struct
*/
- bzero(global_ddl_log.file_entry_buf, sizeof(global_ddl_log.file_entry_buf));
+ memset(global_ddl_log.file_entry_buf, 0, sizeof(global_ddl_log.file_entry_buf));
global_ddl_log.inited= FALSE;
global_ddl_log.recovery_phase= TRUE;
global_ddl_log.io_size= IO_SIZE;
@@ -4758,7 +4758,7 @@ bool mysql_create_like_table(THD* thd, T
src_table->table->use_all_columns();
/* Fill HA_CREATE_INFO and Alter_info with description of source table. */
- bzero((char*) &local_create_info, sizeof(local_create_info));
+ memset(&local_create_info, 0, sizeof(local_create_info));
local_create_info.db_type= src_table->table->s->db_type();
local_create_info.row_type= src_table->table->s->row_type;
if (mysql_prepare_alter_table(thd, src_table->table, &local_create_info,
@@ -5772,7 +5772,7 @@ mysql_prepare_alter_table(THD *thd, TABL
KEY_CREATE_INFO key_create_info;
Key *key;
enum Key::Keytype key_type;
- bzero((char*) &key_create_info, sizeof(key_create_info));
+ memset(&key_create_info, 0, sizeof(key_create_info));
key_create_info.algorithm= key_info->algorithm;
if (key_info->flags & HA_USES_BLOCK_SIZE)
@@ -7214,7 +7214,7 @@ copy_data_between_tables(TABLE *from,TAB
{
from->sort.io_cache=(IO_CACHE*) my_malloc(sizeof(IO_CACHE),
MYF(MY_FAE | MY_ZEROFILL));
- bzero((char *) &tables, sizeof(tables));
+ memset(&tables, 0, sizeof(tables));
tables.table= from;
tables.alias= tables.table_name= from->s->table_name.str;
tables.db= from->s->db.str;
@@ -7351,7 +7351,7 @@ bool mysql_recreate_table(THD *thd, TABL
/* Same applies to MDL request. */
table_list->mdl_request.set_type(MDL_SHARED_NO_WRITE);
- bzero((char*) &create_info, sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
create_info.row_type=ROW_TYPE_NOT_USED;
create_info.default_table_charset=default_charset_info;
/* Force alter table to recreate table */
=== modified file 'sql/sql_trigger.cc'
--- a/sql/sql_trigger.cc 2011-04-15 12:14:35 +0000
+++ b/sql/sql_trigger.cc 2011-05-26 15:20:09 +0000
@@ -1680,7 +1680,7 @@ bool Table_triggers_list::drop_all_trigg
bool result= 0;
DBUG_ENTER("drop_all_triggers");
- bzero(&table, sizeof(table));
+ memset(&table, 0, sizeof(table));
init_sql_alloc(&table.mem_root, 8192, 0);
if (Table_triggers_list::check_n_load(thd, db, name, &table, 1))
@@ -1893,7 +1893,7 @@ bool Table_triggers_list::change_table_n
LEX_STRING *err_trigname;
DBUG_ENTER("change_table_name");
- bzero(&table, sizeof(table));
+ memset(&table, 0, sizeof(table));
init_sql_alloc(&table.mem_root, 8192, 0);
/*
=== modified file 'sql/sql_trigger.h'
--- a/sql/sql_trigger.h 2010-11-29 16:27:58 +0000
+++ b/sql/sql_trigger.h 2011-05-26 15:20:09 +0000
@@ -121,9 +121,9 @@ public:
Table_triggers_list(TABLE *table_arg):
record1_field(0), trigger_table(table_arg)
{
- bzero((char *)bodies, sizeof(bodies));
- bzero((char *)trigger_fields, sizeof(trigger_fields));
- bzero((char *)&subject_table_grants, sizeof(subject_table_grants));
+ memset(bodies, 0, sizeof(bodies));
+ memset(trigger_fields, 0, sizeof(trigger_fields));
+ memset(&subject_table_grants, 0, sizeof(subject_table_grants));
}
~Table_triggers_list();
=== modified file 'sql/sql_udf.cc'
--- a/sql/sql_udf.cc 2011-04-19 03:29:06 +0000
+++ b/sql/sql_udf.cc 2011-05-26 15:20:09 +0000
@@ -385,7 +385,7 @@ static udf_func *add_udf(LEX_STRING *nam
udf_func *tmp= (udf_func*) alloc_root(&mem, sizeof(udf_func));
if (!tmp)
return 0;
- bzero((char*) tmp,sizeof(*tmp));
+ memset(tmp, 0, sizeof(*tmp));
tmp->name = *name; //dup !!
tmp->dl = dl;
tmp->returns = ret;
=== modified file 'sql/sql_union.cc'
--- a/sql/sql_union.cc 2011-03-17 17:39:31 +0000
+++ b/sql/sql_union.cc 2011-05-26 15:20:09 +0000
@@ -392,7 +392,7 @@ bool st_select_lex_unit::prepare(THD *th
if (union_result->create_result_table(thd, &types, test(union_distinct),
create_options, "", FALSE))
goto err;
- bzero((char*) &result_table_list, sizeof(result_table_list));
+ memset(&result_table_list, 0, sizeof(result_table_list));
result_table_list.db= (char*) "";
result_table_list.table_name= result_table_list.alias= (char*) "union";
result_table_list.table= table= union_result->table;
=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc 2011-05-12 17:29:19 +0000
+++ b/sql/sql_update.cc 2011-05-26 15:20:09 +0000
@@ -1728,7 +1728,7 @@ loop_end:
temp_fields.concat(fields_for_table[cnt]);
/* Make an unique key over the first field to avoid duplicated updates */
- bzero((char*) &group, sizeof(group));
+ memset(&group, 0, sizeof(group));
group.direction= ORDER::ORDER_ASC;
group.item= (Item**) temp_fields.head_ref();
=== modified file 'sql/sql_view.cc'
--- a/sql/sql_view.cc 2011-05-04 07:51:15 +0000
+++ b/sql/sql_view.cc 2011-05-26 15:20:09 +0000
@@ -1979,7 +1979,7 @@ mysql_rename_view(THD *thd,
view definition parsing or use temporary 'view_def'
object for it.
*/
- bzero(&view_def, sizeof(view_def));
+ memset(&view_def, 0, sizeof(view_def));
view_def.timestamp.str= view_def.timestamp_buffer;
view_def.view_suid= TRUE;
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2011-05-21 08:25:33 +0000
+++ b/sql/sql_yacc.yy 2011-05-26 15:20:09 +0000
@@ -2070,7 +2070,7 @@ create:
lex->alter_info.reset();
lex->col_list.empty();
lex->change=NullS;
- bzero((char*) &lex->create_info,sizeof(lex->create_info));
+ memset(&lex->create_info, 0, sizeof(lex->create_info));
lex->create_info.options=$2 | $4;
lex->create_info.db_type= ha_default_handlerton(thd);
lex->create_info.default_table_charset= NULL;
@@ -2365,7 +2365,7 @@ ev_sql_stmt:
lex->sphead->m_type= TYPE_ENUM_PROCEDURE;
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
lex->sphead->m_chistics= &lex->sp_chistics;
lex->sphead->set_body_start(thd, lip->get_cpp_ptr());
@@ -2412,7 +2412,7 @@ clear_privileges:
lex->select_lex.db= 0;
lex->ssl_type= SSL_TYPE_NOT_SPECIFIED;
lex->ssl_cipher= lex->x509_subject= lex->x509_issuer= 0;
- bzero((char *)&(lex->mqh),sizeof(lex->mqh));
+ memset(&(lex->mqh), 0, sizeof(lex->mqh));
}
;
@@ -6262,7 +6262,7 @@ alter:
lex->col_list.empty();
lex->select_lex.init_order();
lex->select_lex.db= (lex->select_lex.table_list.first)->db;
- bzero((char*) &lex->create_info,sizeof(lex->create_info));
+ memset(&lex->create_info, 0, sizeof(lex->create_info));
lex->create_info.db_type= 0;
lex->create_info.default_table_charset= NULL;
lex->create_info.row_type= ROW_TYPE_NOT_USED;
@@ -6318,7 +6318,7 @@ alter:
my_error(ER_SP_NO_DROP_SP, MYF(0), "PROCEDURE");
MYSQL_YYABORT;
}
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
}
sp_a_chistics
{
@@ -6336,7 +6336,7 @@ alter:
my_error(ER_SP_NO_DROP_SP, MYF(0), "FUNCTION");
MYSQL_YYABORT;
}
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
}
sp_a_chistics
{
@@ -11027,7 +11027,7 @@ show:
lex->wild=0;
mysql_init_select(lex);
lex->current_select->parsing_place= SELECT_LIST;
- bzero((char*) &lex->create_info,sizeof(lex->create_info));
+ memset(&lex->create_info, 0, sizeof(lex->create_info));
}
show_param
{}
@@ -11206,7 +11206,7 @@ show_param:
LEX_USER *curr_user;
if (!(curr_user= (LEX_USER*) lex->thd->alloc(sizeof(st_lex_user))))
MYSQL_YYABORT;
- bzero(curr_user, sizeof(st_lex_user));
+ memset(curr_user, 0, sizeof(st_lex_user));
lex->grant_user= curr_user;
}
| GRANTS FOR_SYM user
@@ -12528,7 +12528,7 @@ user:
will be handled in the get_current_user() function
later
*/
- bzero($$, sizeof(LEX_USER));
+ memset($$, 0, sizeof(LEX_USER));
}
;
@@ -14439,7 +14439,7 @@ trigger_tail:
lex->sphead= sp;
lex->spname= $3;
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
lex->sphead->m_chistics= &lex->sp_chistics;
lex->sphead->set_body_start(thd, lip->get_cpp_ptr());
}
@@ -14583,7 +14583,7 @@ sf_tail:
&sp->m_return_field_def))
MYSQL_YYABORT;
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
}
sp_c_chistics /* $13 */
{ /* $14 */
@@ -14689,7 +14689,7 @@ sp_tail:
LEX *lex= thd->lex;
lex->sphead->m_param_end= YYLIP->get_cpp_tok_start();
- bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
+ memset(&lex->sp_chistics, 0, sizeof(st_sp_chistics));
}
sp_c_chistics
{
=== modified file 'sql/table.cc'
--- a/sql/table.cc 2011-05-23 23:34:47 +0000
+++ b/sql/table.cc 2011-05-26 15:20:09 +0000
@@ -332,7 +332,7 @@ TABLE_SHARE *alloc_table_share(TABLE_LIS
&path_buff, path_length + 1,
NULL))
{
- bzero((char*) share, sizeof(*share));
+ memset(share, 0, sizeof(*share));
share->set_table_cache_key(key_buff, key, key_length);
@@ -396,7 +396,7 @@ void init_tmp_table_share(THD *thd, TABL
DBUG_ENTER("init_tmp_table_share");
DBUG_PRINT("enter", ("table: '%s'.'%s'", key, table_name));
- bzero((char*) share, sizeof(*share));
+ memset(share, 0, sizeof(*share));
init_sql_alloc(&share->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
share->table_category= TABLE_CATEGORY_TEMPORARY;
share->tmp_table= INTERNAL_TMP_TABLE;
@@ -892,7 +892,7 @@ static int open_binary_frm(THD *thd, TAB
if (!(keyinfo = (KEY*) alloc_root(&share->mem_root,
n_length + uint2korr(disk_buff+4))))
goto err; /* purecov: inspected */
- bzero((char*) keyinfo,n_length);
+ memset(keyinfo, 0, n_length);
share->key_info= keyinfo;
key_part= reinterpret_cast<KEY_PART_INFO*>(keyinfo+keys);
strpos=disk_buff+6;
@@ -1434,7 +1434,7 @@ static int open_binary_frm(THD *thd, TAB
}
else
charset= share->table_charset;
- bzero((char*) &comment, sizeof(comment));
+ memset(&comment, 0, sizeof(comment));
}
if (interval_nr && charset->mbminlen > 1)
@@ -1731,8 +1731,8 @@ static int open_binary_frm(THD *thd, TAB
{
/* Old file format with default as not null */
uint null_length= (share->null_fields+7)/8;
- bfill(share->default_values + (null_flags - (uchar*) record),
- null_length, 255);
+ memset(share->default_values + (null_flags - (uchar*) record), 255,
+ null_length);
}
if (share->found_next_number_field)
@@ -1860,7 +1860,7 @@ int open_table_from_share(THD *thd, TABL
share->table_name.str, (long) outparam));
error= 1;
- bzero((char*) outparam, sizeof(*outparam));
+ memset(outparam, 0, sizeof(*outparam));
outparam->in_use= thd;
outparam->s= share;
outparam->db_stat= db_stat;
@@ -2143,7 +2143,7 @@ partititon_err:
}
#if defined(HAVE_purify) && !defined(DBUG_OFF)
- bzero((char*) bitmaps, bitmap_size*3);
+ memset(bitmaps, 0, bitmap_size*3);
#endif
outparam->no_replicate= outparam->file &&
@@ -2163,7 +2163,7 @@ partititon_err:
#endif
outparam->file= 0; // For easier error checking
outparam->db_stat=0;
- free_root(&outparam->mem_root, MYF(0)); // Safe to call on bzero'd root
+ free_root(&outparam->mem_root, MYF(0));
my_free((void *) outparam->alias);
DBUG_RETURN (error);
}
@@ -2363,7 +2363,7 @@ ulong make_new_entry(File file, uchar *f
DBUG_RETURN(0);
endpos-=bufflength; bufflength=IO_SIZE;
}
- bzero(buff,IO_SIZE); /* Null new block */
+ memset(buff, 0, IO_SIZE); /* Null new block */
mysql_file_seek(file, (ulong) maxlength, MY_SEEK_SET, MYF(0));
if (mysql_file_write(file, buff, bufflength, MYF(MY_NABP+MY_WME)))
DBUG_RETURN(0L);
@@ -2682,7 +2682,7 @@ File create_frm(THD *thd, const char *na
name, CREATE_MODE, create_flags, MYF(0))) >= 0)
{
uint key_length, tmp_key_length, tmp, csid;
- bzero((char*) fileinfo,64);
+ memset(fileinfo, 0, 64);
/* header */
fileinfo[0]=(uchar) 254;
fileinfo[1]= 1;
@@ -2756,7 +2756,7 @@ File create_frm(THD *thd, const char *na
61 for default_part_db_type
*/
int2store(fileinfo+62, create_info->key_block_size);
- bzero(fill,IO_SIZE);
+ memset(fill, 0, IO_SIZE);
for (; length > IO_SIZE ; length-= IO_SIZE)
{
if (mysql_file_write(file, fill, IO_SIZE, MYF(MY_WME | MY_NABP)))
@@ -4803,7 +4803,7 @@ void TABLE::clear_column_bitmaps()
bitmap_clear_all(&table->def_read_set);
bitmap_clear_all(&table->def_write_set);
*/
- bzero((char*) def_read_set.bitmap, s->column_bitmap_size*2);
+ memset(def_read_set.bitmap, 0, s->column_bitmap_size*2);
column_bitmaps_set(&def_read_set, &def_write_set);
}
@@ -5460,7 +5460,7 @@ void init_mdl_requests(TABLE_LIST *table
bool TABLE::update_const_key_parts(Item *conds)
{
- bzero((char*) const_key_parts, sizeof(key_part_map) * s->keys);
+ memset(const_key_parts, 0, sizeof(key_part_map) * s->keys);
if (conds == NULL)
return FALSE;
=== modified file 'sql/table.h'
--- a/sql/table.h 2011-05-04 07:51:15 +0000
+++ b/sql/table.h 2011-05-26 15:20:09 +0000
@@ -1429,7 +1429,7 @@ struct TABLE_LIST
const char *alias_arg,
enum thr_lock_type lock_type_arg)
{
- bzero((char*) this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
db= (char*) db_name_arg;
db_length= db_length_arg;
table_name= (char*) table_name_arg;
@@ -2235,7 +2235,7 @@ inline void mark_as_null_row(TABLE *tabl
{
table->null_row=1;
table->status|=STATUS_NULL_ROW;
- bfill(table->null_flags,table->s->null_bytes,255);
+ memset(table->null_flags, 255, table->s->null_bytes);
}
bool is_simple_order(ORDER *order);
=== modified file 'sql/thr_malloc.cc'
--- a/sql/thr_malloc.cc 2011-03-09 20:54:55 +0000
+++ b/sql/thr_malloc.cc 2011-05-26 15:20:09 +0000
@@ -41,7 +41,7 @@ void *sql_calloc(size_t size)
{
void *ptr;
if ((ptr=sql_alloc(size)))
- bzero(ptr,size);
+ memset(ptr, 0, size);
return ptr;
}
=== modified file 'sql/tztime.cc'
--- a/sql/tztime.cc 2011-04-19 03:29:06 +0000
+++ b/sql/tztime.cc 2011-05-26 15:20:09 +0000
@@ -1519,7 +1519,7 @@ my_offset_tzs_get_key(Time_zone_offset *
static void
tz_init_table_list(TABLE_LIST *tz_tabs)
{
- bzero(tz_tabs, sizeof(TABLE_LIST) * MY_TZ_TABLES_COUNT);
+ memset(tz_tabs, 0, sizeof(TABLE_LIST) * MY_TZ_TABLES_COUNT);
for (int i= 0; i < MY_TZ_TABLES_COUNT; i++)
{
@@ -1650,7 +1650,7 @@ my_tz_init(THD *org_thd, const char *def
*/
thd->set_db(db, sizeof(db)-1);
- bzero((char*) &tz_tables[0], sizeof(TABLE_LIST));
+ memset(&tz_tables[0], 0, sizeof(TABLE_LIST));
tz_tables[0].alias= tz_tables[0].table_name=
(char*)"time_zone_leap_second";
tz_tables[0].table_name_length= 21;
@@ -1876,7 +1876,7 @@ tz_load_from_open_tables(const String *t
return 0;
}
tz_info= (TIME_ZONE_INFO *)alloc_buff;
- bzero(tz_info, sizeof(TIME_ZONE_INFO));
+ memset(tz_info, 0, sizeof(TIME_ZONE_INFO));
tz_name_buff= alloc_buff + sizeof(TIME_ZONE_INFO);
/*
By writing zero to the end we guarantee that we can call ptr()
=== modified file 'sql/udf_example.c'
--- a/sql/udf_example.c 2010-07-29 12:33:56 +0000
+++ b/sql/udf_example.c 2011-05-26 15:20:09 +0000
@@ -132,7 +132,6 @@ typedef long long longlong;
/* when compiled as standalone */
#include <string.h>
#define strmov(a,b) stpcpy(a,b)
-#define bzero(a,b) memset(a,0,b)
#endif
#endif
#include <mysql.h>
@@ -653,7 +652,7 @@ my_bool sequence_init(UDF_INIT *initid,
strmov(message,"Couldn't allocate memory");
return 1;
}
- bzero(initid->ptr,sizeof(longlong));
+ memset(initid->ptr, 0, sizeof(longlong));
/*
sequence() is a non-deterministic function : it has different value
even if called with the same arguments.
=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc 2011-05-21 08:25:33 +0000
+++ b/sql/unireg.cc 2011-05-26 15:20:09 +0000
@@ -345,7 +345,7 @@ bool mysql_create_frm(THD *thd, const ch
else
#endif
{
- bzero((uchar*) buff, 6);
+ memset(buff, 0, 6);
if (mysql_file_write(file, (uchar*) buff, 6, MYF_RW))
goto err;
}
@@ -844,7 +844,7 @@ static bool pack_header(uchar *forminfo,
DBUG_RETURN(1);
}
- bzero((char*)forminfo,288);
+ memset(forminfo, 0, 288);
length=(info_length+create_fields.elements*FCOMP+288+n_length+int_length+
com_length);
int2store(forminfo,length);
@@ -984,7 +984,7 @@ static bool pack_fields(File file, List<
uint i;
unsigned char *val= NULL;
- bzero(occ, sizeof(occ));
+ memset(occ, 0, sizeof(occ));
for (i=0; (val= (unsigned char*) field->interval->type_names[i]); i++)
for (uint j = 0; j < field->interval->type_lengths[i]; j++)
@@ -1062,8 +1062,8 @@ static bool make_empty_rec(THD *thd, Fil
DBUG_ENTER("make_empty_rec");
/* We need a table to generate columns for default values */
- bzero((char*) &table, sizeof(table));
- bzero((char*) &share, sizeof(share));
+ memset(&table, 0, sizeof(table));
+ memset(&share, 0, sizeof(share));
table.s= &share;
if (!(buff=(uchar*) my_malloc((size_t) reclength,MYF(MY_WME | MY_ZEROFILL))))
=== modified file 'sql/unireg.h'
--- a/sql/unireg.h 2011-02-02 13:41:10 +0000
+++ b/sql/unireg.h 2011-05-26 15:20:09 +0000
@@ -80,7 +80,7 @@ typedef struct st_ha_create_information
#define cmp_record(A,B) memcmp((A)->record[0],(A)->B,(size_t) (A)->s->reclength)
#define empty_record(A) { \
restore_record((A),s->default_values); \
- bfill((A)->null_flags,(A)->s->null_bytes,255);\
+ memset((A)->null_flags, 255, (A)->s->null_bytes);\
}
/* Defines for use with openfrm, openprt and openfrd */
=== modified file 'storage/blackhole/ha_blackhole.cc'
--- a/storage/blackhole/ha_blackhole.cc 2011-04-19 03:29:06 +0000
+++ b/storage/blackhole/ha_blackhole.cc 2011-05-26 15:20:09 +0000
@@ -174,7 +174,7 @@ int ha_blackhole::info(uint flag)
{
DBUG_ENTER("ha_blackhole::info");
- bzero((char*) &stats, sizeof(stats));
+ memset(&stats, 0, sizeof(stats));
if (flag & HA_STATUS_AUTO)
stats.auto_increment_value= 1;
DBUG_RETURN(0);
=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc 2011-04-19 03:29:06 +0000
+++ b/storage/federated/ha_federated.cc 2011-05-26 15:20:09 +0000
@@ -898,7 +898,7 @@ ha_federated::ha_federated(handlerton *h
mysql(0), stored_result(0)
{
trx_next= 0;
- bzero(&bulk_insert, sizeof(bulk_insert));
+ memset(&bulk_insert, 0, sizeof(bulk_insert));
}
=== modified file 'storage/heap/ha_heap.cc'
--- a/storage/heap/ha_heap.cc 2011-04-23 20:44:45 +0000
+++ b/storage/heap/ha_heap.cc 2011-05-26 15:20:09 +0000
@@ -648,7 +648,7 @@ heap_prepare_hp_create_info(TABLE *table
TABLE_SHARE *share= table_arg->s;
bool found_real_auto_increment= 0;
- bzero(hp_create_info, sizeof(*hp_create_info));
+ memset(hp_create_info, 0, sizeof(*hp_create_info));
for (key= parts= 0; key < keys; key++)
parts+= table_arg->key_info[key].key_parts;
=== modified file 'storage/heap/hp_create.c'
--- a/storage/heap/hp_create.c 2011-01-11 09:09:21 +0000
+++ b/storage/heap/hp_create.c 2011-05-26 15:20:09 +0000
@@ -59,8 +59,8 @@ int heap_create(const char *name, HP_CRE
for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++)
{
- bzero((char*) &keyinfo->block,sizeof(keyinfo->block));
- bzero((char*) &keyinfo->rb_tree ,sizeof(keyinfo->rb_tree));
+ memset(&keyinfo->block, 0, sizeof(keyinfo->block));
+ memset(&keyinfo->rb_tree, 0, sizeof(keyinfo->rb_tree));
for (j= length= 0; j < keyinfo->keysegs; j++)
{
length+= keyinfo->seg[j].length;
=== modified file 'storage/heap/hp_hash.c'
--- a/storage/heap/hp_hash.c 2011-03-09 20:54:55 +0000
+++ b/storage/heap/hp_hash.c 2011-05-26 15:20:09 +0000
@@ -729,7 +729,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, u
if (isnan(nr))
{
/* Replace NAN with zero */
- bzero(key, length);
+ memset(key, 0, length);
key+= length;
continue;
}
@@ -740,7 +740,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, u
float8get(nr, pos);
if (isnan(nr))
{
- bzero(key, length);
+ memset(key, 0, length);
key+= length;
continue;
}
=== modified file 'storage/heap/hp_test1.c'
--- a/storage/heap/hp_test1.c 2010-06-11 15:28:18 +0000
+++ b/storage/heap/hp_test1.c 2011-05-26 15:20:09 +0000
@@ -44,7 +44,7 @@ int main(int argc, char **argv)
filename= "test1";
get_options(argc,argv);
- bzero(&hp_create_info, sizeof(hp_create_info));
+ memset(&hp_create_info, 0, sizeof(hp_create_info));
hp_create_info.max_table_size= 1024L*1024L;
hp_create_info.keys= 1;
hp_create_info.keydef= keyinfo;
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
keyinfo[0].flag = HA_NOSAME;
deleted=0;
- bzero((uchar*) flags,sizeof(flags));
+ memset(flags, 0, sizeof(flags));
printf("- Creating heap-file\n");
if (heap_create(filename, &hp_create_info, &tmp_share, &unused) ||
=== modified file 'storage/heap/hp_test2.c'
--- a/storage/heap/hp_test2.c 2011-01-11 09:09:21 +0000
+++ b/storage/heap/hp_test2.c 2011-05-26 15:20:09 +0000
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
file=file2=0;
get_options(argc,argv);
- bzero(&hp_create_info, sizeof(hp_create_info));
+ memset(&hp_create_info, 0, sizeof(hp_create_info));
hp_create_info.max_table_size= 1024L*1024L;
hp_create_info.keys= keys;
hp_create_info.keydef= keyinfo;
@@ -118,8 +118,8 @@ int main(int argc, char *argv[])
keyinfo[3].seg[0].null_pos=38;
keyinfo[3].seg[0].charset=cs;
- bzero((char*) key1,sizeof(key1));
- bzero((char*) key3,sizeof(key3));
+ memset(key1, 0, sizeof(key1));
+ memset(key3, 0, sizeof(key3));
printf("- Creating heap-file\n");
if (heap_create(filename, &hp_create_info, &tmp_share, &unused) ||
@@ -676,7 +676,7 @@ static int calc_check(uchar *buf, uint l
static void make_record(uchar *record, uint n1, uint n2, uint n3,
const char *mark, uint count)
{
- bfill(record,reclength,' ');
+ memset(record, ' ', reclength);
sprintf((char*) record,"%6d:%4d:%8d:%3.3s: %4d",
n1,n2,n3,mark,count);
record[37]='A'; /* Store A in null key */
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2011-05-26 16:23:52 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2011-05-26 15:20:09 +0000
@@ -4549,7 +4549,7 @@ ha_innobase::store_key_val_for_row(
simple memcmp to compare two key values to determine if they are
equal. MySQL does this to compare contents of two 'ref' values. */
- bzero(buff, buff_len);
+ memset(buff, 0, buff_len);
for (; key_part != end; key_part++) {
is_null = FALSE;
@@ -4627,7 +4627,7 @@ ha_innobase::store_key_val_for_row(
length of the true VARCHAR in the key value, though
only len first bytes after the 2 length bytes contain
actual data. The rest of the space was reset to zero
- in the bzero() call above. */
+ in the memset() call above. */
buff += key_len;
=== modified file 'storage/myisam/ft_boolean_search.c'
--- a/storage/myisam/ft_boolean_search.c 2011-03-09 20:54:55 +0000
+++ b/storage/myisam/ft_boolean_search.c 2011-05-26 15:20:09 +0000
@@ -568,7 +568,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO
DBUG_ASSERT(keynr==NO_SUCH_KEY || cs == info->s->keyinfo[keynr].seg->charset);
ftb->with_scan=0;
ftb->lastpos=HA_OFFSET_ERROR;
- bzero(& ftb->no_dupes, sizeof(TREE));
+ memset(&ftb->no_dupes, 0, sizeof(TREE));
ftb->last_word= 0;
init_alloc_root(&ftb->mem_root, 1024, 1024);
=== modified file 'storage/myisam/ft_nlq_search.c'
--- a/storage/myisam/ft_nlq_search.c 2011-03-09 20:54:55 +0000
+++ b/storage/myisam/ft_nlq_search.c 2011-05-26 15:20:09 +0000
@@ -229,7 +229,7 @@ FT_INFO *ft_init_nlq_search(MI_INFO *inf
if (! (ftparser_param= ftparser_call_initializer(info, keynr, 0)))
goto err;
- bzero(&wtree,sizeof(wtree));
+ memset(&wtree, 0, sizeof(wtree));
init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,0,
NULL, NULL);
=== modified file 'storage/myisam/ft_update.c'
--- a/storage/myisam/ft_update.c 2011-03-09 20:54:55 +0000
+++ b/storage/myisam/ft_update.c 2011-05-26 15:20:09 +0000
@@ -121,7 +121,7 @@ FT_WORD *_mi_ft_parserecord(MI_INFO *inf
DBUG_ENTER("_mi_ft_parserecord");
if (! (param= ftparser_call_initializer(info, keynr, 0)))
DBUG_RETURN(NULL);
- bzero((char*) &ptree, sizeof(ptree));
+ memset(&ptree, 0, sizeof(ptree));
param->flags= 0;
if (_mi_ft_parse(&ptree, info, keynr, record, param, mem_root))
DBUG_RETURN(NULL);
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2011-04-23 20:44:45 +0000
+++ b/storage/myisam/ha_myisam.cc 2011-05-26 15:20:09 +0000
@@ -335,7 +335,7 @@ int table2myisam(TABLE *table_arg, MI_KE
(long) found, recpos, minpos, length));
if (recpos != minpos)
{ // Reserved space (Null bits?)
- bzero((char*) recinfo_pos, sizeof(*recinfo_pos));
+ memset(recinfo_pos, 0, sizeof(*recinfo_pos));
recinfo_pos->type= (int) FIELD_NORMAL;
recinfo_pos++->length= (uint16) (minpos - recpos);
}
@@ -1913,7 +1913,7 @@ int ha_myisam::create(const char *name,
}
if ((error= table2myisam(table_arg, &keydef, &recinfo, &records)))
DBUG_RETURN(error); /* purecov: inspected */
- bzero((char*) &create_info, sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
create_info.max_rows= share->max_rows;
create_info.reloc_rows= share->min_rows;
create_info.with_auto_increment= share->next_number_key_offset == 0;
=== modified file 'storage/myisam/mi_cache.c'
--- a/storage/myisam/mi_cache.c 2009-12-05 01:26:15 +0000
+++ b/storage/myisam/mi_cache.c 2011-05-26 15:20:09 +0000
@@ -26,7 +26,7 @@
expected to hit the cache again.
Allows "partial read" errors in the record header (when READING_HEADER flag
- is set) - unread part is bzero'ed
+ is set) - unread part is zerofilled.
Note: out-of-cache reads are enabled for shared IO_CACHE's too,
as these reads will be cached by OS cache (and mysql_file_pread is always atomic)
@@ -102,7 +102,7 @@ int _mi_read_cache(IO_CACHE *info, uchar
my_errno=HA_ERR_WRONG_IN_RECORD;
DBUG_RETURN(1);
}
- bzero(buff+read_length,MI_BLOCK_INFO_HEADER_LENGTH - in_buff_length -
- read_length);
+ memset(buff+read_length, 0,
+ MI_BLOCK_INFO_HEADER_LENGTH - in_buff_length - read_length);
DBUG_RETURN(0);
} /* _mi_read_cache */
=== modified file 'storage/myisam/mi_check.c'
--- a/storage/myisam/mi_check.c 2011-03-29 12:56:34 +0000
+++ b/storage/myisam/mi_check.c 2011-05-26 15:20:09 +0000
@@ -84,7 +84,7 @@ static HA_KEYSEG *ha_find_null(HA_KEYSEG
void myisamchk_init(MI_CHECK *param)
{
- bzero((uchar*) param,sizeof(*param));
+ memset(param, 0, sizeof(*param));
param->opt_follow_links=1;
param->keys_in_use= ~(ulonglong) 0;
param->search_after_block=HA_OFFSET_ERROR;
@@ -446,8 +446,8 @@ int chk_key(MI_CHECK *param, register MI
param->record_checksum=init_checksum;
- bzero((char*) ¶m->unique_count,sizeof(param->unique_count));
- bzero((char*) ¶m->notnull_count,sizeof(param->notnull_count));
+ memset(¶m->unique_count, 0, sizeof(param->unique_count));
+ memset(¶m->notnull_count, 0, sizeof(param->notnull_count));
if ((!(param->testflag & T_SILENT)))
printf ("- check data record references index: %d\n",key+1);
@@ -527,7 +527,7 @@ int chk_key(MI_CHECK *param, register MI
/* Check that there isn't a row with auto_increment = 0 in the table */
mi_extra(info,HA_EXTRA_KEYREAD,0);
- bzero(info->lastkey,keyinfo->seg->length);
+ memset(info->lastkey, 0, keyinfo->seg->length);
if (!mi_rkey(info, info->rec_buff, key, (const uchar*) info->lastkey,
(key_part_map)1, HA_READ_KEY_EXACT))
{
@@ -981,7 +981,7 @@ int chk_data_link(MI_CHECK *param, MI_IN
}
pos=my_b_tell(¶m->read_cache);
- bzero((char*) key_checksum, info->s->base.keys * sizeof(key_checksum[0]));
+ memset(key_checksum, 0, info->s->base.keys * sizeof(key_checksum[0]));
while (pos < info->state->data_file_length)
{
if (*killed_ptr(param))
@@ -1523,8 +1523,8 @@ int mi_repair(MI_CHECK *param, register
MI_SORT_PARAM sort_param;
DBUG_ENTER("mi_repair");
- bzero((char *)&sort_info, sizeof(sort_info));
- bzero((char *)&sort_param, sizeof(sort_param));
+ memset(&sort_info, 0, sizeof(sort_info));
+ memset(&sort_param, 0, sizeof(sort_param));
start_records=info->state->records;
new_header_length=(param->testflag & T_UNPACK) ? 0L :
share->pack.header_length;
@@ -1552,7 +1552,7 @@ int mi_repair(MI_CHECK *param, register
(uint) param->read_buffer_length,
READ_CACHE,share->pack.header_length,1,MYF(MY_WME)))
{
- bzero(&info->rec_cache,sizeof(info->rec_cache));
+ memset(&info->rec_cache, 0, sizeof(info->rec_cache));
goto err;
}
if (!rep_quick)
@@ -2107,7 +2107,7 @@ static int sort_one_index(MI_CHECK *para
/* Fill block with zero and write it to the new index file */
length=mi_getint(buff);
- bzero((uchar*) buff+length,keyinfo->block_length-length);
+ memset(buff+length, 0, keyinfo->block_length-length);
if (mysql_file_pwrite(new_file, (uchar*) buff, (uint) keyinfo->block_length,
new_page_pos, MYF(MY_NABP | MY_WAIT_IF_FULL)))
{
@@ -2247,8 +2247,8 @@ int mi_repair_by_sort(MI_CHECK *param, r
if (info->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
param->testflag|=T_CALC_CHECKSUM;
- bzero((char*)&sort_info,sizeof(sort_info));
- bzero((char *)&sort_param, sizeof(sort_param));
+ memset(&sort_info, 0, sizeof(sort_info));
+ memset(&sort_param, 0, sizeof(sort_param));
if (!(sort_info.key_block=
alloc_key_blocks(param,
(uint) param->sort_key_blocks,
@@ -2371,7 +2371,7 @@ int mi_repair_by_sort(MI_CHECK *param, r
printf ("- Fixing index %d\n",sort_param.key+1);
sort_param.max_pos=sort_param.pos=share->pack.header_length;
keyseg=sort_param.seg;
- bzero((char*) sort_param.unique,sizeof(sort_param.unique));
+ memset(sort_param.unique, 0, sizeof(sort_param.unique));
sort_param.key_length=share->rec_reflength;
for (i=0 ; keyseg[i].type != HA_KEYTYPE_END; i++)
{
@@ -2693,7 +2693,7 @@ int mi_repair_parallel(MI_CHECK *param,
}
*/
DBUG_PRINT("info", ("is quick repair: %d", rep_quick));
- bzero((char*)&sort_info,sizeof(sort_info));
+ memset(&sort_info, 0, sizeof(sort_info));
/* Initialize pthread structures before goto err. */
mysql_mutex_init(mi_key_mutex_MI_SORT_INFO_mutex,
&sort_info.mutex, MY_MUTEX_INIT_FAST);
@@ -3143,8 +3143,8 @@ static int sort_key_read(MI_SORT_PARAM *
_mi_make_key(info, sort_param->key, (uchar*) key,
sort_param->record, sort_param->filepos));
#ifdef HAVE_purify
- bzero(key+sort_param->real_key_length,
- (sort_param->key_length-sort_param->real_key_length));
+ memset(key+sort_param->real_key_length, 0,
+ (sort_param->key_length-sort_param->real_key_length));
#endif
DBUG_RETURN(sort_write_record(sort_param));
} /* sort_key_read */
@@ -3184,8 +3184,8 @@ static int sort_ft_key_read(MI_SORT_PARA
key, wptr++, sort_param->filepos));
#ifdef HAVE_purify
if (sort_param->key_length > sort_param->real_key_length)
- bzero(key+sort_param->real_key_length,
- (sort_param->key_length-sort_param->real_key_length));
+ memset(key+sort_param->real_key_length, 0,
+ (sort_param->key_length-sort_param->real_key_length));
#endif
if (!wptr->pos)
{
@@ -4044,8 +4044,8 @@ static int sort_insert_key(MI_SORT_PARAM
/* Fill block with end-zero and write filled block */
mi_putint(anc_buff,key_block->last_length,nod_flag);
- bzero((uchar*) anc_buff+key_block->last_length,
- keyinfo->block_length- key_block->last_length);
+ memset(anc_buff+key_block->last_length, 0,
+ keyinfo->block_length - key_block->last_length);
key_file_length=info->state->key_file_length;
if ((filepos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR)
DBUG_RETURN(1);
@@ -4151,7 +4151,7 @@ int flush_pending_blocks(MI_SORT_PARAM *
if (nod_flag)
_mi_kpointer(info,key_block->end_pos,filepos);
key_file_length=info->state->key_file_length;
- bzero((uchar*) key_block->buff+length, keyinfo->block_length-length);
+ memset(key_block->buff+length, 0, keyinfo->block_length-length);
if ((filepos=_mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR)
DBUG_RETURN(1);
@@ -4321,7 +4321,7 @@ int recreate_table(MI_CHECK *param, MI_I
set_if_bigger(file_length,(ulonglong) share.base.max_data_file_length);
(void) mi_close(*org_info);
- bzero((char*) &create_info,sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
create_info.max_rows=max(max_records,share.base.records);
create_info.reloc_rows=share.base.reloc;
create_info.old_options=(share.options |
@@ -4394,7 +4394,7 @@ int write_data_suffix(SORT_INFO *sort_in
if (info->s->options & HA_OPTION_COMPRESS_RECORD && fix_datafile)
{
uchar buff[MEMMAP_EXTRA_MARGIN];
- bzero(buff,sizeof(buff));
+ memset(buff, 0, sizeof(buff));
if (my_b_write(&info->rec_cache,buff,sizeof(buff)))
{
mi_check_print_error(sort_info->param,
=== modified file 'storage/myisam/mi_create.c'
--- a/storage/myisam/mi_create.c 2011-02-15 12:04:52 +0000
+++ b/storage/myisam/mi_create.c 2011-05-26 15:20:09 +0000
@@ -61,7 +61,7 @@ int mi_create(const char *name,uint keys
if (!ci)
{
- bzero((char*) &tmp_create_info,sizeof(tmp_create_info));
+ memset(&tmp_create_info, 0, sizeof(tmp_create_info));
ci=&tmp_create_info;
}
@@ -72,7 +72,7 @@ int mi_create(const char *name,uint keys
errpos=0;
options=0;
- bzero((uchar*) &share,sizeof(share));
+ memset(&share, 0, sizeof(share));
if (flags & HA_DONT_TOUCH_DATA)
{
@@ -727,8 +727,8 @@ int mi_create(const char *name,uint keys
}
/* Create extra keys for unique definitions */
offset=reclength-uniques*MI_UNIQUE_HASH_LENGTH;
- bzero((char*) &tmp_keydef,sizeof(tmp_keydef));
- bzero((char*) &tmp_keyseg,sizeof(tmp_keyseg));
+ memset(&tmp_keydef, 0, sizeof(tmp_keydef));
+ memset(&tmp_keyseg, 0, sizeof(tmp_keyseg));
for (i=0; i < uniques ; i++)
{
tmp_keydef.keysegs=1;
=== modified file 'storage/myisam/mi_dynrec.c'
--- a/storage/myisam/mi_dynrec.c 2011-01-11 09:09:21 +0000
+++ b/storage/myisam/mi_dynrec.c 2011-05-26 15:20:09 +0000
@@ -577,7 +577,7 @@ static int delete_dynamic_record(MI_INFO
mi_int3store(block_info.header+1,length);
mi_sizestore(block_info.header+4,info->s->state.dellink);
if (b_type & BLOCK_LAST)
- bfill(block_info.header+12,8,255);
+ memset(block_info.header + 12, 255, 8);
else
mi_sizestore(block_info.header+12,block_info.next_filepos);
if (info->s->file_write(info,(uchar*) block_info.header,20,filepos,
@@ -712,7 +712,7 @@ int _mi_write_part_record(MI_INFO *info,
del_length=(res_length ? MI_DYN_DELETE_BLOCK_HEADER : 0);
bmove((uchar*) (*record-head_length),(uchar*) temp,head_length);
memcpy(temp,record_end,(size_t) (extra_length+del_length));
- bzero((uchar*) record_end,extra_length);
+ memset(record_end, 0, extra_length);
if (res_length)
{
@@ -739,7 +739,7 @@ int _mi_write_part_record(MI_INFO *info,
pos[0]= '\0';
mi_int3store(pos+1,res_length);
mi_sizestore(pos+4,info->s->state.dellink);
- bfill(pos+12,8,255); /* End link */
+ memset(pos + 12, 255, 8); /* End link */
next_delete_block=info->s->state.dellink;
info->s->state.dellink= filepos+length+extra_length;
info->state->del++;
@@ -917,7 +917,7 @@ static int update_dynamic_record(MI_INFO
del_block.header[0]=0;
mi_int3store(del_block.header+1, rest_length);
mi_sizestore(del_block.header+4,info->s->state.dellink);
- bfill(del_block.header+12,8,255);
+ memset(del_block.header + 12, 255, 8);
if (info->s->file_write(info,(uchar*) del_block.header,20, next_pos,
MYF(MY_NABP)))
DBUG_RETURN(1);
@@ -1266,7 +1266,7 @@ ulong _mi_rec_unpack(register MI_INFO *i
if (flag & bit)
{
if (type == FIELD_BLOB || type == FIELD_SKIP_ZERO)
- bzero((uchar*) to,rec_length);
+ memset(to, 0, rec_length);
else if (type == FIELD_SKIP_ENDSPACE ||
type == FIELD_SKIP_PRESPACE)
{
@@ -1289,11 +1289,11 @@ ulong _mi_rec_unpack(register MI_INFO *i
if (type == FIELD_SKIP_ENDSPACE)
{
memcpy(to,(uchar*) from,(size_t) length);
- bfill((uchar*) to+length,rec_length-length,' ');
+ memset(to + length, ' ', rec_length-length);
}
else
{
- bfill((uchar*) to,rec_length-length,' ');
+ memset(to, ' ', rec_length-length);
memcpy(to+rec_length-length,(uchar*) from,(size_t) length);
}
from+=length;
=== modified file 'storage/myisam/mi_key.c'
--- a/storage/myisam/mi_key.c 2011-03-09 20:54:55 +0000
+++ b/storage/myisam/mi_key.c 2011-05-26 15:20:09 +0000
@@ -158,7 +158,7 @@ uint _mi_make_key(register MI_INFO *info
if (isnan(nr))
{
/* Replace NAN with zero */
- bzero(key,length);
+ memset(key, 0, length);
key+=length;
continue;
}
@@ -169,7 +169,7 @@ uint _mi_make_key(register MI_INFO *info
float8get(nr,pos);
if (isnan(nr))
{
- bzero(key,length);
+ memset(key, 0, length);
key+=length;
continue;
}
@@ -389,7 +389,7 @@ static int _mi_put_key_in_record(registe
}
else
{
- bfill(pos,keyseg->length-length,' ');
+ memset(pos, ' ', keyseg->length-length);
memcpy(pos+keyseg->length-length,key,(size_t) length);
}
key+=length;
=== modified file 'storage/myisam/mi_log.c'
--- a/storage/myisam/mi_log.c 2011-01-11 09:09:21 +0000
+++ b/storage/myisam/mi_log.c 2011-05-26 15:20:09 +0000
@@ -73,7 +73,7 @@ void _myisam_log(enum myisam_log_command
int error,old_errno;
ulong pid=(ulong) GETPID();
old_errno=my_errno;
- bzero(buff,sizeof(buff));
+ memset(buff, 0, sizeof(buff));
buff[0]=(char) command;
mi_int2store(buff+1,info->dfile);
mi_int4store(buff+3,pid);
=== modified file 'storage/myisam/mi_open.c'
--- a/storage/myisam/mi_open.c 2011-01-11 09:09:21 +0000
+++ b/storage/myisam/mi_open.c 2011-05-26 15:20:09 +0000
@@ -85,7 +85,7 @@ MI_INFO *mi_open(const char *name, int m
lock_error=1;
errpos=0;
head_length=sizeof(share_buff.state.header);
- bzero((uchar*) &info,sizeof(info));
+ memset(&info, 0, sizeof(info));
realpath_err= my_realpath(name_buff,
fn_format(org_name,name,"",MI_NAME_IEXT,4),MYF(0));
@@ -100,7 +100,7 @@ MI_INFO *mi_open(const char *name, int m
if (!(old_info=test_if_reopen(name_buff)))
{
share= &share_buff;
- bzero((uchar*) &share_buff,sizeof(share_buff));
+ memset(&share_buff, 0, sizeof(share_buff));
share_buff.state.rec_per_key_part=rec_per_key_part;
share_buff.state.key_root=key_root;
share_buff.state.key_del=key_del;
@@ -615,10 +615,10 @@ MI_INFO *mi_open(const char *name, int m
/* Allocate buffer for one record */
- /* prerequisites: bzero(info) && info->s=share; are met. */
+ /* prerequisites: memset(&info, 0) && info->s=share; are met. */
if (!mi_alloc_rec_buff(&info, -1, &info.rec_buff))
goto err;
- bzero(info.rec_buff, mi_get_rec_buff_len(&info, info.rec_buff));
+ memset(info.rec_buff, 0, mi_get_rec_buff_len(&info, info.rec_buff));
*m_info=info;
thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info);
@@ -627,7 +627,7 @@ MI_INFO *mi_open(const char *name, int m
mysql_mutex_unlock(&THR_LOCK_myisam);
- bzero(info.buff, share->base.max_key_block_length * 2);
+ memset(info.buff, 0, share->base.max_key_block_length * 2);
if (myisam_log_file >= 0)
{
@@ -1011,7 +1011,7 @@ uint mi_base_info_write(File file, MI_BA
mi_int2store(ptr,base->max_key_length); ptr +=2;
mi_int2store(ptr,base->extra_alloc_bytes); ptr +=2;
*ptr++= base->extra_alloc_procent;
- bzero(ptr,13); ptr +=13; /* extra */
+ memset(ptr, 0, 13); ptr +=13; /* extra */
return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0;
}
=== modified file 'storage/myisam/mi_packrec.c'
--- a/storage/myisam/mi_packrec.c 2010-07-26 11:34:07 +0000
+++ b/storage/myisam/mi_packrec.c 2011-05-26 15:20:09 +0000
@@ -819,12 +819,12 @@ static void uf_zerofill_skip_zero(MI_COL
uchar *to, uchar *end)
{
if (get_bit(bit_buff))
- bzero((char*) to,(uint) (end-to));
+ memset(to, 0, (end-to));
else
{
end-=rec->space_length_bits;
decode_bytes(rec,bit_buff,to,end);
- bzero((char*) end,rec->space_length_bits);
+ memset(end, 0, rec->space_length_bits);
}
}
@@ -832,7 +832,7 @@ static void uf_skip_zero(MI_COLUMNDEF *r
uchar *end)
{
if (get_bit(bit_buff))
- bzero((char*) to,(uint) (end-to));
+ memset(to, 0, (end-to));
else
decode_bytes(rec,bit_buff,to,end);
}
@@ -841,7 +841,7 @@ static void uf_space_normal(MI_COLUMNDEF
uchar *end)
{
if (get_bit(bit_buff))
- bfill((uchar*) to,(end-to),' ');
+ memset(to, ' ', end - to);
else
decode_bytes(rec,bit_buff,to,end);
}
@@ -851,7 +851,7 @@ static void uf_space_endspace_selected(M
{
uint spaces;
if (get_bit(bit_buff))
- bfill((uchar*) to,(end-to),' ');
+ memset(to, ' ', end-to);
else
{
if (get_bit(bit_buff))
@@ -863,7 +863,7 @@ static void uf_space_endspace_selected(M
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((uchar*) end-spaces,spaces,' ');
+ memset(end-spaces, ' ', spaces);
}
else
decode_bytes(rec,bit_buff,to,end);
@@ -883,7 +883,7 @@ static void uf_endspace_selected(MI_COLU
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((uchar*) end-spaces,spaces,' ');
+ memset(end - spaces, ' ', spaces);
}
else
decode_bytes(rec,bit_buff,to,end);
@@ -894,7 +894,7 @@ static void uf_space_endspace(MI_COLUMND
{
uint spaces;
if (get_bit(bit_buff))
- bfill((uchar*) to,(end-to),' ');
+ memset(to, ' ', end - to);
else
{
if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
@@ -904,7 +904,7 @@ static void uf_space_endspace(MI_COLUMND
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((uchar*) end-spaces,spaces,' ');
+ memset(end - spaces, ' ', spaces);
}
}
@@ -919,7 +919,7 @@ static void uf_endspace(MI_COLUMNDEF *re
}
if (to+spaces != end)
decode_bytes(rec,bit_buff,to,end-spaces);
- bfill((uchar*) end-spaces,spaces,' ');
+ memset(end - spaces, ' ', spaces);
}
static void uf_space_prespace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
@@ -927,7 +927,7 @@ static void uf_space_prespace_selected(M
{
uint spaces;
if (get_bit(bit_buff))
- bfill((uchar*) to,(end-to),' ');
+ memset(to, ' ', end - to);
else
{
if (get_bit(bit_buff))
@@ -937,7 +937,7 @@ static void uf_space_prespace_selected(M
bit_buff->error=1;
return;
}
- bfill((uchar*) to,spaces,' ');
+ memset(to, ' ', spaces);
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -958,7 +958,7 @@ static void uf_prespace_selected(MI_COLU
bit_buff->error=1;
return;
}
- bfill((uchar*) to,spaces,' ');
+ memset(to, ' ', spaces);
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -972,7 +972,7 @@ static void uf_space_prespace(MI_COLUMND
{
uint spaces;
if (get_bit(bit_buff))
- bfill((uchar*) to,(end-to),' ');
+ memset(to, ' ', end-to);
else
{
if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
@@ -980,7 +980,7 @@ static void uf_space_prespace(MI_COLUMND
bit_buff->error=1;
return;
}
- bfill((uchar*) to,spaces,' ');
+ memset(to, ' ', spaces);
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -995,7 +995,7 @@ static void uf_prespace(MI_COLUMNDEF *re
bit_buff->error=1;
return;
}
- bfill((uchar*) to,spaces,' ');
+ memset(to, ' ', spaces);
if (to+spaces != end)
decode_bytes(rec,bit_buff,to+spaces,end);
}
@@ -1005,7 +1005,7 @@ static void uf_zerofill_normal(MI_COLUMN
{
end-=rec->space_length_bits;
decode_bytes(rec,bit_buff,(uchar*) to,end);
- bzero((char*) end,rec->space_length_bits);
+ memset(end, 0, rec->space_length_bits);
}
static void uf_constant(MI_COLUMNDEF *rec,
@@ -1031,14 +1031,14 @@ static void uf_zero(MI_COLUMNDEF *rec __
MI_BIT_BUFF *bit_buff __attribute__((unused)),
uchar *to, uchar *end)
{
- bzero((char*) to,(uint) (end-to));
+ memset(to, 0, (end-to));
}
static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
uchar *to, uchar *end)
{
if (get_bit(bit_buff))
- bzero((uchar*) to,(end-to));
+ memset(to, 0, (end-to));
else
{
ulong length=get_bits(bit_buff,rec->space_length_bits);
@@ -1046,7 +1046,7 @@ static void uf_blob(MI_COLUMNDEF *rec, M
if (bit_buff->blob_pos+length > bit_buff->blob_end)
{
bit_buff->error=1;
- bzero((uchar*) to,(end-to));
+ memset(to, 0, (end-to));
return;
}
decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length);
=== modified file 'storage/myisam/mi_rkey.c'
--- a/storage/myisam/mi_rkey.c 2010-05-04 07:57:44 +0000
+++ b/storage/myisam/mi_rkey.c 2011-05-26 15:20:09 +0000
@@ -193,7 +193,7 @@ int mi_rkey(MI_INFO *info, uchar *buf, i
/* Store last used key as a base for read next */
memcpy(info->lastkey,key_buff,pack_key_length);
info->last_rkey_length= pack_key_length;
- bzero((char*) info->lastkey+pack_key_length,info->s->base.rec_reflength);
+ memset(info->lastkey+pack_key_length, 0, info->s->base.rec_reflength);
info->lastkey_length=pack_key_length+info->s->base.rec_reflength;
if (search_flag == HA_READ_AFTER_KEY)
=== modified file 'storage/myisam/mi_statrec.c'
--- a/storage/myisam/mi_statrec.c 2011-01-11 09:09:21 +0000
+++ b/storage/myisam/mi_statrec.c 2011-05-26 15:20:09 +0000
@@ -54,7 +54,7 @@ int _mi_write_static_record(MI_INFO *inf
if (info->s->base.pack_reclength != info->s->base.reclength)
{
uint length=info->s->base.pack_reclength - info->s->base.reclength;
- bzero(temp,length);
+ memset(temp, 0, length);
if (my_b_write(&info->rec_cache, temp,length))
goto err;
}
@@ -69,7 +69,7 @@ int _mi_write_static_record(MI_INFO *inf
if (info->s->base.pack_reclength != info->s->base.reclength)
{
uint length=info->s->base.pack_reclength - info->s->base.reclength;
- bzero(temp,length);
+ memset(temp, 0, length);
if (info->s->file_write(info, temp,length,
info->state->data_file_length+
info->s->base.reclength,
=== modified file 'storage/myisam/mi_test1.c'
--- a/storage/myisam/mi_test1.c 2011-03-28 08:49:43 +0000
+++ b/storage/myisam/mi_test1.c 2011-05-26 15:20:09 +0000
@@ -66,7 +66,7 @@ static int run_test(const char *filename
MI_UNIQUEDEF uniquedef;
MI_CREATE_INFO create_info;
- bzero((char*) recinfo,sizeof(recinfo));
+ memset(recinfo, 0, sizeof(recinfo));
/* First define 2 columns */
recinfo[0].type=FIELD_NORMAL; recinfo[0].length=1; /* For NULL bits */
@@ -109,13 +109,13 @@ static int run_test(const char *filename
}
keyinfo[0].flag = (uint8) (pack_keys | unique_key);
- bzero((uchar*) flags,sizeof(flags));
+ memset(flags, 0, sizeof(flags));
if (opt_unique)
{
uint start;
uniques=1;
- bzero((char*) &uniquedef,sizeof(uniquedef));
- bzero((char*) uniqueseg,sizeof(uniqueseg));
+ memset(&uniquedef, 0, sizeof(uniquedef));
+ memset(uniqueseg, 0, sizeof(uniqueseg));
uniquedef.seg=uniqueseg;
uniquedef.keysegs=2;
@@ -144,7 +144,7 @@ static int run_test(const char *filename
if (!silent)
printf("- Creating isam-file\n");
- bzero((char*) &create_info,sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
create_info.max_rows=(ulong) (rec_pointer_size ?
(1L << (rec_pointer_size*8))/40 :
0);
@@ -339,12 +339,12 @@ static void create_key_part(uchar *key,u
keyinfo[0].seg[0].type == HA_KEYTYPE_VARTEXT2)
{ /* Alpha record */
/* Create a key that may be easily packed */
- bfill(key,keyinfo[0].seg[0].length,rownr < 10 ? 'A' : 'B');
+ memset(key, rownr < 10 ? 'A' : 'B', keyinfo[0].seg[0].length);
sprintf((char*) key+keyinfo[0].seg[0].length-2,"%-2d",rownr);
if ((rownr & 7) == 0)
{
/* Change the key to force a unpack of the next key */
- bfill(key+3,keyinfo[0].seg[0].length-4,rownr < 10 ? 'a' : 'b');
+ memset(key + 3, rownr < 10 ? 'a' : 'b', keyinfo[0].seg[0].length-4);
}
}
else
@@ -354,7 +354,7 @@ static void create_key_part(uchar *key,u
else
{
/* Create a key that may be easily packed */
- bfill(key,keyinfo[0].seg[0].length,rownr < 10 ? 'A' : 'B');
+ memset(key, rownr < 10 ? 'A' : 'B', keyinfo[0].seg[0].length);
sprintf((char*) key+keyinfo[0].seg[0].length-2,"%-2d",rownr);
if ((rownr & 7) == 0)
{
@@ -397,7 +397,7 @@ static uchar blob_record[MAX_REC_LENGTH+
static void create_record(uchar *record,uint rownr)
{
uchar *pos;
- bzero((char*) record,MAX_REC_LENGTH);
+ memset(record, 0, MAX_REC_LENGTH);
record[0]=1; /* delete marker */
if (rownr == 0 && keyinfo[0].seg[0].null_bit)
record[0]|=keyinfo[0].seg[0].null_bit; /* Null key */
@@ -503,7 +503,7 @@ static void update_record(uchar *record)
length=uint4korr(pos);
memcpy(&column, pos+4, sizeof(char*));
memcpy(blob_record,column,length);
- bfill(blob_record+length,20,'.'); /* Make it larger */
+ memset(blob_record + length, '.', 20); /* Make it larger */
length+=20;
int4store(pos,length);
column= blob_record;
@@ -514,7 +514,8 @@ static void update_record(uchar *record)
/* Second field is longer than 10 characters */
uint pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1);
uint length= pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos);
- bfill(pos+pack_length+length,recinfo[2].length-length-pack_length,'.');
+ memset(pos + pack_length + length, '.',
+ recinfo[2].length - length-pack_length);
length=recinfo[2].length-pack_length;
if (pack_length == 1)
*(uchar*) pos= (uchar) length;
@@ -523,7 +524,7 @@ static void update_record(uchar *record)
}
else
{
- bfill(pos+recinfo[2].length-10,10,'.');
+ memset(pos + recinfo[2].length - 10, '.', 10);
}
}
=== modified file 'storage/myisam/mi_test2.c'
--- a/storage/myisam/mi_test2.c 2010-07-23 20:17:55 +0000
+++ b/storage/myisam/mi_test2.c 2011-05-26 15:20:09 +0000
@@ -201,7 +201,7 @@ int main(int argc, char *argv[])
/* DBUG_PUSH(""); */
/* my_delete(filename,MYF(0)); */ /* Remove old locks under gdb */
file= 0;
- bzero((char*) &create_info,sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
create_info.max_rows=(ha_rows) (rec_pointer_size ?
(1L << (rec_pointer_size*8))/
reclength : 0);
@@ -503,7 +503,7 @@ int main(int argc, char *argv[])
key2[i]=0;
/* The following row is just to catch some bugs in the key code */
- bzero((char*) file->lastkey,file->s->base.max_key_length*2);
+ memset(file->lastkey, 0, file->s->base.max_key_length*2);
if (mi_rkey(file,read_record,0,key2,(uint) i,HA_READ_PREFIX))
goto err;
if (memcmp(read_record+start,key,(uint) i))
=== modified file 'storage/myisam/mi_test3.c'
--- a/storage/myisam/mi_test3.c 2010-07-23 20:17:55 +0000
+++ b/storage/myisam/mi_test3.c 2011-05-26 15:20:09 +0000
@@ -62,9 +62,9 @@ int main(int argc,char **argv)
MY_INIT(argv[0]);
get_options(argc,argv);
- bzero((char*) keyinfo,sizeof(keyinfo));
- bzero((char*) recinfo,sizeof(recinfo));
- bzero((char*) keyseg,sizeof(keyseg));
+ memset(keyinfo, 0, sizeof(keyinfo));
+ memset(recinfo, 0, sizeof(recinfo));
+ memset(keyseg, 0, sizeof(keyseg));
keyinfo[0].seg= &keyseg[0][0];
keyinfo[0].seg[0].start=0;
keyinfo[0].seg[0].length=8;
@@ -416,7 +416,7 @@ int test_update(MI_INFO *file,int id,int
return 1;
}
}
- bzero((char*) &new_record,sizeof(new_record));
+ memset(&new_record, 0, sizeof(new_record));
strmov((char*) new_record.text,"Updated");
found=next=prev=update=0;
=== modified file 'storage/myisam/myisamchk.c'
--- a/storage/myisam/myisamchk.c 2011-02-11 14:00:09 +0000
+++ b/storage/myisam/myisamchk.c 2011-05-26 15:20:09 +0000
@@ -1447,8 +1447,8 @@ static int mi_sort_records(MI_CHECK *par
MI_SORT_PARAM sort_param;
DBUG_ENTER("sort_records");
- bzero((char*)&sort_info,sizeof(sort_info));
- bzero((char*)&sort_param,sizeof(sort_param));
+ memset(&sort_info, 0, sizeof(sort_info));
+ memset(&sort_param, 0, sizeof(sort_param));
sort_param.sort_info=&sort_info;
sort_info.param=param;
keyinfo= &share->keyinfo[sort_key];
@@ -1677,7 +1677,7 @@ static int sort_record_index(MI_SORT_PAR
goto err;
}
/* Clear end of block to get better compression if the table is backuped */
- bzero((uchar*) buff+used_length,keyinfo->block_length-used_length);
+ memset(buff+used_length, 0, keyinfo->block_length-used_length);
if (my_pwrite(info->s->kfile,(uchar*) buff,(uint) keyinfo->block_length,
page,param->myf_rw))
{
=== modified file 'storage/myisam/myisamlog.c'
--- a/storage/myisam/myisamlog.c 2010-07-23 20:17:55 +0000
+++ b/storage/myisam/myisamlog.c 2011-05-26 15:20:09 +0000
@@ -327,7 +327,7 @@ static int examine_log(char * file_name,
}
init_io_cache(&cache,file,0,READ_CACHE,start_offset,0,MYF(0));
- bzero((uchar*) com_count,sizeof(com_count));
+ memset(com_count, 0, sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
(tree_element_free) file_info_free, NULL);
(void) init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
=== modified file 'storage/myisam/myisampack.c'
--- a/storage/myisam/myisampack.c 2010-12-29 00:26:31 +0000
+++ b/storage/myisam/myisampack.c 2011-05-26 15:20:09 +0000
@@ -637,7 +637,7 @@ static int compress(PACK_MRG_INFO *mrg,c
if (!error && !test_only)
{
uchar buff[MEMMAP_EXTRA_MARGIN]; /* End marginal for memmap */
- bzero(buff,sizeof(buff));
+ memset(buff, 0, sizeof(buff));
error=my_write(file_buffer.file,buff,sizeof(buff),
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0;
}
@@ -1192,7 +1192,7 @@ static void check_counts(HUFF_COUNTS *hu
my_off_t old_length,new_length,length;
DBUG_ENTER("check_counts");
- bzero((uchar*) field_count,sizeof(field_count));
+ memset(field_count, 0, sizeof(field_count));
space_fields=fill_zero_fields=0;
for (; trees-- ; huff_counts++)
@@ -2039,7 +2039,7 @@ static int write_header(PACK_MRG_INFO *m
{
uchar *buff= (uchar*) file_buffer.pos;
- bzero(buff,HEAD_LENGTH);
+ memset(buff, 0, HEAD_LENGTH);
memcpy(buff,myisam_pack_file_magic,4);
int4store(buff+4,head_length);
int4store(buff+8, mrg->min_pack_length);
=== modified file 'storage/myisam/rt_test.c'
--- a/storage/myisam/rt_test.c 2010-07-23 20:09:27 +0000
+++ b/storage/myisam/rt_test.c 2011-05-26 15:20:09 +0000
@@ -147,7 +147,7 @@ static int run_test(const char *filename
if (!silent)
printf("- Creating isam-file\n");
- bzero((char*) &create_info,sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
create_info.max_rows=10000000;
if (mi_create(filename,
@@ -193,7 +193,7 @@ static int run_test(const char *filename
my_errno=0;
create_record(record,i);
- bzero((char*) read_record,MAX_REC_LENGTH);
+ memset(read_record, 0, MAX_REC_LENGTH);
error=mi_rkey(file,read_record,0,record+1,0,HA_READ_MBR_EQUAL);
if (error && error!=HA_ERR_KEY_NOT_FOUND)
@@ -214,7 +214,7 @@ static int run_test(const char *filename
for (i=0; i < nrecords/4; i++)
{
my_errno=0;
- bzero((char*) read_record,MAX_REC_LENGTH);
+ memset(read_record, 0, MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if (error)
{
@@ -236,7 +236,7 @@ static int run_test(const char *filename
for (i=0; i < (nrecords - nrecords/4) ; i++)
{
my_errno=0;
- bzero((char*) read_record,MAX_REC_LENGTH);
+ memset(read_record, 0, MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if (error)
{
@@ -349,7 +349,7 @@ static int read_with_pos (MI_INFO * file
for (i=0;;i++)
{
my_errno=0;
- bzero((char*) read_record,MAX_REC_LENGTH);
+ memset(read_record, 0, MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if (error)
{
@@ -394,7 +394,7 @@ static void create_record1(uchar *record
uchar * pos;
double c=rownr+10;
- bzero((char*) record,MAX_REC_LENGTH);
+ memset(record, 0, MAX_REC_LENGTH);
record[0]=0x01; /* DEL marker */
for (pos=record+1, i=0; i<2*ndims; i++)
=== modified file 'storage/myisam/sort.c'
--- a/storage/myisam/sort.c 2011-01-11 09:09:21 +0000
+++ b/storage/myisam/sort.c 2011-05-26 15:20:09 +0000
@@ -125,7 +125,7 @@ int _create_index_by_sort(MI_SORT_PARAM
my_b_clear(&tempfile);
my_b_clear(&tempfile_for_exceptions);
- bzero((char*) &buffpek,sizeof(buffpek));
+ memset(&buffpek, 0, sizeof(buffpek));
sort_keys= (uchar **) NULL; error= 1;
maxbuffer=1;
@@ -340,8 +340,8 @@ pthread_handler_t thr_find_all_keys(void
my_b_clear(&sort_param->tempfile);
my_b_clear(&sort_param->tempfile_for_exceptions);
- bzero((char*) &sort_param->buffpek, sizeof(sort_param->buffpek));
- bzero((char*) &sort_param->unique, sizeof(sort_param->unique));
+ memset(&sort_param->buffpek, 0, sizeof(sort_param->buffpek));
+ memset(&sort_param->unique, 0, sizeof(sort_param->unique));
sort_keys= (uchar **) NULL;
memavl= max(sort_param->sortbuff_size, MIN_SORT_BUFFER);
=== modified file 'storage/myisam/sp_key.c'
--- a/storage/myisam/sp_key.c 2010-07-23 20:17:55 +0000
+++ b/storage/myisam/sp_key.c 2011-05-26 15:20:09 +0000
@@ -69,7 +69,7 @@ uint sp_make_key(register MI_INFO *info,
#ifdef HAVE_ISNAN
if (isnan(val))
{
- bzero(key, length);
+ memset(key, 0, length);
key+= length;
len+= length;
continue;
=== modified file 'storage/myisam/sp_test.c'
--- a/storage/myisam/sp_test.c 2011-03-28 08:49:43 +0000
+++ b/storage/myisam/sp_test.c 2011-05-26 15:20:09 +0000
@@ -103,7 +103,7 @@ int run_test(const char *filename)
if (!silent)
printf("- Creating isam-file\n");
- bzero((char*) &create_info,sizeof(create_info));
+ memset(&create_info, 0, sizeof(create_info));
create_info.max_rows=10000000;
if (mi_create(filename,
@@ -146,7 +146,7 @@ int run_test(const char *filename)
for (i=0; i < nrecords/4; i++)
{
my_errno=0;
- bzero((char*) read_record,MAX_REC_LENGTH);
+ memset(read_record, 0, MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if (error)
{
@@ -167,7 +167,7 @@ int run_test(const char *filename)
for (i=0; i < nrecords/2 ; i++)
{
my_errno=0;
- bzero((char*) read_record,MAX_REC_LENGTH);
+ memset(read_record, 0, MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if (error)
{
@@ -280,7 +280,7 @@ static int read_with_pos (MI_INFO * file
for (i=0;;i++)
{
my_errno=0;
- bzero((char*) read_record,MAX_REC_LENGTH);
+ memset(read_record, 0, MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if (error)
{
@@ -333,7 +333,7 @@ static void create_linestring(uchar *rec
for(i=0;i<SPDIMS;i++)
x[i+j*SPDIMS]=rownr*j;
- bzero((char*) record,MAX_REC_LENGTH);
+ memset(record, 0, MAX_REC_LENGTH);
*pos=0x01; /* DEL marker */
pos++;
@@ -354,7 +354,7 @@ static void create_key(uchar *key,uint r
uchar *pos;
uint i;
- bzero(key,MAX_REC_LENGTH);
+ memset(key, 0, MAX_REC_LENGTH);
for (pos=key, i=0; i<2*SPDIMS; i++)
{
float8store(pos,c);
=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc 2011-05-04 07:51:15 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc 2011-05-26 15:20:09 +0000
@@ -1317,8 +1317,8 @@ int ha_myisammrg::info(uint flag)
It's safe though, because even if opimizer will decide to use a key
with such a number, it'll be an error later anyway.
*/
- bzero((char*) table->key_info[0].rec_per_key,
- sizeof(table->key_info[0].rec_per_key[0]) * table->s->key_parts);
+ memset(table->key_info[0].rec_per_key, 0,
+ sizeof(table->key_info[0].rec_per_key[0]) * table->s->key_parts);
#endif
memcpy((char*) table->key_info[0].rec_per_key,
(char*) mrg_info.rec_per_key,
=== modified file 'storage/myisammrg/myrg_open.c'
--- a/storage/myisammrg/myrg_open.c 2011-02-11 14:00:09 +0000
+++ b/storage/myisammrg/myrg_open.c 2011-05-26 15:20:09 +0000
@@ -46,7 +46,7 @@ MYRG_INFO *myrg_open(const char *name, i
my_bool bad_children= FALSE;
DBUG_ENTER("myrg_open");
- bzero((char*) &file,sizeof(file));
+ memset(&file, 0, sizeof(file));
if ((fd= mysql_file_open(rg_key_file_MRG,
fn_format(name_buff, name, "", MYRG_NAME_EXT,
MY_UNPACK_FILENAME|MY_APPEND_EXT),
@@ -158,7 +158,7 @@ MYRG_INFO *myrg_open(const char *name, i
goto err;
}
m_info->keys= min_keys;
- bzero((char*) &m_info->by_key,sizeof(m_info->by_key));
+ memset(&m_info->by_key, 0, sizeof(m_info->by_key));
/* this works ok if the table list is empty */
m_info->end_table=m_info->open_tables+files;
@@ -235,7 +235,7 @@ MYRG_INFO *myrg_parent_open(const char *
rc= 1;
errpos= 0;
- bzero((char*) &file_cache, sizeof(file_cache));
+ memset(&file_cache, 0, sizeof(file_cache));
/* Open MERGE meta file. */
if ((fd= mysql_file_open(rg_key_file_MRG,
@@ -424,7 +424,7 @@ int myrg_attach_children(MYRG_INFO *m_in
goto err; /* purecov: inspected */
errpos= 1;
}
- bzero((char*) m_info->rec_per_key_part, key_parts * sizeof(long));
+ memset(m_info->rec_per_key_part, 0, key_parts * sizeof(long));
}
/* Add MyISAM table info. */
@@ -514,7 +514,7 @@ int myrg_detach_children(MYRG_INFO *m_in
{
/* Do not attach/detach an empty child list. */
m_info->children_attached= FALSE;
- bzero((char*) m_info->open_tables, m_info->tables * sizeof(MYRG_TABLE));
+ memset(m_info->open_tables, 0, m_info->tables * sizeof(MYRG_TABLE));
}
m_info->records= 0;
m_info->del= 0;
=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2009-09-01 12:32:26 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2011-05-26 15:20:09 +0000
@@ -15139,7 +15139,7 @@ Dbdict::createObj_prepare_start_done(Sig
}
SchemaFile::TableEntry tabEntry;
- bzero(&tabEntry, sizeof(tabEntry));
+ memset(&tabEntry, 0, sizeof(tabEntry));
tabEntry.m_tableVersion = createObjPtr.p->m_obj_version;
tabEntry.m_tableType = createObjPtr.p->m_obj_type;
tabEntry.m_tableState = SchemaFile::ADD_STARTED;
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2008-01-10 11:49:32 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2011-05-26 15:20:09 +0000
@@ -1229,7 +1229,7 @@ void Dbdih::execDIH_RESTARTREQ(Signal* s
mask.assign(NdbNodeBitmask::Size, signal->theData + 1);
Uint32 *node_gcis = signal->theData+1+NdbNodeBitmask::Size;
Uint32 node_group_gcis[MAX_NDB_NODES+1];
- bzero(node_group_gcis, sizeof(node_group_gcis));
+ memset(node_group_gcis, 0, sizeof(node_group_gcis));
for (i = 0; i<MAX_NDB_NODES; i++)
{
if (mask.get(i))
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2009-11-02 20:37:21 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-05-26 15:20:09 +0000
@@ -15606,7 +15606,7 @@ void Dblqh::invalidateLogAfterLastGCI(Si
/**
* Make page really empty
*/
- bzero(logPagePtr.p, sizeof(LogPageRecord));
+ memset(logPagePtr.p, 0, sizeof(LogPageRecord));
writeSinglePage(signal, logPartPtr.p->invalidatePageNo,
ZPAGE_SIZE - 1, __LINE__);
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2008-01-24 14:31:42 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2011-05-26 15:20:09 +0000
@@ -536,7 +536,7 @@ Dbtup::disk_page_prealloc(Signal* signal
ndbout << "allocated " << pages << " pages: " << ext.p->m_key << endl;
ext.p->m_first_page_no = ext.p->m_key.m_page_no;
- bzero(ext.p->m_free_page_count, sizeof(ext.p->m_free_page_count));
+ memset(ext.p->m_free_page_count, 0, sizeof(ext.p->m_free_page_count));
ext.p->m_free_space= alloc.m_page_free_bits_map[0] * pages;
ext.p->m_free_page_count[0]= pages; // All pages are "free"-est
c_extent_hash.add(ext);
@@ -1842,7 +1842,7 @@ Dbtup::disk_restart_alloc_extent(Uint32
ext.p->m_key = *key;
ext.p->m_first_page_no = ext.p->m_key.m_page_no;
ext.p->m_free_space= 0;
- bzero(ext.p->m_free_page_count, sizeof(ext.p->m_free_page_count));
+ memset(ext.p->m_free_page_count, 0, sizeof(ext.p->m_free_page_count));
if (alloc.m_curr_extent_info_ptr_i != RNIL)
{
=== modified file 'storage/ndb/src/kernel/blocks/tsman.cpp'
--- a/storage/ndb/src/kernel/blocks/tsman.cpp 2008-03-05 13:57:13 +0000
+++ b/storage/ndb/src/kernel/blocks/tsman.cpp 2011-05-26 15:20:09 +0000
@@ -1478,7 +1478,7 @@ Tsman::execALLOC_EXTENT_REQ(Signal* sign
/**
* Init header
*/
- bzero(header, 4*eh_words);
+ memset(header, 0, 4*eh_words);
header->m_table = req.request.table_id;
header->m_fragment_id = req.request.fragment_id;
=== modified file 'storage/ndb/src/kernel/vm/RWPool.cpp'
--- a/storage/ndb/src/kernel/vm/RWPool.cpp 2007-06-20 03:41:54 +0000
+++ b/storage/ndb/src/kernel/vm/RWPool.cpp 2011-05-26 15:20:09 +0000
@@ -21,7 +21,7 @@
RWPool::RWPool()
{
- bzero(this, sizeof(* this));
+ memset(this, 0, sizeof(* this));
m_current_pos = RWPage::RWPAGE_WORDS;
m_current_first_free = REC_NIL;
m_first_free_page = RNIL;
=== modified file 'storage/ndb/src/kernel/vm/WOPool.cpp'
--- a/storage/ndb/src/kernel/vm/WOPool.cpp 2007-02-21 15:33:16 +0000
+++ b/storage/ndb/src/kernel/vm/WOPool.cpp 2011-05-26 15:20:09 +0000
@@ -19,7 +19,7 @@
WOPool::WOPool()
{
- bzero(this, sizeof(* this));
+ memset(this, 0, sizeof(* this));
m_current_pos = WOPage::WOPAGE_WORDS;
}
=== modified file 'storage/ndb/src/kernel/vm/bench_pool.cpp'
--- a/storage/ndb/src/kernel/vm/bench_pool.cpp 2006-12-27 01:23:51 +0000
+++ b/storage/ndb/src/kernel/vm/bench_pool.cpp 2011-05-26 15:20:09 +0000
@@ -98,7 +98,7 @@ test_pool(R& pool, Uint32 cnt, Uint32 lo
{
Ptr<T> ptr;
Uint32 *arr = (Uint32*)alloca(cnt * sizeof(Uint32));
- bzero(arr, cnt * sizeof(Uint32));
+ memset(arr, 0, cnt * sizeof(Uint32));
if (tests & T_SEIZE)
{
Uint64 sum = 0;
=== modified file 'storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp'
--- a/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp 2008-02-08 14:17:45 +0000
+++ b/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp 2011-05-26 15:20:09 +0000
@@ -169,8 +169,8 @@ Ndbd_mem_manager::ndb_log2(Uint32 input)
Ndbd_mem_manager::Ndbd_mem_manager()
{
m_base_page = 0;
- bzero(m_buddy_lists, sizeof(m_buddy_lists));
- bzero(m_resource_limit, sizeof(m_resource_limit));
+ memset(m_buddy_lists, 0, sizeof(m_buddy_lists));
+ memset(m_resource_limit, 0, sizeof(m_resource_limit));
if (sizeof(Free_page_data) != (4 * (1 << FPD_2LOG)))
{
@@ -282,7 +282,7 @@ Ndbd_mem_manager::init(bool alloc_less_m
Uint32 cnt = 0;
struct InitChunk chunks[MAX_CHUNKS];
- bzero(chunks, sizeof(chunks));
+ memset(chunks, 0, sizeof(chunks));
Uint32 allocated = 0;
while (cnt < MAX_CHUNKS && allocated < pages)
=== modified file 'storage/ndb/src/mgmsrv/InitConfigFileParser.cpp'
--- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp 2010-11-08 13:52:10 +0000
+++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp 2011-05-26 15:20:09 +0000
@@ -757,7 +757,7 @@ InitConfigFileParser::load_mycnf_groups(
}
struct my_option end;
- bzero(&end, sizeof(end));
+ memset(&end, 0, sizeof(end));
copy.push_back(end);
if (load_defaults(copy, groups))
@@ -776,7 +776,7 @@ InitConfigFileParser::parse_mycnf()
{
{
struct my_option opt;
- bzero(&opt, sizeof(opt));
+ memset(&opt, 0, sizeof(opt));
const ConfigInfo::ParamInfo& param = ConfigInfo::m_ParamInfo[i];
switch(param._type){
case ConfigInfo::CI_BOOL:
@@ -815,7 +815,7 @@ InitConfigFileParser::parse_mycnf()
Uint32 idx = options.size();
{
struct my_option opt;
- bzero(&opt, sizeof(opt));
+ memset(&opt, 0, sizeof(opt));
opt.name = "ndbd";
opt.id = 256;
opt.value = (uchar**)malloc(sizeof(char*));
@@ -844,7 +844,7 @@ InitConfigFileParser::parse_mycnf()
opt.arg_type = REQUIRED_ARG;
options.push_back(opt);
- bzero(&opt, sizeof(opt));
+ memset(&opt, 0, sizeof(opt));
options.push_back(opt);
ndbd = &options[idx];
=== modified file 'storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp 2010-01-21 00:21:18 +0000
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp 2011-05-26 15:20:09 +0000
@@ -1030,7 +1030,7 @@ NdbEventBuffer::NdbEventBuffer(Ndb *ndb)
m_ndb->theImpl->m_ndb_cluster_connection.m_event_add_drop_mutex;
// initialize lists
- bzero(&g_empty_gci_container, sizeof(Gci_container));
+ memset(&g_empty_gci_container, 0, sizeof(Gci_container));
init_gci_containers();
}
@@ -1087,7 +1087,7 @@ NdbEventBuffer::remove_op()
void
NdbEventBuffer::init_gci_containers()
{
- bzero(&m_complete_data, sizeof(m_complete_data));
+ memset(&m_complete_data, 0, sizeof(m_complete_data));
m_latest_complete_GCI = m_latestGCI = 0;
m_active_gci.clear();
m_active_gci.fill(2 * ACTIVE_GCI_DIRECTORY_SIZE - 1, g_empty_gci_container);
@@ -1107,7 +1107,7 @@ int NdbEventBuffer::expand(unsigned sz)
EventBufData *end_data= data+sz;
EventBufData *last_data= m_free_data;
- bzero((void*)data, sz*sizeof(EventBufData));
+ memset(data, 0, sz*sizeof(EventBufData));
for (; data < end_data; data++)
{
data->m_next= last_data;
@@ -1179,7 +1179,7 @@ NdbEventBuffer::flushIncompleteEvents(Ui
free_list(tmp->m_data);
}
tmp->~Gci_container();
- bzero(tmp, sizeof(Gci_container));
+ memset(tmp, 0, sizeof(Gci_container));
}
}
#ifdef VM_TRACE
@@ -1392,7 +1392,7 @@ find_bucket_chained(Vector<Gci_container
if(move->m_gcp_complete_rep_count == 0)
{
memcpy(move, bucket, sizeof(Gci_container));
- bzero(bucket, sizeof(Gci_container));
+ memset(bucket, 0, sizeof(Gci_container));
bucket->m_gci = gci;
bucket->m_gcp_complete_rep_count = ~(Uint32)0;
#ifdef VM_TRACE
@@ -1532,7 +1532,7 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP
m_complete_data.m_data.append_list(&bucket->m_data, gci);
}
reportStatus();
- bzero(bucket, sizeof(Gci_container));
+ memset(bucket, 0, sizeof(Gci_container));
if (likely(idx < ACTIVE_GCI_DIRECTORY_SIZE))
{
/**
@@ -1621,7 +1621,7 @@ NdbEventBuffer::complete_outof_order_gci
ndbout_c(" ");
#endif
}
- bzero(bucket, sizeof(Gci_container));
+ memset(bucket, 0, sizeof(Gci_container));
if(i < ACTIVE_GCI_DIRECTORY_SIZE)
{
bucket->m_gci = start_gci + ACTIVE_GCI_DIRECTORY_SIZE;
@@ -1678,8 +1678,8 @@ NdbEventBuffer::report_node_connected(Ui
DBUG_ENTER("NdbEventBuffer::report_node_connected");
SubTableData data;
LinearSectionPtr ptr[3];
- bzero(&data, sizeof(data));
- bzero(ptr, sizeof(ptr));
+ memset(&data, 0, sizeof(data));
+ memset(ptr, 0, sizeof(ptr));
data.tableId = ~0;
data.requestInfo = 0;
@@ -1707,8 +1707,8 @@ NdbEventBuffer::report_node_failure(Uint
DBUG_ENTER("NdbEventBuffer::report_node_failure");
SubTableData data;
LinearSectionPtr ptr[3];
- bzero(&data, sizeof(data));
- bzero(ptr, sizeof(ptr));
+ memset(&data, 0, sizeof(data));
+ memset(ptr, 0, sizeof(ptr));
data.tableId = ~0;
data.requestInfo = 0;
@@ -1736,8 +1736,8 @@ NdbEventBuffer::completeClusterFailed()
DBUG_ENTER("NdbEventBuffer::completeClusterFailed");
SubTableData data;
LinearSectionPtr ptr[3];
- bzero(&data, sizeof(data));
- bzero(ptr, sizeof(ptr));
+ memset(&data, 0, sizeof(data));
+ memset(ptr, 0, sizeof(ptr));
data.tableId = ~0;
data.requestInfo = 0;
@@ -1774,7 +1774,7 @@ NdbEventBuffer::completeClusterFailed()
free_list(tmp->m_data);
}
tmp->~Gci_container();
- bzero(tmp, sizeof(Gci_container));
+ memset(tmp, 0, sizeof(Gci_container));
}
else if (tmp->m_gcp_complete_rep_count)
{
@@ -1795,7 +1795,7 @@ NdbEventBuffer::completeClusterFailed()
free_list(tmp->m_data);
}
tmp->~Gci_container();
- bzero(tmp, sizeof(Gci_container));
+ memset(tmp, 0, sizeof(Gci_container));
}
}
@@ -2567,7 +2567,7 @@ NdbEventBuffer::move_data()
// move this list to last in m_available_data
m_available_data.append_list(&m_complete_data.m_data, 0);
- bzero(&m_complete_data, sizeof(m_complete_data));
+ memset(&m_complete_data, 0, sizeof(m_complete_data));
}
// handle used data
=== modified file 'storage/ndb/test/ndbapi/testNodeRestart.cpp'
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp 2008-02-08 15:42:17 +0000
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp 2011-05-26 15:20:09 +0000
@@ -744,8 +744,8 @@ runBug18612(NDBT_Context* ctx, NDBT_Step
{
int partition0[256];
int partition1[256];
- bzero(partition0, sizeof(partition0));
- bzero(partition1, sizeof(partition1));
+ memset(partition0, 0, sizeof(partition0));
+ memset(partition1, 0, sizeof(partition1));
Bitmask<4> nodesmask;
Uint32 node1 = restarter.getDbNodeId(rand()%cnt);
@@ -853,8 +853,8 @@ runBug18612SR(NDBT_Context* ctx, NDBT_St
{
int partition0[256];
int partition1[256];
- bzero(partition0, sizeof(partition0));
- bzero(partition1, sizeof(partition1));
+ memset(partition0, 0, sizeof(partition0));
+ memset(partition1, 0, sizeof(partition1));
Bitmask<4> nodesmask;
Uint32 node1 = restarter.getDbNodeId(rand()%cnt);
=== modified file 'storage/ndb/test/run-test/setup.cpp'
--- a/storage/ndb/test/run-test/setup.cpp 2011-01-17 07:44:37 +0000
+++ b/storage/ndb/test/run-test/setup.cpp 2011-05-26 15:20:09 +0000
@@ -440,7 +440,7 @@ configure(atrt_config& config, int setup
{
bool ok = true;
proc_rule_ctx ctx;
- bzero(&ctx, sizeof(ctx));
+ memset(&ctx, 0, sizeof(ctx));
ctx.m_setup = setup;
ctx.m_config = &config;
=== modified file 'storage/ndb/test/src/DbUtil.cpp'
--- a/storage/ndb/test/src/DbUtil.cpp 2008-01-18 21:55:02 +0000
+++ b/storage/ndb/test/src/DbUtil.cpp 2011-05-26 15:20:09 +0000
@@ -367,7 +367,7 @@ DbUtil::runQuery(const char* sql,
uint params= mysql_stmt_param_count(stmt);
MYSQL_BIND bind_param[params];
- bzero(bind_param, sizeof(bind_param));
+ memset(bind_param, 0, sizeof(bind_param));
for(uint i= 0; i < mysql_stmt_param_count(stmt); i++)
{
@@ -437,7 +437,7 @@ DbUtil::runQuery(const char* sql,
MYSQL_FIELD *fields= mysql_fetch_fields(res);
uint num_fields= mysql_num_fields(res);
MYSQL_BIND bind_result[num_fields];
- bzero(bind_result, sizeof(bind_result));
+ memset(bind_result, 0, sizeof(bind_result));
for (uint i= 0; i < num_fields; i++)
{
=== modified file 'strings/conf_to_src.c'
--- a/strings/conf_to_src.c 2011-01-19 13:35:54 +0000
+++ b/strings/conf_to_src.c 2011-05-26 15:20:09 +0000
@@ -303,8 +303,8 @@ main(int argc, char **argv __attribute_
exit(EXIT_FAILURE);
}
- bzero((void*)&ncs,sizeof(ncs));
- bzero((void*)&all_charsets,sizeof(all_charsets));
+ memset(&ncs, 0, sizeof(ncs));
+ memset(&all_charsets, 0, sizeof(all_charsets));
sprintf(filename,"%s/%s",argv[1],"Index.xml");
my_read_charset_file(filename);
=== modified file 'strings/ctype-czech.c'
--- a/strings/ctype-czech.c 2011-03-09 20:54:55 +0000
+++ b/strings/ctype-czech.c 2011-05-26 15:20:09 +0000
@@ -315,7 +315,7 @@ my_strnxfrm_czech(const CHARSET_INFO *cs
while (value);
if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && len > totlen)
{
- bfill(dest + totlen, len - totlen, ' ');
+ memset(dest + totlen, ' ', len - totlen);
totlen= len;
}
return totlen;
=== modified file 'strings/ctype-mb.c'
--- a/strings/ctype-mb.c 2011-03-09 20:54:55 +0000
+++ b/strings/ctype-mb.c 2011-05-26 15:20:09 +0000
@@ -695,7 +695,7 @@ my_hash_sort_mb_bin(const CHARSET_INFO *
DESCRIPTION
Write max key:
- for non-Unicode character sets:
- just bfill using max_sort_char if max_sort_char is one byte.
+ just memset using max_sort_char if max_sort_char is one byte.
In case when max_sort_char is two bytes, fill with double-byte pairs
and optionally pad with a single space character.
- for Unicode character set (utf-8):
@@ -711,7 +711,7 @@ static void pad_max_char(const CHARSET_I
{
if (cs->max_sort_char <= 255)
{
- bfill(str, end - str, cs->max_sort_char);
+ memset(str, cs->max_sort_char, end - str);
return;
}
buf[0]= cs->max_sort_char >> 8;
=== modified file 'strings/ctype-simple.c'
--- a/strings/ctype-simple.c 2011-03-09 20:54:55 +0000
+++ b/strings/ctype-simple.c 2011-05-26 15:20:09 +0000
@@ -1020,7 +1020,7 @@ size_t my_scan_8bit(const CHARSET_INFO *
void my_fill_8bit(const CHARSET_INFO *cs __attribute__((unused)),
char *s, size_t l, int fill)
{
- bfill((uchar*) s,l,fill);
+ memset(s, fill, l);
}
@@ -1164,7 +1164,7 @@ create_fromuni(CHARSET_INFO *cs,
return TRUE;
/* Clear plane statistics */
- bzero(idx,sizeof(idx));
+ memset(idx, 0, sizeof(idx));
/* Count number of characters in each plane */
for (i=0; i< 0x100; i++)
@@ -1204,7 +1204,7 @@ create_fromuni(CHARSET_INFO *cs,
sizeof(*idx[i].uidx.tab))))
return TRUE;
- bzero(idx[i].uidx.tab,numchars*sizeof(*idx[i].uidx.tab));
+ memset(idx[i].uidx.tab, 0, numchars*sizeof(*idx[i].uidx.tab));
for (ch=1; ch < PLANE_SIZE; ch++)
{
@@ -1227,7 +1227,7 @@ create_fromuni(CHARSET_INFO *cs,
cs->tab_from_uni[i]= idx[i].uidx;
/* Set end-of-list marker */
- bzero(&cs->tab_from_uni[i],sizeof(MY_UNI_IDX));
+ memset(&cs->tab_from_uni[i], 0, sizeof(MY_UNI_IDX));
return FALSE;
}
=== modified file 'strings/ctype-uca.c'
--- a/strings/ctype-uca.c 2011-05-21 08:25:33 +0000
+++ b/strings/ctype-uca.c 2011-05-26 15:20:09 +0000
@@ -19566,8 +19566,8 @@ my_uca_alloc_contractions(MY_UCA_INFO *u
if (!(uca->contractions.item= (loader->once_alloc)(size)) ||
!(uca->contractions.flags= (char *) (loader->once_alloc)(MY_UCA_CNT_FLAG_SIZE)))
return 1;
- bzero((void *) uca->contractions.item, size);
- bzero((void *) uca->contractions.flags, MY_UCA_CNT_FLAG_SIZE);
+ memset(uca->contractions.item, 0, size);
+ memset(uca->contractions.flags, 0, MY_UCA_CNT_FLAG_SIZE);
return 0;
}
@@ -20924,7 +20924,7 @@ my_coll_rule_expand(my_wc_t *wc, size_t
static void
my_coll_rule_reset(MY_COLL_RULE *r)
{
- bzero((void *) r, sizeof(*r));
+ memset(r, 0, sizeof(*r));
}
@@ -21104,7 +21104,7 @@ my_coll_parser_init(MY_COLL_RULE_PARSER
Initialize parser to the input buffer and scan two tokens,
to make the current token and the next token known.
*/
- bzero((void *) p, sizeof(*p));
+ memset(p, 0, sizeof(*p));
p->rules= rules;
p->errstr[0]= '\0';
my_coll_lexem_init(my_coll_parser_curr(p), str, str_end);
@@ -21493,7 +21493,7 @@ my_coll_parser_scan_shift_sequence(MY_CO
{
MY_COLL_RULE before_extend;
- bzero((void *) &p->rule.curr, sizeof(p->rule.curr));
+ memset(&p->rule.curr, 0, sizeof(p->rule.curr));
/* Scan single shift character or contraction */
if (!my_coll_parser_scan_character_list(p, p->rule.curr,
@@ -21741,7 +21741,7 @@ my_uca_copy_page(MY_CHARSET_LOADER *load
return TRUE;
DBUG_ASSERT(src_uca->lengths[page] <= dst_uca->lengths[page]);
- bzero((void *) dst_uca->weights[page], size);
+ memset(dst_uca->weights[page], 0, size);
for (chc=0 ; chc < 256; chc++)
{
memcpy(dst_uca->weights[page] + chc * dst_uca->lengths[page],
@@ -21783,10 +21783,10 @@ create_tailoring(CHARSET_INFO *cs, MY_CH
if (!cs->tailoring)
return 0; /* Ok to add a collation without tailoring */
- bzero((void *) &rules, sizeof(rules));
+ memset(&rules, 0, sizeof(rules));
rules.loader= loader;
rules.uca= cs->uca ? cs->uca : &my_uca_v400; /* For logical positions, etc */
- bzero((void *) &new_uca, sizeof(new_uca));
+ memset(&new_uca, 0, sizeof(new_uca));
/* Parse ICU Collation Customization expression */
if ((rc= my_coll_rule_parse(&rules,
=== modified file 'strings/ctype-win1250ch.c'
--- a/strings/ctype-win1250ch.c 2011-03-09 20:54:55 +0000
+++ b/strings/ctype-win1250ch.c 2011-05-26 15:20:09 +0000
@@ -504,7 +504,7 @@ my_strnxfrm_win1250ch(const CHARSET_INFO
}
if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && len > totlen)
{
- bfill(dest + totlen, len - totlen, 0x00);
+ memset(dest + totlen, 0x00, len - totlen);
totlen= len;
}
return totlen;
=== modified file 'strings/ctype.c'
--- a/strings/ctype.c 2011-03-09 20:54:55 +0000
+++ b/strings/ctype.c 2011-05-26 15:20:09 +0000
@@ -290,7 +290,7 @@ typedef struct my_cs_file_info
static void
my_charset_file_reset_charset(MY_CHARSET_FILE *i)
{
- bzero(&i->cs, sizeof(i->cs));
+ memset(&i->cs, 0, sizeof(i->cs));
}
=== modified file 'strings/decimal.c'
--- a/strings/decimal.c 2011-05-16 14:30:54 +0000
+++ b/strings/decimal.c 2011-05-26 15:20:09 +0000
@@ -2032,7 +2032,7 @@ int decimal_mul(const decimal_t *from1,
stop1=buf1-intg1;
stop2=buf2-intg2;
- bzero(to->buf, (intg0+frac0)*sizeof(dec1));
+ memset(to->buf, 0, (intg0+frac0)*sizeof(dec1));
for (buf1+=frac1-1; buf1 >= stop1; buf1--, start0--)
{
@@ -2203,7 +2203,7 @@ static int do_div_mod(const decimal_t *f
if (!(tmp1=(dec1 *)my_alloca(len1*sizeof(dec1))))
return E_DEC_OOM;
memcpy(tmp1, buf1, i*sizeof(dec1));
- bzero(tmp1+i, (len1-i)*sizeof(dec1));
+ memset(tmp1+i, 0, (len1-i)*sizeof(dec1));
start1=tmp1;
stop1=start1+len1;
=== modified file 'strings/dump_map.c'
--- a/strings/dump_map.c 2011-01-19 13:17:52 +0000
+++ b/strings/dump_map.c 2011-05-26 15:20:09 +0000
@@ -40,9 +40,9 @@ int main(void)
unsigned short fromstat[256];
int i;
- bzero((void*)touni,sizeof(touni));
- bzero((void*)fromuni,sizeof(fromuni));
- bzero((void*)fromstat,sizeof(fromstat));
+ memset(touni, 0, sizeof(touni));
+ memset(fromuni, 0, sizeof(fromuni));
+ memset(fromstat, 0, sizeof(fromstat));
while (fgets(str,sizeof(str),stdin))
{
=== modified file 'strings/my_vsnprintf.c'
--- a/strings/my_vsnprintf.c 2011-03-09 20:54:55 +0000
+++ b/strings/my_vsnprintf.c 2011-05-26 15:20:09 +0000
@@ -284,7 +284,7 @@ static char *process_int_arg(char *to, c
if (res_length < length)
{
size_t diff= (length- res_length);
- bfill(to, diff, (print_type & PREZERO_ARG) ? '0' : ' ');
+ memset(to, (print_type & PREZERO_ARG) ? '0' : ' ', diff);
if (arg_type == 'p' && print_type & PREZERO_ARG)
{
if (diff > 1)
=== modified file 'strings/uca-dump.c'
--- a/strings/uca-dump.c 2011-03-11 14:16:44 +0000
+++ b/strings/uca-dump.c 2011-05-26 15:20:09 +0000
@@ -359,7 +359,7 @@ normalize_weight(MY_UCA_ITEM *item, size
{
size_t num, i;
- bzero(weight, weight_elements * sizeof(*weight));
+ memset(weight, 0, weight_elements * sizeof(*weight));
/*
Copy non-zero weights only. For example:
@@ -653,11 +653,11 @@ main(int ac, char **av)
size_t level, maxchar= MY_UCA_MAXCHAR;
static int pageloaded[MY_UCA_NPAGES];
- bzero(&uca, sizeof(uca));
+ memset(&uca, 0, sizeof(uca));
process_options(ac, av, &uca);
- bzero(pageloaded, sizeof(pageloaded));
+ memset(pageloaded, 0, sizeof(pageloaded));
load_uca_file(&uca, maxchar, pageloaded);
=== modified file 'strings/uctypedump.c'
--- a/strings/uctypedump.c 2011-03-23 12:14:17 +0000
+++ b/strings/uctypedump.c 2011-05-26 15:20:09 +0000
@@ -152,7 +152,7 @@ load_unidata(MY_UNIDATA_PARAM *prm, MY_U
size_t n;
char *s, *e;
MY_UNIDATA_CHAR ch;
- bzero(&ch, sizeof(ch));
+ memset(&ch, 0, sizeof(ch));
for(n= 0, s= str; s; n++)
{
@@ -536,7 +536,7 @@ int main(int ac, char ** av)
static MY_UNIDATA_CHAR unidata[MAX_CHAR + 1];
process_options(&prm, ac, av);
- bzero(unidata, sizeof(unidata));
+ memset(unidata, 0, sizeof(unidata));
fill_implicit_ctype(&prm, unidata);
load_unidata(&prm, unidata);
=== modified file 'strings/xml.c'
--- a/strings/xml.c 2011-03-01 12:30:18 +0000
+++ b/strings/xml.c 2011-05-26 15:20:09 +0000
@@ -443,7 +443,7 @@ gt:
void my_xml_parser_create(MY_XML_PARSER *p)
{
- bzero((void*)p,sizeof(p[0]));
+ memset(p, 0, sizeof(p[0]));
}
=== modified file 'support-files/build-tags'
--- a/support-files/build-tags 2009-06-12 14:06:59 +0000
+++ b/support-files/build-tags 2011-05-26 15:20:09 +0000
@@ -1,7 +1,7 @@
#! /bin/sh
rm -f TAGS
-filter='\.cc$\|\.c$\|\.h$\|\.yy$'
+filter='\.cpp$\|\.cc$\|\.c$\|\.h$\|\.yy$'
list="find . -type f"
bzr root >/dev/null 2>/dev/null && list="bzr ls --from-root -R --kind=file --versioned"
=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c 2011-03-22 12:06:52 +0000
+++ b/tests/mysql_client_test.c 2011-05-26 15:20:09 +0000
@@ -627,9 +627,9 @@ static int my_process_stmt_result(MYSQL_
field_count= min(mysql_num_fields(result), MAX_RES_FIELDS);
- bzero((char*) buffer, sizeof(buffer));
- bzero((char*) length, sizeof(length));
- bzero((char*) is_null, sizeof(is_null));
+ memset(buffer, 0, sizeof(buffer));
+ memset(length, 0, sizeof(length));
+ memset(is_null, 0, sizeof(is_null));
for(i= 0; i < field_count; i++)
{
@@ -1730,7 +1730,7 @@ static void test_wl4435()
/* Init PS-parameters. */
- bzero((char *) ps_params, sizeof (ps_params));
+ memset(ps_params, 0, sizeof (ps_params));
/* - v0 -- INT */
@@ -1833,7 +1833,7 @@ static void test_wl4435()
fields= mysql_fetch_fields(rs_metadata);
rs_bind= (MYSQL_BIND *) malloc(sizeof (MYSQL_BIND) * num_fields);
- bzero(rs_bind, sizeof (MYSQL_BIND) * num_fields);
+ memset(rs_bind, 0, sizeof (MYSQL_BIND) * num_fields);
mct_log("num_fields: %d\n", (int) num_fields);
@@ -1986,7 +1986,7 @@ static void test_wl4435()
/* Init PS-parameters. */
- bzero((char *) ps_params, sizeof (ps_params));
+ memset(ps_params, 0, sizeof (ps_params));
ps_params[0].buffer_type= MYSQL_TYPE_STRING;
ps_params[0].buffer= (char *) str_koi8r;
@@ -2017,7 +2017,7 @@ static void test_wl4435()
/* Bind result. */
- bzero(rs_bind, sizeof (rs_bind));
+ memset(rs_bind, 0, sizeof (rs_bind));
rs_bind[0].buffer_type= MYSQL_TYPE_STRING;
rs_bind[0].buffer= o1_buffer;
@@ -2131,7 +2131,7 @@ static void test_wl4435_2()
c_type pspv c_type_ext; \
my_bool psp_null; \
\
- bzero(&pspv, sizeof (pspv)); \
+ memset(&pspv, 0, sizeof (pspv)); \
\
rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1"); \
myquery(rc); \
@@ -2142,8 +2142,7 @@ static void test_wl4435_2()
\
ps = mysql_simple_prepare(mysql, "CALL p1(?)"); \
check_stmt(ps); \
- \
- bzero(&psp, sizeof (psp)); \
+ memset(&psp, 0, sizeof (psp)); \
psp.buffer_type= c_api_in_type; \
psp.is_null= &psp_null; \
psp.buffer= (char *) &pspv; \
@@ -2490,7 +2489,7 @@ static void test_prepare()
verify_param_count(stmt, 7);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
/* tinyint */
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
@@ -2666,8 +2665,8 @@ static void test_double_compare()
verify_param_count(stmt, 3);
- /* Always bzero bind array because there can be internal members */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset bind array because there can be internal members */
+ memset(my_bind, 0, sizeof(my_bind));
/* tinyint */
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
@@ -2745,8 +2744,8 @@ static void test_null()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].is_null= &is_null[0];
@@ -2851,9 +2850,9 @@ static void test_ps_null_param()
rc= mysql_query(mysql, "INSERT INTO test_ps_nulls values (1), (null)");
myquery(rc);
- /* Always bzero all members of bind parameter */
- bzero((char*) &in_bind, sizeof(in_bind));
- bzero((char*) &out_bind, sizeof(out_bind));
+ /* Always memset all members of bind parameter */
+ memset(&in_bind, 0, sizeof(in_bind));
+ memset(&out_bind, 0, sizeof(out_bind));
in_bind.buffer_type= MYSQL_TYPE_LONG;
in_bind.is_null= &in_is_null;
@@ -2928,7 +2927,7 @@ static void test_fetch_null()
myquery(rc);
/* fetch */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i= 0; i < (int) array_elements(my_bind); i++)
{
my_bind[i].buffer_type= MYSQL_TYPE_LONG;
@@ -3163,8 +3162,8 @@ static void test_select()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
/* string data */
nData= 10;
@@ -3225,8 +3224,8 @@ static void test_ps_conj_select()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&int_data;
@@ -3423,7 +3422,7 @@ static void test_ps_query_cache()
break;
}
- bzero((char*) p_bind, sizeof(p_bind));
+ memset(p_bind, 0, sizeof(p_bind));
p_bind[0].buffer_type= MYSQL_TYPE_LONG;
p_bind[0].buffer= (void *)&p_int_data;
p_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING;
@@ -3438,7 +3437,7 @@ static void test_ps_query_cache()
strmov(p_str_data, "hh");
p_str_length= strlen(p_str_data);
- bzero((char*) r_bind, sizeof(r_bind));
+ memset(r_bind, 0, sizeof(r_bind));
r_bind[0].buffer_type= MYSQL_TYPE_LONG;
r_bind[0].buffer= (void *)&r_int_data;
r_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING;
@@ -3576,8 +3575,8 @@ session_id char(9) NOT NULL, \
verify_param_count(stmt, 1);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
strmov(szData, (char *)"abc");
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
@@ -3661,8 +3660,8 @@ static void test_bug1180()
verify_param_count(stmt, 1);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
strmov(szData, (char *)"abc");
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
@@ -3750,8 +3749,8 @@ static void test_bug1644()
verify_param_count(stmt, 4);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
num= 22;
isnull= 0;
@@ -3931,8 +3930,8 @@ static void test_simple_update()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
nData= 1;
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
@@ -4004,8 +4003,8 @@ static void test_long_data()
verify_param_count(stmt, 3);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= (void *)&int_data;
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
@@ -4086,8 +4085,8 @@ static void test_long_data_str()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= (void *)&length;
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
@@ -4179,8 +4178,8 @@ static void test_long_data_str1()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= data; /* string data */
my_bind[0].buffer_length= sizeof(data);
@@ -4272,7 +4271,7 @@ static void test_long_data_str1()
DIE_UNLESS(field->max_length == max_blob_length);
/* Fetch results into a data buffer that is smaller than data */
- bzero((char*) my_bind, sizeof(*my_bind));
+ memset(my_bind, 0, sizeof(*my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_BLOB;
my_bind[0].buffer= (void *) &data; /* this buffer won't be altered */
my_bind[0].buffer_length= 16;
@@ -4288,12 +4287,12 @@ static void test_long_data_str1()
DIE_UNLESS(blob_length == max_blob_length);
/* Fetch all data */
- bzero((char*) (my_bind+1), sizeof(*my_bind));
+ memset((my_bind+1), 0, sizeof(*my_bind));
my_bind[1].buffer_type= MYSQL_TYPE_BLOB;
my_bind[1].buffer= (void *) &data; /* this buffer won't be altered */
my_bind[1].buffer_length= sizeof(data);
my_bind[1].length= &blob_length;
- bzero(data, sizeof(data));
+ memset(data, 0, sizeof(data));
mysql_stmt_fetch_column(stmt, my_bind+1, 0, 0);
DIE_UNLESS(strlen(data) == max_blob_length);
@@ -4336,8 +4335,8 @@ static void test_long_data_bin()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= (void *)&length;
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
@@ -4426,8 +4425,8 @@ static void test_simple_delete()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
nData= 1;
strmov(szData, "MySQL");
@@ -4500,8 +4499,8 @@ static void test_update()
verify_param_count(stmt, 2);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
/* string data */
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
@@ -4530,8 +4529,8 @@ static void test_update()
verify_param_count(stmt, 2);
nData= 100;
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= szData;
@@ -4651,7 +4650,7 @@ static void test_bind_result()
/* fetch */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *) &nData; /* integer data */
my_bind[0].is_null= &is_null[0];
@@ -4744,7 +4743,7 @@ static void test_bind_result_ext()
rc= mysql_commit(mysql);
myquery(rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i= 0; i < (int) array_elements(my_bind); i++)
{
my_bind[i].length= &length[i];
@@ -4863,7 +4862,7 @@ static void test_bind_result_ext1()
rc= mysql_commit(mysql);
myquery(rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void *) t_data;
my_bind[0].buffer_length= sizeof(t_data);
@@ -4983,8 +4982,8 @@ static void bind_fetch(int row_count)
verify_param_count(stmt, 7);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
for (i= 0; i < (int) array_elements(my_bind); i++)
{
@@ -5161,7 +5160,7 @@ static void test_fetch_date()
rc= mysql_commit(mysql);
myquery(rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i= 0; i < array_elements(my_bind); i++)
{
my_bind[i].is_null= &is_null[i];
@@ -5489,8 +5488,8 @@ static void test_prepare_ext()
verify_param_count(stmt, 6);
- /* Always bzero all members of bind parameter */
- bzero((char*) my_bind, sizeof(my_bind));
+ /* Always memset all members of bind parameter */
+ memset(my_bind, 0, sizeof(my_bind));
/*tinyint*/
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
@@ -5678,10 +5677,10 @@ static void test_insert()
verify_param_count(stmt, 2);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
/* tinyint */
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
@@ -5903,10 +5902,10 @@ static void test_stmt_close()
mysql_close(lmysql);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= (void *)&count;
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
@@ -5956,10 +5955,10 @@ static void test_set_variable()
check_stmt(stmt1);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) get_bind, sizeof(get_bind));
+ memset(get_bind, 0, sizeof(get_bind));
get_bind[0].buffer_type= MYSQL_TYPE_STRING;
get_bind[0].buffer= (void *)var;
@@ -5990,7 +5989,7 @@ static void test_set_variable()
stmt= mysql_simple_prepare(mysql, "set max_error_count= ?");
check_stmt(stmt);
- bzero((char*) set_bind, sizeof(set_bind));
+ memset(set_bind, 0, sizeof(set_bind));
set_bind[0].buffer_type= MYSQL_TYPE_LONG;
set_bind[0].buffer= (void *)&set_count;
@@ -6156,10 +6155,10 @@ static void test_multi_stmt()
verify_param_count(stmt, 1);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&id;
@@ -6317,10 +6316,10 @@ static void test_manual_sample()
/* Bind the data for the parameters */
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
/* INTEGER PART */
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
@@ -6444,10 +6443,10 @@ static void test_prepare_alter()
verify_param_count(stmt, 1);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
is_null= 0;
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
@@ -6690,7 +6689,7 @@ static void test_store_result()
myquery(rc);
/* fetch */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *) &nData; /* integer data */
my_bind[0].length= &length;
@@ -6874,10 +6873,10 @@ static void test_store_result2()
myquery(rc);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *) &nData; /* integer data */
@@ -6968,10 +6967,10 @@ static void test_subselect()
/* fetch */
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *) &id;
@@ -7073,10 +7072,10 @@ static void test_bind_date_conv(uint row
verify_param_count(stmt, 4);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP;
my_bind[1].buffer_type= MYSQL_TYPE_TIME;
@@ -7330,10 +7329,10 @@ static void test_pure_coverage()
check_stmt(stmt);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].length= &length;
my_bind[0].is_null= 0;
@@ -7403,9 +7402,9 @@ static void test_buffers()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero(buffer, sizeof(buffer)); /* Avoid overruns in printf() */
+ memset(buffer, 0, sizeof(buffer)); /* Avoid overruns in printf() */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].length= &length;
my_bind[0].is_null= &is_null;
my_bind[0].buffer_length= 1;
@@ -7594,7 +7593,7 @@ static void test_fetch_nobuffs()
fprintf(stdout, "\n total rows : %d", rc);
DIE_UNLESS(rc == 1);
- bzero((char*) my_bind, sizeof(MYSQL_BIND));
+ memset(my_bind, 0, sizeof(MYSQL_BIND));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void *)str[0];
my_bind[0].buffer_length= sizeof(str[0]);
@@ -7664,7 +7663,7 @@ static void test_ushort_bug()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
my_bind[0].buffer= (void *)&short_value;
my_bind[0].is_unsigned= TRUE;
@@ -7752,7 +7751,7 @@ static void test_sshort_bug()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
my_bind[0].buffer= (void *)&short_value;
my_bind[0].length= &s_length;
@@ -7839,7 +7838,7 @@ static void test_stiny_bug()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
my_bind[0].buffer= (void *)&short_value;
my_bind[0].length= &s_length;
@@ -8211,7 +8210,7 @@ static void test_frm_bug()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= data_dir;
my_bind[0].buffer_length= FN_REFLEN;
@@ -8296,10 +8295,10 @@ static void test_decimal_bug()
check_stmt(stmt);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_NEWDECIMAL;
my_bind[0].buffer= (void *)data;
@@ -8734,10 +8733,10 @@ static void test_logs()
check_stmt(stmt);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
my_bind[0].buffer= (void *)&id;
@@ -8884,10 +8883,10 @@ static void test_nstmts()
myquery(rc);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= (void *)&i;
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
@@ -8961,7 +8960,7 @@ static void test_fetch_seek()
stmt= mysql_simple_prepare(mysql, "select * from t1");
check_stmt(stmt);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&c1;
@@ -9057,7 +9056,7 @@ static void test_fetch_offset()
stmt= mysql_simple_prepare(mysql, "select * from t1");
check_stmt(stmt);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void *)data;
my_bind[0].buffer_length= 11;
@@ -9147,7 +9146,7 @@ static void test_fetch_column()
stmt= mysql_simple_prepare(mysql, "select * from t1 order by c2 desc");
check_stmt(stmt);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&bc1;
my_bind[0].buffer_length= 0;
@@ -9429,7 +9428,7 @@ static void test_free_result()
stmt= mysql_simple_prepare(mysql, "select * from test_free_result");
check_stmt(stmt);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&bc1;
my_bind[0].length= &bl1;
@@ -9509,7 +9508,7 @@ static void test_free_store_result()
stmt= mysql_simple_prepare(mysql, "select * from test_free_result");
check_stmt(stmt);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&bc1;
my_bind[0].buffer_length= 0;
@@ -9602,10 +9601,10 @@ static void test_sqlmode()
fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt));
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void *)c1;
@@ -9745,10 +9744,10 @@ static void test_ts()
length= (long)(strmov(strts, "2003-07-12 21:07:46") - strts);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP;
my_bind[0].buffer= (void *)&ts;
@@ -9848,10 +9847,10 @@ static void test_bug1500()
verify_param_count(stmt, 3);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= (void *)int_data;
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
@@ -10326,7 +10325,7 @@ static void test_bug3117()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) &buffer, sizeof(buffer));
+ memset(&buffer, 0, sizeof(buffer));
buffer.buffer_type= MYSQL_TYPE_LONGLONG;
buffer.buffer_length= sizeof(lii);
buffer.buffer= (void *)&lii;
@@ -10644,10 +10643,10 @@ static void test_multi()
myheader("test_multi");
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)¶m;
@@ -10794,7 +10793,7 @@ static void test_bind_nagative()
check_stmt(stmt_insert);
/* bind parameters */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&my_val;
@@ -10840,10 +10839,10 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8");
stmt= mysql_simple_prepare(mysql, query);
check_stmt(stmt);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *)&my_val;
@@ -10975,7 +10974,7 @@ static void test_bug3035()
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
myquery(rc);
- bzero((char*) bind_array, sizeof(bind_array));
+ memset(bind_array, 0, sizeof(bind_array));
for (my_bind= bind_array; my_bind < bind_end; my_bind++)
my_bind->error= &my_bind->error_value;
@@ -11184,7 +11183,7 @@ static void test_bug1664()
verify_param_count(stmt, 2);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void *)str_data;
@@ -11355,10 +11354,10 @@ static void test_union_param()
check_stmt(stmt);
/*
- We need to bzero bind structure because mysql_stmt_bind_param checks all
+ We need to memset bind structure because mysql_stmt_bind_param checks all
its members.
*/
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
/* bind parameters */
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
@@ -11425,7 +11424,7 @@ static void test_ps_i18n()
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
myquery(rc);
- bzero((char*) bind_array, sizeof(bind_array));
+ memset(bind_array, 0, sizeof(bind_array));
bind_array[0].buffer_type= MYSQL_TYPE_STRING;
bind_array[0].buffer= (void *) koi8;
@@ -11609,7 +11608,7 @@ static void test_bug3796()
check_execute(stmt, rc);
/* Bind input buffers */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void *) concat_arg0;
@@ -11676,11 +11675,11 @@ static void test_bug4026()
check_execute(stmt, rc);
/* Bind input buffers */
- bzero((char*) my_bind, sizeof(my_bind));
- bzero((char*) &time_in, sizeof(time_in));
- bzero((char*) &time_out, sizeof(time_out));
- bzero((char*) &datetime_in, sizeof(datetime_in));
- bzero((char*) &datetime_out, sizeof(datetime_out));
+ memset(my_bind, 0, sizeof(my_bind));
+ memset(&time_in, 0, sizeof(time_in));
+ memset(&time_out, 0, sizeof(time_out));
+ memset(&datetime_in, 0, sizeof(datetime_in));
+ memset(&datetime_out, 0, sizeof(datetime_out));
my_bind[0].buffer_type= MYSQL_TYPE_TIME;
my_bind[0].buffer= (void *) &time_in;
@@ -11758,7 +11757,7 @@ static void test_bug4079()
check_execute(stmt, rc);
/* Bind input buffers */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void *) &res;
@@ -11827,13 +11826,13 @@ static void test_bug4030()
check_execute(stmt, rc);
/* Bind output buffers */
- bzero((char*) my_bind, sizeof(my_bind));
- bzero((char*) &time_canonical, sizeof(time_canonical));
- bzero((char*) &time_out, sizeof(time_out));
- bzero((char*) &date_canonical, sizeof(date_canonical));
- bzero((char*) &date_out, sizeof(date_out));
- bzero((char*) &datetime_canonical, sizeof(datetime_canonical));
- bzero((char*) &datetime_out, sizeof(datetime_out));
+ memset(my_bind, 0, sizeof(my_bind));
+ memset(&time_canonical, 0, sizeof(time_canonical));
+ memset(&time_out, 0, sizeof(time_out));
+ memset(&date_canonical, 0, sizeof(date_canonical));
+ memset(&date_out, 0, sizeof(date_out));
+ memset(&datetime_canonical, 0, sizeof(datetime_canonical));
+ memset(&datetime_out, 0, sizeof(datetime_out));
my_bind[0].buffer_type= MYSQL_TYPE_TIME;
my_bind[0].buffer= (void *) &time_out;
@@ -11936,7 +11935,7 @@ static void test_view()
check_execute(stmt, rc);
strmov(str_data, "TEST");
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (char *)&str_data;
my_bind[0].buffer_length= 50;
@@ -12057,7 +12056,7 @@ static void test_view_2where()
" AENAME,T0001.DEPENDVARS AS DEPENDVARS,T0001.INACTIVE AS "
" INACTIVE from LTDX T0001 where (T0001.SRTF2 = 0)");
myquery(rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i=0; i < 8; i++) {
strmov(parms[i], "1");
my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING;
@@ -12107,7 +12106,7 @@ static void test_view_star()
myquery(rc);
rc= mysql_query(mysql, "CREATE VIEW vt1 AS SELECT a FROM t1");
myquery(rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i= 0; i < 2; i++) {
sprintf((char *)&parms[i], "%d", i);
my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING;
@@ -12174,7 +12173,7 @@ static void test_view_insert()
rc= mysql_stmt_prepare(select_stmt, query, strlen(query));
check_execute(select_stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type = MYSQL_TYPE_LONG;
my_bind[0].buffer = (char *)&my_val;
my_bind[0].length = &my_length;
@@ -12281,7 +12280,7 @@ static void test_view_insert_fields()
" F7F8 AS F7F8, F6N4 AS F6N4, F5C8 AS F5C8, F9D8 AS F9D8"
" from t1 T0001");
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i= 0; i < 11; i++)
{
l[i]= 20;
@@ -12350,7 +12349,7 @@ static void test_bug5126()
check_execute(stmt, rc);
/* Bind output buffers */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= &c1;
@@ -12396,8 +12395,8 @@ static void test_bug4231()
check_execute(stmt, rc);
/* Bind input buffers */
- bzero((char*) my_bind, sizeof(my_bind));
- bzero((char*) tm, sizeof(tm));
+ memset(my_bind, 0, sizeof(my_bind));
+ memset(tm, 0, sizeof(tm));
my_bind[0].buffer_type= MYSQL_TYPE_DATE;
my_bind[0].buffer= &tm[0];
@@ -12457,7 +12456,7 @@ static void test_bug5399()
myheader("test_bug5399");
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= &no;
@@ -12617,7 +12616,7 @@ static void test_bug5194()
param_str_length= strlen(param_str);
/* setup bind array */
- bzero((char*) my_bind, MAX_PARAM_COUNT * sizeof(MYSQL_BIND));
+ memset(my_bind, 0, MAX_PARAM_COUNT * sizeof(MYSQL_BIND));
for (i= 0; i < MAX_PARAM_COUNT; ++i)
{
my_bind[i].buffer_type= MYSQL_TYPE_FLOAT;
@@ -12744,7 +12743,7 @@ static void test_bug6049()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type = MYSQL_TYPE_STRING;
my_bind[0].buffer = &buffer;
my_bind[0].buffer_length = sizeof(buffer);
@@ -12796,7 +12795,7 @@ static void test_bug6058()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type = MYSQL_TYPE_STRING;
my_bind[0].buffer = &buffer;
my_bind[0].buffer_length = sizeof(buffer);
@@ -12864,7 +12863,7 @@ static void test_bug6046()
check_execute(stmt, rc);
b= 1;
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= &b;
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
@@ -13067,7 +13066,7 @@ static void test_bug6096()
/* Bind and fetch the data */
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i= 0; i < stmt_field_count; ++i)
{
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
@@ -13122,7 +13121,7 @@ static void test_datetime_ranges()
check_stmt(stmt);
verify_param_count(stmt, 6);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i= 0; i < 6; i++)
{
my_bind[i].buffer_type= MYSQL_TYPE_DATETIME;
@@ -13253,7 +13252,7 @@ static void test_bug4172()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= f;
my_bind[0].buffer_length= sizeof(f);
@@ -13320,7 +13319,7 @@ static void test_conversion()
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer= buff;
my_bind[0].length= &length;
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
@@ -13383,7 +13382,7 @@ static void test_rewind(void)
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
check_execute(stmt, rc);
- bzero((char*) &my_bind, sizeof(MYSQL_BIND));
+ memset(&my_bind, 0, sizeof(MYSQL_BIND));
my_bind.buffer_type= MYSQL_TYPE_LONG;
my_bind.buffer= (void *)&Data; /* this buffer won't be altered */
my_bind.length= &length;
@@ -13481,7 +13480,7 @@ static void test_truncation()
/*************** Fill in the bind structure and bind it **************/
bind_array= malloc(sizeof(MYSQL_BIND) * bind_count);
- bzero((char*) bind_array, sizeof(MYSQL_BIND) * bind_count);
+ memset(bind_array, 0, sizeof(MYSQL_BIND) * bind_count);
for (my_bind= bind_array; my_bind < bind_array + bind_count; my_bind++)
my_bind->error= &my_bind->error_value;
my_bind= bind_array;
@@ -13686,7 +13685,7 @@ static void test_truncation_option()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) &my_bind, sizeof(my_bind));
+ memset(&my_bind, 0, sizeof(my_bind));
my_bind.buffer= (void*) &buf;
my_bind.buffer_type= MYSQL_TYPE_TINY;
@@ -13761,7 +13760,7 @@ static void test_bug8330()
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
myquery(rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i=0; i < 2; i++)
{
stmt[i]= mysql_stmt_init(mysql);
@@ -14168,7 +14167,7 @@ static void test_bug9520()
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (char*) a;
my_bind[0].buffer_length= sizeof(a);
@@ -14218,7 +14217,7 @@ static void test_bug9478()
stmt= open_cursor("select name from t1 where id=2");
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (char*) a;
my_bind[0].buffer_length= sizeof(a);
@@ -14376,7 +14375,7 @@ static void test_bug9643()
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void*) &a;
my_bind[0].buffer_length= sizeof(a);
@@ -14432,7 +14431,7 @@ static void test_bug11111()
mysql_stmt_prepare(stmt, query, strlen(query));
mysql_stmt_execute(stmt);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
for (i=0; i < 2; i++)
{
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
@@ -14490,7 +14489,7 @@ static void test_bug10729()
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void*) a;
my_bind[0].buffer_length= sizeof(a);
@@ -14600,7 +14599,7 @@ static void test_bug10736()
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void*) a;
my_bind[0].buffer_length= sizeof(a);
@@ -14649,7 +14648,7 @@ static void test_bug10794()
stmt_text= "insert into t1 (id, name) values (?, ?)";
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
check_execute(stmt, rc);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void*) &id_val;
my_bind[1].buffer_type= MYSQL_TYPE_STRING;
@@ -14671,7 +14670,7 @@ static void test_bug10794()
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
stmt1= mysql_stmt_init(mysql);
mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void*) a;
my_bind[0].buffer_length= sizeof(a);
@@ -14744,9 +14743,9 @@ static void test_bug11172()
type= (ulong) CURSOR_TYPE_READ_ONLY;
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
- bzero((char*) bind_in, sizeof(bind_in));
- bzero((char*) bind_out, sizeof(bind_out));
- bzero((char*) &hired, sizeof(hired));
+ memset(bind_in, 0, sizeof(bind_in));
+ memset(bind_out, 0, sizeof(bind_out));
+ memset(&hired, 0, sizeof(hired));
hired.year= 1965;
hired.month= 1;
hired.day= 1;
@@ -14815,7 +14814,7 @@ static void test_bug11656()
type= (ulong) CURSOR_TYPE_READ_ONLY;
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
strmov(buf[0], "pcint502_MY2");
strmov(buf[1], "*");
for (i=0; i < 2; i++)
@@ -15080,7 +15079,7 @@ static void test_bug10760()
rc= mysql_query(mysql, "alter table t1 engine=InnoDB");
myquery(rc);
- bzero(my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
my_bind[0].buffer= (void*) id_buf;
my_bind[0].buffer_length= sizeof(id_buf);
@@ -15202,7 +15201,7 @@ static void test_bug11909()
stmt1= open_cursor("SELECT empno, firstname, midinit, lastname,"
"workdept, salary, bonus FROM t1");
- bzero(my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= (void*) &empno;
@@ -15374,7 +15373,7 @@ static void test_bug11901()
" from (t1 left join t2 on t2.deptno = t1.workdept) "
" where t1.empno = ?) "
"order by 1");
- bzero(my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
my_bind[0].buffer= &empno;
@@ -18131,7 +18130,7 @@ static void test_wl4166_1()
verify_param_count(stmt, 7);
- bzero(my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
/* tinyint */
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
my_bind[0].buffer= (void *)&tiny_data;
@@ -18238,7 +18237,7 @@ static void test_wl4166_2()
stmt= mysql_simple_prepare(mysql, "select * from t1");
check_stmt(stmt);
- bzero(bind_out, sizeof(bind_out));
+ memset(bind_out, 0, sizeof(bind_out));
bind_out[0].buffer_type= MYSQL_TYPE_LONG;
bind_out[0].buffer= (void*) &c_int;
@@ -18332,7 +18331,7 @@ static void test_wl4166_3()
check_stmt(stmt);
verify_param_count(stmt, 1);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_DATETIME;
my_bind[0].buffer= &tm[0];
@@ -18403,7 +18402,7 @@ static void test_wl4166_4()
"character_set_results=koi8r");
myquery(rc);
- bzero((char*) bind_array, sizeof(bind_array));
+ memset(bind_array, 0, sizeof(bind_array));
bind_array[0].buffer_type= MYSQL_TYPE_STRING;
@@ -18656,7 +18655,7 @@ static void test_bug40365(void)
check_stmt(stmt);
verify_param_count(stmt, 2);
- bzero((char*) my_bind, sizeof(my_bind));
+ memset(my_bind, 0, sizeof(my_bind));
my_bind[0].buffer_type= MYSQL_TYPE_DATETIME;
my_bind[1].buffer_type= MYSQL_TYPE_DATE;
for (i= 0; i < (int) array_elements(my_bind); i++)
@@ -18897,7 +18896,7 @@ static void test_bug41078(void)
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, &cursor_type);
check_execute(stmt, rc);
- bzero(¶m, sizeof(param));
+ memset(¶m, 0, sizeof(param));
param.buffer_type= MYSQL_TYPE_STRING;
param.buffer= (void *) param_str;
len= sizeof(param_str) - 1;
@@ -18909,7 +18908,7 @@ static void test_bug41078(void)
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
- bzero(&result, sizeof(result));
+ memset(&result, 0, sizeof(result));
result.buffer_type= MYSQL_TYPE_STRING;
result.buffer= str;
result.buffer_length= sizeof(str);
@@ -19414,7 +19413,7 @@ static void test_bug49972()
stmt= mysql_simple_prepare(mysql, "CALL p1((SELECT f1()), ?)");
check_stmt(stmt);
- bzero((char *) &in_param_bind, sizeof (in_param_bind));
+ memset(&in_param_bind, 0, sizeof (in_param_bind));
in_param_bind.buffer_type= MYSQL_TYPE_LONG;
in_param_bind.buffer= (char *) &int_data;
@@ -19427,7 +19426,7 @@ static void test_bug49972()
check_execute(stmt, rc);
{
- bzero(&out_param_bind, sizeof (out_param_bind));
+ memset(&out_param_bind, 0, sizeof (out_param_bind));
out_param_bind.buffer_type= MYSQL_TYPE_LONG;
out_param_bind.is_null= &is_null;
@@ -19455,7 +19454,7 @@ static void test_bug49972()
check_execute(stmt, rc);
{
- bzero(&out_param_bind, sizeof (out_param_bind));
+ memset(&out_param_bind, 0, sizeof (out_param_bind));
out_param_bind.buffer_type= MYSQL_TYPE_LONG;
out_param_bind.is_null= &is_null;
=== modified file 'unittest/mysys/waiting_threads-t.c'
--- a/unittest/mysys/waiting_threads-t.c 2010-05-19 13:50:12 +0000
+++ b/unittest/mysys/waiting_threads-t.c 2011-05-26 15:20:09 +0000
@@ -52,7 +52,7 @@ struct my_rnd_struct {
static void my_rnd_init(struct my_rnd_struct *rand_st, ulong seed1, ulong seed2)
{
#ifdef HAVE_purify
- bzero((char*) rand_st,sizeof(*rand_st)); /* Avoid UMC varnings */
+ memset((char*) rand_st, 0, sizeof(*rand_st)); /* Avoid UMC varnings */
#endif
rand_st->max_value= 0x3FFFFFFFL;
rand_st->max_value_dbl=(double) rand_st->max_value;
@@ -84,7 +84,7 @@ pthread_cond_t thread_sync;
ulong wt_timeout_short=100, wt_deadlock_search_depth_short=4;
ulong wt_timeout_long=10000, wt_deadlock_search_depth_long=15;
-#define reset(ARRAY) bzero(ARRAY, sizeof(ARRAY))
+#define reset(ARRAY) memset(ARRAY, 0, sizeof(ARRAY))
/* see explanation of the kill strategies in waiting_threads.h */
enum { LATEST, RANDOM, YOUNGEST, LOCKS } kill_strategy;
=== modified file 'vio/vio.c'
--- a/vio/vio.c 2010-08-16 12:50:27 +0000
+++ b/vio/vio.c 2011-05-26 15:20:09 +0000
@@ -62,7 +62,7 @@ static void vio_init(Vio* vio, enum enum
#ifndef HAVE_VIO_READ_BUFF
flags&= ~VIO_BUFFERED_READ;
#endif
- bzero((char*) vio, sizeof(*vio));
+ memset(vio, 0, sizeof(*vio));
vio->type = type;
vio->sd = sd;
vio->hPipe = hPipe;
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (tor.didriksen:3121 to 3122) Bug#11765003 | Tor Didriksen | 27 May |