diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2006-12-15 00:51:37 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2006-12-15 00:51:37 +0200 |
commit | f00257ddd0a2f392f9b80c9cd5c405017e3a9d63 (patch) | |
tree | 142bd488523fec48817d9fb2194f1a608eec00fc /ndb | |
parent | 25226de9ea52d06667c2c7fbd99f5cd014764241 (diff) | |
download | mariadb-git-f00257ddd0a2f392f9b80c9cd5c405017e3a9d63.tar.gz |
Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments
Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c
I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
BUILD/SETUP.sh:
Added printing of unused functions and variables.
Made it easy to test compiling with -Wshadow
BUILD/compile-pentium-gcov:
Added warnings
Mark binary with -gcov
client/mysql.cc:
Fixed warnings found with gcc -Wshadow
client/mysql_upgrade.c:
Fixed warnings found with gcc -Wshadow
client/mysqlbinlog.cc:
Fixed warnings found with gcc -Wshadow
client/mysqldump.c:
Fixed warnings found with gcc -Wshadow
client/mysqltest.c:
Fixed warnings found with gcc -Wshadow
client/sql_string.cc:
Fixed warnings found with gcc -Wshadow
Merged with sql/sql_string.cc
client/sql_string.h:
Fixed warnings found with gcc -Wshadow
Merged with sql/sql_string.h
cmd-line-utils/readline/display.c:
Fixed compiler warning
cmd-line-utils/readline/histexpand.c:
Fixed warnings found with gcc -Wshadow
cmd-line-utils/readline/input.c:
Fixed warnings found with gcc -Wshadow
cmd-line-utils/readline/text.c:
Fixed warnings found with gcc -Wshadow
cmd-line-utils/readline/vi_mode.c:
Fixed warnings found with gcc -Wshadow
dbug/dbug_analyze.c:
Fixed warnings found with gcc -Wshadow
extra/my_print_defaults.c:
Prefixed defaults_extra_file and defaults_group_suffix with 'my' to avoid conflicts with similar named local variables
extra/yassl/include/buffer.hpp:
Fixed compiler warnings
extra/yassl/include/crypto_wrapper.hpp:
Fixed compiler warnings
extra/yassl/include/yassl_imp.hpp:
Fixed compiler warnings
extra/yassl/include/yassl_int.hpp:
Fixed compiler warnings
extra/yassl/src/crypto_wrapper.cpp:
Fixed compiler warnings
extra/yassl/taocrypt/benchmark/benchmark.cpp:
Fixed warnings found with gcc -Wshadow
extra/yassl/taocrypt/include/algebra.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/des.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/hash.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/hmac.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/modarith.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/modes.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/rsa.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/mySTL/list.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/src/aes.cpp:
Fixed compiler warnings
extra/yassl/taocrypt/src/algebra.cpp:
Fixed compiler warnings
extra/yassl/taocrypt/src/asn.cpp:
Fixed compiler warnings
extra/yassl/taocrypt/test/test.cpp:
Fixed compiler warnings
extra/yassl/testsuite/testsuite.cpp:
Fixed compiler warnings
include/m_ctype.h:
Fixed warnings found with gcc -Wshadow
include/my_pthread.h:
Fixed warnings found with gcc -Wshadow
include/my_sys.h:
Fixed warnings found with gcc -Wshadow
include/my_time.h:
Fixed warnings found with gcc -Wshadow
include/mysql.h:
Fixed warnings found with gcc -Wshadow
Added define IS_LONGDATA() to simplify code in libmysql.c
libmysql/libmysql.c:
Fixed warnings found with gcc -Wshadow
(Mostly replaced bind -> my_bind and time -> my_time)
libmysqld/lib_sql.cc:
Removed not used variables and labels
myisam/ft_boolean_search.c:
Fixed warnings found with gcc -Wshadow
myisam/mi_open.c:
Fixed warnings found with gcc -Wshadow
myisam/mi_search.c:
Fixed warnings found with gcc -Wshadow
myisam/mi_unique.c:
Fixed compiler warning
myisam/myisampack.c:
Fixed warnings found with gcc -Wshadow
myisam/rt_index.c:
Remove not used variables
myisam/sort.c:
Fixed warnings found with gcc -Wshadow
mysql-test/r/mysqlcheck.result:
Remove databases and tables possible left by previous test
mysql-test/r/mysqltest.result:
New test results
mysql-test/t/mysql.test:
Coverage tests
mysql-test/t/mysqlbinlog.test:
Coverage tests
mysql-test/t/mysqlcheck.test:
Remove databases and tables possible left by previous test
mysql-test/t/mysqltest.test:
Coverage tests
mysys/default.c:
Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions
mysys/mf_iocache2.c:
Fixed warnings found with gcc -Wshadow
mysys/mf_keycache.c:
Fixed warnings found with gcc -Wshadow
mysys/my_bitmap.c:
Fixed warnings found with gcc -Wshadow
mysys/sha1.c:
Fixed warnings found with gcc -Wshadow
ndb/include/kernel/signaldata/ArbitSignalData.hpp:
Fixed compiler warning
ndb/include/kernel/signaldata/DictTabInfo.hpp:
Fixed compiler warnings
ndb/include/ndbapi/NdbReceiver.hpp:
Fixed warnings found with gcc -Wshadow
ndb/include/transporter/TransporterDefinitions.hpp:
Fixed compiler warning
ndb/include/util/InputStream.hpp:
Fixed compiler warning
ndb/include/util/OutputStream.hpp:
Fixed compiler warning
ndb/include/util/SimpleProperties.hpp:
Fixed compiler warning
ndb/include/util/SocketAuthenticator.hpp:
Fixed compiler warning
ndb/include/util/SocketServer.hpp:
Fixed compiler warning
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/portlib/NdbTick.c:
Fixed warnings found with gcc -Wshadow
ndb/src/common/transporter/SHM_Transporter.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/transporter/TCP_Transporter.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/transporter/TCP_Transporter.hpp:
Fixed compiler warning
ndb/src/common/transporter/Transporter.cpp:
Removed not used variable
ndb/src/common/transporter/TransporterRegistry.cpp:
Removed not used variable
ndb/src/common/util/Bitmask.cpp:
Moved function to avoid warnings of not used function
ndb/src/common/util/ConfigValues.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/util/File.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/util/Properties.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/util/SocketClient.cpp:
Fixed wrong return value
ndb/src/common/util/random.c:
Fixed warnings found with gcc -Wshadow
ndb/src/common/util/socket_io.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/cw/cpcd/APIService.cpp:
Removed not used variable
ndb/src/cw/cpcd/main.cpp:
Removed not used variables
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Removed not used variables
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
Removed not used variables
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dbtup/DbtupScan.cpp:
Removed not used variable
ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp:
Removed not used variables
ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
Removed not used variables
ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp:
Removed not used variables
ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
Removed not used variables
ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
Removed not used variables
ndb/src/kernel/blocks/suma/Suma.cpp:
Removed not used variables
ndb/src/kernel/blocks/suma/Suma.hpp:
Fixed compiler warnings
ndb/src/kernel/vm/MetaData.hpp:
Fixed compiler warnings
ndb/src/mgmapi/LocalConfig.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/mgmapi/mgmapi.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/mgmclient/CommandInterpreter.cpp:
Removed not used variables
ndb/src/mgmsrv/ConfigInfo.cpp:
Fixed warnings found with gcc -Wshadow
Removed not used variables
ndb/src/mgmsrv/ConfigInfo.hpp:
Fixed warnings found with gcc -Wshadow
ndb/src/mgmsrv/InitConfigFileParser.cpp:
Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions
ndb/src/mgmsrv/MgmtSrvr.cpp:
Removed not used variables and functions
ndb/src/mgmsrv/MgmtSrvr.hpp:
Fixed compiler warnings
ndb/src/mgmsrv/Services.cpp:
Removed not used variables and functions
ndb/src/mgmsrv/main.cpp:
Removed not used variable
ndb/src/ndbapi/ClusterMgr.hpp:
Fixed compiler warnings
ndb/src/ndbapi/Ndb.cpp:
Removed not used variables
ndb/src/ndbapi/NdbBlob.cpp:
Removed not used variables
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Removed not used variables
ndb/src/ndbapi/NdbIndexOperation.cpp:
Removed not used variables
ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variables
ndb/src/ndbapi/NdbOperationExec.cpp:
Removed not used variables
ndb/src/ndbapi/NdbOperationSearch.cpp:
Removed not used variables
ndb/src/ndbapi/NdbScanFilter.cpp:
Fixed compiler warning
ndb/src/ndbapi/NdbScanOperation.cpp:
Removed not used variables
ndb/src/ndbapi/SignalSender.cpp:
Removed not used variables
ndb/src/ndbapi/ndb_cluster_connection.cpp:
Removed not used variable
ndb/tools/delete_all.cpp:
Removed not used variable
ndb/tools/desc.cpp:
Removed not used variable
ndb/tools/drop_index.cpp:
Removed not used variable
ndb/tools/drop_tab.cpp:
Removed not used variable
ndb/tools/listTables.cpp:
Removed not used variable
ndb/tools/ndb_config.cpp:
Fixed warnings found with gcc -Wshadow
Added missing puts(desc)
ndb/tools/restore/Restore.hpp:
Changed delimiter to define instead of static variable, as the static variable caused a LOT of compiler warnings
Fixed compiler warning
ndb/tools/restore/consumer.hpp:
Fixed compiler warning
ndb/tools/restore/restore_main.cpp:
Fixed compiler warnings
ndb/tools/select_all.cpp:
Removed not used variables
ndb/tools/select_count.cpp:
Removed not used variable
server-tools/instance-manager/commands.h:
Fixed compiler warnings
server-tools/instance-manager/guardian.cc:
Fixed compiler warnings
server-tools/instance-manager/instance_options.cc:
Removed not used variables
server-tools/instance-manager/mysql_connection.cc:
Fixed compiler warnings
server-tools/instance-manager/options.cc:
Fixed compiler warnings
server-tools/instance-manager/options.h:
Fixed compiler warnings
server-tools/instance-manager/parse.cc:
Removed not used variable
server-tools/instance-manager/user_map.cc:
Fixed compiler warnings
server-tools/instance-manager/user_map.h:
Fixed compiler warnings
sql/field.cc:
Fixed compiler warnings
sql/field.h:
Fixed compiler warnings
sql/filesort.cc:
Fixed compiler warnings
sql/ha_archive.cc:
Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings
sql/ha_archive.h:
Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings
sql/ha_federated.cc:
Fixed compiler warnings
sql/ha_heap.cc:
Fixed compiler warnings
sql/ha_myisam.cc:
Fixed compiler warnings
sql/ha_myisammrg.cc:
Fixed compiler warnings
sql/ha_ndbcluster.cc:
Fixed compiler warnings
sql/handler.cc:
Fixed compiler warnings
sql/item.cc:
Fixed compiler warnings
sql/item.h:
Fixed compiler warnings
new_item() -> clone_item(), to avoid a lot of warnings with variable 'new_item'
el() -> element_index()
sql/item_cmpfunc.cc:
Fixed compiler warnings
sql/item_cmpfunc.h:
Fixed compiler warnings
sql/item_func.cc:
Fixed compiler warnings
sql/item_geofunc.cc:
Fixed compiler warnings
sql/item_row.h:
Fixed compiler warnings
sql/item_strfunc.cc:
Fixed compiler warnings
sql/item_subselect.cc:
Fixed compiler warnings
sql/item_subselect.h:
Fixed compiler warnings
sql/item_sum.cc:
Fixed compiler warnings
sql/item_timefunc.cc:
Fixed compiler warnings
sql/log.cc:
Fixed compiler warnings
More comments
Added #ifdef HAVE_REPLICATION
sql/log_event.cc:
Fixed compiler warnings
sql/log_event.h:
Fixed compiler warnings
sql/mysql_priv.h:
query_id -> global_query_id, to avoid a lot of clashes with function and class variables
start_time -> server_start_time
sql/mysqld.cc:
Fixed compiler warnings:
- Removed not used variables
- Added #ifndef EMBEDDED_LIBRARY
- Fixed shadow warnings
sql/net_serv.cc:
Fixed compiler warnings
sql/opt_range.cc:
range -> last_range to avoid shadow warnings
Removed not used function print_rowid()
sql/opt_range.h:
range -> last_range to avoid shadow warnings
sql/password.c:
Fixed compiler warnings
sql/protocol.cc:
Fixed compiler warnings
sql/repl_failsafe.cc:
Fixed compiler warnings
sql/set_var.cc:
Fixed compiler warnings
sql/set_var.h:
type() -> show_type()
Fixed compiler warnings
sql/slave.cc:
Fixed compiler warnings
sql/sp_head.cc:
Fixed compiler warnings
sql/sp_head.h:
Fixed compiler warnings
sql/spatial.cc:
Fixed compiler warnings
sql/spatial.h:
length() -> geom_length() to avoid compiler warnings
wkb_end -> wkb_last to avoid compiler warnings with local variables named 'wkb_end'
sql/sql_cache.h:
Fixed compiler warnings
sql/sql_class.cc:
Fixed compiler warnings
sql/sql_class.h:
log -> log_xid() to avoid compiler warnings
Fixed shadow compiler warnings
sql/sql_derived.cc:
Removed not used variable
sql/sql_insert.cc:
Fixed compiler warnings
sql/sql_lex.cc:
Fixed compiler warnings
sql/sql_lex.h:
res -> saved_error to make the meaning of the variable clear and avoid shadow warnings
sql/sql_load.cc:
Fixed compiler warnings
sql/sql_parse.cc:
Fixed compiler warnings
sql/sql_prepare.cc:
Fixed compiler warnings
sql/sql_select.cc:
Fixed compiler warnings
sql/sql_show.cc:
Fixed compiler warnings
sql/sql_string.cc:
Fixed compiler warnings
sql/sql_string.h:
Fixed compiler warnings
sql/sql_table.cc:
Fixed compiler warnings
sql/sql_trigger.cc:
Fixed compiler warnings
sql/sql_trigger.h:
table -> trigger_table to avoid warnings from local variables
sql/sql_union.cc:
Fixed compiler warnings
(mainly res -> saved_error)
sql-common/client.c:
Removed not used variable
sql-common/my_time.c:
Removed not used variable
time -> my_time
sql/sql_update.cc:
Removed not used variable
sql/sql_view.cc:
Removed not used variable
sql/sql_yacc.yy:
Removed not used variable
sql/table.cc:
Removed not used variable
sql/tztime.cc:
Removed not used variable
sql/unireg.cc:
Removed not used variable
strings/ctype-bin.c:
mblen -> mb_len to avoid compiler warnings with local variable mblen
strings/ctype-cp932.c:
Fixed compiler warnings
strings/ctype-eucjpms.c:
Fixed compiler warnings
strings/ctype-mb.c:
mblen -> mb_len to avoid compiler warnings with local variable mblen
strings/ctype-simple.c:
mblen -> mb_len to avoid compiler warnings with local variable mblen
exp -> exponent
strings/ctype-sjis.c:
Fixed compiler warnings
strings/ctype-uca.c:
mblen -> mb_len to avoid compiler warnings with local variable mblen
strings/ctype-ujis.c:
Fixed compiler warnings
strings/ctype-utf8.c:
Fixed compiler warnings
strings/decimal.c:
Fixed compiler warnings
strings/my_vsnprintf.c:
Added comment
strings/strtod.c:
Fixed compiler warnings
tests/mysql_client_test.c:
Fixed compiler warnings
(Biggest part of patch is to not get a conflict with global function 'bind')
Diffstat (limited to 'ndb')
78 files changed, 168 insertions, 163 deletions
diff --git a/ndb/include/kernel/signaldata/ArbitSignalData.hpp b/ndb/include/kernel/signaldata/ArbitSignalData.hpp index 34b73644a13..233f9bf0a78 100644 --- a/ndb/include/kernel/signaldata/ArbitSignalData.hpp +++ b/ndb/include/kernel/signaldata/ArbitSignalData.hpp @@ -32,6 +32,7 @@ private: Uint32 data[2]; public: + ArbitTicket() {} STATIC_CONST( DataLength = 2 ); STATIC_CONST( TextLength = DataLength * 8 ); // hex digits @@ -143,6 +144,7 @@ public: ArbitTicket ticket; // ticket NodeBitmask mask; // set of nodes + ArbitSignalData() {} STATIC_CONST( SignalLength = 3 + ArbitTicket::DataLength + NodeBitmask::Size ); inline bool match(ArbitSignalData& aData) const { diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index 0a7f6aa3fb3..41cb21ebdc1 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -275,6 +275,7 @@ public: Uint32 MinRowsLow; Uint32 MinRowsHigh; + Table() {} void init(); }; @@ -335,6 +336,7 @@ public: Uint32 AttributeAutoIncrement; char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE]; + Attribute() {} void init(); inline diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index ff6debc7fd3..5ba5f7021b5 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -58,7 +58,7 @@ public: bool checkMagicNumber() const; - inline void next(NdbReceiver* next) { m_next = next;} + inline void next(NdbReceiver* next_arg) { m_next = next_arg;} inline NdbReceiver* next() { return m_next; } void setErrorCode(int); diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp index e9c5ffa2c80..d72ea006ff6 100644 --- a/ndb/include/transporter/TransporterDefinitions.hpp +++ b/ndb/include/transporter/TransporterDefinitions.hpp @@ -117,6 +117,11 @@ struct SegmentedSectionPtr { Uint32 i; struct SectionSegment * p; + SegmentedSectionPtr() {} + SegmentedSectionPtr(Uint32 sz_arg, Uint32 i_arg, + struct SectionSegment *p_arg) + :sz(sz_arg), i(i_arg), p(p_arg) + {} void setNull() { p = 0;} bool isNull() const { return p == 0;} }; diff --git a/ndb/include/util/InputStream.hpp b/ndb/include/util/InputStream.hpp index 56c43686df1..29866aa3418 100644 --- a/ndb/include/util/InputStream.hpp +++ b/ndb/include/util/InputStream.hpp @@ -27,6 +27,7 @@ class InputStream { public: virtual ~InputStream() {} virtual char* gets(char * buf, int bufLen) = 0; + InputStream() {} }; class FileInputStream : public InputStream { diff --git a/ndb/include/util/OutputStream.hpp b/ndb/include/util/OutputStream.hpp index a834b577bb3..ccf88a72359 100644 --- a/ndb/include/util/OutputStream.hpp +++ b/ndb/include/util/OutputStream.hpp @@ -25,6 +25,7 @@ */ class OutputStream { public: + OutputStream() {} virtual ~OutputStream() {} virtual int print(const char * fmt, ...) = 0; virtual int println(const char * fmt, ...) = 0; @@ -61,6 +62,7 @@ public: class NullOutputStream : public OutputStream { public: + NullOutputStream() {} int print(const char * /* unused */, ...) { return 1;} int println(const char * /* unused */, ...) { return 1;} }; diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp index b29e65e21da..c19780c2757 100644 --- a/ndb/include/util/SimpleProperties.hpp +++ b/ndb/include/util/SimpleProperties.hpp @@ -169,6 +169,7 @@ public: bool add(Uint16 key, Uint32 value); bool add(Uint16 key, const char * value); bool add(Uint16 key, const void* value, int len); + Writer() {} protected: virtual ~Writer() {} virtual bool reset() = 0; diff --git a/ndb/include/util/SocketAuthenticator.hpp b/ndb/include/util/SocketAuthenticator.hpp index 1b82567feaa..0c3de073b1e 100644 --- a/ndb/include/util/SocketAuthenticator.hpp +++ b/ndb/include/util/SocketAuthenticator.hpp @@ -20,6 +20,7 @@ class SocketAuthenticator { public: + SocketAuthenticator() {} virtual ~SocketAuthenticator() {}; virtual bool client_authenticate(int sockfd) = 0; virtual bool server_authenticate(int sockfd) = 0; diff --git a/ndb/include/util/SocketServer.hpp b/ndb/include/util/SocketServer.hpp index ea709bfecae..c4f7e8c0ade 100644 --- a/ndb/include/util/SocketServer.hpp +++ b/ndb/include/util/SocketServer.hpp @@ -60,6 +60,7 @@ public: */ class Service { public: + Service() {} virtual ~Service(){} /** diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index a0e3a4b74f3..e3fa68a11d6 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -155,12 +155,13 @@ ConfigRetriever::getConfig() { } ndb_mgm_configuration * -ConfigRetriever::getConfig(NdbMgmHandle m_handle) +ConfigRetriever::getConfig(NdbMgmHandle m_handle_arg) { - ndb_mgm_configuration * conf = ndb_mgm_get_configuration(m_handle,m_version); + ndb_mgm_configuration * conf = ndb_mgm_get_configuration(m_handle_arg, + m_version); if(conf == 0) { - setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); + setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle_arg)); return 0; } return conf; diff --git a/ndb/src/common/portlib/NdbTick.c b/ndb/src/common/portlib/NdbTick.c index d8f0b6ec27a..95843282797 100644 --- a/ndb/src/common/portlib/NdbTick.c +++ b/ndb/src/common/portlib/NdbTick.c @@ -61,9 +61,9 @@ NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros){ int res = gettimeofday(&tick_time, 0); if(secs==0) { - NDB_TICKS secs = tick_time.tv_sec; + NDB_TICKS local_secs = tick_time.tv_sec; *micros = tick_time.tv_usec; - *micros = secs*1000000+*micros; + *micros = local_secs*1000000+*micros; } else { * secs = tick_time.tv_sec; * micros = tick_time.tv_usec; diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index 93d718b8713..38685b6fdc7 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -32,7 +32,7 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, int r_port, - bool isMgmConnection, + bool isMgmConnection_arg, NodeId lNodeId, NodeId rNodeId, NodeId serverNodeId, @@ -41,7 +41,7 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, key_t _shmKey, Uint32 _shmSize) : Transporter(t_reg, tt_SHM_TRANSPORTER, - lHostName, rHostName, r_port, isMgmConnection, + lHostName, rHostName, r_port, isMgmConnection_arg, lNodeId, rNodeId, serverNodeId, 0, false, checksum, signalId), shmKey(_shmKey), diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index 5db12d3985c..152e4fe9cbc 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -68,14 +68,14 @@ TCP_Transporter::TCP_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, int r_port, - bool isMgmConnection, + bool isMgmConnection_arg, NodeId lNodeId, NodeId rNodeId, NodeId serverNodeId, bool chksm, bool signalId, Uint32 _reportFreq) : Transporter(t_reg, tt_TCP_TRANSPORTER, - lHostName, rHostName, r_port, isMgmConnection, + lHostName, rHostName, r_port, isMgmConnection_arg, lNodeId, rNodeId, serverNodeId, 0, false, chksm, signalId), m_sendBuffer(sendBufSize) diff --git a/ndb/src/common/transporter/TCP_Transporter.hpp b/ndb/src/common/transporter/TCP_Transporter.hpp index df4149531b4..59b2bf435fe 100644 --- a/ndb/src/common/transporter/TCP_Transporter.hpp +++ b/ndb/src/common/transporter/TCP_Transporter.hpp @@ -34,6 +34,7 @@ struct ReceiveBuffer { Uint32 sizeOfData; // In bytes Uint32 sizeOfBuffer; + ReceiveBuffer() {} bool init(int bytes); void destroy(); diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index b2ee75e4754..2882e080c8e 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -104,7 +104,7 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { { struct sockaddr_in addr; SOCKET_SIZE_TYPE addrlen= sizeof(addr); - int r= getpeername(sockfd, (struct sockaddr*)&addr, &addrlen); + getpeername(sockfd, (struct sockaddr*)&addr, &addrlen); m_connect_address= (&addr)->sin_addr; } @@ -210,7 +210,7 @@ Transporter::connect_client(NDB_SOCKET_TYPE sockfd) { { struct sockaddr_in addr; SOCKET_SIZE_TYPE addrlen= sizeof(addr); - int r= getpeername(sockfd, (struct sockaddr*)&addr, &addrlen); + getpeername(sockfd, (struct sockaddr*)&addr, &addrlen); m_connect_address= (&addr)->sin_addr; } diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index cd78bc52027..cffce1c2cc6 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1414,8 +1414,6 @@ TransporterRegistry::add_transporter_interface(NodeId remoteNodeId, bool TransporterRegistry::start_service(SocketServer& socket_server) { - struct ndb_mgm_reply mgm_reply; - DBUG_ENTER("TransporterRegistry::start_service"); if (m_transporter_interface.size() > 0 && !nodeIdSpecified) { diff --git a/ndb/src/common/util/Bitmask.cpp b/ndb/src/common/util/Bitmask.cpp index 0aa39a37204..4db41dd38ae 100644 --- a/ndb/src/common/util/Bitmask.cpp +++ b/ndb/src/common/util/Bitmask.cpp @@ -1,21 +1,6 @@ #include <Bitmask.hpp> #include <NdbOut.hpp> -static -void print(const Uint32 src[], Uint32 len, Uint32 pos = 0) -{ - printf("b'"); - for(unsigned i = 0; i<len; i++) - { - if(BitmaskImpl::get((pos + len + 31) >> 5, src, i+pos)) - printf("1"); - else - printf("0"); - if((i & 31) == 31) - printf(" "); - } -} - #ifndef __TEST_BITMASK__ void @@ -80,6 +65,21 @@ BitmaskImpl::setFieldImpl(Uint32 dst[], } #else +static +void print(const Uint32 src[], Uint32 len, Uint32 pos = 0) +{ + printf("b'"); + for(unsigned i = 0; i<len; i++) + { + if(BitmaskImpl::get((pos + len + 31) >> 5, src, i+pos)) + printf("1"); + else + printf("0"); + if((i & 31) == 31) + printf(" "); + } +} + #define DEBUG 0 #include <Vector.hpp> static void do_test(int bitmask_size); diff --git a/ndb/src/common/util/ConfigValues.cpp b/ndb/src/common/util/ConfigValues.cpp index ae4fbfd2f71..34d289e06dc 100644 --- a/ndb/src/common/util/ConfigValues.cpp +++ b/ndb/src/common/util/ConfigValues.cpp @@ -433,13 +433,13 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){ if(count >= sz){ pos = hash(tmp, sz); count = 0; - Uint32 val = m_cfg->m_values[pos]; + Uint32 val2 = m_cfg->m_values[pos]; printf("key: %d, (key %% size): %d\n", entry.m_key, (entry.m_key % sz)); printf("pos: %d", pos); - while((val & KP_MASK) != tmp && val != CFV_KEY_FREE && count < sz){ + while((val2 & KP_MASK) != tmp && val2 != CFV_KEY_FREE && count < sz){ pos = nextHash(tmp, sz, pos, ++count); - val = m_cfg->m_values[pos]; + val2 = m_cfg->m_values[pos]; printf(" %d", pos); } printf("\n"); diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index 056b7ff199b..5b65240e3ad 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -152,9 +152,9 @@ File_class::readChar(char* buf) } int -File_class::write(const void* buf, size_t size, size_t nitems) +File_class::write(const void* buf, size_t size_arg, size_t nitems) { - return ::fwrite(buf, size, nitems, m_file); + return ::fwrite(buf, size_arg, nitems, m_file); } int diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 0edcda0e726..e8c71455918 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -628,11 +628,11 @@ PropertiesImpl::getPropsPut(const char * name, if(nvp == 0){ Properties * tmpP = new Properties(); PropertyImpl * tmpPI = new PropertyImpl(tmp2, tmpP); - PropertyImpl * nvp = put(tmpPI); + PropertyImpl * nvp2 = put(tmpPI); delete tmpP; free(tmp2); - return ((Properties*)nvp->value)->impl->getPropsPut(tmp+1, impl); + return ((Properties*)nvp2->value)->impl->getPropsPut(tmp+1, impl); } free(tmp2); if(nvp->valueType != PropertiesType_Properties){ diff --git a/ndb/src/common/util/SocketClient.cpp b/ndb/src/common/util/SocketClient.cpp index f4f2babf312..fd93fc227f6 100644 --- a/ndb/src/common/util/SocketClient.cpp +++ b/ndb/src/common/util/SocketClient.cpp @@ -88,7 +88,7 @@ SocketClient::bind(const char* bindaddress, unsigned short localport) int ret = errno; NDB_CLOSE_SOCKET(m_sockfd); m_sockfd= NDB_INVALID_SOCKET; - return errno; + return ret; } if (::bind(m_sockfd, (struct sockaddr*)&local, sizeof(local)) == -1) diff --git a/ndb/src/common/util/random.c b/ndb/src/common/util/random.c index 21235763793..2098af98ad1 100644 --- a/ndb/src/common/util/random.c +++ b/ndb/src/common/util/random.c @@ -198,7 +198,7 @@ int initSequence(RandomSequence *seq, SequenceValues *inputValues) unsigned int i; unsigned int j; unsigned int totalLength; - unsigned int index; + unsigned int idx; if( !seq || !inputValues ) return(-1); @@ -220,12 +220,12 @@ int initSequence(RandomSequence *seq, SequenceValues *inputValues) /*----------------------*/ /* set the array values */ /*----------------------*/ - index = 0; + idx = 0; for(i = 0; inputValues[i].length != 0; i++) { for(j = 0; j < inputValues[i].length; j++ ) { - seq->values[index] = inputValues[i].value; - index++; + seq->values[idx] = inputValues[i].value; + idx++; } } diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp index ba2794e4374..4e89be1379c 100644 --- a/ndb/src/common/util/socket_io.cpp +++ b/ndb/src/common/util/socket_io.cpp @@ -142,8 +142,8 @@ write_socket(NDB_SOCKET_TYPE socket, int timeout_millis, FD_SET(socket, &writeset); timeout.tv_sec = 1; timeout.tv_usec = 0; - const int selectRes = select(socket + 1, 0, &writeset, 0, &timeout); - if(selectRes != 1){ + const int selectRes2 = select(socket + 1, 0, &writeset, 0, &timeout); + if(selectRes2 != 1){ return -1; } } diff --git a/ndb/src/cw/cpcd/APIService.cpp b/ndb/src/cw/cpcd/APIService.cpp index e7a2092c15d..e30b1b8689e 100644 --- a/ndb/src/cw/cpcd/APIService.cpp +++ b/ndb/src/cw/cpcd/APIService.cpp @@ -390,7 +390,6 @@ CPCDAPISession::listProcesses(Parser_t::Context & /* unused */, void CPCDAPISession::showVersion(Parser_t::Context & /* unused */, const class Properties & args){ - Uint32 id; CPCD::RequestStatus rs; m_output->println("show version"); diff --git a/ndb/src/cw/cpcd/main.cpp b/ndb/src/cw/cpcd/main.cpp index 137735c9e76..6963fd54a29 100644 --- a/ndb/src/cw/cpcd/main.cpp +++ b/ndb/src/cw/cpcd/main.cpp @@ -75,8 +75,6 @@ extern "C" static void sig_child(int signo, siginfo_t*, void*); const char *progname = "ndb_cpcd"; int main(int argc, char** argv){ - int save_argc= argc; - char** save_argv= argv; const char *load_default_groups[]= { "ndb_cpcd",0 }; MY_INIT(argv[0]); diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 44f9917438f..38fc6d0447b 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -1234,7 +1234,7 @@ Cmvmi::execTESTSIG(Signal* signal){ fprintf(stdout, "\n"); for(i = 0; i<signal->header.m_noOfSections; i++){ - SegmentedSectionPtr ptr = {0,0,0}; + SegmentedSectionPtr ptr(0,0,0); ndbout_c("-- Section %d --", i); signal->getSection(ptr, i); ndbrequire(ptr.p != 0); @@ -1292,7 +1292,7 @@ Cmvmi::execTESTSIG(Signal* signal){ LinearSectionPtr ptr[3]; const Uint32 secs = signal->getNoOfSections(); for(i = 0; i<secs; i++){ - SegmentedSectionPtr sptr = {0,0,0}; + SegmentedSectionPtr sptr(0,0,0); signal->getSection(sptr, i); ptr[i].sz = sptr.sz; ptr[i].p = new Uint32[sptr.sz]; @@ -1341,7 +1341,7 @@ Cmvmi::execTESTSIG(Signal* signal){ LinearSectionPtr ptr[3]; const Uint32 secs = signal->getNoOfSections(); for(i = 0; i<secs; i++){ - SegmentedSectionPtr sptr = {0,0,0}; + SegmentedSectionPtr sptr(0,0,0); signal->getSection(sptr, i); ptr[i].sz = sptr.sz; ptr[i].p = new Uint32[sptr.sz]; @@ -1407,7 +1407,7 @@ Cmvmi::execTESTSIG(Signal* signal){ const Uint32 secs = signal->getNoOfSections(); memset(g_test, 0, sizeof(g_test)); for(i = 0; i<secs; i++){ - SegmentedSectionPtr sptr = {0,0,0}; + SegmentedSectionPtr sptr(0,0,0); signal->getSection(sptr, i); g_test[i].sz = sptr.sz; g_test[i].p = new Uint32[sptr.sz]; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 2eca2a76c45..871efd6b1ce 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -5068,11 +5068,6 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it, tablePtr.p->minRowsLow = tableDesc.MinRowsLow; tablePtr.p->minRowsHigh = tableDesc.MinRowsHigh; - Uint64 maxRows = - (((Uint64)tablePtr.p->maxRowsHigh) << 32) + tablePtr.p->maxRowsLow; - Uint64 minRows = - (((Uint64)tablePtr.p->minRowsHigh) << 32) + tablePtr.p->minRowsLow; - tablePtr.p->frmLen = tableDesc.FrmLen; memcpy(tablePtr.p->frmData, tableDesc.FrmData, tableDesc.FrmLen); diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 82644826d5b..13b4f0279d3 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -132,6 +132,7 @@ public: * on disk. Index trigger ids are volatile. */ struct TableRecord : public MetaData::Table { + TableRecord() {} Uint32 maxRowsLow; Uint32 maxRowsHigh; Uint32 minRowsLow; @@ -251,6 +252,7 @@ public: * attributes. This is wrong but convenient. */ struct AttributeRecord : public MetaData::Attribute { + AttributeRecord() {} union { /** Pointer to the next attribute used by ArrayPool */ Uint32 nextPool; @@ -286,6 +288,7 @@ public: * trigger online creates the trigger in TC (if index) and LQH-TUP. */ struct TriggerRecord { + TriggerRecord() {} /** Trigger state */ enum TriggerState { @@ -865,6 +868,7 @@ private: * seize/release invokes ctor/dtor automatically. */ struct OpRecordCommon { + OpRecordCommon() {} Uint32 key; // key shared between master and slaves Uint32 nextHash; Uint32 prevHash; @@ -880,6 +884,7 @@ private: * Create table record */ struct CreateTableRecord : OpRecordCommon { + CreateTableRecord() {} Uint32 m_senderRef; Uint32 m_senderData; Uint32 m_coordinatorRef; @@ -918,6 +923,7 @@ private: * Drop table record */ struct DropTableRecord : OpRecordCommon { + DropTableRecord() {} DropTableReq m_request; Uint32 m_requestType; diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 53e54e96d2b..aea23ce7c78 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -1289,6 +1289,7 @@ public: private: struct LcpState { + LcpState() {} LcpStatus lcpStatus; Uint32 lcpStatusUpdatedPlace; @@ -1395,6 +1396,7 @@ public: private: class MasterTakeOverState { public: + MasterTakeOverState() {} void set(LcpMasterTakeOverState s, Uint32 line) { state = s; updatePlace = line; } @@ -1482,6 +1484,7 @@ private: * SwitchReplicaRecord - Should only be used by master */ struct SwitchReplicaRecord { + SwitchReplicaRecord() {} void clear(){} Uint32 nodeId; diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index 299cad16ec1..6900aec8c80 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -509,6 +509,7 @@ public: typedef Ptr<Databuf> DatabufPtr; struct ScanRecord { + ScanRecord() {} enum ScanState { SCAN_FREE = 0, WAIT_STORED_PROC_COPY = 1, @@ -2898,6 +2899,7 @@ public: * */ struct CommitAckMarker { + CommitAckMarker() {} Uint32 transid1; Uint32 transid2; @@ -2924,6 +2926,7 @@ public: void scanMarkers(Signal* signal, Uint32 tcNodeFail, Uint32 bucket, Uint32 i); struct Counters { + Counters() {} Uint32 operations; inline void clear(){ diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 4739450884c..bc615711dd3 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -7511,7 +7511,6 @@ Dblqh::get_acc_ptr_from_scan_record(ScanRecord* scanP, bool crash_flag) { Uint32* acc_ptr; - Uint32 attr_buf_rec, attr_buf_index; if (!((index < MAX_PARALLEL_OP_PER_SCAN) && index < scanP->scan_acc_index)) { ndbrequire(crash_flag); @@ -7556,7 +7555,6 @@ void Dblqh::execSCAN_FRAGREQ(Signal* signal) const Uint32 scanLockMode = ScanFragReq::getLockMode(reqinfo); const Uint8 keyinfo = ScanFragReq::getKeyinfoFlag(reqinfo); const Uint8 rangeScan = ScanFragReq::getRangeScanFlag(reqinfo); - const Uint8 tupScan = ScanFragReq::getTupScanFlag(reqinfo); ptrCheckGuard(tabptr, ctabrecFileSize, tablerec); if(tabptr.p->tableStatus != Tablerec::TABLE_DEFINED){ @@ -8942,9 +8940,6 @@ Uint32 Dblqh::sendKeyinfo20(Signal* signal, const Uint32 scanOp = scanP->m_curr_batch_size_rows; const Uint32 nodeId = refToNode(ref); const bool connectedToNode = getNodeInfo(nodeId).m_connected; - const Uint32 type = getNodeInfo(nodeId).m_type; - const bool is_api = (type >= NodeInfo::API && type <= NodeInfo::REP); - const bool old_dest = (getNodeInfo(nodeId).m_version < MAKE_VERSION(3,5,0)); const bool longable = true; // TODO is_api && !old_dest; Uint32 * dst = keyInfo->keyData; @@ -9045,7 +9040,6 @@ void Dblqh::sendScanFragConf(Signal* signal, Uint32 scanCompleted) return; } ScanFragConf * conf = (ScanFragConf*)&signal->theData[0]; - NodeId tc_node_id= refToNode(tcConnectptr.p->clientBlockref); Uint32 trans_id1= tcConnectptr.p->transid[0]; Uint32 trans_id2= tcConnectptr.p->transid[1]; @@ -11331,7 +11325,6 @@ void Dblqh::sendAccContOp(Signal* signal) { LcpLocRecordPtr sacLcpLocptr; - int count = 0; sacLcpLocptr.i = lcpPtr.p->firstLcpLocAcc; do { ptrCheckGuard(sacLcpLocptr, clcpLocrecFileSize, lcpLocRecord); @@ -15033,8 +15026,6 @@ void Dblqh::execDEBUG_SIG(Signal* signal) 2.5 TEMPORARY VARIABLES ----------------------- */ - UintR tdebug; - jamEntry(); //logPagePtr.i = signal->theData[0]; //tdebug = logPagePtr.p->logPageWord[0]; diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index bf6ce7129ba..79becb1ec8c 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -304,6 +304,7 @@ public: /* WHEN THE TRIGGER IS DEACTIVATED. */ /* **************************************** */ struct TcDefinedTriggerData { + TcDefinedTriggerData() {} /** * Trigger id, used to identify the trigger */ @@ -957,6 +958,7 @@ public: /* ALL TABLES IN THE SYSTEM. */ /********************************************************/ struct TableRecord { + TableRecord() {} Uint32 currentSchemaVersion; Uint8 enabled; Uint8 dropping; @@ -1665,6 +1667,7 @@ private: UintR tcheckGcpId; struct TransCounters { + TransCounters() {} enum { Off, Timer, Started } c_trans_status; UintR cattrinfoCount; UintR ctransCount; @@ -1803,6 +1806,7 @@ private: */ public: struct CommitAckMarker { + CommitAckMarker() {} Uint32 transid1; Uint32 transid2; union { Uint32 nextPool; Uint32 nextHash; }; diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 0b66d9a45bb..17178a9681e 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -747,6 +747,7 @@ typedef Ptr<RestartInfoRecord> RestartInfoRecordPtr; /* WHEN THE TRIGGER IS DEACTIVATED. */ /* **************************************** */ struct TupTriggerData { + TupTriggerData() {} /** * Trigger id, used by DICT/TRIX to identify the trigger diff --git a/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp index 396404faa8c..56d63bc66f1 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp @@ -90,7 +90,6 @@ Dbtup::execNEXT_SCANREQ(Signal* signal) FragrecordPtr fragPtr; fragPtr.i = scan.m_fragPtrI[0]; ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); - Fragrecord& frag = *fragPtr.p; switch (req->scanFlag) { case NextScanReq::ZSCAN_NEXT: jam(); diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp index 68a3e78ce9e..6138de2f7fa 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp @@ -402,8 +402,6 @@ Dbtux::nodePopUpScans(NodeHandle& node, unsigned pos) void Dbtux::nodeSlide(NodeHandle& dstNode, NodeHandle& srcNode, unsigned cnt, unsigned i) { - Frag& frag = dstNode.m_frag; - TreeHead& tree = frag.m_tree; ndbrequire(i <= 1); while (cnt != 0) { TreeEnt ent; diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp index 6d9385b3989..a8a83ffa7c4 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp @@ -705,7 +705,6 @@ Dbtux::scanFirst(ScanOpPtr scanPtr) debugOut << "Enter first scan " << scanPtr.i << " " << scan << endl; } #endif - TreeHead& tree = frag.m_tree; // set up index keys for this operation setKeyAttrs(frag); // scan direction 0, 1 @@ -986,7 +985,6 @@ Dbtux::scanVisible(ScanOpPtr scanPtr, TreeEnt ent) const Frag& frag = *c_fragPool.getPtr(scan.m_fragPtrI); Uint32 fragBit = ent.m_fragBit; Uint32 tableFragPtrI = frag.m_tupTableFragPtrI[fragBit]; - Uint32 fragId = frag.m_fragId | fragBit; Uint32 tupAddr = getTupAddr(frag, ent); Uint32 tupVersion = ent.m_tupVersion; // check for same tuple twice in row diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp index 5107a8d8e31..1ed24d1b694 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp @@ -213,7 +213,6 @@ Dbtux::treeRemove(Frag& frag, TreePos treePos) void Dbtux::treeRemoveInner(Frag& frag, NodeHandle lubNode, unsigned pos) { - TreeHead& tree = frag.m_tree; TreeEnt ent; // find g.l.b node NodeHandle glbNode(frag); diff --git a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp index 7aa5be7a3cb..7d9fde5a500 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp +++ b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp @@ -83,6 +83,7 @@ public: */ struct StartRecord { + StartRecord() {} Uint64 m_startTime; void reset(); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index af05eeb9e9a..a8a42884eac 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -819,7 +819,6 @@ Ndbcntr::trySystemRestart(Signal* signal){ */ const bool allNodes = c_start.m_waiting.equal(c_allDefinedNodes); const bool allClusterNodes = c_start.m_waiting.equal(c_clusterNodes); - const Uint64 now = NdbTick_CurrentMillisecond(); if(!allClusterNodes){ jam(); @@ -1391,7 +1390,6 @@ void Ndbcntr::execNODE_FAILREP(Signal* signal) const bool tMasterFailed = allFailed.get(cmasterNodeId); const bool tStarted = !failedStarted.isclear(); const bool tStarting = !failedStarting.isclear(); - const bool tWaiting = !failedWaiting.isclear(); if(tMasterFailed){ jam(); @@ -2472,8 +2470,6 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){ void Ndbcntr::execABORT_ALL_REF(Signal* signal){ jamEntry(); - AbortAllRef *abortAllRef = (AbortAllRef *)&signal->theData[0]; - AbortAllRef::ErrorCode errorCode = (AbortAllRef::ErrorCode) abortAllRef->errorCode; StopRef * const stopRef = (StopRef *)&signal->theData[0]; stopRef->senderData = c_stopRec.stopReq.senderData; diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp index 997bf40fe2a..a2e8d521051 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp @@ -107,6 +107,8 @@ class AsyncFile; class Request { public: + Request() {} + enum Action { open, close, diff --git a/ndb/src/kernel/blocks/qmgr/Qmgr.hpp b/ndb/src/kernel/blocks/qmgr/Qmgr.hpp index e728ea81a7d..b68b7054d86 100644 --- a/ndb/src/kernel/blocks/qmgr/Qmgr.hpp +++ b/ndb/src/kernel/blocks/qmgr/Qmgr.hpp @@ -102,6 +102,7 @@ public: }; struct StartRecord { + StartRecord() {} void reset(){ m_startKey++; m_startNode = 0; @@ -170,6 +171,7 @@ public: }; struct ArbitRec { + ArbitRec() {} ArbitState state; // state bool newstate; // flag to initialize new state unsigned thread; // identifies a continueB "thread" diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 68e649d8ae0..3f5d4bf0601 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -846,7 +846,6 @@ void Qmgr::execCM_REGCONF(Signal* signal) jamEntry(); const CmRegConf * const cmRegConf = (CmRegConf *)&signal->theData[0]; - Uint32 presidentNodeId = cmRegConf->presidentNodeId; if (!ndbCompatible_ndb_ndb(NDB_VERSION, cmRegConf->presidentVersion)) { jam(); @@ -1271,7 +1270,6 @@ Qmgr::check_startup(Signal* signal) /** * Check for missing node group directly */ - char buf[100]; NdbNodeBitmask check; check.assign(c_definedNodes); check.bitANDC(c_start.m_starting_nodes); // Not connected nodes diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp index 449436331e4..d2b006fd05a 100644 --- a/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/ndb/src/kernel/blocks/suma/Suma.cpp @@ -1435,7 +1435,6 @@ SumaParticipant::SyncRecord::nextScan(Signal* signal){ LocalDataBuffer<15> attrBuf(suma.c_dataBufferPool, head); ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend(); - const Uint32 parallelism = 16; const Uint32 attrLen = 5 + attrBuf.getSize(); req->senderData = m_subscriptionPtrI; @@ -1611,10 +1610,6 @@ SumaParticipant::execSCAN_HBREP(Signal* signal){ static Uint32 f_bufferLock = 0; static Uint32 f_buffer[SUMA_BUF_SZ]; -static Uint32 f_trigBufferSize = 0; -static Uint32 b_bufferLock = 0; -static Uint32 b_buffer[SUMA_BUF_SZ]; -static Uint32 b_trigBufferSize = 0; void SumaParticipant::execTRANSID_AI(Signal* signal){ @@ -1718,7 +1713,6 @@ SumaParticipant::execSUB_REMOVE_REQ(Signal* signal) { return; } - int count = 0; { jam(); SubscriberPtr i_subbPtr; diff --git a/ndb/src/kernel/blocks/suma/Suma.hpp b/ndb/src/kernel/blocks/suma/Suma.hpp index 5cf1c4d543f..1f2023635cc 100644 --- a/ndb/src/kernel/blocks/suma/Suma.hpp +++ b/ndb/src/kernel/blocks/suma/Suma.hpp @@ -209,6 +209,7 @@ public: friend struct SyncRecord; struct Subscription { + Subscription() {} Uint32 m_subscriberRef; Uint32 m_subscriberData; Uint32 m_senderRef; diff --git a/ndb/src/kernel/vm/MetaData.hpp b/ndb/src/kernel/vm/MetaData.hpp index 1000114a421..adf28fb702d 100644 --- a/ndb/src/kernel/vm/MetaData.hpp +++ b/ndb/src/kernel/vm/MetaData.hpp @@ -68,6 +68,7 @@ public: */ class Table { public: + Table() {} /* Table id (array index in DICT and other blocks) */ Uint32 tableId; diff --git a/ndb/src/mgmapi/LocalConfig.cpp b/ndb/src/mgmapi/LocalConfig.cpp index 75ad8b40a1f..eb1ea2b322a 100644 --- a/ndb/src/mgmapi/LocalConfig.cpp +++ b/ndb/src/mgmapi/LocalConfig.cpp @@ -74,9 +74,9 @@ LocalConfig::init(const char *connectString, //4. Check Ndb.cfg in NDB_HOME { bool fopenError; - char *buf= NdbConfig_NdbCfgName(1 /*true*/); - NdbAutoPtr<char> tmp_aptr(buf); - if(readFile(buf, fopenError)) + char *buf2= NdbConfig_NdbCfgName(1 /*true*/); + NdbAutoPtr<char> tmp_aptr(buf2); + if(readFile(buf2, fopenError)) DBUG_RETURN(true); if (!fopenError) DBUG_RETURN(false); @@ -85,9 +85,9 @@ LocalConfig::init(const char *connectString, //5. Check Ndb.cfg in cwd { bool fopenError; - char *buf= NdbConfig_NdbCfgName(0 /*false*/); - NdbAutoPtr<char> tmp_aptr(buf); - if(readFile(buf, fopenError)) + char *buf2= NdbConfig_NdbCfgName(0 /*false*/); + NdbAutoPtr<char> tmp_aptr(buf2); + if(readFile(buf2, fopenError)) DBUG_RETURN(true); if (!fopenError) DBUG_RETURN(false); @@ -95,9 +95,9 @@ LocalConfig::init(const char *connectString, //7. Check { - char buf[256]; - BaseString::snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_PORT); - if(readConnectString(buf, "default connect string")) + char buf2[256]; + BaseString::snprintf(buf2, sizeof(buf2), "host=localhost:%s", NDB_PORT); + if(readConnectString(buf2, "default connect string")) DBUG_RETURN(true); } diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 8aa4f7213de..3531367740f 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -455,7 +455,6 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries, LocalConfig &cfg= handle->cfg; NDB_SOCKET_TYPE sockfd= NDB_INVALID_SOCKET; Uint32 i; - int binderror = 0; SocketClient s(0, 0); if (!s.init()) { @@ -824,12 +823,12 @@ ndb_mgm_get_status(NdbMgmHandle handle) break; } - Vector<BaseString> split; - tmp.split(split, ":.", 4); - if(split.size() != 4) + Vector<BaseString> split2; + tmp.split(split2, ":.", 4); + if(split2.size() != 4) break; - const int id = atoi(split[1].c_str()); + const int id = atoi(split2[1].c_str()); if(id != nodeId){ ptr++; i++; @@ -837,9 +836,9 @@ ndb_mgm_get_status(NdbMgmHandle handle) ptr->node_id = id; } - split[3].trim(" \t\n"); + split2[3].trim(" \t\n"); - if(status_ackumulate(ptr,split[2].c_str(), split[3].c_str()) != 0) { + if(status_ackumulate(ptr,split2[2].c_str(), split2[3].c_str()) != 0) { break; } } diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 1dacd9689e8..6faa7677da9 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1550,7 +1550,6 @@ CommandInterpreter::executePurge(char* parameters) return -1; } - int i; char *str; if (ndb_mgm_purge_stale_sessions(m_mgmsrv, &str)) { @@ -1668,7 +1667,6 @@ CommandInterpreter::executeConnect(char* parameters, bool interactive) { BaseString *basestring = NULL; - int retval; disconnect(); if (!emptyString(parameters)) { basestring= new BaseString(parameters); @@ -2103,7 +2101,6 @@ CommandInterpreter::executeStatus(int processId, ndb_mgm_node_status status; Uint32 startPhase, version; - bool system; struct ndb_mgm_cluster_state *cl; cl = ndb_mgm_get_status(m_mgmsrv); diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index d4e72a7ff1d..6780c53a71e 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -2318,7 +2318,6 @@ ConfigInfo::ConfigInfo() break; case CI_BOOL: { - bool tmp_bool; require(InitConfigFileParser::convertStringToBool(param._default, default_bool)); require(p->put(param._fname, default_bool)); break; @@ -2326,7 +2325,6 @@ ConfigInfo::ConfigInfo() case CI_INT: case CI_INT64: { - Uint64 tmp_uint64; require(InitConfigFileParser::convertStringToUint64(param._default, default_uint64)); require(p->put(param._fname, default_uint64)); break; @@ -2842,7 +2840,7 @@ applyDefaultValues(InitConfigFileParser::Context & ctx, Properties::Iterator it(defaults); for(const char * name = it.first(); name != NULL; name = it.next()){ - ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); + (void) ctx.m_info->getStatus(ctx.m_currentInfo, name); if(!ctx.m_currentSection->contains(name)){ switch (ctx.m_info->getType(ctx.m_currentInfo, name)){ case ConfigInfo::CI_INT: @@ -3449,7 +3447,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ if(!ctx.m_currentInfo->get(n, &info)) continue; - Uint32 id = 0; + id = 0; info->get("Id", &id); if(id == KEY_INTERNAL) diff --git a/ndb/src/mgmsrv/ConfigInfo.hpp b/ndb/src/mgmsrv/ConfigInfo.hpp index 788619db7fe..fb4be836a53 100644 --- a/ndb/src/mgmsrv/ConfigInfo.hpp +++ b/ndb/src/mgmsrv/ConfigInfo.hpp @@ -27,8 +27,11 @@ * A MANDATORY parameters must be specified in the config file * An UNDEFINED parameter may or may not be specified in the config file */ -static const char* MANDATORY = (char*)~(UintPtr)0;// Default value for mandatory params. -static const char* UNDEFINED = 0; // Default value for undefined params. + +// Default value for mandatory params. +#define MANDATORY ((char*)~(UintPtr)0) +// Default value for undefined params. +#define UNDEFINED ((char*) 0) /** * @class ConfigInfo diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index f937daf8620..7b4174b5eb5 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -690,34 +690,35 @@ load_defaults(Vector<struct my_option>& options, const char* groups[]) BaseString extra_file; BaseString group_suffix; - const char *save_file = defaults_file; - char *save_extra_file = defaults_extra_file; - const char *save_group_suffix = defaults_group_suffix; + const char *save_file = my_defaults_file; + char *save_extra_file = my_defaults_extra_file; + const char *save_group_suffix = my_defaults_group_suffix; - if (defaults_file) + if (my_defaults_file) { - file.assfmt("--defaults-file=%s", defaults_file); + file.assfmt("--defaults-file=%s", my_defaults_file); argv[argc++] = file.c_str(); } - if (defaults_extra_file) + if (my_defaults_extra_file) { - extra_file.assfmt("--defaults-extra-file=%s", defaults_extra_file); + extra_file.assfmt("--defaults-extra-file=%s", my_defaults_extra_file); argv[argc++] = extra_file.c_str(); } - if (defaults_group_suffix) + if (my_defaults_group_suffix) { - group_suffix.assfmt("--defaults-group-suffix=%s", defaults_group_suffix); + group_suffix.assfmt("--defaults-group-suffix=%s", + my_defaults_group_suffix); argv[argc++] = group_suffix.c_str(); } char ** tmp = (char**)argv; int ret = load_defaults("my", groups, &argc, &tmp); - defaults_file = save_file; - defaults_extra_file = save_extra_file; - defaults_group_suffix = save_group_suffix; + my_defaults_file = save_file; + my_defaults_extra_file = save_extra_file; + my_defaults_group_suffix = save_group_suffix; if (ret == 0) { diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 766992af0cb..ff93936d450 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -101,6 +101,8 @@ MgmtSrvr::logLevelThread_C(void* m) extern EventLogger g_eventLogger; +#ifdef NOT_USED + static NdbOut& operator<<(NdbOut& out, const LogLevel & ll) { @@ -110,6 +112,7 @@ operator<<(NdbOut& out, const LogLevel & ll) out << "]"; return out; } +#endif void MgmtSrvr::logLevelThreadRun() @@ -1115,7 +1118,6 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids, break; } case GSN_STOP_CONF:{ - const StopConf * const ref = CAST_CONSTPTR(StopConf, signal->getDataPtr()); const NodeId nodeId = refToNode(signal->header.theSendersBlockRef); #ifdef VM_TRACE ndbout_c("Node %d single user mode", nodeId); @@ -1145,8 +1147,6 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids, break; } case GSN_NODE_FAILREP:{ - const NodeFailRep * const rep = - CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); break; } default: @@ -1334,7 +1334,7 @@ int MgmtSrvr::restartNodes(const Vector<NodeId> &node_ids, for (unsigned i = 0; i < node_ids.size(); i++) { - int result = start(node_ids[i]); + start(node_ids[i]); } return 0; } diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 17debb19f50..97840a5d89a 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -50,6 +50,7 @@ class Ndb_mgmd_event_service : public EventLoggerBase friend class MgmtSrvr; public: struct Event_listener : public EventLoggerBase { + Event_listener() {} NDB_SOCKET_TYPE m_socket; Uint32 m_parsable; }; diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index bf16aa03d04..ed1bd971479 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -646,14 +646,13 @@ MgmApiSession::getConfig_common(Parser_t::Context &, NdbMutex_Lock(m_mgmsrv.m_configMutex); const ConfigValues * cfg = &conf->m_configValues->m_config; - const Uint32 size = cfg->getPackedSize(); UtilBuffer src; cfg->pack(src); NdbMutex_Unlock(m_mgmsrv.m_configMutex); char *tmp_str = (char *) malloc(base64_needed_encoded_length(src.length())); - int res = base64_encode(src.get_data(), src.length(), tmp_str); + (void) base64_encode(src.get_data(), src.length(), tmp_str); m_output->println("get config reply"); m_output->println("result: Ok"); @@ -836,8 +835,6 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &, const char *reply= "set cluster loglevel reply"; Uint32 node, level, cat; BaseString errorString; - SetLogLevelOrd logLevel; - int result; DBUG_ENTER("MgmApiSession::setClusterLogLevel"); args.get("node", &node); args.get("category", &cat); @@ -884,7 +881,6 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &, Uint32 node = 0, level = 0, cat; BaseString errorString; SetLogLevelOrd logLevel; - int result; logLevel.clear(); args.get("node", &node); args.get("category", &cat); @@ -1313,6 +1309,8 @@ MgmApiSession::setLogFilter(Parser_t::Context &ctx, m_output->println(""); } +#ifdef NOT_USED + static NdbOut& operator<<(NdbOut& out, const LogLevel & ll) { @@ -1322,6 +1320,7 @@ operator<<(NdbOut& out, const LogLevel & ll) out << "]"; return out; } +#endif void Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId){ diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 32b9de92d90..feda39b2123 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -195,7 +195,6 @@ static void usage() */ int main(int argc, char** argv) { - int mgm_connect_result; NDB_INIT(argv[0]); diff --git a/ndb/src/ndbapi/ClusterMgr.hpp b/ndb/src/ndbapi/ClusterMgr.hpp index d2bcc52f7e8..ab8d5ded2fc 100644 --- a/ndb/src/ndbapi/ClusterMgr.hpp +++ b/ndb/src/ndbapi/ClusterMgr.hpp @@ -180,6 +180,7 @@ private: ArbitSignalData data; NDB_TICKS timestamp; + ArbitSignal() {} inline void init(GlobalSignalNumber aGsn, const Uint32* aData) { gsn = aGsn; if (aData != NULL) diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 59a204be2a8..df8de2f818f 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -269,8 +269,6 @@ Ndb::waitUntilReady(int timeout) DBUG_ENTER("Ndb::waitUntilReady"); int secondsCounter = 0; int milliCounter = 0; - int noChecksSinceFirstAliveFound = 0; - int id; if (theInitState != Initialised) { // Ndb::init is not called diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index fdee8961337..91abcace4e9 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -389,8 +389,6 @@ NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part) DBUG_ENTER("NdbBlob::setPartKeyValue"); DBUG_PRINT("info", ("dist=%u part=%u key=", getDistKey(part), part)); DBUG_DUMP("info", theKeyBuf.data, 4 * theTable->m_keyLenInWords); - Uint32* data = (Uint32*)theKeyBuf.data; - unsigned size = theTable->m_keyLenInWords; // TODO use attr ids after compatibility with 4.1.7 not needed if (anOp->equal("PK", theKeyBuf.data) == -1 || anOp->equal("DIST", getDistKey(part)) == -1 || diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index b91df24d8d7..314c072be76 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1521,11 +1521,6 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, tmpTab.MinRowsHigh = (Uint32)(impl.m_min_rows >> 32); tmpTab.MinRowsLow = (Uint32)(impl.m_min_rows & 0xFFFFFFFF); - Uint64 maxRows = - (((Uint64)tmpTab.MaxRowsHigh) << 32) + tmpTab.MaxRowsLow; - Uint64 minRows = - (((Uint64)tmpTab.MinRowsHigh) << 32) + tmpTab.MinRowsLow; - tmpTab.FragmentType = getKernelConstant(impl.m_fragmentType, fragmentTypeMapping, DictTabInfo::AllNodesSmallTable); diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp index 853bab09c41..7c3af67f6e0 100644 --- a/ndb/src/ndbapi/NdbIndexOperation.cpp +++ b/ndb/src/ndbapi/NdbIndexOperation.cpp @@ -245,8 +245,6 @@ NdbIndexOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransactionId) // Simple state is set if start and commit is set and it is // a read request. Otherwise it is set to zero. //------------------------------------------------------------- - Uint8 tReadInd = (theOperationType == ReadRequest); - Uint8 tSimpleState = tReadInd & tSimpleAlt; //theNdbCon->theSimpleState = tSimpleState; tcKeyReq->transId1 = tTransId1; diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp index 42dec161307..800fa29fb42 100644 --- a/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -534,8 +534,7 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, }//if const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; // Including bits in last word const Uint32 sizeInWords = sizeInBytes / 4; // Excluding bits in last word - AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, - totalSizeInWords); + (void) AttributeHeader::init(&ahValue, tAttrId, totalSizeInWords); insertATTRINFO( ahValue ); /*********************************************************************** diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index 11713678478..b3281989bdc 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -177,8 +177,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) // Simple state is set if start and commit is set and it is // a read request. Otherwise it is set to zero. //------------------------------------------------------------- - Uint8 tReadInd = (theOperationType == ReadRequest); - Uint8 tSimpleState = tReadInd & tSimpleIndicator; tcKeyReq->transId1 = tTransId1; tcKeyReq->transId2 = tTransId2; diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp index ede3240e9f4..a2e966dab2d 100644 --- a/ndb/src/ndbapi/NdbOperationSearch.cpp +++ b/ndb/src/ndbapi/NdbOperationSearch.cpp @@ -67,7 +67,6 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, register Uint32 tAttrId; - Uint32 tData; Uint32 tKeyInfoPosition; const char* aValue = aValuePassed; Uint64 tempData[512]; @@ -347,7 +346,6 @@ NdbOperation::insertKEYINFO(const char* aValue, Uint32 tEndPos; Uint32 tPos; Uint32 signalCounter; - Uint32 tData; /***************************************************************************** * Calculate the end position of the attribute in the key information. * @@ -514,7 +512,6 @@ NdbOperation::handle_distribution_key(const Uint64* value, Uint32 len) * Copy distribution key to linear memory */ NdbColumnImpl* const * cols = m_accessTable->m_columns.getBase(); - Uint32 len = 0; Uint64 tmp[1000]; Uint32 chunk = 8; diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index b39fd10fe95..421c01ed3e3 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -32,6 +32,7 @@ class NdbScanFilterImpl { public: + NdbScanFilterImpl() {} struct State { NdbScanFilter::Group m_group; Uint32 m_popCount; diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 92a1e476b45..de7978be074 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -830,7 +830,6 @@ NdbScanOperation::doSendScan(int aProcessorId) tSignal = theSCAN_TABREQ; Uint32 tupKeyLen = theTupKeyLen; - Uint32 len = theTotalNrOfKeyWordInSignal; Uint32 aTC_ConnectPtr = theNdbCon->theTCConPtr; Uint64 transId = theNdbCon->theTransactionId; @@ -1300,8 +1299,6 @@ NdbIndexScanOperation::fix_get_values(){ Uint32 cnt = m_accessTable->getNoOfColumns() - 1; assert(cnt < NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY); - const NdbIndexImpl * idx = m_accessTable->m_index; - const NdbTableImpl * tab = m_currentTable; for(Uint32 i = 0; i<cnt; i++){ Uint32 val = theTupleKeyDefined[i][0]; switch(val){ diff --git a/ndb/src/ndbapi/SignalSender.cpp b/ndb/src/ndbapi/SignalSender.cpp index 0ecc98f5f29..492a5193f89 100644 --- a/ndb/src/ndbapi/SignalSender.cpp +++ b/ndb/src/ndbapi/SignalSender.cpp @@ -173,6 +173,7 @@ SignalSender::waitFor(Uint32 timeOutMillis, T & t) class WaitForAny { public: + WaitForAny() {} SimpleSignal * check(Vector<SimpleSignal*> & m_jobBuffer){ if(m_jobBuffer.size() > 0){ SimpleSignal * s = m_jobBuffer[0]; @@ -192,6 +193,7 @@ SignalSender::waitFor(Uint32 timeOutMillis){ class WaitForNode { public: + WaitForNode() {} Uint32 m_nodeId; SimpleSignal * check(Vector<SimpleSignal*> & m_jobBuffer){ Uint32 len = m_jobBuffer.size(); diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 3ae84125112..c3e6b3f850a 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -516,7 +516,6 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, struct ndb_mgm_reply mgm_reply; DBUG_ENTER("Ndb_cluster_connection::connect"); - const char* error = 0; do { if (m_impl.m_config_retriever == 0) DBUG_RETURN(-1); diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index a3d9ff4ccee..893c2ce33cc 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -44,9 +44,11 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program will delete all records in the specified table using scan delete.\n"; +#endif ndb_std_print_version(); print_defaults(MYSQL_CONFIG_NAME,load_default_groups); puts(""); diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index 934394e4d31..0f6856cd046 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -43,10 +43,12 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program list all properties of table(s) in NDB Cluster.\n"\ " ex: desc T1 T2 T4\n"; +#endif ndb_std_print_version(); print_defaults(MYSQL_CONFIG_NAME,load_default_groups); puts(""); diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index c10211a9108..18b6e5b55c1 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -37,9 +37,11 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "[<table> <index>]+\n"\ "This program will drop index(es) in Ndb\n"; +#endif ndb_std_print_version(); print_defaults(MYSQL_CONFIG_NAME,load_default_groups); puts(""); diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 61df4ee9b34..38b043ddd9a 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -37,9 +37,11 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program will drop one table in Ndb\n"; +#endif ndb_std_print_version(); print_defaults(MYSQL_CONFIG_NAME,load_default_groups); puts(""); diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index 8cc4e65586a..c097aeb1d6c 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -190,6 +190,7 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program list all system objects in NDB Cluster.\n"\ @@ -197,6 +198,7 @@ static void usage() " ex: ndb_show_tables -t 2 would show all UserTables\n"\ "To show all indexes for a table write table name as final argument\n"\ " ex: ndb_show_tables T1\n"; +#endif ndb_std_print_version(); print_defaults(MYSQL_CONFIG_NAME,load_default_groups); puts(""); diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 049e4599447..fe8b2f7a547 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -99,6 +99,7 @@ static void usage() { char desc[] = "This program will retreive config options for a ndb cluster\n"; + puts(desc); ndb_std_print_version(); print_defaults(MYSQL_CONFIG_NAME,load_default_groups); puts(""); @@ -113,12 +114,14 @@ struct Match { int m_key; BaseString m_value; + Match() {} virtual int eval(const Iter&); virtual ~Match() {} }; struct HostMatch : public Match { + HostMatch() {} virtual int eval(const Iter&); }; @@ -133,11 +136,13 @@ struct Apply struct NodeTypeApply : public Apply { + NodeTypeApply() {} virtual int apply(const Iter&); }; struct ConnectionTypeApply : public Apply { + ConnectionTypeApply() {} virtual int apply(const Iter&); }; @@ -296,10 +301,10 @@ parse_where(Vector<Match*>& where, int &argc, char**& argv) Match m; if(g_host) { - HostMatch *m = new HostMatch; - m->m_key = CFG_NODE_HOST; - m->m_value.assfmt("%s", g_host); - where.push_back(m); + HostMatch *tmp = new HostMatch; + tmp->m_key = CFG_NODE_HOST; + tmp->m_value.assfmt("%s", g_host); + where.push_back(tmp); } if(g_type) diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index cf8feb7125c..aaf18e3aac6 100644 --- a/ndb/tools/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -26,7 +26,7 @@ #include <ndb_version.h> #include <version.h> -static const char * delimiter = ";"; // Delimiter in file dump +#define delimiter ";" const int FileNameLenC = 256; const int TableNameLenC = 256; @@ -359,6 +359,7 @@ public: m_values_e.push_back(m_values[i]); m_values.clear(); } + LogEntry() {} ~LogEntry() { Uint32 i; diff --git a/ndb/tools/restore/consumer.hpp b/ndb/tools/restore/consumer.hpp index 6a8ef29e295..330ed0520d1 100644 --- a/ndb/tools/restore/consumer.hpp +++ b/ndb/tools/restore/consumer.hpp @@ -21,6 +21,7 @@ class BackupConsumer { public: + BackupConsumer() {} virtual ~BackupConsumer() { } virtual bool init() { return true;} virtual bool table(const TableS &){return true;} diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index eb0a8b8d139..55aedc13b04 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -357,8 +357,8 @@ main(int argc, char** argv) while ((tuple = dataIter.getNextTuple(res= 1)) != 0) { if (checkSysTable(tuple->getTable()->getTableName())) - for(Uint32 i= 0; i < g_consumers.size(); i++) - g_consumers[i]->tuple(* tuple); + for(Uint32 j= 0; j < g_consumers.size(); j++) + g_consumers[j]->tuple(* tuple); } // while (tuple != NULL); if (res < 0) @@ -401,8 +401,8 @@ main(int argc, char** argv) while ((logEntry = logIter.getNextLogEntry(res= 0)) != 0) { if (checkSysTable(logEntry->m_table->getTableName())) - for(Uint32 i= 0; i < g_consumers.size(); i++) - g_consumers[i]->logEntry(* logEntry); + for(Uint32 j= 0; j < g_consumers.size(); j++) + g_consumers[j]->logEntry(* logEntry); } if (res < 0) { @@ -433,9 +433,9 @@ main(int argc, char** argv) } } } - for(Uint32 i= 0; i < g_consumers.size(); i++) + for(Uint32 j= 0; j < g_consumers.size(); j++) { - if (g_consumers[i]->has_temp_error()) + if (g_consumers[j]->has_temp_error()) { clearConsumers(); ndbout_c("\nRestore successful, but encountered temporary error, " diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 7bb3557d1ba..426ecc45a52 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -40,7 +40,7 @@ NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; static const char* _delimiter = "\t"; -static int _unqualified, _header, _parallelism, _useHexFormat, _lock, +static int _header, _parallelism, _useHexFormat, _lock, _order, _descending; const char *load_default_groups[]= { "mysql_cluster",0 }; @@ -76,6 +76,7 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname\n"\ "This program reads all records from one table in NDB Cluster\n"\ @@ -83,6 +84,7 @@ static void usage() "(It only print error messages if it encounters a permanent error.)\n"\ "It can also be used to dump the content of a table to file \n"\ " ex: select_all --no-header --delimiter=';' T4 > T4.data\n"; +#endif ndb_std_print_version(); print_defaults(MYSQL_CONFIG_NAME,load_default_groups); puts(""); diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index 0d5d4684878..49438be728e 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -56,9 +56,11 @@ static struct my_option my_long_options[] = }; static void usage() { +#ifdef NOT_USED char desc[] = "tabname1 ... tabnameN\n"\ "This program will count the number of records in tables\n"; +#endif ndb_std_print_version(); print_defaults(MYSQL_CONFIG_NAME,load_default_groups); puts(""); |