summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <jani@ua141d10.elisa.omakaista.fi>2007-02-28 22:23:35 +0200
committerunknown <jani@ua141d10.elisa.omakaista.fi>2007-02-28 22:23:35 +0200
commitdef9c0b2367808d6e8f6b9ffe2f82f6465d9642b (patch)
tree288ffce0d7e95cc7177686fa96f53632b56e4161 /sql/ha_ndbcluster.cc
parent8c336fbc46fd3e8d1a7cc073883270c5a2ac3cc8 (diff)
downloadmariadb-git-def9c0b2367808d6e8f6b9ffe2f82f6465d9642b.tar.gz
Fixed compiler warnings.
client/mysql_upgrade.c: Fixed problem with mysql_upgrade being dependent on local my.cnf files and problem with memory not being freed. client/mysqltest.c: Changed type to avoid warning. cmd-line-utils/readline/xmalloc.c: Fix to avoid warning. include/my_dbug.h: To disable parts from code in non-debug more. sql/field.cc: Fixed warning. sql/ha_archive.cc: Fixed warning. sql/ha_berkeley.cc: Added casts to avoid warnings. sql/ha_ndbcluster.cc: Fixed warnings. sql/log.cc: Added casts to avoid warnings. sql/slave.cc: Avoid warning. sql/sql_repl.cc: Avoid warning. support-files/compiler_warnings.supp: Added disabled warnings to compiler_warnings.supp file. These are backported mainly from 5.1 suppress file, but there are some additional new ones.
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc29
1 files changed, 22 insertions, 7 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 46d3870e544..7a9c7d0d021 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -2331,10 +2331,12 @@ int ha_ndbcluster::write_row(byte *record)
{
Ndb *ndb= get_ndb();
Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1;
+#ifndef DBUG_OFF
char buff[22];
DBUG_PRINT("info",
("Trying to set next auto increment value to %s",
llstr(next_val, buff)));
+#endif
if (ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)
== -1)
ERR_RETURN(ndb->getNdbError());
@@ -3490,7 +3492,7 @@ int ha_ndbcluster::end_bulk_insert()
}
else
{
- int res= trans->restart();
+ IF_DBUG(int res=) trans->restart();
DBUG_ASSERT(res == 0);
}
}
@@ -4257,7 +4259,9 @@ static int create_ndb_column(NDBCOL &col,
// Set autoincrement
if (field->flags & AUTO_INCREMENT_FLAG)
{
+#ifndef DBUG_OFF
char buff[22];
+#endif
col.setAutoIncrement(TRUE);
ulonglong value= info->auto_increment_value ?
info->auto_increment_value : (ulonglong) 1;
@@ -5680,7 +5684,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
if (share->commit_count != 0)
{
*commit_count= share->commit_count;
+#ifndef DBUG_OFF
char buff[22];
+#endif
DBUG_PRINT("info", ("Getting commit_count: %s from share",
llstr(share->commit_count, buff)));
pthread_mutex_unlock(&share->mutex);
@@ -5706,7 +5712,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
pthread_mutex_lock(&share->mutex);
if (share->commit_count_lock == lock)
{
+#ifndef DBUG_OFF
char buff[22];
+#endif
DBUG_PRINT("info", ("Setting commit_count to %s",
llstr(stat.commit_count, buff)));
share->commit_count= stat.commit_count;
@@ -5762,7 +5770,9 @@ ndbcluster_cache_retrieval_allowed(THD *thd,
bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
char *dbname= full_name;
char *tabname= dbname+strlen(dbname)+1;
+#ifndef DBUG_OFF
char buff[22], buff2[22];
+#endif
DBUG_ENTER("ndbcluster_cache_retrieval_allowed");
DBUG_PRINT("enter", ("dbname: %s, tabname: %s, is_autocommit: %d",
dbname, tabname, is_autocommit));
@@ -5829,7 +5839,9 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
ulonglong *engine_data)
{
Uint64 commit_count;
+#ifndef DBUG_OFF
char buff[22];
+#endif
bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
DBUG_ENTER("ha_ndbcluster::register_query_cache_table");
DBUG_PRINT("enter",("dbname: %s, tabname: %s, is_autocommit: %d",
@@ -6036,7 +6048,9 @@ ndb_get_table_statistics(ha_ndbcluster* file, bool report_error, Ndb* ndb,
int retries= 10;
int reterr= 0;
int retry_sleep= 30 * 1000; /* 30 milliseconds */
+#ifndef DBUG_OFF
char buff[22], buff2[22], buff3[22], buff4[22];
+#endif
DBUG_ENTER("ndb_get_table_statistics");
DBUG_PRINT("enter", ("table: %s", table));
@@ -6725,7 +6739,9 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
if (ndb_get_table_statistics(NULL, false, ndb, tabname, &stat) == 0)
{
+#ifndef DBUG_OFF
char buff[22], buff2[22];
+#endif
DBUG_PRINT("ndb_util_thread",
("Table: %s commit_count: %s rows: %s",
share->table_name,
@@ -7565,8 +7581,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
DBUG_PRINT("info", ("INT_ITEM"));
if (context->expecting(Item::INT_ITEM))
{
- Item_int *int_item= (Item_int *) item;
- DBUG_PRINT("info", ("value %ld", (long) int_item->value));
+ DBUG_PRINT("info", ("value %ld",
+ (long) ((Item_int*) item)->value));
NDB_ITEM_QUALIFICATION q;
q.value_type= Item::INT_ITEM;
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
@@ -7592,8 +7608,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
DBUG_PRINT("info", ("REAL_ITEM"));
if (context->expecting(Item::REAL_ITEM))
{
- Item_float *float_item= (Item_float *) item;
- DBUG_PRINT("info", ("value %f", float_item->value));
+ DBUG_PRINT("info", ("value %f", ((Item_float *) item)->value));
NDB_ITEM_QUALIFICATION q;
q.value_type= Item::REAL_ITEM;
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
@@ -7640,8 +7655,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
DBUG_PRINT("info", ("DECIMAL_ITEM"));
if (context->expecting(Item::DECIMAL_ITEM))
{
- Item_decimal *decimal_item= (Item_decimal *) item;
- DBUG_PRINT("info", ("value %f", decimal_item->val_real()));
+ DBUG_PRINT("info", ("value %f",
+ ((Item_decimal*) item)->val_real()));
NDB_ITEM_QUALIFICATION q;
q.value_type= Item::DECIMAL_ITEM;
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);