3576 Ole John Aske 2011-10-28 [merge]
Merge telco-7.0 -> telco-7.0-spj-scan-scan
modified:
config/ac-macros/misc.m4
sql/ha_ndb_index_stat.cc
sql/ha_ndbcluster.cc
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.h
sql/ha_ndbcluster_connection.cc
sql/ha_ndbinfo.cc
storage/ndb/include/kernel/signaldata/DiGetNodes.hpp
storage/ndb/include/util/OutputStream.hpp
storage/ndb/src/common/debugger/EventLogger.cpp
storage/ndb/src/common/debugger/SignalLoggerManager.cpp
storage/ndb/src/common/logger/LogHandler.cpp
storage/ndb/src/common/logger/Logger.cpp
storage/ndb/src/common/portlib/NdbConfig.c
storage/ndb/src/common/portlib/NdbDir.cpp
storage/ndb/src/common/portlib/NdbThread.c
storage/ndb/src/common/portlib/ndb_daemon.cc
storage/ndb/src/common/transporter/TransporterRegistry.cpp
storage/ndb/src/common/util/BaseString.cpp
storage/ndb/src/common/util/ConfigValues.cpp
storage/ndb/src/common/util/File.cpp
storage/ndb/src/common/util/InputStream.cpp
storage/ndb/src/common/util/NdbSqlUtil.cpp
storage/ndb/src/common/util/OutputStream.cpp
storage/ndb/src/common/util/Parser.cpp
storage/ndb/src/common/util/Properties.cpp
storage/ndb/src/common/util/ndb_init.cpp
storage/ndb/src/common/util/ndbzio.c
storage/ndb/src/common/util/socket_io.cpp
storage/ndb/src/cw/cpcd/APIService.cpp
storage/ndb/src/cw/cpcd/CPCD.cpp
storage/ndb/src/cw/cpcd/Monitor.cpp
storage/ndb/src/cw/cpcd/Process.cpp
storage/ndb/src/kernel/blocks/backup/read.cpp
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp
storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp
storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp
storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.cpp
storage/ndb/src/kernel/error/ErrorReporter.cpp
storage/ndb/src/kernel/error/ndbd_exit_codes.c
storage/ndb/src/kernel/vm/SimulatedBlock.cpp
storage/ndb/src/mgmapi/mgmapi.cpp
storage/ndb/src/mgmapi/ndb_logevent.cpp
storage/ndb/src/mgmclient/CommandInterpreter.cpp
storage/ndb/src/mgmsrv/Defragger.hpp
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
storage/ndb/src/mgmsrv/Services.cpp
storage/ndb/src/ndbapi/NdbBlob.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/src/ndbapi/NdbOperationExec.cpp
storage/ndb/src/ndbapi/NdbQueryOperation.cpp
storage/ndb/src/ndbapi/NdbTransaction.cpp
storage/ndb/src/ndbapi/ndberror.c
storage/ndb/test/include/NDBT_Table.hpp
storage/ndb/test/include/NdbMgmd.hpp
storage/ndb/test/ndbapi/ScanFunctions.hpp
storage/ndb/test/ndbapi/testMgm.cpp
storage/ndb/test/src/DbUtil.cpp
storage/ndb/test/src/HugoQueries.cpp
storage/ndb/test/src/HugoQueryBuilder.cpp
storage/ndb/test/src/NDBT_Test.cpp
storage/ndb/test/src/NdbBackup.cpp
storage/ndb/test/src/NdbRestarter.cpp
storage/ndb/test/src/getarg.c
storage/ndb/test/tools/cpcc.cpp
storage/ndb/tools/ndb_dump_frm_data.cpp
storage/ndb/tools/restore/consumer_restore.cpp
storage/ndb/tools/waiter.cpp
3575 Ole John Aske 2011-10-25
The logic for counting 'm_pushed_queries_dropped' was duplicated in
ha_ndbcluster::read_multi_range_first which caused that counter to
be incremented twice.
modified:
mysql-test/suite/ndb/r/ndb_join_pushdown.result
sql/ha_ndbcluster.cc
=== modified file 'config/ac-macros/misc.m4'
--- a/config/ac-macros/misc.m4 2009-11-04 23:08:21 +0000
+++ b/config/ac-macros/misc.m4 2011-10-21 08:30:40 +0000
@@ -460,22 +460,23 @@ AC_DEFUN([MYSQL_STACK_DIRECTION],
#if defined(__HP_cc) || defined (__HP_aCC) || defined (__hpux)
#pragma noinline
#endif
- int find_stack_direction ()
- {
- static char *addr = 0;
- auto char dummy;
- if (addr == 0)
- {
- addr = &dummy;
- return find_stack_direction ();
- }
- else
- return (&dummy > addr) ? 1 : -1;
- }
- int main ()
- {
- exit (find_stack_direction() < 0);
- }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
+ /* Check stack direction (0-down, 1-up) */
+ int f(int *a)
+ {
+ int b;
+ return(&b > a)?1:-1;
+ }
+ /*
+ Prevent compiler optimizations by calling function
+ through pointer.
+ */
+ volatile int (*ptr_f)(int *) = f;
+ int main()
+ {
+ int a;
+ exit(ptr_f(&a) < 0);
+ }
+ ], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
ac_cv_c_stack_direction=)])
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
])dnl
=== modified file 'sql/ha_ndb_index_stat.cc'
--- a/sql/ha_ndb_index_stat.cc 2011-10-17 12:43:31 +0000
+++ b/sql/ha_ndb_index_stat.cc 2011-10-20 16:18:28 +0000
@@ -227,7 +227,7 @@ ndb_index_stat_opt2str(const Ndb_index_s
const Ndb_index_stat_opt::Val& v= opt.val[i];
ptr+= strlen(ptr);
const char* sep= (ptr == buf ? "" : ",");
- const uint sz= ptr < end ? end - ptr : 0;
+ const uint sz= ptr < end ? (uint)(end - ptr) : 0;
switch (v.unit) {
case Ndb_index_stat_opt::Ubool:
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2011-10-25 07:45:06 +0000
+++ b/sql/ha_ndbcluster.cc 2011-10-28 09:04:10 +0000
@@ -1450,8 +1450,7 @@ int ha_ndbcluster::ndb_err(NdbTransactio
{
const NDBINDEX *unique_index=
(const NDBINDEX *) m_index[i].unique_index;
- if (unique_index &&
- (char *) unique_index->getObjectId() == error_data)
+ if (unique_index && UintPtr(unique_index->getObjectId()) == UintPtr(error_data))
{
dupkey= i;
break;
@@ -1494,7 +1493,7 @@ bool ha_ndbcluster::get_error_message(in
const NdbError err= ndb->getNdbError(error);
bool temporary= err.status==NdbError::TemporaryError;
- buf->set(err.message, strlen(err.message), &my_charset_bin);
+ buf->set(err.message, (uint32)strlen(err.message), &my_charset_bin);
DBUG_PRINT("exit", ("message: %s, temporary: %d", buf->ptr(), temporary));
DBUG_RETURN(temporary);
}
@@ -2046,7 +2045,7 @@ void ha_ndbcluster::release_blobs_buffer
*/
int cmp_frm(const NDBTAB *ndbtab, const void *pack_data,
- uint pack_length)
+ size_t pack_length)
{
DBUG_ENTER("cmp_frm");
/*
@@ -3961,7 +3960,7 @@ count_key_columns(const KEY *key_info, c
break;
length+= key_part->store_length;
}
- return key_part - first_key_part;
+ return (uint)(key_part - first_key_part);
}
/* Helper method to compute NDB index bounds. Note: does not set range_no. */
@@ -6535,7 +6534,7 @@ int ha_ndbcluster::ndb_update_row(const
uint blob_count= 0;
if (uses_blob_value(table->write_set))
{
- int row_offset= new_data - table->record[0];
+ int row_offset= (int)(new_data - table->record[0]);
int res= set_blob_values(op, row_offset, table->write_set, &blob_count,
(batch_allowed && !need_flush));
if (res != 0)
@@ -8292,7 +8291,7 @@ static int ndbcluster_update_apply_statu
// log_name
char tmp_buf[FN_REFLEN];
ndb_pack_varchar(ndbtab->getColumn(2u), tmp_buf,
- group_master_log_name, strlen(group_master_log_name));
+ group_master_log_name, (int)strlen(group_master_log_name));
r|= op->setValue(2u, tmp_buf);
DBUG_ASSERT(r == 0);
// start_pos
@@ -9886,7 +9885,7 @@ void ha_ndbcluster::update_create_info(H
goto err;
const char *tablespace= ts.getName();
DBUG_PRINT("info", ("Found tablespace '%s'", tablespace));
- uint tablespace_len= strlen(tablespace);
+ uint tablespace_len= (uint)strlen(tablespace);
if (tablespace_len != 0)
{
share->tablespace= (char *) alloc_root(&share->mem_root,
@@ -10055,7 +10054,7 @@ int ha_ndbcluster::create(const char *na
*/
if ((my_errno= write_ndb_file(name)))
DBUG_RETURN(my_errno);
- ndbcluster_create_binlog_setup(thd, ndb, name, strlen(name),
+ ndbcluster_create_binlog_setup(thd, ndb, name, (uint)strlen(name),
m_dbname, m_tabname, FALSE);
DBUG_RETURN(my_errno);
}
@@ -10967,7 +10966,7 @@ int ha_ndbcluster::rename_table(const ch
this is a "real" rename table, i.e. not tied to an offline alter table
- send new name == "to" in query field
*/
- ndbcluster_log_schema_op(thd, to, strlen(to),
+ ndbcluster_log_schema_op(thd, to, (int)strlen(to),
old_dbname, m_tabname,
ndb_table_id, ndb_table_version,
SOT_RENAME_TABLE_PREPARE,
@@ -11643,7 +11642,7 @@ int ha_ndbcluster::open(const char *name
name);
}
Ndb* ndb= check_ndb_in_thd(thd);
- ndbcluster_create_binlog_setup(thd, ndb, name, strlen(name),
+ ndbcluster_create_binlog_setup(thd, ndb, name, (uint)strlen(name),
m_dbname, m_tabname, FALSE);
if ((m_share=get_share(name, table, FALSE)) == 0)
{
@@ -12299,7 +12298,7 @@ int ndbcluster_drop_database_impl(THD *t
List_iterator_fast<char> it(drop_list);
while ((tabname=it++))
{
- tablename_to_filename(tabname, tmp, FN_REFLEN - (tmp - full_path)-1);
+ tablename_to_filename(tabname, tmp, (uint)(FN_REFLEN - (tmp - full_path)-1));
mysql_mutex_lock(&LOCK_open);
if (ha_ndbcluster::drop_table(thd, 0, ndb, full_path, dbname, tabname))
{
@@ -12441,7 +12440,7 @@ int ndbcluster_find_all_files(THD *thd)
}
/* finalize construction of path */
end+= tablename_to_filename(elmt.name, end,
- sizeof(key)-(end-key));
+ (uint)(sizeof(key)-(end-key)));
uchar *data= 0, *pack_data= 0;
size_t length, pack_length;
int discover= 0;
@@ -12490,7 +12489,7 @@ int ndbcluster_find_all_files(THD *thd)
else
{
/* set up replication for this table */
- ndbcluster_create_binlog_setup(thd, ndb, key, end-key,
+ ndbcluster_create_binlog_setup(thd, ndb, key, (uint)(end-key),
elmt.database, elmt.name,
TRUE);
}
@@ -12662,9 +12661,9 @@ ndbcluster_find_files(handlerton *hton,
{
file_name_str= (char*)my_hash_element(&ok_tables, i);
end= end1 +
- tablename_to_filename(file_name_str, end1, sizeof(name) - (end1 - name));
+ tablename_to_filename(file_name_str, end1, (uint)(sizeof(name) - (end1 - name)));
mysql_mutex_lock(&LOCK_open);
- ndbcluster_create_binlog_setup(thd, ndb, name, end-name,
+ ndbcluster_create_binlog_setup(thd, ndb, name, (uint)(end-name),
db, file_name_str, TRUE);
mysql_mutex_unlock(&LOCK_open);
}
@@ -12729,7 +12728,7 @@ ndbcluster_find_files(handlerton *hton,
{
LEX_STRING *tmp_file_name= 0;
tmp_file_name= thd->make_lex_string(tmp_file_name, file_name_str,
- strlen(file_name_str), TRUE);
+ (uint)strlen(file_name_str), TRUE);
files->push_back(tmp_file_name);
}
}
@@ -13137,7 +13136,7 @@ void ha_ndbcluster::set_dbname(const cha
while (ptr >= path_name && *ptr != '\\' && *ptr != '/') {
ptr--;
}
- uint name_len= end - ptr;
+ uint name_len= (uint)(end - ptr);
memcpy(tmp_name, ptr + 1, name_len);
tmp_name[name_len]= '\0';
filename_to_tablename(tmp_name, dbname, sizeof(tmp_buff) - 1);
@@ -13169,7 +13168,7 @@ ha_ndbcluster::set_tabname(const char *p
while (ptr >= path_name && *ptr != '\\' && *ptr != '/') {
ptr--;
}
- uint name_len= end - ptr;
+ uint name_len= (uint)(end - ptr);
memcpy(tmp_name, ptr + 1, end - ptr);
tmp_name[name_len]= '\0';
filename_to_tablename(tmp_name, tabname, sizeof(tmp_buff) - 1);
@@ -13944,7 +13943,7 @@ int handle_trailing_share(THD *thd, NDB_
share->key_length= min_key_length;
}
share->key_length=
- my_snprintf(share->key, min_key_length + 1, "#leak%lu",
+ (uint)my_snprintf(share->key, min_key_length + 1, "#leak%lu",
trailing_share_id++);
}
/* Keep it for possible the future trailing free */
@@ -15231,7 +15230,7 @@ ha_ndbcluster::read_multi_range_next(KEY
need to process all index scan ranges together.
*/
if (!multi_range_sorted ||
- (expected_range_no= multi_range_curr - m_multi_ranges)
+ (expected_range_no= (int)(multi_range_curr - m_multi_ranges))
== current_range_no)
{
*multi_range_found_p= m_multi_ranges + current_range_no;
@@ -15280,7 +15279,7 @@ ha_ndbcluster::read_multi_range_next(KEY
*/
DBUG_RETURN(read_multi_range_first(multi_range_found_p,
multi_range_curr,
- multi_range_end - multi_range_curr,
+ (uint)(multi_range_end - multi_range_curr),
multi_range_sorted,
multi_range_buffer));
}
@@ -15711,7 +15710,7 @@ ha_ndbcluster::update_table_comment(
const char* comment)/* in: table comment defined by user */
{
THD *thd= current_thd;
- uint length= strlen(comment);
+ uint length= (uint)strlen(comment);
if (length > 64000 - 3)
{
return((char*)comment); /* string too long */
@@ -15732,7 +15731,7 @@ ha_ndbcluster::update_table_comment(
char *str;
const char *fmt="%s%snumber_of_replicas: %d";
- const unsigned fmt_len_plus_extra= length + strlen(fmt);
+ const unsigned fmt_len_plus_extra= length + (uint)strlen(fmt);
if ((str= (char*) my_malloc(fmt_len_plus_extra, MYF(0))) == NULL)
{
sql_print_error("ha_ndbcluster::update_table_comment: "
@@ -16118,7 +16117,7 @@ ndbcluster_show_status(handlerton *hton,
else
update_status_variables(NULL, &ns, g_ndb_cluster_connection);
- buflen=
+ buflen= (uint)
my_snprintf(buf, sizeof(buf),
"cluster_node_id=%ld, "
"connected_host=%s, "
@@ -16141,8 +16140,8 @@ ndbcluster_show_status(handlerton *hton,
if (ns.transaction_hint_count[i] > 0 ||
ns.transaction_no_hint_count[i] > 0)
{
- uint namelen= my_snprintf(name, sizeof(name), "node[%d]", i);
- buflen= my_snprintf(buf, sizeof(buf),
+ uint namelen= (uint)my_snprintf(name, sizeof(name), "node[%d]", i);
+ buflen= (uint)my_snprintf(buf, sizeof(buf),
"transaction_hint=%ld, transaction_no_hint=%ld",
ns.transaction_hint_count[i],
ns.transaction_no_hint_count[i]);
@@ -16158,12 +16157,12 @@ ndbcluster_show_status(handlerton *hton,
tmp.m_name= 0;
while (ndb->get_free_list_usage(&tmp))
{
- buflen=
+ buflen= (uint)
my_snprintf(buf, sizeof(buf),
"created=%u, free=%u, sizeof=%u",
tmp.m_created, tmp.m_free, tmp.m_sizeof);
if (stat_print(thd, ndbcluster_hton_name, ndbcluster_hton_name_length,
- tmp.m_name, strlen(tmp.m_name), buf, buflen))
+ tmp.m_name, (uint)strlen(tmp.m_name), buf, buflen))
DBUG_RETURN(TRUE);
}
}
@@ -17659,19 +17658,19 @@ static int ndbcluster_fill_files_table(h
}
table->field[IS_FILES_FILE_NAME]->set_notnull();
- table->field[IS_FILES_FILE_NAME]->store(elt.name, strlen(elt.name),
+ table->field[IS_FILES_FILE_NAME]->store(elt.name, (uint)strlen(elt.name),
system_charset_info);
table->field[IS_FILES_FILE_TYPE]->set_notnull();
table->field[IS_FILES_FILE_TYPE]->store("DATAFILE",8,
system_charset_info);
table->field[IS_FILES_TABLESPACE_NAME]->set_notnull();
table->field[IS_FILES_TABLESPACE_NAME]->store(df.getTablespace(),
- strlen(df.getTablespace()),
+ (uint)strlen(df.getTablespace()),
system_charset_info);
table->field[IS_FILES_LOGFILE_GROUP_NAME]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NAME]->
store(ts.getDefaultLogfileGroup(),
- strlen(ts.getDefaultLogfileGroup()),
+ (uint)strlen(ts.getDefaultLogfileGroup()),
system_charset_info);
table->field[IS_FILES_ENGINE]->set_notnull();
table->field[IS_FILES_ENGINE]->store(ndbcluster_hton_name,
@@ -17697,7 +17696,7 @@ static int ndbcluster_fill_files_table(h
table->field[IS_FILES_ROW_FORMAT]->store("FIXED", 5, system_charset_info);
char extra[30];
- int len= my_snprintf(extra, sizeof(extra), "CLUSTER_NODE=%u", id);
+ int len= (int)my_snprintf(extra, sizeof(extra), "CLUSTER_NODE=%u", id);
table->field[IS_FILES_EXTRA]->set_notnull();
table->field[IS_FILES_EXTRA]->store(extra, len, system_charset_info);
schema_table_store_record(thd, table);
@@ -17730,12 +17729,12 @@ static int ndbcluster_fill_files_table(h
table->field[IS_FILES_TABLESPACE_NAME]->set_notnull();
table->field[IS_FILES_TABLESPACE_NAME]->store(elt.name,
- strlen(elt.name),
+ (uint)strlen(elt.name),
system_charset_info);
table->field[IS_FILES_LOGFILE_GROUP_NAME]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NAME]->
store(ts.getDefaultLogfileGroup(),
- strlen(ts.getDefaultLogfileGroup()),
+ (uint)strlen(ts.getDefaultLogfileGroup()),
system_charset_info);
table->field[IS_FILES_ENGINE]->set_notnull();
@@ -17790,7 +17789,7 @@ static int ndbcluster_fill_files_table(h
init_fill_schema_files_row(table);
table->field[IS_FILES_FILE_NAME]->set_notnull();
- table->field[IS_FILES_FILE_NAME]->store(elt.name, strlen(elt.name),
+ table->field[IS_FILES_FILE_NAME]->store(elt.name, (uint)strlen(elt.name),
system_charset_info);
table->field[IS_FILES_FILE_TYPE]->set_notnull();
table->field[IS_FILES_FILE_TYPE]->store("UNDO LOG", 8,
@@ -17799,7 +17798,7 @@ static int ndbcluster_fill_files_table(h
uf.getLogfileGroupId(&objid);
table->field[IS_FILES_LOGFILE_GROUP_NAME]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NAME]->store(uf.getLogfileGroup(),
- strlen(uf.getLogfileGroup()),
+ (uint)strlen(uf.getLogfileGroup()),
system_charset_info);
table->field[IS_FILES_LOGFILE_GROUP_NUMBER]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NUMBER]->store(objid.getObjectId(), true);
@@ -17822,7 +17821,7 @@ static int ndbcluster_fill_files_table(h
table->field[IS_FILES_VERSION]->store(uf.getObjectVersion(), true);
char extra[100];
- int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",
+ int len= (int)my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",
id, (ulong) lfg.getUndoBufferSize());
table->field[IS_FILES_EXTRA]->set_notnull();
table->field[IS_FILES_EXTRA]->store(extra, len, system_charset_info);
@@ -17857,7 +17856,7 @@ static int ndbcluster_fill_files_table(h
table->field[IS_FILES_LOGFILE_GROUP_NAME]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NAME]->store(elt.name,
- strlen(elt.name),
+ (uint)strlen(elt.name),
system_charset_info);
table->field[IS_FILES_LOGFILE_GROUP_NUMBER]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NUMBER]->store(lfg.getObjectId(), true);
@@ -17875,7 +17874,7 @@ static int ndbcluster_fill_files_table(h
table->field[IS_FILES_VERSION]->store(lfg.getObjectVersion(), true);
char extra[100];
- int len= my_snprintf(extra,sizeof(extra),
+ int len= (int)my_snprintf(extra,sizeof(extra),
"UNDO_BUFFER_SIZE=%lu",
(ulong) lfg.getUndoBufferSize());
table->field[IS_FILES_EXTRA]->set_notnull();
=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc 2011-10-17 12:43:31 +0000
+++ b/sql/ha_ndbcluster_binlog.cc 2011-10-20 16:18:28 +0000
@@ -1549,7 +1549,7 @@ static int ndbcluster_find_all_databases
/* create missing database */
sql_print_information("NDB: Discovered missing database '%s'", db);
const int no_print_error[1]= {0};
- name_len= my_snprintf(name, sizeof(name), "CREATE DATABASE %s", db);
+ name_len= (unsigned)my_snprintf(name, sizeof(name), "CREATE DATABASE %s", db);
run_query(thd, name, name + name_len,
no_print_error, /* print error */
TRUE, /* don't binlog the query */
@@ -1891,12 +1891,12 @@ ndbcluster_update_slock(THD *thd,
DBUG_ASSERT(r == 0);
/* db */
- ndb_pack_varchar(col[SCHEMA_DB_I], tmp_buf, db, strlen(db));
+ ndb_pack_varchar(col[SCHEMA_DB_I], tmp_buf, db, (int)strlen(db));
r|= op->equal(SCHEMA_DB_I, tmp_buf);
DBUG_ASSERT(r == 0);
/* name */
ndb_pack_varchar(col[SCHEMA_NAME_I], tmp_buf, table_name,
- strlen(table_name));
+ (int)strlen(table_name));
r|= op->equal(SCHEMA_NAME_I, tmp_buf);
DBUG_ASSERT(r == 0);
/* slock */
@@ -1934,12 +1934,12 @@ ndbcluster_update_slock(THD *thd,
DBUG_ASSERT(r == 0);
/* db */
- ndb_pack_varchar(col[SCHEMA_DB_I], tmp_buf, db, strlen(db));
+ ndb_pack_varchar(col[SCHEMA_DB_I], tmp_buf, db, (int)strlen(db));
r|= op->equal(SCHEMA_DB_I, tmp_buf);
DBUG_ASSERT(r == 0);
/* name */
ndb_pack_varchar(col[SCHEMA_NAME_I], tmp_buf, table_name,
- strlen(table_name));
+ (int)strlen(table_name));
r|= op->equal(SCHEMA_NAME_I, tmp_buf);
DBUG_ASSERT(r == 0);
/* slock */
@@ -2284,12 +2284,12 @@ int ndbcluster_log_schema_op(THD *thd,
DBUG_ASSERT(r == 0);
/* db */
- ndb_pack_varchar(col[SCHEMA_DB_I], tmp_buf, log_db, strlen(log_db));
+ ndb_pack_varchar(col[SCHEMA_DB_I], tmp_buf, log_db, (int)strlen(log_db));
r|= op->equal(SCHEMA_DB_I, tmp_buf);
DBUG_ASSERT(r == 0);
/* name */
ndb_pack_varchar(col[SCHEMA_NAME_I], tmp_buf, log_tab,
- strlen(log_tab));
+ (int)strlen(log_tab));
r|= op->equal(SCHEMA_NAME_I, tmp_buf);
DBUG_ASSERT(r == 0);
/* slock */
@@ -2789,7 +2789,7 @@ ndb_binlog_thread_handle_schema_event(TH
// fall through
case SOT_RENAME_TABLE_NEW:
{
- uint end= my_snprintf(&errmsg[0], MYSQL_ERRMSG_SIZE,
+ uint end= (uint)my_snprintf(&errmsg[0], MYSQL_ERRMSG_SIZE,
"NDB Binlog: Skipping renaming locally "
"defined table '%s.%s' from binlog schema "
"event '%s' from node %d. ",
@@ -2801,7 +2801,7 @@ ndb_binlog_thread_handle_schema_event(TH
case SOT_DROP_TABLE:
if (schema_type == SOT_DROP_TABLE)
{
- uint end= my_snprintf(&errmsg[0], MYSQL_ERRMSG_SIZE,
+ uint end= (uint)my_snprintf(&errmsg[0], MYSQL_ERRMSG_SIZE,
"NDB Binlog: Skipping dropping locally "
"defined table '%s.%s' from binlog schema "
"event '%s' from node %d. ",
@@ -3562,7 +3562,7 @@ ndb_binlog_index_table__write_rows(THD *
ndb_binlog_index->field[0]->store(first->master_log_pos, true);
ndb_binlog_index->field[1]->store(first->master_log_file,
- strlen(first->master_log_file),
+ (uint)strlen(first->master_log_file),
&my_charset_bin);
ndb_binlog_index->field[2]->store(epoch= first->epoch, true);
if (ndb_binlog_index->s->fields > 7)
@@ -4300,7 +4300,7 @@ parse_conflict_fn_spec(const char* confl
{
const st_conflict_fn_def &fn= conflict_fns[i];
- uint len= strlen(fn.name);
+ uint len= (uint)strlen(fn.name);
if (strncmp(ptr, fn.name, len))
continue;
@@ -4372,7 +4372,7 @@ parse_conflict_fn_spec(const char* confl
}
}
- uint len= end_arg - start_arg;
+ uint len= (uint)(end_arg - start_arg);
args[no_args].type= type;
args[no_args].ptr= start_arg;
args[no_args].len= len;
@@ -4701,9 +4701,9 @@ ndbcluster_read_replication_table(THD *t
DBUG_PRINT("info", ("reading[%u]: %s,%s,%u", i, db, table_name, id));
if ((_op= trans->getNdbOperation(reptab)) == NULL) abort();
if (_op->readTuple(NdbOperation::LM_CommittedRead)) abort();
- ndb_pack_varchar(col_db, tmp_buf, db, strlen(db));
+ ndb_pack_varchar(col_db, tmp_buf, db, (int)strlen(db));
if (_op->equal(col_db->getColumnNo(), tmp_buf)) abort();
- ndb_pack_varchar(col_table_name, tmp_buf, table_name, strlen(table_name));
+ ndb_pack_varchar(col_table_name, tmp_buf, table_name, (int)strlen(table_name));
if (_op->equal(col_table_name->getColumnNo(), tmp_buf)) abort();
if (_op->equal(col_server_id->getColumnNo(), id)) abort();
if ((col_binlog_type_rec_attr[i]=
@@ -5478,7 +5478,7 @@ ndbcluster_create_event_ops(THD *thd, ND
Ndb_event_data *event_data= share->event_data;
int do_ndb_schema_share= 0, do_ndb_apply_status_share= 0;
#ifdef HAVE_NDB_BINLOG
- uint len= strlen(share->table_name);
+ uint len= (int)strlen(share->table_name);
#endif
if (!ndb_schema_share && strcmp(share->db, NDB_REP_DB) == 0 &&
strcmp(share->table_name, NDB_SCHEMA_TABLE) == 0)
@@ -6851,7 +6851,7 @@ restart_cluster_failure:
{
LOG_INFO log_info;
mysql_bin_log.get_current_log(&log_info);
- int len= strlen(log_info.log_file_name);
+ int len= (uint)strlen(log_info.log_file_name);
uint no= 0;
if ((sscanf(log_info.log_file_name + len - 6, "%u", &no) == 1) &&
no == 1)
@@ -7710,7 +7710,7 @@ ndbcluster_show_status_binlog(THD* thd,
ndb_latest_epoch= injector_ndb->getLatestGCI();
pthread_mutex_unlock(&injector_mutex);
- buflen=
+ buflen= (uint)
my_snprintf(buf, sizeof(buf),
"latest_epoch=%s, "
"latest_trans_epoch=%s, "
@@ -7723,7 +7723,7 @@ ndbcluster_show_status_binlog(THD* thd,
llstr(ndb_latest_handled_binlog_epoch, buff4),
llstr(ndb_latest_applied_binlog_epoch, buff5));
if (stat_print(thd, ndbcluster_hton_name, ndbcluster_hton_name_length,
- "binlog", strlen("binlog"),
+ "binlog", (uint)strlen("binlog"),
buf, buflen))
DBUG_RETURN(TRUE);
}
=== modified file 'sql/ha_ndbcluster_binlog.h'
--- a/sql/ha_ndbcluster_binlog.h 2011-09-07 22:50:01 +0000
+++ b/sql/ha_ndbcluster_binlog.h 2011-10-20 16:18:28 +0000
@@ -299,7 +299,7 @@ ndbcluster_show_status_binlog(THD* thd,
the ndb binlog code
*/
int cmp_frm(const NDBTAB *ndbtab, const void *pack_data,
- uint pack_length);
+ size_t pack_length);
int ndbcluster_find_all_files(THD *thd);
char *ndb_pack_varchar(const NDBCOL *col, char *buf,
=== modified file 'sql/ha_ndbcluster_connection.cc'
--- a/sql/ha_ndbcluster_connection.cc 2011-10-20 12:23:31 +0000
+++ b/sql/ha_ndbcluster_connection.cc 2011-10-22 07:56:33 +0000
@@ -368,10 +368,10 @@ ndb_transid_mysql_connection_map_fill_ta
table->field[2]->set_notnull();
table->field[2]->store(p->getNextTransactionId(), true);
schema_table_store_record(thd, table);
- p = g_pool[i]->get_next_ndb_object(p);
}
- g_pool[i]->unlock_ndb_objects();
+ p = g_pool[i]->get_next_ndb_object(p);
}
+ g_pool[i]->unlock_ndb_objects();
}
}
=== modified file 'sql/ha_ndbinfo.cc'
--- a/sql/ha_ndbinfo.cc 2011-10-17 12:43:31 +0000
+++ b/sql/ha_ndbinfo.cc 2011-10-20 16:18:28 +0000
@@ -245,7 +245,7 @@ bool ha_ndbinfo::get_error_message(int e
if (!message)
DBUG_RETURN(false);
- buf->set(message, strlen(message), &my_charset_bin);
+ buf->set(message, (uint32)strlen(message), &my_charset_bin);
DBUG_PRINT("exit", ("message: %s", buf->ptr()));
DBUG_RETURN(false);
}
=== modified file 'storage/ndb/include/kernel/signaldata/DiGetNodes.hpp'
--- a/storage/ndb/include/kernel/signaldata/DiGetNodes.hpp 2011-07-09 11:16:31 +0000
+++ b/storage/ndb/include/kernel/signaldata/DiGetNodes.hpp 2011-10-28 09:04:10 +0000
@@ -64,7 +64,10 @@ private:
Uint32 hashValue;
Uint32 distr_key_indicator;
Uint32 unused;
- Uint32 jamBuffer[2];
+ union {
+ void * jamBufferPtr;
+ Uint32 jamBufferStorage[2];
+ };
};
#endif
=== modified file 'storage/ndb/include/util/OutputStream.hpp'
--- a/storage/ndb/include/util/OutputStream.hpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/include/util/OutputStream.hpp 2011-10-24 07:44:52 +0000
@@ -33,6 +33,7 @@ public:
ATTRIBUTE_FORMAT(printf, 2, 3) = 0;
virtual int println(const char * fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3) = 0;
+ virtual int write(const void * buf, size_t len) = 0;
virtual void flush() {};
virtual void reset_timeout() {};
};
@@ -48,6 +49,7 @@ public:
ATTRIBUTE_FORMAT(printf, 2, 3);
int println(const char * fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
+ int write(const void * buf, size_t len);
void flush() { fflush(f); }
};
@@ -67,6 +69,7 @@ public:
ATTRIBUTE_FORMAT(printf, 2, 3);
int println(const char * fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
+ int write(const void * buf, size_t len);
};
@@ -82,6 +85,7 @@ public:
int println(const char * fmt, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
+ int write(const void * buf, size_t len);
void flush();
};
@@ -92,6 +96,7 @@ public:
virtual ~NullOutputStream() {}
int print(const char * /* unused */, ...) { return 1;}
int println(const char * /* unused */, ...) { return 1;}
+ int write(const void * buf, size_t len) { return 1;}
};
#endif
=== modified file 'storage/ndb/src/common/debugger/EventLogger.cpp'
--- a/storage/ndb/src/common/debugger/EventLogger.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/debugger/EventLogger.cpp 2011-10-21 08:59:23 +0000
@@ -1524,7 +1524,7 @@ EventLogger::getText(char * dst, size_t
if (nodeId != 0)
{
BaseString::snprintf(dst, dst_len, "Node %u: ", nodeId);
- pos= strlen(dst);
+ pos= (int)strlen(dst);
}
if (dst_len-pos > 0)
textF(dst+pos, dst_len-pos, theData, len);
=== modified file 'storage/ndb/src/common/debugger/SignalLoggerManager.cpp'
--- a/storage/ndb/src/common/debugger/SignalLoggerManager.cpp 2011-02-02 15:16:35 +0000
+++ b/storage/ndb/src/common/debugger/SignalLoggerManager.cpp 2011-10-28 09:04:10 +0000
@@ -126,7 +126,7 @@ getParameter(char *blocks[NO_OF_BLOCKS],
char * tmp = copy;
bool done = false;
while(!done){
- int len = strcspn(tmp, ", ;:\0");
+ int len = (int)strcspn(tmp, ", ;:\0");
if(len == 0)
done = true;
else {
=== modified file 'storage/ndb/src/common/logger/LogHandler.cpp'
--- a/storage/ndb/src/common/logger/LogHandler.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/logger/LogHandler.cpp 2011-10-21 08:59:23 +0000
@@ -175,7 +175,7 @@ LogHandler::parseParams(const BaseString
bool ret = true;
_params.split(v_args, ",");
- for(size_t i=0; i < v_args.size(); i++) {
+ for(unsigned i=0; i < v_args.size(); i++) {
Vector<BaseString> v_param_value;
if(v_args[i].split(v_param_value, "=", 2) != 2)
{
=== modified file 'storage/ndb/src/common/logger/Logger.cpp'
--- a/storage/ndb/src/common/logger/Logger.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/logger/Logger.cpp 2011-10-21 08:59:23 +0000
@@ -212,13 +212,12 @@ Logger::addHandler(LogHandler* pHandler)
bool
Logger::addHandler(const BaseString &logstring, int *err, int len, char* errStr) {
- size_t i;
Vector<BaseString> logdest;
DBUG_ENTER("Logger::addHandler");
logstring.split(logdest, ";");
- for(i = 0; i < logdest.size(); i++) {
+ for(unsigned i = 0; i < logdest.size(); i++) {
DBUG_PRINT("info",("adding: %s",logdest[i].c_str()));
Vector<BaseString> v_type_args;
=== modified file 'storage/ndb/src/common/portlib/NdbConfig.c'
--- a/storage/ndb/src/common/portlib/NdbConfig.c 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/portlib/NdbConfig.c 2011-10-21 08:59:23 +0000
@@ -31,14 +31,14 @@ NdbConfig_get_path(int *_len)
const char *path= NdbEnv_GetEnv("NDB_HOME", 0, 0);
int path_len= 0;
if (path)
- path_len= strlen(path);
+ path_len= (int)strlen(path);
if (path_len == 0 && datadir_path) {
path= datadir_path;
- path_len= strlen(path);
+ path_len= (int)strlen(path);
}
if (path_len == 0) {
path= ".";
- path_len= strlen(path);
+ path_len= (int)strlen(path);
}
if (_len)
*_len= path_len;
@@ -68,7 +68,7 @@ NdbConfig_NdbCfgName(int with_ndb_home){
if (with_ndb_home) {
buf= NdbConfig_AllocHomePath(PATH_MAX);
- len= strlen(buf);
+ len= (int)strlen(buf);
} else
buf= NdbMem_Allocate(PATH_MAX);
basestring_snprintf(buf+len, PATH_MAX, "Ndb.cfg");
@@ -87,7 +87,7 @@ char *get_prefix_buf(int len, int node_i
NdbHost_GetProcessId());
tmp_buf[sizeof(tmp_buf)-1]= 0;
- buf= NdbConfig_AllocHomePath(len+strlen(tmp_buf));
+ buf= NdbConfig_AllocHomePath(len+(int)strlen(tmp_buf));
strcat(buf, tmp_buf);
return buf;
}
@@ -95,7 +95,7 @@ char *get_prefix_buf(int len, int node_i
char*
NdbConfig_ErrorFileName(int node_id){
char *buf= get_prefix_buf(PATH_MAX, node_id);
- int len= strlen(buf);
+ int len= (int)strlen(buf);
basestring_snprintf(buf+len, PATH_MAX, "_error.log");
return buf;
}
@@ -103,7 +103,7 @@ NdbConfig_ErrorFileName(int node_id){
char*
NdbConfig_ClusterLogFileName(int node_id){
char *buf= get_prefix_buf(PATH_MAX, node_id);
- int len= strlen(buf);
+ int len= (int)strlen(buf);
basestring_snprintf(buf+len, PATH_MAX, "_cluster.log");
return buf;
}
@@ -111,7 +111,7 @@ NdbConfig_ClusterLogFileName(int node_id
char*
NdbConfig_SignalLogFileName(int node_id){
char *buf= get_prefix_buf(PATH_MAX, node_id);
- int len= strlen(buf);
+ int len= (int)strlen(buf);
basestring_snprintf(buf+len, PATH_MAX, "_signal.log");
return buf;
}
@@ -119,7 +119,7 @@ NdbConfig_SignalLogFileName(int node_id)
char*
NdbConfig_TraceFileName(int node_id, int file_no){
char *buf= get_prefix_buf(PATH_MAX, node_id);
- int len= strlen(buf);
+ int len= (int)strlen(buf);
basestring_snprintf(buf+len, PATH_MAX, "_trace.log.%u", file_no);
return buf;
}
@@ -127,7 +127,7 @@ NdbConfig_TraceFileName(int node_id, int
char*
NdbConfig_NextTraceFileName(int node_id){
char *buf= get_prefix_buf(PATH_MAX, node_id);
- int len= strlen(buf);
+ int len= (int)strlen(buf);
basestring_snprintf(buf+len, PATH_MAX, "_trace.log.next");
return buf;
}
@@ -135,7 +135,7 @@ NdbConfig_NextTraceFileName(int node_id)
char*
NdbConfig_PidFileName(int node_id){
char *buf= get_prefix_buf(PATH_MAX, node_id);
- int len= strlen(buf);
+ int len= (int)strlen(buf);
basestring_snprintf(buf+len, PATH_MAX, ".pid");
return buf;
}
@@ -143,7 +143,7 @@ NdbConfig_PidFileName(int node_id){
char*
NdbConfig_StdoutFileName(int node_id){
char *buf= get_prefix_buf(PATH_MAX, node_id);
- int len= strlen(buf);
+ int len= (int)strlen(buf);
basestring_snprintf(buf+len, PATH_MAX, "_out.log");
return buf;
}
=== modified file 'storage/ndb/src/common/portlib/NdbDir.cpp'
--- a/storage/ndb/src/common/portlib/NdbDir.cpp 2011-01-30 23:13:49 +0000
+++ b/storage/ndb/src/common/portlib/NdbDir.cpp 2011-10-21 08:59:23 +0000
@@ -280,7 +280,7 @@ NdbDir::remove_recursive(const char* dir
fprintf(stderr, "Too long path to remove: '%s'\n", dir);
return false;
}
- int start_len = strlen(path);
+ int start_len = (int)strlen(path);
const char* name;
NdbDir::Iterator iter;
@@ -298,7 +298,7 @@ loop:
if ((strcmp(".", name) == 0) || (strcmp("..", name) == 0))
continue;
- int end_len, len = strlen(path);
+ int end_len, len = (int)strlen(path);
if ((end_len = basestring_snprintf(path + len, sizeof(path) - len,
"%s", name)) < 0)
{
@@ -329,7 +329,7 @@ loop:
}
iter.close();
- int len = strlen(path);
+ int len = (int)strlen(path);
path[len - 1] = 0; // remove ending slash
char * prev_slash = strrchr(path, IF_WIN('\\', '/'));
=== modified file 'storage/ndb/src/common/portlib/NdbThread.c'
--- a/storage/ndb/src/common/portlib/NdbThread.c 2011-10-07 07:37:47 +0000
+++ b/storage/ndb/src/common/portlib/NdbThread.c 2011-10-21 08:59:23 +0000
@@ -253,7 +253,11 @@ NdbThread_Create(NDB_THREAD_FUNC *p_thre
thread_stack_size = PTHREAD_STACK_MIN;
#endif
DBUG_PRINT("info", ("stack_size: %llu", (ulonglong)thread_stack_size));
+#ifndef _WIN32
pthread_attr_setstacksize(&thread_attr, thread_stack_size);
+#else
+ pthread_attr_setstacksize(&thread_attr, (DWORD)thread_stack_size);
+#endif
#ifdef USE_PTHREAD_EXTRAS
/* Guard stack overflow with a 2k databuffer */
pthread_attr_setguardsize(&thread_attr, 2048);
=== modified file 'storage/ndb/src/common/portlib/ndb_daemon.cc'
--- a/storage/ndb/src/common/portlib/ndb_daemon.cc 2011-01-30 23:13:49 +0000
+++ b/storage/ndb/src/common/portlib/ndb_daemon.cc 2011-10-20 16:18:28 +0000
@@ -315,7 +315,7 @@ do_files(const char *pidfile_name, const
pidfile_name, errno);
char buf[32];
- int length = my_snprintf(buf, sizeof(buf), "%ld",
+ int length = (int)my_snprintf(buf, sizeof(buf), "%ld",
(long)NdbHost_GetProcessId());
if (write(pidfd, buf, length) != length)
return ERR1("Failed to write pid to pidfile '%s', errno: %d",
=== modified file 'storage/ndb/src/common/transporter/TransporterRegistry.cpp'
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp 2011-09-09 10:48:14 +0000
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp 2011-10-21 08:59:23 +0000
@@ -2418,7 +2418,7 @@ TransporterRegistry::print_transporters(
out << "<<" << endl;
- for (size_t i= 0; i < m_transporter_interface.size(); i++){
+ for (unsigned i= 0; i < m_transporter_interface.size(); i++){
Transporter_interface tf= m_transporter_interface[i];
out << i
=== modified file 'storage/ndb/src/common/util/BaseString.cpp'
--- a/storage/ndb/src/common/util/BaseString.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/util/BaseString.cpp 2011-10-21 08:59:23 +0000
@@ -50,7 +50,7 @@ BaseString::BaseString(const char* s)
return;
}
memcpy(m_chr, s, n + 1);
- m_len = n;
+ m_len = (unsigned)n;
}
BaseString::BaseString(const char * s, size_t n)
@@ -70,7 +70,7 @@ BaseString::BaseString(const char * s, s
}
memcpy(m_chr, s, n);
m_chr[n] = 0;
- m_len = n;
+ m_len = (unsigned)n;
}
BaseString::BaseString(const BaseString& str)
@@ -93,7 +93,7 @@ BaseString::BaseString(const BaseString&
}
memcpy(t, s, n + 1);
m_chr = t;
- m_len = n;
+ m_len = (unsigned)n;
}
BaseString::~BaseString()
@@ -125,7 +125,7 @@ BaseString::assign(const char* s)
}
delete[] m_chr;
m_chr = t;
- m_len = n;
+ m_len = (unsigned)n;
return *this;
}
@@ -145,7 +145,7 @@ BaseString::assign(const char* s, size_t
}
delete[] m_chr;
m_chr = t;
- m_len = n;
+ m_len = (unsigned)n;
return *this;
}
@@ -178,7 +178,7 @@ BaseString::append(const char* s)
}
delete[] m_chr;
m_chr = t;
- m_len += n;
+ m_len += (unsigned)n;
return *this;
}
@@ -196,7 +196,7 @@ BaseString::append(const BaseString& str
BaseString&
BaseString::append(const Vector<BaseString> &vector,
const BaseString &separator) {
- for(size_t i=0;i<vector.size(); i++) {
+ for(unsigned i=0;i<vector.size(); i++) {
append(vector[i]);
if(i<vector.size()-1)
append(separator);
@@ -232,7 +232,7 @@ BaseString::assfmt(const char *fmt, ...)
l = basestring_vsnprintf(m_chr, l, fmt, ap);
assert(l == (int)strlen(m_chr));
va_end(ap);
- m_len = strlen(m_chr);
+ m_len = (unsigned)strlen(m_chr);
return *this;
}
@@ -279,7 +279,7 @@ BaseString::split(Vector<BaseString> &v,
int maxSize) const {
char *str = strdup(m_chr);
int i, start, len, num = 0;
- len = strlen(str);
+ len = (int)strlen(str);
for(start = i = 0;
(i <= len) && ( (maxSize<0) || ((int)v.size()<=maxSize-1) );
i++) {
@@ -360,7 +360,7 @@ BaseString::argify(const char *argv0, co
char *tmp = new char[strlen(src)+1];
if (tmp == NULL)
{
- for(size_t i = 0; i < vargv.size(); i++)
+ for(unsigned i = 0; i < vargv.size(); i++)
free(vargv[i]);
errno = ENOMEM;
return NULL;
@@ -413,7 +413,7 @@ BaseString::argify(const char *argv0, co
if (t == NULL)
{
delete[] tmp;
- for(size_t i = 0; i < vargv.size(); i++)
+ for(unsigned i = 0; i < vargv.size(); i++)
free(vargv[i]);
errno = ENOMEM;
return NULL;
@@ -422,7 +422,7 @@ BaseString::argify(const char *argv0, co
{
free(t);
delete[] tmp;
- for(size_t i = 0; i < vargv.size(); i++)
+ for(unsigned i = 0; i < vargv.size(); i++)
free(vargv[i]);
return NULL;
}
@@ -433,7 +433,7 @@ BaseString::argify(const char *argv0, co
delete[] tmp;
if (vargv.push_back(NULL))
{
- for(size_t i = 0; i < vargv.size(); i++)
+ for(unsigned i = 0; i < vargv.size(); i++)
free(vargv[i]);
return NULL;
}
@@ -444,13 +444,13 @@ BaseString::argify(const char *argv0, co
char **argv = (char **)malloc(sizeof(*argv) * (vargv.size()));
if(argv == NULL)
{
- for(size_t i = 0; i < vargv.size(); i++)
+ for(unsigned i = 0; i < vargv.size(); i++)
free(vargv[i]);
errno = ENOMEM;
return NULL;
}
- for(size_t i = 0; i < vargv.size(); i++){
+ for(unsigned i = 0; i < vargv.size(); i++){
argv[i] = vargv[i];
}
@@ -460,13 +460,13 @@ BaseString::argify(const char *argv0, co
BaseString&
BaseString::trim(const char * delim){
trim(m_chr, delim);
- m_len = strlen(m_chr);
+ m_len = (unsigned)strlen(m_chr);
return * this;
}
char*
BaseString::trim(char * str, const char * delim){
- int len = strlen(str) - 1;
+ int len = (int)strlen(str) - 1;
for(; len > 0 && strchr(delim, str[len]); len--)
;
=== modified file 'storage/ndb/src/common/util/ConfigValues.cpp'
--- a/storage/ndb/src/common/util/ConfigValues.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/util/ConfigValues.cpp 2011-10-21 08:59:23 +0000
@@ -593,7 +593,7 @@ ConfigValues::getPackedSize() const {
break;
case StringType:
size += 8; // key + len
- size += mod4(strlen(* getString(m_values[i+1])) + 1);
+ size += mod4((unsigned)strlen(* getString(m_values[i+1])) + 1);
break;
case InvalidType:
default:
=== modified file 'storage/ndb/src/common/util/File.cpp'
--- a/storage/ndb/src/common/util/File.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/util/File.cpp 2011-10-21 08:59:23 +0000
@@ -148,13 +148,13 @@ File_class::close()
int
File_class::read(void* buf, size_t itemSize, size_t nitems) const
{
- return ::fread(buf, itemSize, nitems, m_file);
+ return (int)::fread(buf, itemSize, nitems, m_file);
}
int
File_class::readChar(char* buf, long start, long length) const
{
- return ::fread((void*)&buf[start], 1, length, m_file);
+ return (int)::fread((void*)&buf[start], 1, length, m_file);
}
int
@@ -166,13 +166,13 @@ File_class::readChar(char* buf)
int
File_class::write(const void* buf, size_t size_arg, size_t nitems)
{
- return ::fwrite(buf, size_arg, nitems, m_file);
+ return (int)::fwrite(buf, size_arg, nitems, m_file);
}
int
File_class::writeChar(const char* buf, long start, long length)
{
- return ::fwrite((const void*)&buf[start], sizeof(char), length, m_file);
+ return (int)::fwrite((const void*)&buf[start], sizeof(char), length, m_file);
}
int
=== modified file 'storage/ndb/src/common/util/InputStream.cpp'
--- a/storage/ndb/src/common/util/InputStream.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/util/InputStream.cpp 2011-10-21 08:59:23 +0000
@@ -57,7 +57,7 @@ SocketInputStream::gets(char * buf, int
m_startover= false;
}
else
- offset= strlen(buf);
+ offset= (int)strlen(buf);
int time= 0;
int res = readln_socket(m_socket, m_timeout_remain, &time,
=== modified file 'storage/ndb/src/common/util/NdbSqlUtil.cpp'
--- a/storage/ndb/src/common/util/NdbSqlUtil.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/util/NdbSqlUtil.cpp 2011-10-21 08:59:23 +0000
@@ -693,7 +693,7 @@ NdbSqlUtil::likeChar(const void* info, c
const char* v2 = (const char*)p2;
CHARSET_INFO* cs = (CHARSET_INFO*)(info);
// strip end spaces to match (incorrect) MySQL behaviour
- n1 = (*cs->cset->lengthsp)(cs, v1, n1);
+ n1 = (unsigned)(*cs->cset->lengthsp)(cs, v1, n1);
int k = (*cs->coll->wildcmp)(cs, v1, v1 + n1, v2, v2 + n2, ndb_wild_prefix, ndb_wild_one, ndb_wild_many);
return k == 0 ? 0 : +1;
}
@@ -980,13 +980,13 @@ NdbSqlUtil::strnxfrm_bug7284(CHARSET_INF
if (n1 <= 0)
return -1;
// strxfrm to binary
- int n2 = ndb_strnxfrm(cs, xsp, sizeof(xsp), nsp, n1);
+ int n2 = (int)ndb_strnxfrm(cs, xsp, sizeof(xsp), nsp, n1);
if (n2 <= 0)
return -1;
// XXX bug workaround - strnxfrm may not write full string
memset(dst, 0x0, dstLen);
// strxfrm argument string - returns no error indication
- int n3 = ndb_strnxfrm(cs, dst, dstLen, src, srcLen);
+ int n3 = (int)ndb_strnxfrm(cs, dst, dstLen, src, srcLen);
// pad with strxfrm-ed space chars
int n4 = n3;
while (n4 < (int)dstLen) {
=== modified file 'storage/ndb/src/common/util/OutputStream.cpp'
--- a/storage/ndb/src/common/util/OutputStream.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/util/OutputStream.cpp 2011-10-24 07:44:52 +0000
@@ -43,6 +43,12 @@ FileOutputStream::println(const char * f
return ret + fprintf(f, "\n");
}
+int
+FileOutputStream::write(const void * buf, size_t len)
+{
+ return (int)fwrite(buf, len, 1, f);
+}
+
SocketOutputStream::SocketOutputStream(NDB_SOCKET_TYPE socket,
unsigned write_timeout_ms) :
m_socket(socket),
@@ -97,6 +103,28 @@ SocketOutputStream::println(const char *
return ret;
}
+int
+SocketOutputStream::write(const void * buf, size_t len)
+{
+ if (timedout())
+ return -1;
+
+ int time = 0;
+ int ret = write_socket(m_socket, m_timeout_ms, &time,
+ (const char*)buf, (int)len);
+ if (ret >= 0)
+ {
+ m_timeout_remain -= time;
+ }
+
+ if ((ret < 0 && errno == SOCKET_ETIMEDOUT) || m_timeout_remain <= 0)
+ {
+ m_timedout = true;
+ ret= -1;
+ }
+ return ret;
+}
+
#include <UtilBuffer.hpp>
#include <BaseString.hpp>
@@ -172,6 +200,12 @@ BufferedSockOutputStream::println(const
return 0;
}
+int
+BufferedSockOutputStream::write(const void * buf, size_t len)
+{
+ return m_buffer.append(buf, len);
+}
+
void BufferedSockOutputStream::flush(){
int elapsed = 0;
if (write_socket(m_socket, m_timeout_ms, &elapsed,
=== modified file 'storage/ndb/src/common/util/Parser.cpp'
--- a/storage/ndb/src/common/util/Parser.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/util/Parser.cpp 2011-10-21 08:59:23 +0000
@@ -78,7 +78,7 @@ bool
Empty(const char * str){
if(str == 0)
return true;
- const int len = strlen(str);
+ const int len = (int)strlen(str);
if(len == 0)
return false;
for(int i = 0; i<len; i++)
@@ -96,7 +96,7 @@ void
trim(char * str){
if(str == NULL)
return;
- int len = strlen(str);
+ int len = (int)strlen(str);
for(len--; str[len] == '\n' || str[len] == ' ' || str[len] == '\t'; len--)
str[len] = 0;
@@ -156,7 +156,7 @@ ParserImpl::run(Context * ctx, const cla
return false;
}
- int last= strlen(ctx->m_currentToken);
+ int last= (int)strlen(ctx->m_currentToken);
if(last>0)
last--;
=== modified file 'storage/ndb/src/common/util/Properties.cpp'
--- a/storage/ndb/src/common/util/Properties.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/util/Properties.cpp 2011-10-21 08:59:23 +0000
@@ -662,10 +662,10 @@ PropertiesImpl::getPackedSize(Uint32 pLe
sz += 4; // Type
sz += 4; // Name Len
sz += 4; // Value Len
- sz += mod4(pLen + strlen(content[i]->name)); // Name
+ sz += mod4(pLen + (unsigned)strlen(content[i]->name)); // Name
switch(content[i]->valueType){
case PropertiesType_char:
- sz += mod4(strlen((char *)content[i]->value));
+ sz += mod4((unsigned)strlen((char *)content[i]->value));
break;
case PropertiesType_Uint32:
sz += mod4(4);
@@ -734,7 +734,7 @@ PropertiesImpl::pack(Uint32 *& buf, cons
CharBuf charBuf;
for(unsigned int i = 0; i<items; i++){
- const int strLenName = strlen(content[i]->name);
+ const int strLenName = (int)strlen(content[i]->name);
if(content[i]->valueType == PropertiesType_Properties){
charBuf.clear();
=== modified file 'storage/ndb/src/common/util/ndb_init.cpp'
--- a/storage/ndb/src/common/util/ndb_init.cpp 2011-09-27 17:28:13 +0000
+++ b/storage/ndb/src/common/util/ndb_init.cpp 2011-10-20 16:18:28 +0000
@@ -56,7 +56,7 @@ ndb_init_internal()
{
{
const char* err = "ndb_init() failed - exit\n";
- int res = write(2, err, strlen(err));
+ int res = (int)write(2, err, (unsigned)strlen(err));
(void)res;
exit(1);
}
@@ -79,7 +79,7 @@ ndb_init()
if (my_init())
{
const char* err = "my_init() failed - exit\n";
- int res = write(2, err, strlen(err));
+ int res = (int)write(2, err, (unsigned)strlen(err));
(void)res;
exit(1);
}
=== modified file 'storage/ndb/src/common/util/ndbzio.c'
--- a/storage/ndb/src/common/util/ndbzio.c 2011-07-04 13:37:56 +0000
+++ b/storage/ndb/src/common/util/ndbzio.c 2011-10-20 18:36:21 +0000
@@ -428,7 +428,7 @@ int read_buffer(ndbzio_stream *s)
my_errno= 0;
if (s->stream.avail_in == 0)
{
- s->stream.avail_in = my_read(s->file, (uchar *)s->inbuf, AZ_BUFSIZE_READ, MYF(0));
+ s->stream.avail_in = (uInt)my_read(s->file, (uchar *)s->inbuf, AZ_BUFSIZE_READ, MYF(0));
if(s->stream.avail_in > 0)
my_errno= 0;
if (s->stream.avail_in == 0)
@@ -681,7 +681,7 @@ unsigned int ZEXPORT ndbzread ( ndbzio_s
bytes_read= my_read(s->file, (uchar *)next_out, s->stream.avail_out,
MYF(0));
if(bytes_read>0)
- s->stream.avail_out -= bytes_read;
+ s->stream.avail_out -= (uInt)bytes_read;
if (bytes_read == 0)
{
s->z_eof = 1;
=== modified file 'storage/ndb/src/common/util/socket_io.cpp'
--- a/storage/ndb/src/common/util/socket_io.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/common/util/socket_io.cpp 2011-10-21 08:59:23 +0000
@@ -123,7 +123,7 @@ readln_socket(NDB_SOCKET_TYPE socket, in
*time = 0;
ptr[0]= 0;
- return ptr - buf;
+ return (int)(ptr - buf);
}
}
@@ -226,7 +226,7 @@ vprint_socket(NDB_SOCKET_TYPE socket, in
} else
return 0;
- int ret = write_socket(socket, timeout_millis, time, buf2, size);
+ int ret = write_socket(socket, timeout_millis, time, buf2, (int)size);
if(buf2 != buf)
free(buf2);
return ret;
@@ -254,7 +254,7 @@ vprintln_socket(NDB_SOCKET_TYPE socket,
}
buf2[size-1]='\n';
- int ret = write_socket(socket, timeout_millis, time, buf2, size);
+ int ret = write_socket(socket, timeout_millis, time, buf2, (int)size);
if(buf2 != buf)
free(buf2);
return ret;
=== modified file 'storage/ndb/src/cw/cpcd/APIService.cpp'
--- a/storage/ndb/src/cw/cpcd/APIService.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/cw/cpcd/APIService.cpp 2011-10-21 08:59:23 +0000
@@ -182,7 +182,7 @@ CPCDAPISession::runSession(){
switch(ctx.m_status){
case Parser_t::Ok:
- for(size_t i = 0; i<ctx.m_aliasUsed.size(); i++)
+ for(unsigned i = 0; i<ctx.m_aliasUsed.size(); i++)
ndbout_c("Used alias: %s -> %s",
ctx.m_aliasUsed[i]->name, ctx.m_aliasUsed[i]->realName);
break;
@@ -199,7 +199,7 @@ CPCDAPISession::runSession(){
void
CPCDAPISession::stopSession(){
CPCD::RequestStatus rs;
- for(size_t i = 0; i<m_temporaryProcesses.size(); i++){
+ for(unsigned i = 0; i<m_temporaryProcesses.size(); i++){
Uint32 id = m_temporaryProcesses[i];
m_cpcd.undefineProcess(&rs, id);
}
@@ -215,7 +215,7 @@ CPCDAPISession::loadFile(){
switch(ctx.m_status){
case Parser_t::Ok:
- for(size_t i = 0; i<ctx.m_aliasUsed.size(); i++)
+ for(unsigned i = 0; i<ctx.m_aliasUsed.size(); i++)
ndbout_c("Used alias: %s -> %s",
ctx.m_aliasUsed[i]->name, ctx.m_aliasUsed[i]->realName);
break;
@@ -348,7 +348,7 @@ CPCDAPISession::listProcesses(Parser_t::
m_output->println("%s", "");
- for(size_t i = 0; i < proclist->size(); i++) {
+ for(unsigned i = 0; i < proclist->size(); i++) {
CPCD::Process *p = (*proclist)[i];
m_output->println("process");
=== modified file 'storage/ndb/src/cw/cpcd/CPCD.cpp'
--- a/storage/ndb/src/cw/cpcd/CPCD.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/cw/cpcd/CPCD.cpp 2011-10-21 08:59:23 +0000
@@ -60,7 +60,7 @@ CPCD::findUniqueId() {
if(id == 0)
ok = false;
- for(size_t i = 0; i<m_processes.size(); i++) {
+ for(unsigned i = 0; i<m_processes.size(); i++) {
if(m_processes[i]->m_id == id)
ok = false;
}
@@ -76,7 +76,7 @@ CPCD::defineProcess(RequestStatus * rs,
Guard tmp(m_processes);
- for(size_t i = 0; i<m_processes.size(); i++) {
+ for(unsigned i = 0; i<m_processes.size(); i++) {
Process * proc = m_processes[i];
if((strcmp(arg->m_name.c_str(), proc->m_name.c_str()) == 0) &&
@@ -106,7 +106,7 @@ CPCD::undefineProcess(CPCD::RequestStatu
Guard tmp(m_processes);
Process * proc = 0;
- size_t i;
+ unsigned i;
for(i = 0; i < m_processes.size(); i++) {
if(m_processes[i]->m_id == id) {
proc = m_processes[i];
@@ -142,7 +142,7 @@ CPCD::startProcess(CPCD::RequestStatus *
Guard tmp(m_processes);
- for(size_t i = 0; i < m_processes.size(); i++) {
+ for(unsigned i = 0; i < m_processes.size(); i++) {
if(m_processes[i]->m_id == id) {
proc = m_processes[i];
break;
@@ -185,7 +185,7 @@ CPCD::stopProcess(CPCD::RequestStatus *r
Guard tmp(m_processes);
Process * proc = 0;
- for(size_t i = 0; i < m_processes.size(); i++) {
+ for(unsigned i = 0; i < m_processes.size(); i++) {
if(m_processes[i]->m_id == id) {
proc = m_processes[i];
break;
@@ -264,7 +264,7 @@ CPCD::saveProcessList(){
return false;
}
- for(size_t i = 0; i<m_processes.size(); i++){
+ for(unsigned i = 0; i<m_processes.size(); i++){
m_processes[i]->print(f);
fprintf(f, "\n");
@@ -367,7 +367,7 @@ CPCD::loadProcessList(){
sess.loadFile();
loadingProcessList = false;
- size_t i;
+ unsigned i;
Vector<int> temporary;
for(i = 0; i<m_processes.size(); i++){
Process * proc = m_processes[i];
=== modified file 'storage/ndb/src/cw/cpcd/Monitor.cpp'
--- a/storage/ndb/src/cw/cpcd/Monitor.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/cw/cpcd/Monitor.cpp 2011-10-21 08:59:23 +0000
@@ -63,7 +63,7 @@ CPCD::Monitor::run() {
proc.lock();
- for(size_t i = 0; i < proc.size(); i++) {
+ for(unsigned i = 0; i < proc.size(); i++) {
proc[i]->monitor();
}
=== modified file 'storage/ndb/src/cw/cpcd/Process.cpp'
--- a/storage/ndb/src/cw/cpcd/Process.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/cw/cpcd/Process.cpp 2011-10-21 08:59:23 +0000
@@ -334,7 +334,7 @@ save_environment(const char *env, Vector
void
CPCD::Process::do_exec() {
- size_t i;
+ unsigned i;
#ifdef _WIN32
Vector<BaseString> saved;
@@ -411,7 +411,7 @@ CPCD::Process::do_exec() {
}
int f = fds[i]= open(redirects[i]->c_str(), flags, mode);
if(f == -1){
- logger.error("Cannot redirect %ld to/from '%s' : %s\n", i,
+ logger.error("Cannot redirect %u to/from '%s' : %s\n", i,
redirects[i]->c_str(), strerror(errno));
_exit(1);
}
=== modified file 'storage/ndb/src/kernel/blocks/backup/read.cpp'
--- a/storage/ndb/src/kernel/blocks/backup/read.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/read.cpp 2011-10-21 08:59:23 +0000
@@ -229,7 +229,7 @@ size_t
aread(void * buf, size_t sz, size_t n, ndbzio_stream* f)
{
int error = 0;
- unsigned r = ndbzread(f, buf, (sz * n), &error);
+ unsigned r = ndbzread(f, buf, (unsigned)(sz * n), &error);
if (error || r != (sz * n))
{
printf("Failed to read!!");
=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2011-10-20 12:51:03 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2011-10-28 09:04:10 +0000
@@ -15406,7 +15406,7 @@ Dbdict::createEvent_RT_USER_CREATE(Signa
}
r0.getString(evntRecPtr.p->m_eventRec.NAME);
{
- int len = strlen(evntRecPtr.p->m_eventRec.NAME);
+ int len = (int)strlen(evntRecPtr.p->m_eventRec.NAME);
memset(evntRecPtr.p->m_eventRec.NAME+len, 0, MAX_TAB_NAME_SIZE-len);
#ifdef EVENT_DEBUG
printf("CreateEvntReq::RT_USER_CREATE; EventName %s, len %u\n",
@@ -15434,7 +15434,7 @@ sendref:
}
r0.getString(evntRecPtr.p->m_eventRec.TABLE_NAME);
{
- int len = strlen(evntRecPtr.p->m_eventRec.TABLE_NAME);
+ int len = (int)strlen(evntRecPtr.p->m_eventRec.TABLE_NAME);
memset(evntRecPtr.p->m_eventRec.TABLE_NAME+len, 0, MAX_TAB_NAME_SIZE-len);
}
@@ -16059,7 +16059,7 @@ Dbdict::createEvent_RT_USER_GET(Signal*
}
r0.getString(evntRecPtr.p->m_eventRec.NAME);
- int len = strlen(evntRecPtr.p->m_eventRec.NAME);
+ int len = (int)strlen(evntRecPtr.p->m_eventRec.NAME);
memset(evntRecPtr.p->m_eventRec.NAME+len, 0, MAX_TAB_NAME_SIZE-len);
releaseSections(handle);
@@ -17122,7 +17122,7 @@ Dbdict::execDROP_EVNT_REQ(Signal* signal
}
r0.getString(evntRecPtr.p->m_eventRec.NAME);
{
- int len = strlen(evntRecPtr.p->m_eventRec.NAME);
+ int len = (int)strlen(evntRecPtr.p->m_eventRec.NAME);
memset(evntRecPtr.p->m_eventRec.NAME+len, 0, MAX_TAB_NAME_SIZE-len);
#ifdef EVENT_DEBUG
printf("DropEvntReq; EventName %s, len %u\n",
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2011-09-29 13:07:26 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2011-10-28 09:04:10 +0000
@@ -9023,7 +9023,7 @@ void Dbdih::execDIGETNODESREQ(Signal* si
Uint32 fragId, newFragId = RNIL;
DiGetNodesConf * const conf = (DiGetNodesConf *)&signal->theData[0];
TabRecord* regTabDesc = tabRecord;
- EmulatedJamBuffer * jambuf = * (EmulatedJamBuffer**)(req->jamBuffer);
+ EmulatedJamBuffer * jambuf = (EmulatedJamBuffer*)req->jamBufferPtr;
thrjamEntry(jambuf);
ptrCheckGuard(tabPtr, ttabFileSize, regTabDesc);
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp 2011-10-21 08:59:23 +0000
@@ -58,7 +58,7 @@ char * getNSString(Uint32 ns){
void
fill(const char * buf, int mod){
- int len = strlen(buf)+1;
+ int len = (int)(strlen(buf)+1);
ndbout << buf << " ";
while((len % mod) != 0){
ndbout << " ";
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp 2011-10-21 08:59:23 +0000
@@ -85,7 +85,7 @@ NDB_COMMAND(redoLogFileReader, "redoLog
{
MY_STAT buf;
my_stat(fileName, &buf, MYF(0));
- NO_MBYTE_IN_FILE = buf.st_size / (1024 * 1024);
+ NO_MBYTE_IN_FILE = (unsigned)(buf.st_size / (1024 * 1024));
if (NO_MBYTE_IN_FILE != 16)
{
ndbout_c("Detected %umb files", NO_MBYTE_IN_FILE);
=== modified file 'storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-10-20 12:51:03 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-10-28 09:04:10 +0000
@@ -3683,7 +3683,7 @@ Dbspj::getNodes(Signal* signal, BuildKey
req->tableId = tableId;
req->hashValue = dst.hashInfo[1];
req->distr_key_indicator = 0; // userDefinedPartitioning not supported!
- * (EmulatedJamBuffer**)req->jamBuffer = jamBuffer();
+ req->jamBufferPtr = jamBuffer();
#if 1
EXECUTE_DIRECT(DBDIH, GSN_DIGETNODESREQ, signal,
@@ -5086,7 +5086,8 @@ Dbspj::scanIndex_parent_batch_complete(S
parallelism = (data.m_fragCount - data.m_frags_complete) / roundTrips;
}
- ndbassert(parallelism <= data.m_fragCount - data.m_frags_complete);
+ ndbassert(parallelism >= 1);
+ ndbassert((Uint32)parallelism + data.m_frags_complete <= data.m_fragCount);
data.m_parallelism = static_cast<Uint32>(parallelism);
#ifdef DEBUG_SCAN_FRAGREQ
=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-10-20 12:51:03 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-10-28 09:04:10 +0000
@@ -3226,7 +3226,7 @@ void Dbtc::tckeyreq050Lab(Signal* signal
req->tableId = Ttableref;
req->hashValue = TdistrHashValue;
req->distr_key_indicator = regCachePtr->distributionKeyIndicator;
- * (EmulatedJamBuffer**)req->jamBuffer = jamBuffer();
+ req->jamBufferPtr = jamBuffer();
/*-------------------------------------------------------------*/
/* FOR EFFICIENCY REASONS WE AVOID THE SIGNAL SENDING HERE AND */
@@ -10926,7 +10926,7 @@ void Dbtc::execDIH_SCAN_TAB_CONF(Signal*
req->tableId = tabPtr.i;
req->hashValue = cachePtr.p->distributionKey;
req->distr_key_indicator = tabPtr.p->get_user_defined_partitioning();
- * (EmulatedJamBuffer**)req->jamBuffer = jamBuffer();
+ req->jamBufferPtr = jamBuffer();
EXECUTE_DIRECT(DBDIH, GSN_DIGETNODESREQ, signal,
DiGetNodesReq::SignalLength, 0);
UintR TerrorIndicator = signal->theData[0];
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp 2011-10-20 16:18:28 +0000
@@ -110,7 +110,7 @@ AsyncFile::writeReq(Request * request)
bool write_not_complete = true;
while(write_not_complete) {
- int totsize = 0;
+ size_t totsize = 0;
off_t offset = request->par.readWrite.pages[page_num].offset;
char* bufptr = theWriteBuffer;
@@ -128,7 +128,7 @@ AsyncFile::writeReq(Request * request)
if (((i + 1) < request->par.readWrite.numberOfPages)) {
// There are more pages to write
// Check that offsets are consequtive
- off_t tmp = page_offset + request->par.readWrite.pages[i].size;
+ off_t tmp=(off_t)(page_offset+request->par.readWrite.pages[i].size);
if (tmp != request->par.readWrite.pages[i+1].offset) {
// Next page is not aligned with previous, not allowed
DEBUG(ndbout_c("Page offsets are not aligned"));
@@ -143,7 +143,7 @@ AsyncFile::writeReq(Request * request)
break;
}
}
- page_offset += request->par.readWrite.pages[i].size;
+ page_offset += (off_t)request->par.readWrite.pages[i].size;
}
bufptr = theWriteBuffer;
} else {
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp 2011-10-20 13:01:37 +0000
@@ -197,7 +197,7 @@ Filename::set(Ndbfs* fs,
strcat(theName, fileExtension[type]);
if(dir == true){
- for(int l = strlen(theName) - 1; l >= 0; l--){
+ for(int l = (int)strlen(theName) - 1; l >= 0; l--){
if(theName[l] == DIR_SEPARATOR[0]){
theName[l] = 0;
break;
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.cpp 2011-10-20 18:36:21 +0000
@@ -217,7 +217,7 @@ Win32AsyncFile::readBuffer(Request* req,
DWORD dwBytesRead;
BOOL bRead = ReadFile(hFile,
buf,
- size,
+ (DWORD)size,
&dwBytesRead,
&ov);
if(!bRead){
@@ -248,7 +248,7 @@ Win32AsyncFile::readBuffer(Request* req,
buf += bytes_read;
size -= bytes_read;
- offset += bytes_read;
+ offset += (off_t)bytes_read;
}
return 0;
}
@@ -277,7 +277,7 @@ Win32AsyncFile::writeBuffer(const char *
size_t bytes_written = 0;
DWORD dwWritten;
- BOOL bWrite = WriteFile(hFile, buf, bytes_to_write, &dwWritten, &ov);
+ BOOL bWrite = WriteFile(hFile, buf, (DWORD)bytes_to_write, &dwWritten, &ov);
if(!bWrite) {
return GetLastError();
}
@@ -288,7 +288,7 @@ Win32AsyncFile::writeBuffer(const char *
buf += bytes_written;
size -= bytes_written;
- offset += bytes_written;
+ offset += (off_t)bytes_written;
}
return 0;
}
@@ -393,7 +393,7 @@ loop:
do {
if (0 != strcmp(".", ffd.cFileName) && 0 != strcmp("..", ffd.cFileName))
{
- int len = strlen(path);
+ int len = (int)strlen(path);
strcat(path, ffd.cFileName);
if(DeleteFile(path) || RemoveDirectory(path))
{
=== modified file 'storage/ndb/src/kernel/error/ErrorReporter.cpp'
--- a/storage/ndb/src/kernel/error/ErrorReporter.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/error/ErrorReporter.cpp 2011-10-21 08:59:23 +0000
@@ -163,7 +163,7 @@ ErrorReporter::formatMessage(int thr_no,
{
for (Uint32 i = 1 ; i < num_threads; i++)
{
- sofar = strlen(messptr);
+ sofar = (int)strlen(messptr);
if(sofar < MESSAGE_LENGTH)
{
BaseString::snprintf(messptr + sofar, MESSAGE_LENGTH - sofar,
@@ -172,7 +172,7 @@ ErrorReporter::formatMessage(int thr_no,
}
}
- sofar = strlen(messptr);
+ sofar = (int)strlen(messptr);
if(sofar < MESSAGE_LENGTH)
{
BaseString::snprintf(messptr + sofar, MESSAGE_LENGTH - sofar,
=== modified file 'storage/ndb/src/kernel/error/ndbd_exit_codes.c'
--- a/storage/ndb/src/kernel/error/ndbd_exit_codes.c 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/error/ndbd_exit_codes.c 2011-10-20 13:01:37 +0000
@@ -267,7 +267,7 @@ const char *ndbd_exit_status_message(ndb
int ndbd_exit_string(int err_no, char *str, unsigned int size)
{
- unsigned int len;
+ size_t len;
ndbd_exit_classification cl;
ndbd_exit_status st;
@@ -279,8 +279,8 @@ int ndbd_exit_string(int err_no, char *s
len = my_snprintf(str, size-1, "%s: %s: %s", msg, st_msg, cl_msg);
str[size-1]= '\0';
-
- return len;
+
+ return (int)len;
}
return -1;
}
=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.cpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp 2011-08-29 10:15:59 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp 2011-10-28 09:04:10 +0000
@@ -1827,7 +1827,7 @@ SimulatedBlock::infoEvent(const char * m
BaseString::vsnprintf(buf, 96, msg, ap); // 96 = 100 - 4
va_end(ap);
- int len = strlen(buf) + 1;
+ size_t len = strlen(buf) + 1;
if(len > 96){
len = 96;
buf[95] = 0;
@@ -1847,7 +1847,7 @@ SimulatedBlock::infoEvent(const char * m
signalT.header.theSendersBlockRef = reference();
signalT.header.theTrace = tTrace;
signalT.header.theSignalId = tSignalId;
- signalT.header.theLength = ((len+3)/4)+1;
+ signalT.header.theLength = (Uint32)((len+3)/4)+1;
#ifdef NDBD_MULTITHREADED
sendlocal(m_threadId,
@@ -1872,7 +1872,7 @@ SimulatedBlock::warningEvent(const char
BaseString::vsnprintf(buf, 96, msg, ap); // 96 = 100 - 4
va_end(ap);
- int len = strlen(buf) + 1;
+ size_t len = strlen(buf) + 1;
if(len > 96){
len = 96;
buf[95] = 0;
@@ -1892,7 +1892,7 @@ SimulatedBlock::warningEvent(const char
signalT.header.theSendersBlockRef = reference();
signalT.header.theTrace = tTrace;
signalT.header.theSignalId = tSignalId;
- signalT.header.theLength = ((len+3)/4)+1;
+ signalT.header.theLength = (Uint32)((len+3)/4)+1;
#ifdef NDBD_MULTITHREADED
sendlocal(m_threadId,
=== modified file 'storage/ndb/src/mgmapi/mgmapi.cpp'
--- a/storage/ndb/src/mgmapi/mgmapi.cpp 2011-09-19 11:59:09 +0000
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp 2011-10-24 07:44:52 +0000
@@ -499,7 +499,10 @@ ndb_mgm_call(NdbMgmHandle handle,
out.println("%s", "");
if (cmd_bulk)
- out.println(cmd_bulk);
+ {
+ out.write(cmd_bulk, strlen(cmd_bulk));
+ out.write("\n", 1);
+ }
CHECK_TIMEDOUT_RET(handle, in, out, NULL);
@@ -2039,7 +2042,7 @@ ndb_mgm_dump_state(NdbMgmHandle handle,
char buf[256];
buf[0] = 0;
for (int i = 0; i < _num_args; i++){
- unsigned n = strlen(buf);
+ unsigned n = (unsigned)strlen(buf);
if (n + 20 > sizeof(buf)) {
SET_ERROR(handle, NDB_MGM_USAGE_ERROR, "arguments too long");
DBUG_RETURN(-1);
@@ -2562,7 +2565,7 @@ ndb_mgm_get_configuration2(NdbMgmHandle
size_t start = 0;
do {
if((read = read_socket(handle->socket, handle->timeout,
- &buf64[start], len-start)) < 1){
+ &buf64[start], (int)(len-start))) < 1){
delete[] buf64;
buf64 = 0;
if(read==0)
=== modified file 'storage/ndb/src/mgmapi/ndb_logevent.cpp'
--- a/storage/ndb/src/mgmapi/ndb_logevent.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/mgmapi/ndb_logevent.cpp 2011-10-20 13:01:37 +0000
@@ -616,7 +616,7 @@ int ndb_logevent_get_next(const NdbLogEv
BaseString tmp(val);
Vector<BaseString> list;
tmp.split(list);
- for (size_t j = 0; j<list.size(); j++)
+ for (unsigned j = 0; j<list.size(); j++)
{
dst->Data[j] = atoi(list[j].c_str());
}
=== modified file 'storage/ndb/src/mgmclient/CommandInterpreter.cpp'
--- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp 2011-10-21 08:59:23 +0000
@@ -1154,7 +1154,7 @@ CommandInterpreter::execute_impl(const c
}
// for mysql client compatability remove trailing ';'
{
- unsigned last= strlen(line)-1;
+ unsigned last= (unsigned)(strlen(line)-1);
if (line[last] == ';')
{
line[last]= 0;
@@ -2431,7 +2431,7 @@ CommandInterpreter::executeDumpState(int
return -1;
}
- for (size_t i = 0; i < args.size(); i++)
+ for (unsigned i = 0; i < args.size(); i++)
{
const char* arg = args[i].c_str();
=== modified file 'storage/ndb/src/mgmsrv/Defragger.hpp'
--- a/storage/ndb/src/mgmsrv/Defragger.hpp 2011-07-04 13:37:56 +0000
+++ b/storage/ndb/src/mgmsrv/Defragger.hpp 2011-10-20 13:01:37 +0000
@@ -37,7 +37,7 @@ class Defragger {
Vector<DefragBuffer*> m_buffers;
DefragBuffer* find_buffer(NodeId nodeId, Uint32 fragId){
- for (size_t i = 0; i < m_buffers.size(); i++)
+ for (unsigned i = 0; i < m_buffers.size(); i++)
{
DefragBuffer* dbuf = m_buffers[i];
if (dbuf->m_node_id == nodeId &&
@@ -48,7 +48,7 @@ class Defragger {
}
void erase_buffer(const DefragBuffer* dbuf){
- for (size_t i = 0; i < m_buffers.size(); i++)
+ for (unsigned i = 0; i < m_buffers.size(); i++)
{
if (m_buffers[i] == dbuf)
{
@@ -64,7 +64,7 @@ public:
Defragger() {};
~Defragger()
{
- for (size_t i = m_buffers.size(); i > 0; --i)
+ for (unsigned i = m_buffers.size(); i > 0; --i)
{
delete m_buffers[i-1]; // free the memory of the fragment
}
@@ -121,7 +121,7 @@ public:
clear any unassembled signal buffers from node
*/
void node_failed(NodeId nodeId) {
- for (size_t i = m_buffers.size(); i > 0; --i)
+ for (unsigned i = m_buffers.size(); i > 0; --i)
{
if (m_buffers[i-1]->m_node_id == nodeId)
{
=== modified file 'storage/ndb/src/mgmsrv/InitConfigFileParser.cpp'
--- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp 2011-10-21 08:59:23 +0000
@@ -186,7 +186,7 @@ InitConfigFileParser::run_config_rules(C
ConfigInfo::m_ConfigRules[i].m_ruleData))
return 0;
- for(size_t j = 0; j<tmp.size(); j++){
+ for(unsigned j = 0; j<tmp.size(); j++){
BaseString::snprintf(ctx.fname, sizeof(ctx.fname),
"%s", tmp[j].m_sectionType.c_str());
ctx.type = InitConfigFileParser::Section;
@@ -478,7 +478,7 @@ bool InitConfigFileParser::convertString
//****************************************************************************
static void
trim(char * str){
- int len = strlen(str);
+ int len = (int)strlen(str);
for(len--;
(str[len] == '\r' || str[len] == '\n' ||
str[len] == ' ' || str[len] == '\t') &&
@@ -581,7 +581,7 @@ bool
InitConfigFileParser::storeSection(Context& ctx){
if(ctx.m_currentSection == NULL)
return true;
- for(int i = strlen(ctx.fname) - 1; i>=0; i--){
+ for(int i = (int)strlen(ctx.fname) - 1; i>=0; i--){
ctx.fname[i] = toupper(ctx.fname[i]);
}
BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "%s", ctx.fname);
=== modified file 'storage/ndb/src/mgmsrv/MgmtSrvr.cpp'
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2011-09-27 07:35:34 +0000
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2011-10-21 08:59:23 +0000
@@ -3576,7 +3576,7 @@ MgmtSrvr::alloc_node_id_impl(NodeId& nod
return false;
// Print list of possible nodes
- for (size_t i = 0; i < nodes.size(); i++)
+ for (unsigned i = 0; i < nodes.size(); i++)
{
const PossibleNode& node = nodes[i];
g_eventLogger->debug(" [%u]: %u, '%s', %d",
=== modified file 'storage/ndb/src/mgmsrv/Services.cpp'
--- a/storage/ndb/src/mgmsrv/Services.cpp 2011-09-13 09:10:52 +0000
+++ b/storage/ndb/src/mgmsrv/Services.cpp 2011-10-24 07:44:52 +0000
@@ -599,15 +599,17 @@ MgmApiSession::getConfig(Parser_t::Conte
m_output->println("Content-Transfer-Encoding: base64");
m_output->print("\n");
+ unsigned len = (unsigned)strlen(pack64.c_str());
if(ERROR_INSERTED(3))
{
// Return only half the packed config
BaseString half64 = pack64.substr(0, pack64.length());
- m_output->println(half64.c_str());
+ m_output->write(half64.c_str(), (unsigned)strlen(half64.c_str()));
+ m_output->write("\n", 1);
return;
}
- m_output->println(pack64.c_str());
- m_output->print("\n");
+ m_output->write(pack64.c_str(), len);
+ m_output->write("\n\n", 2);
return;
}
@@ -1370,12 +1372,12 @@ logevent2str(BaseString& str, int eventT
str.appfmt("%s=%d\n",ndb_logevent_body[i].token, val);
if(strcmp(ndb_logevent_body[i].token,"error") == 0)
{
- int pretty_text_len= strlen(pretty_text);
+ int pretty_text_len= (int)strlen(pretty_text);
if(pretty_text_size-pretty_text_len-3 > 0)
{
BaseString::snprintf(pretty_text+pretty_text_len, 4 , " - ");
ndb_error_string(val, pretty_text+(pretty_text_len+3),
- pretty_text_size-pretty_text_len-3);
+ (int)(pretty_text_size-pretty_text_len-3));
}
}
} while (ndb_logevent_body[++i].type == eventType);
@@ -1430,9 +1432,20 @@ Ndb_mgmd_event_service::log(int eventTyp
int r;
if (m_clients[i].m_parsable)
- r= out.println(str.c_str());
+ {
+ unsigned len = str.length();
+ r= out.write(str.c_str(), len);
+ }
else
- r= out.println(pretty_text);
+ {
+ unsigned len = (unsigned)strlen(pretty_text);
+ r= out.write(pretty_text, len);
+ }
+
+ if (! (r < 0))
+ {
+ r = out.write("\n", 1);
+ }
if (r<0)
{
@@ -1631,7 +1644,7 @@ MgmApiSession::listen_event(Parser<MgmAp
Vector<BaseString> list;
param.trim();
param.split(list, " ,");
- for(size_t i = 0; i<list.size(); i++){
+ for(unsigned i = 0; i<list.size(); i++){
Vector<BaseString> spec;
list[i].trim();
list[i].split(spec, "=:");
@@ -1852,7 +1865,7 @@ MgmApiSession::list_session(SocketServer
lister->m_output->println("session.%llu.m_stop: %d",id,s->m_stop);
if(s->m_ctx)
{
- int l= strlen(s->m_ctx->m_tokenBuffer);
+ int l= (int)strlen(s->m_ctx->m_tokenBuffer);
char *buf= (char*) malloc(2*l+1);
char *b= buf;
for(int i=0; i<l;i++)
@@ -1922,7 +1935,7 @@ MgmApiSession::get_session(SocketServer:
p->l->m_output->println("m_stop: %d",s->m_stop);
if(s->m_ctx)
{
- int l= strlen(s->m_ctx->m_tokenBuffer);
+ int l= (int)strlen(s->m_ctx->m_tokenBuffer);
p->l->m_output->println("parser_buffer_len: %u",l);
p->l->m_output->println("parser_status: %d",s->m_ctx->m_status);
}
@@ -2019,7 +2032,7 @@ void MgmApiSession::setConfig(Parser_t::
if((r= read_socket(m_socket,
SOCKET_TIMEOUT,
&buf64[start],
- len64-start)) < 1)
+ (int)(len64-start))) < 1)
{
delete[] buf64;
result.assfmt("read_socket failed, errno: %d", errno);
=== modified file 'storage/ndb/src/ndbapi/NdbBlob.cpp'
--- a/storage/ndb/src/ndbapi/NdbBlob.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/ndbapi/NdbBlob.cpp 2011-10-21 08:59:23 +0000
@@ -696,7 +696,7 @@ NdbBlob::copyKeyFromRow(const NdbRecord
unpacked+= unpacked_len;
}
- packedBuf.size= packed - packedBuf.data;
+ packedBuf.size= (Uint32)(packed - packedBuf.data);
packedBuf.zerorest();
assert(unpacked == unpackedBuf.data + unpackedBuf.size);
DBUG_RETURN(0);
=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2011-06-06 12:18:27 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2011-10-21 08:59:23 +0000
@@ -1260,7 +1260,7 @@ NdbTableImpl::buildColumnHash(){
Uint32 bucket = hv & m_columnHashMask;
bucket = (bucket < size ? bucket : bucket - size);
m_columnHash[bucket] = (sz << 16) | (((size - bucket) + pos) << 1);
- for(size_t j = 0; j<sz; j++, pos++){
+ for(unsigned j = 0; j<sz; j++, pos++){
Uint32 col = chains[i][j];
Uint32 hv = hashValues[col];
if (m_columnHash.push_back((col << 16) | hv))
=== modified file 'storage/ndb/src/ndbapi/NdbOperationExec.cpp'
--- a/storage/ndb/src/ndbapi/NdbOperationExec.cpp 2011-07-09 11:16:31 +0000
+++ b/storage/ndb/src/ndbapi/NdbOperationExec.cpp 2011-10-28 09:04:10 +0000
@@ -1744,7 +1744,7 @@ NdbOperation::receiveTCKEYREF(const NdbA
if (aSignal->getLength() == TcKeyRef::SignalLength)
{
// Signal may contain additional error data
- theError.details = (char *) aSignal->readData(5);
+ theError.details = (char *)UintPtr(aSignal->readData(5));
}
theStatus = Finished;
=== modified file 'storage/ndb/src/ndbapi/NdbQueryOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2011-10-20 12:51:03 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2011-10-28 09:04:10 +0000
@@ -4974,7 +4974,7 @@ NdbQueryOperationImpl::execTCKEYREF(cons
if (aSignal->getLength() == TcKeyRef::SignalLength)
{
// Signal may contain additional error data
- getQuery().m_error.details = (char *)ref->errorData;
+ getQuery().m_error.details = (char *)UintPtr(ref->errorData);
}
}
=== modified file 'storage/ndb/src/ndbapi/NdbTransaction.cpp'
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp 2011-09-02 08:54:55 +0000
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp 2011-10-28 09:04:10 +0000
@@ -2090,7 +2090,7 @@ transactions.
if (aSignal->getLength() == TcRollbackRep::SignalLength)
{
// Signal may contain additional error data
- theError.details = (char *) aSignal->readData(5);
+ theError.details = (char *)UintPtr(aSignal->readData(5));
}
/**********************************************************************/
=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c 2011-10-13 20:08:25 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c 2011-10-28 09:04:10 +0000
@@ -979,17 +979,17 @@ int ndb_error_string(int err_no, char *s
int len;
assert(size > 1);
- if(size <= 1)
+ if(size <= 1)
return 0;
+
error.code = err_no;
ndberror_update(&error);
- len =
- my_snprintf(str, size-1, "%s: %s: %s", error.message,
+ len = (int)my_snprintf(str, size-1, "%s: %s: %s", error.message,
ndberror_status_message(error.status),
ndberror_classification_message(error.classification));
str[size-1]= '\0';
-
+
if (error.classification != UE)
return len;
return -len;
=== modified file 'storage/ndb/test/include/NDBT_Table.hpp'
--- a/storage/ndb/test/include/NDBT_Table.hpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/test/include/NDBT_Table.hpp 2011-10-22 09:47:36 +0000
@@ -93,6 +93,7 @@ public:
// validate() might cause initialization order problem with charset
NdbError error;
int ret = aggregate(error);
+ (void)ret;
assert(ret == 0);
}
=== modified file 'storage/ndb/test/include/NdbMgmd.hpp'
--- a/storage/ndb/test/include/NdbMgmd.hpp 2011-09-13 08:58:27 +0000
+++ b/storage/ndb/test/include/NdbMgmd.hpp 2011-10-24 07:44:52 +0000
@@ -227,7 +227,7 @@ public:
SocketOutputStream out(socket());
- if (out.println(cmd)){
+ if (out.println("%s", cmd)){
error("call: println failed at line %d", __LINE__);
return false;
}
@@ -278,9 +278,16 @@ public:
}
// Send any bulk data
- if (bulk && out.println(bulk)){
- error("call: print('<bulk>') failed at line %d", __LINE__);
- return false;
+ if (bulk)
+ {
+ if (out.write(bulk, strlen(bulk)) >= 0)
+ {
+ if (out.write("\n", 1) < 0)
+ {
+ error("call: print('<bulk>') failed at line %d", __LINE__);
+ return false;
+ }
+ }
}
BaseString buf;
=== modified file 'storage/ndb/test/ndbapi/ScanFunctions.hpp'
--- a/storage/ndb/test/ndbapi/ScanFunctions.hpp 2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/ScanFunctions.hpp 2011-10-21 08:59:23 +0000
@@ -29,7 +29,7 @@ class AttribList {
public:
AttribList(){};
~AttribList(){
- for(size_t i = 0; i < attriblist.size(); i++){
+ for(unsigned i = 0; i < attriblist.size(); i++){
delete attriblist[i];
}
};
@@ -335,7 +335,7 @@ void AttribList::buildAttribList(const N
attriblist.push_back(attr);
#if 1
- for(size_t j = 0; j < attriblist.size(); j++){
+ for(unsigned j = 0; j < attriblist.size(); j++){
g_info << attriblist[j]->numAttribs << ": " ;
for(int a = 0; a < attriblist[j]->numAttribs; a++)
=== modified file 'storage/ndb/test/ndbapi/testMgm.cpp'
--- a/storage/ndb/test/ndbapi/testMgm.cpp 2011-09-19 14:10:19 +0000
+++ b/storage/ndb/test/ndbapi/testMgm.cpp 2011-10-24 07:44:52 +0000
@@ -736,7 +736,7 @@ get_nodeid_of_type(NdbMgmd& mgmd, ndb_mg
int noOfNodes = cs->no_of_nodes;
int randomnode = myRandom48(noOfNodes);
ndb_mgm_node_state *ns = cs->node_states + randomnode;
- assert(ns->node_type == (Uint32)type);
+ assert((Uint32)ns->node_type == (Uint32)type);
assert(ns->node_id);
*nodeId = ns->node_id;
=== modified file 'storage/ndb/test/src/DbUtil.cpp'
--- a/storage/ndb/test/src/DbUtil.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/test/src/DbUtil.cpp 2011-10-21 08:59:23 +0000
@@ -215,7 +215,7 @@ DbUtil::mysqlSimplePrepare(const char *q
printf("Inside DbUtil::mysqlSimplePrepare\n");
#endif
MYSQL_STMT *my_stmt= mysql_stmt_init(this->getMysql());
- if (my_stmt && mysql_stmt_prepare(my_stmt, query, strlen(query))){
+ if (my_stmt && mysql_stmt_prepare(my_stmt, query, (unsigned long)strlen(query))){
this->printStError(my_stmt,"Prepare Statement Failed");
mysql_stmt_close(my_stmt);
return NULL;
@@ -353,7 +353,7 @@ DbUtil::runQuery(const char* sql,
MYSQL_STMT *stmt= mysql_stmt_init(m_mysql);
- if (mysql_stmt_prepare(stmt, sql, strlen(sql)))
+ if (mysql_stmt_prepare(stmt, sql, (unsigned long)strlen(sql)))
{
report_error("Failed to prepare: ", m_mysql);
return false;
@@ -390,7 +390,7 @@ DbUtil::runQuery(const char* sql,
args.get(name.c_str(), &val_s);
bind_param[i].buffer_type= MYSQL_TYPE_STRING;
bind_param[i].buffer= (char*)val_s;
- bind_param[i].buffer_length= strlen(val_s);
+ bind_param[i].buffer_length= (unsigned long)strlen(val_s);
g_debug << " param" << name.c_str() << ": " << val_s << endl;
break;
default:
=== modified file 'storage/ndb/test/src/HugoQueries.cpp'
--- a/storage/ndb/test/src/HugoQueries.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/test/src/HugoQueries.cpp 2011-10-28 08:47:01 +0000
@@ -41,7 +41,7 @@ HugoQueries::HugoQueries(const NdbQueryD
HugoQueries::~HugoQueries()
{
- for (size_t o = 0; o<m_ops.size(); o++)
+ for (unsigned o = 0; o<m_ops.size(); o++)
{
while (m_ops[o].m_rows.size())
{
@@ -56,14 +56,14 @@ HugoQueries::~HugoQueries()
void
HugoQueries::allocRows(int batch)
{
- for (size_t o = 0; o<m_ops.size(); o++)
+ for (unsigned o = 0; o<m_ops.size(); o++)
{
const NdbQueryOperationDef * pOp =m_query_def->getQueryOperation((Uint32)o);
const NdbDictionary::Table* tab = pOp->getTable();
if (tab)
{
- while (m_ops[o].m_rows.size() < (size_t)batch)
+ while (m_ops[o].m_rows.size() < (unsigned)batch)
{
m_ops[o].m_rows.push_back(new NDBT_ResultRow(* tab));
}
@@ -197,7 +197,7 @@ HugoQueries::runLookupQuery(Ndb* pNdb,
return NDBT_FAILED;
}
- for (size_t o = 0; o<m_ops.size(); o++)
+ for (unsigned o = 0; o<m_ops.size(); o++)
{
NdbQueryOperation * pOp = query->getQueryOperation((Uint32)o);
HugoQueries::getValueForQueryOp(pOp, m_ops[o].m_rows[b]);
@@ -219,13 +219,53 @@ HugoQueries::runLookupQuery(Ndb* pNdb,
pTrans->close();
return NDBT_FAILED;
}
+#if 0
+ // Disabled, as this is incorrectly handled in SPJ API, will fix soon
+ else
+ {
+ /**
+ * If ::execute() didn't fail, there should not be an error on
+ * its NdbError object either:
+ */
+ const NdbError err = pTrans->getNdbError();
+ if (err.code)
+ {
+ ERR(err);
+ ndbout_c("API INCONSISTENCY: NdbTransaction returned NdbError even if ::execute() succeeded");
+ pTrans->close();
+ return NDBT_FAILED;
+ }
+ }
+#endif
+ bool retry = false;
for (int b = 0; b<batch; b++)
{
NdbQuery * query = queries[b];
- if (query->nextResult() == NdbQuery::NextResult_gotRow)
+
+ /**
+ * As NdbQuery is always 'dirty read' (impl. limitations), 'AbortOnError'
+ * is ignored and handled as 'IgnoreError'. We will therefore not get
+ * errors returned from ::execute() or set into 'pTrans->getNdbError()':
+ * Has to check for errors on the NdbQuery object instead:
+ */
+ const NdbError& err = query->getNdbError();
+ if (err.code)
+ {
+ ERR(err);
+ if (err.status == NdbError::TemporaryError){
+ pTrans->close();
+ retry = true;
+ break;
+ }
+ pTrans->close();
+ return NDBT_FAILED;
+ }
+
+ const NdbQuery::NextResultOutcome stat = query->nextResult();
+ if (stat == NdbQuery::NextResult_gotRow)
{
- for (size_t o = 0; o<m_ops.size(); o++)
+ for (unsigned o = 0; o<m_ops.size(); o++)
{
NdbQueryOperation * pOp = query->getQueryOperation((Uint32)o);
if (!pOp->isRowNULL())
@@ -239,11 +279,30 @@ HugoQueries::runLookupQuery(Ndb* pNdb,
}
}
}
+ else if (stat == NdbQuery::NextResult_error)
+ {
+ const NdbError& err = query->getNdbError();
+ ERR(err);
+ if (err.status == NdbError::TemporaryError){
+ pTrans->close();
+ retry = true;
+ break;
+ }
+ pTrans->close();
+ return NDBT_FAILED;
+ }
+ }
+ if (retry)
+ {
+ NdbSleep_MilliSleep(50);
+ retryAttempt++;
+ continue;
}
+
pTrans->close();
r += batch;
- for (size_t i = 0; i<batch_rows_found.size(); i++)
+ for (unsigned i = 0; i<batch_rows_found.size(); i++)
m_rows_found[i] += batch_rows_found[i];
}
@@ -292,7 +351,7 @@ HugoQueries::runScanQuery(Ndb * pNdb,
return NDBT_FAILED;
}
- for (size_t o = 0; o<m_ops.size(); o++)
+ for (unsigned o = 0; o<m_ops.size(); o++)
{
NdbQueryOperation * pOp = query->getQueryOperation((Uint32)o);
HugoQueries::getValueForQueryOp(pOp, m_ops[o].m_rows[0]);
@@ -312,6 +371,44 @@ HugoQueries::runScanQuery(Ndb * pNdb,
pTrans->close();
return NDBT_FAILED;
}
+ else
+ {
+ // Disabled, as this is incorrectly handled in SPJ API, will fix soon
+#if 0
+ /**
+ * If ::execute() didn't fail, there should not be an error on
+ * its NdbError object either:
+ */
+ const NdbError err = pTrans->getNdbError();
+ if (err.code)
+ {
+ ERR(err);
+ ndbout_c("API INCONSISTENCY: NdbTransaction returned NdbError even if ::execute() succeeded");
+ pTrans->close();
+ return NDBT_FAILED;
+ }
+#endif
+
+ /**
+ * As NdbQuery is always 'dirty read' (impl. limitations), 'AbortOnError'
+ * is ignored and handled as 'IgnoreError'. We will therefore not get
+ * errors returned from ::execute() or set into 'pTrans->getNdbError()':
+ * Has to check for errors on the NdbQuery object instead:
+ */
+ NdbError err = query->getNdbError();
+ if (err.code)
+ {
+ ERR(err);
+ if (err.status == NdbError::TemporaryError){
+ pTrans->close();
+ NdbSleep_MilliSleep(50);
+ retryAttempt++;
+ continue;
+ }
+ pTrans->close();
+ return NDBT_FAILED;
+ }
+ }
int r = rand() % 100;
if (r < abort && ((r & 1) == 0))
@@ -335,7 +432,7 @@ HugoQueries::runScanQuery(Ndb * pNdb,
return NDBT_OK;
}
- for (size_t o = 0; o<m_ops.size(); o++)
+ for (unsigned o = 0; o<m_ops.size(); o++)
{
NdbQueryOperation * pOp = query->getQueryOperation((Uint32)o);
if (!pOp->isRowNULL())
=== modified file 'storage/ndb/test/src/HugoQueryBuilder.cpp'
--- a/storage/ndb/test/src/HugoQueryBuilder.cpp 2011-07-09 11:16:31 +0000
+++ b/storage/ndb/test/src/HugoQueryBuilder.cpp 2011-10-28 09:04:10 +0000
@@ -55,7 +55,7 @@ HugoQueryBuilder::init()
HugoQueryBuilder::~HugoQueryBuilder()
{
- for (size_t i = 0; i<m_queries.size(); i++)
+ for (unsigned i = 0; i<m_queries.size(); i++)
m_queries[i]->destroy();
}
@@ -76,7 +76,7 @@ HugoQueryBuilder::fixOptions()
void
HugoQueryBuilder::addTable(Ndb* ndb, const NdbDictionary::Table* tab)
{
- for (size_t i = 0; i<m_tables.size(); i++)
+ for (unsigned i = 0; i<m_tables.size(); i++)
{
if (m_tables[i].m_table == tab)
return;
@@ -133,7 +133,7 @@ HugoQueryBuilder::getJoinLevel() const
void
HugoQueryBuilder::removeTable(const NdbDictionary::Table* tab)
{
- for (size_t i = 0; i<m_tables.size(); i++)
+ for (unsigned i = 0; i<m_tables.size(); i++)
{
if (m_tables[i].m_table == tab)
{
@@ -215,11 +215,11 @@ HugoQueryBuilder::checkBindable(Vector<c
Vector<Op> ops,
bool allow_bind_nullable)
{
- for (size_t c = 0; c < cols.size(); c++)
+ for (unsigned c = 0; c < cols.size(); c++)
{
const NdbDictionary::Column * col = cols[c];
bool found = false;
- for (size_t t = 0; !found && t<ops.size(); t++)
+ for (unsigned t = 0; !found && t<ops.size(); t++)
{
const NdbDictionary::Table * tab = ops[t].m_op->getTable();
if (tab)
@@ -274,7 +274,7 @@ HugoQueryBuilder::checkBusyScan(Op op) c
op = m_query[op.m_parent];
}
- for (size_t i = op.m_idx + 1; i < m_query.size(); i++)
+ for (unsigned i = op.m_idx + 1; i < m_query.size(); i++)
if (isAncestor(op, m_query[i]) && isScan(m_query[i].m_op))
return true;
@@ -537,11 +537,11 @@ loop:
if (op.m_op == 0)
{
ndbout << "Failed to add to " << endl;
- for (size_t i = 0; i<m_query.size(); i++)
+ for (unsigned i = 0; i<m_query.size(); i++)
ndbout << m_query[i] << endl;
ndbout << "Parents: " << endl;
- for (size_t i = 0; i<parents.size(); i++)
+ for (unsigned i = 0; i<parents.size(); i++)
ndbout << parents[i].m_idx << " ";
ndbout << endl;
}
=== modified file 'storage/ndb/test/src/NDBT_Test.cpp'
--- a/storage/ndb/test/src/NDBT_Test.cpp 2011-07-09 11:16:31 +0000
+++ b/storage/ndb/test/src/NDBT_Test.cpp 2011-10-28 09:04:10 +0000
@@ -414,7 +414,7 @@ NDBT_TestCaseImpl1::NDBT_TestCaseImpl1(N
NDBT_TestCaseImpl1::~NDBT_TestCaseImpl1(){
NdbCondition_Destroy(waitThreadsCondPtr);
NdbMutex_Destroy(waitThreadsMutexPtr);
- size_t i;
+ unsigned i;
for(i = 0; i < initializers.size(); i++)
delete initializers[i];
initializers.clear();
=== modified file 'storage/ndb/test/src/NdbBackup.cpp'
--- a/storage/ndb/test/src/NdbBackup.cpp 2011-07-04 13:37:56 +0000
+++ b/storage/ndb/test/src/NdbBackup.cpp 2011-10-21 08:59:23 +0000
@@ -308,7 +308,7 @@ NdbBackup::restore(unsigned _backup_id){
res = execRestore(true, true, ndbNodes[0].node_id, _backup_id);
// Restore data once for each node
- for(size_t i = 1; i < ndbNodes.size(); i++){
+ for(unsigned i = 1; i < ndbNodes.size(); i++){
res = execRestore(true, false, ndbNodes[i].node_id, _backup_id);
}
=== modified file 'storage/ndb/test/src/NdbRestarter.cpp'
--- a/storage/ndb/test/src/NdbRestarter.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/test/src/NdbRestarter.cpp 2011-10-21 08:59:23 +0000
@@ -59,7 +59,7 @@ int NdbRestarter::getDbNodeId(int _i){
if (getStatus() != 0)
return -1;
- for(size_t i = 0; i < ndbNodes.size(); i++){
+ for(unsigned i = 0; i < ndbNodes.size(); i++){
if (i == (unsigned)_i){
return ndbNodes[i].node_id;
}
@@ -114,7 +114,7 @@ NdbRestarter::restartNodes(int * nodes,
for (int j = 0; j<cnt; j++)
{
int _nodeId = nodes[j];
- for(size_t i = 0; i < ndbNodes.size(); i++)
+ for(unsigned i = 0; i < ndbNodes.size(); i++)
{
if(ndbNodes[i].node_id == _nodeId)
{
@@ -147,7 +147,7 @@ NdbRestarter::getMasterNodeId(){
int min = 0;
int node = -1;
- for(size_t i = 0; i < ndbNodes.size(); i++){
+ for(unsigned i = 0; i < ndbNodes.size(); i++){
if(min == 0 || ndbNodes[i].dynamic_id < min){
min = ndbNodes[i].dynamic_id;
node = ndbNodes[i].node_id;
@@ -165,7 +165,7 @@ NdbRestarter::getNodeGroup(int nodeId){
if (getStatus() != 0)
return -1;
- for(size_t i = 0; i < ndbNodes.size(); i++)
+ for(unsigned i = 0; i < ndbNodes.size(); i++)
{
if(ndbNodes[i].node_id == nodeId)
{
@@ -184,7 +184,7 @@ NdbRestarter::getNextMasterNodeId(int no
if (getStatus() != 0)
return -1;
- size_t i;
+ unsigned i;
for(i = 0; i < ndbNodes.size(); i++)
{
if(ndbNodes[i].node_id == nodeId)
@@ -244,7 +244,7 @@ NdbRestarter::getRandomNodeOtherNodeGrou
return -1;
int node_group = -1;
- for(size_t i = 0; i < ndbNodes.size(); i++){
+ for(unsigned i = 0; i < ndbNodes.size(); i++){
if(ndbNodes[i].node_id == nodeId){
node_group = ndbNodes[i].node_group;
break;
@@ -274,7 +274,7 @@ NdbRestarter::getRandomNodeSameNodeGroup
return -1;
int node_group = -1;
- for(size_t i = 0; i < ndbNodes.size(); i++){
+ for(unsigned i = 0; i < ndbNodes.size(); i++){
if(ndbNodes[i].node_id == nodeId){
node_group = ndbNodes[i].node_group;
break;
@@ -347,7 +347,7 @@ NdbRestarter::waitClusterState(ndb_mgm_n
}
// Collect all nodes into nodes
- for (size_t i = 0; i < ndbNodes.size(); i++){
+ for (unsigned i = 0; i < ndbNodes.size(); i++){
nodes[i] = ndbNodes[i].node_id;
numNodes++;
}
@@ -388,7 +388,7 @@ NdbRestarter::waitNodesState(const int *
* First check if any node is not starting
* then it's no idea to wait anymore
*/
- for (size_t n = 0; n < ndbNodes.size(); n++){
+ for (unsigned n = 0; n < ndbNodes.size(); n++){
if (ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTED &&
ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTING)
waitMore = false;
@@ -426,7 +426,7 @@ NdbRestarter::waitNodesState(const int *
for (int i = 0; i < _num_nodes; i++){
ndb_mgm_node_state* ndbNode = NULL;
- for (size_t n = 0; n < ndbNodes.size(); n++){
+ for (unsigned n = 0; n < ndbNodes.size(); n++){
if (ndbNodes[n].node_id == _nodes[i])
ndbNode = &ndbNodes[n];
}
@@ -713,7 +713,7 @@ int NdbRestarter::insertErrorInAllNodes(
int result = 0;
- for(size_t i = 0; i < ndbNodes.size(); i++){
+ for(unsigned i = 0; i < ndbNodes.size(); i++){
g_debug << "inserting error in node " << ndbNodes[i].node_id << endl;
if (insertErrorInNode(ndbNodes[i].node_id, _error) == -1)
result = -1;
@@ -751,7 +751,7 @@ int NdbRestarter::dumpStateAllNodes(cons
int result = 0;
- for(size_t i = 0; i < ndbNodes.size(); i++){
+ for(unsigned i = 0; i < ndbNodes.size(); i++){
g_debug << "dumping state in node " << ndbNodes[i].node_id << endl;
if (dumpStateOneNode(ndbNodes[i].node_id, _args, _num_args) == -1)
result = -1;
@@ -841,7 +841,7 @@ NdbRestarter::checkClusterAlive(const in
for (int i = 0; i<num_nodes; i++)
mask.set(deadnodes[i]);
- for (size_t n = 0; n < ndbNodes.size(); n++)
+ for (unsigned n = 0; n < ndbNodes.size(); n++)
{
if (mask.get(ndbNodes[n].node_id))
continue;
@@ -862,7 +862,7 @@ NdbRestarter::rollingRestart(Uint32 flag
NdbNodeBitmask ng_mask;
NdbNodeBitmask restart_nodes;
Vector<int> nodes;
- for(size_t i = 0; i < ndbNodes.size(); i++)
+ for(unsigned i = 0; i < ndbNodes.size(); i++)
{
if (ng_mask.get(ndbNodes[i].node_group) == false)
{
@@ -911,7 +911,7 @@ NdbRestarter::getMasterNodeVersion(int&
int masterNodeId = getMasterNodeId();
if (masterNodeId != -1)
{
- for(size_t i = 0; i < ndbNodes.size(); i++)
+ for(unsigned i = 0; i < ndbNodes.size(); i++)
{
if (ndbNodes[i].node_id == masterNodeId)
{
@@ -964,7 +964,7 @@ NdbRestarter::getNodeTypeVersionRange(nd
minVer = 0;
maxVer = 0;
- for(size_t i = 0; i < nodeVec->size(); i++)
+ for(unsigned i = 0; i < nodeVec->size(); i++)
{
int nodeVer = (*nodeVec)[i].version;
if ((minVer == 0) ||
@@ -984,7 +984,7 @@ NdbRestarter::getNodeStatus(int nodeid)
if (getStatus() != 0)
return -1;
- for (size_t n = 0; n < ndbNodes.size(); n++)
+ for (unsigned n = 0; n < ndbNodes.size(); n++)
{
if (ndbNodes[n].node_id == nodeid)
return ndbNodes[n].node_status;
=== modified file 'storage/ndb/test/src/getarg.c'
--- a/storage/ndb/test/src/getarg.c 2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/src/getarg.c 2011-10-21 08:59:23 +0000
@@ -290,7 +290,7 @@ arg_printusage (struct getargs *args,
strlcat(buf, "]", sizeof(buf));
if(args[i].type == arg_strings)
strlcat(buf, "...", sizeof(buf));
- col = check_column(stderr, col, strlen(buf) + 1, columns);
+ col = check_column(stderr, col, (int)strlen(buf) + 1, columns);
col += fprintf(stderr, " %s", buf);
}
if (args[i].short_name) {
@@ -301,7 +301,7 @@ arg_printusage (struct getargs *args,
strlcat(buf, "]", sizeof(buf));
if(args[i].type == arg_strings)
strlcat(buf, "...", sizeof(buf));
- col = check_column(stderr, col, strlen(buf) + 1, columns);
+ col = check_column(stderr, col, (int)strlen(buf) + 1, columns);
col += fprintf(stderr, " %s", buf);
}
if (args[i].long_name && args[i].short_name)
@@ -309,7 +309,7 @@ arg_printusage (struct getargs *args,
max_len = max(max_len, len);
}
if (extra_string) {
- col = check_column(stderr, col, strlen(extra_string) + 1, columns);
+ col = check_column(stderr, col, (int)strlen(extra_string) + 1, columns);
fprintf (stderr, " %s\n", extra_string);
} else
fprintf (stderr, "\n");
@@ -360,14 +360,14 @@ arg_match_long(struct getargs *args, siz
int argv_len;
char *p;
- argv_len = strlen(argv);
+ argv_len = (int)strlen(argv);
p = strchr (argv, '=');
if (p != NULL)
- argv_len = p - argv;
+ argv_len = (int)(p - argv);
for (i = 0; i < num_args; ++i) {
if(args[i].long_name) {
- int len = strlen(args[i].long_name);
+ int len = (int)strlen(args[i].long_name);
char *p = argv;
int p_len = argv_len;
negate = 0;
@@ -467,7 +467,7 @@ arg_match_long(struct getargs *args, siz
}
case arg_collect:{
struct getarg_collect_info *c = current->value;
- int o = argv - rargv[*optind];
+ int o = (int)(argv - rargv[*optind]);
return (*c->func)(FALSE, argc, rargv, optind, &o, c->data);
}
=== modified file 'storage/ndb/test/tools/cpcc.cpp'
--- a/storage/ndb/test/tools/cpcc.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/test/tools/cpcc.cpp 2011-10-21 08:59:23 +0000
@@ -140,7 +140,7 @@ public:
virtual bool evaluate(SimpleCpcClient* c, const SimpleCpcClient::Process & p){
bool run = on_empty;
- for(size_t i = 0; i<m_cond.size(); i++){
+ for(unsigned i = 0; i<m_cond.size(); i++){
if(m_cond[i]->evaluate(c, p)){
run = true;
break;
@@ -172,7 +172,7 @@ void
add_hosts(Vector<SimpleCpcClient*> & hosts, BaseString list){
Vector<BaseString> split;
list.split(split);
- for(size_t i = 0; i<split.size(); i++){
+ for(unsigned i = 0; i<split.size(); i++){
add_host(hosts, split[i]);
}
}
@@ -273,7 +273,7 @@ main(int argc, const char** argv){
int
connect(Vector<SimpleCpcClient*>& list){
- for(size_t i = 0; i<list.size(); i++){
+ for(unsigned i = 0; i<list.size(); i++){
if(list[i]->connect() != 0){
ndbout_c("Failed to connect to %s:%d",
list[i]->getHost(), list[i]->getPort());
@@ -285,7 +285,7 @@ connect(Vector<SimpleCpcClient*>& list){
int
for_each(Vector<SimpleCpcClient*>& list, Expression & expr){
- for(size_t i = 0; i<list.size(); i++){
+ for(unsigned i = 0; i<list.size(); i++){
if(list[i] == 0)
continue;
Properties p;
@@ -294,7 +294,7 @@ for_each(Vector<SimpleCpcClient*>& list,
ndbout << "Failed to list processes on "
<< list[i]->getHost() << ":" << list[i]->getPort() << endl;
}
- for(size_t j = 0; j<procs.size(); j++)
+ for(unsigned j = 0; j<procs.size(); j++)
expr.evaluate(list[i], procs[j]);
}
return 0;
=== modified file 'storage/ndb/tools/ndb_dump_frm_data.cpp'
--- a/storage/ndb/tools/ndb_dump_frm_data.cpp 2011-07-04 13:37:56 +0000
+++ b/storage/ndb/tools/ndb_dump_frm_data.cpp 2011-10-20 18:36:21 +0000
@@ -104,7 +104,7 @@ dofile(const char* file)
break;
}
ssize_t size2;
- if ((size2 = read(fd, data, size)) == -1)
+ if ((size2 = read(fd, data, (unsigned)size)) == -1)
{
fprintf(stderr, "%s: read: %s\n", file, strerror(errno));
break;
@@ -137,7 +137,7 @@ dofile(const char* file)
printf(" orig: %u\n", (uint)size);
printf(" pack: %u\n", (uint)pack_len);
printf("*/\n\n");
- dodump(name, pack_data, pack_len);
+ dodump(name, pack_data, (uint)pack_len);
ret = 0;
}
while (0);
=== modified file 'storage/ndb/tools/restore/consumer_restore.cpp'
--- a/storage/ndb/tools/restore/consumer_restore.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/tools/restore/consumer_restore.cpp 2011-10-21 08:59:23 +0000
@@ -679,7 +679,7 @@ BackupRestore::rebuild_indexes(const Tab
NdbDictionary::Dictionary* dict = m_ndb->getDictionary();
Vector<NdbDictionary::Index*> & indexes = m_index_per_table[id];
- for(size_t i = 0; i<indexes.size(); i++)
+ for(unsigned i = 0; i<indexes.size(); i++)
{
const NdbDictionary::Index * const idx = indexes[i];
const char * const idx_name = idx->getName();
@@ -818,7 +818,7 @@ bool BackupRestore::search_replace(char
const char **data, const char *end_data,
uint *new_data_len)
{
- uint search_str_len = strlen(search_str);
+ uint search_str_len = (uint)strlen(search_str);
uint inx = 0;
bool in_delimiters = FALSE;
bool escape_char = FALSE;
@@ -969,7 +969,7 @@ bool BackupRestore::translate_frm(NdbDic
{
DBUG_RETURN(TRUE);
}
- if (map_in_frm(new_data, (const char*)data, data_len, &new_data_len))
+ if (map_in_frm(new_data, (const char*)data, (uint)data_len, &new_data_len))
{
free(new_data);
DBUG_RETURN(TRUE);
@@ -1997,7 +1997,7 @@ BackupRestore::endOfTables(){
return true;
NdbDictionary::Dictionary* dict = m_ndb->getDictionary();
- for(size_t i = 0; i<m_indexes.size(); i++){
+ for(unsigned i = 0; i<m_indexes.size(); i++){
NdbTableImpl & indtab = NdbTableImpl::getImpl(* m_indexes[i]);
BaseString db_name, schema_name, table_name;
=== modified file 'storage/ndb/tools/waiter.cpp'
--- a/storage/ndb/tools/waiter.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/tools/waiter.cpp 2011-10-21 08:59:23 +0000
@@ -322,7 +322,7 @@ waitClusterStatus(const char* _addr,
* First check if any node is not starting
* then it's no idea to wait anymore
*/
- for (size_t n = 0; n < ndbNodes.size(); n++){
+ for (unsigned n = 0; n < ndbNodes.size(); n++){
if (ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTED &&
ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTING)
waitMore = false;
@@ -359,7 +359,7 @@ waitClusterStatus(const char* _addr,
allInState = (ndbNodes.size() > 0);
/* Loop through all nodes and check their state */
- for (size_t n = 0; n < ndbNodes.size(); n++) {
+ for (unsigned n = 0; n < ndbNodes.size(); n++) {
ndb_mgm_node_state* ndbNode = &ndbNodes[n];
assert(ndbNode != NULL);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(ole.john.aske:3575 to 3576) | Ole John Aske | 28 Oct |