summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster_binlog.cc
diff options
context:
space:
mode:
authorunknown <mskold/marty@linux.site>2006-11-30 15:31:20 +0100
committerunknown <mskold/marty@linux.site>2006-11-30 15:31:20 +0100
commitd6e2895da72e79c031c4e0738a565b98c861eaaa (patch)
tree501aa12882c7189318e5c0edb34c332ecb5aaac0 /sql/ha_ndbcluster_binlog.cc
parent9253140b8d7dc129e290f18d21afd8c974a2f50a (diff)
parenta6a0aa42362bf6811150a3d8190f363fc116859a (diff)
downloadmariadb-git-d6e2895da72e79c031c4e0738a565b98c861eaaa.tar.gz
Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.1
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb configure.in: Auto merged client/mysqldump.c: Auto merged include/my_sys.h: Auto merged mysql-test/r/ndb_update.result: Auto merged mysql-test/t/ndb_index_ordered.test: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged storage/ndb/include/util/OutputStream.hpp: Auto merged storage/ndb/src/common/debugger/EventLogger.cpp: Auto merged storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: Auto merged storage/ndb/src/mgmapi/mgmapi.cpp: Auto merged storage/ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged storage/ndb/src/ndbapi/ClusterMgr.cpp: Auto merged storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged storage/ndb/src/ndbapi/NdbTransaction.cpp: Auto merged storage/ndb/src/ndbapi/Ndbinit.cpp: Auto merged storage/ndb/src/ndbapi/ndb_cluster_connection.cpp: Auto merged sql/sql_cache.cc: Merge
Diffstat (limited to 'sql/ha_ndbcluster_binlog.cc')
-rw-r--r--sql/ha_ndbcluster_binlog.cc123
1 files changed, 67 insertions, 56 deletions
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 8eae4a676d1..92bc82f3114 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -162,16 +162,16 @@ static void dbug_print_table(const char *info, TABLE *table)
}
DBUG_PRINT("info",
("%s: %s.%s s->fields: %d "
- "reclength: %d rec_buff_length: %d record[0]: %lx "
- "record[1]: %lx",
+ "reclength: %lu rec_buff_length: %u record[0]: 0x%lx "
+ "record[1]: 0x%lx",
info,
table->s->db.str,
table->s->table_name.str,
table->s->fields,
table->s->reclength,
table->s->rec_buff_length,
- table->record[0],
- table->record[1]));
+ (long) table->record[0],
+ (long) table->record[1]));
for (unsigned int i= 0; i < table->s->fields; i++)
{
@@ -181,7 +181,7 @@ static void dbug_print_table(const char *info, TABLE *table)
"ptr: 0x%lx[+%d] null_bit: %u null_ptr: 0x%lx[+%d]",
i,
f->field_name,
- f->flags,
+ (long) f->flags,
(f->flags & PRI_KEY_FLAG) ? "pri" : "attr",
(f->flags & NOT_NULL_FLAG) ? "" : ",nullable",
(f->flags & UNSIGNED_FLAG) ? ",unsigned" : ",signed",
@@ -190,16 +190,18 @@ static void dbug_print_table(const char *info, TABLE *table)
(f->flags & BINARY_FLAG) ? ",binary" : "",
f->real_type(),
f->pack_length(),
- f->ptr, f->ptr - table->record[0],
+ (long) f->ptr, (int) (f->ptr - table->record[0]),
f->null_bit,
- f->null_ptr, (byte*) f->null_ptr - table->record[0]));
+ (long) f->null_ptr,
+ (int) ((byte*) f->null_ptr - table->record[0])));
if (f->type() == MYSQL_TYPE_BIT)
{
Field_bit *g= (Field_bit*) f;
DBUG_PRINT("MYSQL_TYPE_BIT",("field_length: %d bit_ptr: 0x%lx[+%d] "
- "bit_ofs: %u bit_len: %u",
- g->field_length, g->bit_ptr,
- (byte*) g->bit_ptr-table->record[0],
+ "bit_ofs: %d bit_len: %u",
+ g->field_length, (long) g->bit_ptr,
+ (int) ((byte*) g->bit_ptr -
+ table->record[0]),
g->bit_ofs, g->bit_len));
}
}
@@ -606,11 +608,11 @@ static int ndbcluster_binlog_end(THD *thd)
{
DBUG_PRINT("share",
("[%d] 0x%lx key: %s key_length: %d",
- i, share, share->key, share->key_length));
+ i, (long) share, share->key, share->key_length));
DBUG_PRINT("share",
- ("db.tablename: %s.%s use_count: %d commit_count: %d",
+ ("db.tablename: %s.%s use_count: %d commit_count: %lu",
share->db, share->table_name,
- share->use_count, share->commit_count));
+ share->use_count, (long) share->commit_count));
}
}
pthread_mutex_unlock(&ndbcluster_mutex);
@@ -686,8 +688,8 @@ static NDB_SHARE *ndbcluster_check_apply_status_share()
void *share= hash_search(&ndbcluster_open_tables,
NDB_APPLY_TABLE_FILE,
sizeof(NDB_APPLY_TABLE_FILE) - 1);
- DBUG_PRINT("info",("ndbcluster_check_apply_status_share %s %p",
- NDB_APPLY_TABLE_FILE, share));
+ DBUG_PRINT("info",("ndbcluster_check_apply_status_share %s 0x%lx",
+ NDB_APPLY_TABLE_FILE, (long) share));
pthread_mutex_unlock(&ndbcluster_mutex);
return (NDB_SHARE*) share;
}
@@ -704,8 +706,8 @@ static NDB_SHARE *ndbcluster_check_schema_share()
void *share= hash_search(&ndbcluster_open_tables,
NDB_SCHEMA_TABLE_FILE,
sizeof(NDB_SCHEMA_TABLE_FILE) - 1);
- DBUG_PRINT("info",("ndbcluster_check_schema_share %s %p",
- NDB_SCHEMA_TABLE_FILE, share));
+ DBUG_PRINT("info",("ndbcluster_check_schema_share %s 0x%lx",
+ NDB_SCHEMA_TABLE_FILE, (long) share));
pthread_mutex_unlock(&ndbcluster_mutex);
return (NDB_SHARE*) share;
}
@@ -2761,10 +2763,9 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
if (share->flags & NSF_BLOB_FLAG)
op->mergeEvents(TRUE); // currently not inherited from event
- DBUG_PRINT("info", ("share->ndb_value[0]: 0x%x",
- share->ndb_value[0]));
- DBUG_PRINT("info", ("share->ndb_value[1]: 0x%x",
- share->ndb_value[1]));
+ DBUG_PRINT("info", ("share->ndb_value[0]: 0x%lx share->ndb_value[1]: 0x%lx",
+ (long) share->ndb_value[0],
+ (long) share->ndb_value[1]));
int n_columns= ndbtab->getNoOfColumns();
int n_fields= table ? table->s->fields : 0; // XXX ???
for (int j= 0; j < n_columns; j++)
@@ -2818,12 +2819,14 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
}
share->ndb_value[0][j].ptr= attr0.ptr;
share->ndb_value[1][j].ptr= attr1.ptr;
- DBUG_PRINT("info", ("&share->ndb_value[0][%d]: 0x%x "
- "share->ndb_value[0][%d]: 0x%x",
- j, &share->ndb_value[0][j], j, attr0.ptr));
- DBUG_PRINT("info", ("&share->ndb_value[1][%d]: 0x%x "
- "share->ndb_value[1][%d]: 0x%x",
- j, &share->ndb_value[0][j], j, attr1.ptr));
+ DBUG_PRINT("info", ("&share->ndb_value[0][%d]: 0x%lx "
+ "share->ndb_value[0][%d]: 0x%lx",
+ j, (long) &share->ndb_value[0][j],
+ j, (long) attr0.ptr));
+ DBUG_PRINT("info", ("&share->ndb_value[1][%d]: 0x%lx "
+ "share->ndb_value[1][%d]: 0x%lx",
+ j, (long) &share->ndb_value[0][j],
+ j, (long) attr1.ptr));
}
op->setCustomData((void *) share); // set before execute
share->op= op; // assign op in NDB_SHARE
@@ -2866,8 +2869,8 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
(void) pthread_cond_signal(&injector_cond);
}
- DBUG_PRINT("info",("%s share->op: 0x%lx, share->use_count: %u",
- share->key, share->op, share->use_count));
+ DBUG_PRINT("info",("%s share->op: 0x%lx share->use_count: %u",
+ share->key, (long) share->op, share->use_count));
if (ndb_extra_logging)
sql_print_information("NDB Binlog: logging %s", share->key);
@@ -3052,10 +3055,11 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
free_share(&apply_status_share);
apply_status_share= 0;
}
- DBUG_PRINT("info", ("CLUSTER FAILURE EVENT: "
- "%s received share: 0x%lx op: %lx share op: %lx "
- "op_old: %lx",
- share->key, share, pOp, share->op, share->op_old));
+ DBUG_PRINT("error", ("CLUSTER FAILURE EVENT: "
+ "%s received share: 0x%lx op: 0x%lx share op: 0x%lx "
+ "op_old: 0x%lx",
+ share->key, (long) share, (long) pOp,
+ (long) share->op, (long) share->op_old));
break;
case NDBEVENT::TE_DROP:
if (apply_status_share == share)
@@ -3073,10 +3077,11 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
// fall through
case NDBEVENT::TE_ALTER:
row.n_schemaops++;
- DBUG_PRINT("info", ("TABLE %s EVENT: %s received share: 0x%lx op: %lx "
- "share op: %lx op_old: %lx",
- type == NDBEVENT::TE_DROP ? "DROP" : "ALTER",
- share->key, share, pOp, share->op, share->op_old));
+ DBUG_PRINT("info", ("TABLE %s EVENT: %s received share: 0x%lx op: 0x%lx "
+ "share op: 0x%lx op_old: 0x%lx",
+ type == NDBEVENT::TE_DROP ? "DROP" : "ALTER",
+ share->key, (long) share, (long) pOp,
+ (long) share->op, (long) share->op_old));
break;
case NDBEVENT::TE_NODE_FAILURE:
/* fall through */
@@ -3476,7 +3481,6 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
global_system_variables.binlog_format == BINLOG_FORMAT_MIXED)
{
ndb_binlog_running= TRUE;
- thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
}
else
{
@@ -3554,7 +3558,8 @@ restart:
}
}
// now check that we have epochs consistant with what we had before the restart
- DBUG_PRINT("info", ("schema_res: %d schema_gci: %d", schema_res, schema_gci));
+ DBUG_PRINT("info", ("schema_res: %d schema_gci: %lu", schema_res,
+ (long) schema_gci));
{
i_ndb->flushIncompleteEvents(schema_gci);
s_ndb->flushIncompleteEvents(schema_gci);
@@ -3598,9 +3603,11 @@ restart:
if (do_ndbcluster_binlog_close_connection)
{
DBUG_PRINT("info", ("do_ndbcluster_binlog_close_connection: %d, "
- "ndb_latest_handled_binlog_epoch: %llu, "
- "*p_latest_trans_gci: %llu", do_ndbcluster_binlog_close_connection,
- ndb_latest_handled_binlog_epoch, *p_latest_trans_gci));
+ "ndb_latest_handled_binlog_epoch: %lu, "
+ "*p_latest_trans_gci: %lu",
+ do_ndbcluster_binlog_close_connection,
+ (ulong) ndb_latest_handled_binlog_epoch,
+ (ulong) *p_latest_trans_gci));
}
#endif
#ifdef RUN_NDB_BINLOG_TIMER
@@ -3688,9 +3695,10 @@ restart:
do_ndbcluster_binlog_close_connection= BCCC_restart;
if (ndb_latest_received_binlog_epoch < *p_latest_trans_gci && ndb_binlog_running)
{
- sql_print_error("NDB Binlog: latest transaction in epoch %lld not in binlog "
- "as latest received epoch is %lld",
- *p_latest_trans_gci, ndb_latest_received_binlog_epoch);
+ sql_print_error("NDB Binlog: latest transaction in epoch %lu not in binlog "
+ "as latest received epoch is %lu",
+ (ulong) *p_latest_trans_gci,
+ (ulong) ndb_latest_received_binlog_epoch);
}
}
}
@@ -3738,8 +3746,8 @@ restart:
!= NULL)
{
NDB_SHARE *share= (NDB_SHARE*)gci_op->getCustomData();
- DBUG_PRINT("info", ("per gci_op: %p share: %p event_types: 0x%x",
- gci_op, share, event_types));
+ DBUG_PRINT("info", ("per gci_op: 0x%lx share: 0x%lx event_types: 0x%x",
+ (long) gci_op, (long) share, event_types));
// workaround for interface returning TE_STOP events
// which are normally filtered out below in the nextEvent loop
if ((event_types & ~NdbDictionary::Event::TE_STOP) == 0)
@@ -3825,11 +3833,13 @@ restart:
{
NDB_SHARE *share= (NDB_SHARE*) pOp->getCustomData();
DBUG_PRINT("info",
- ("EVENT TYPE: %d GCI: %lld last applied: %lld "
- "share: 0x%lx (%s.%s)", pOp->getEventType(), gci,
- ndb_latest_applied_binlog_epoch, share,
- share ? share->db : "share == NULL",
- share ? share->table_name : ""));
+ ("EVENT TYPE: %d GCI: %ld last applied: %ld "
+ "share: 0x%lx (%s.%s)", pOp->getEventType(),
+ (long) gci,
+ (long) ndb_latest_applied_binlog_epoch,
+ (long) share,
+ share ? share->db : "'NULL'",
+ share ? share->table_name : "'NULL'"));
DBUG_ASSERT(share != 0);
}
// assert that there is consistancy between gci op list
@@ -3874,9 +3884,10 @@ restart:
do_ndbcluster_binlog_close_connection= BCCC_restart;
if (ndb_latest_received_binlog_epoch < *p_latest_trans_gci && ndb_binlog_running)
{
- sql_print_error("NDB Binlog: latest transaction in epoch %lld not in binlog "
- "as latest received epoch is %lld",
- *p_latest_trans_gci, ndb_latest_received_binlog_epoch);
+ sql_print_error("NDB Binlog: latest transaction in epoch %lu not in binlog "
+ "as latest received epoch is %lu",
+ (ulong) *p_latest_trans_gci,
+ (ulong) ndb_latest_received_binlog_epoch);
}
}
}
@@ -3908,7 +3919,7 @@ restart:
row.master_log_file= start.file_name();
row.master_log_pos= start.file_pos();
- DBUG_PRINT("info", ("COMMIT gci: %lld", gci));
+ DBUG_PRINT("info", ("COMMIT gci: %lu", (ulong) gci));
if (ndb_update_binlog_index)
ndb_add_binlog_index(thd, &row);
ndb_latest_applied_binlog_epoch= gci;