Commit 74ac13f0 authored by vasil's avatar vasil

branches/zip:

Change the output format of transaction ids from 2 32bit numbers separated
by space to a single hex number.

Suggested by:	Heikki
Approved by:	Heikki
parent 81b55378
......@@ -973,9 +973,8 @@ btr_cur_trx_report(
const dict_index_t* index, /* in: index */
const char* op) /* in: operation */
{
fprintf(stderr, "Trx with id %lu %lu going to ",
ut_dulint_get_high(trx->id),
ut_dulint_get_low(trx->id));
fprintf(stderr, "Trx with id " TRX_ID_FMT " going to ",
TRX_ID_PREP_PRINTF(trx->id));
fputs(op, stderr);
dict_index_name_print(stderr, trx, index);
putc('\n', stderr);
......
......@@ -416,8 +416,8 @@ dfield_print_also_hex(
case DATA_TRX_ID:
id = mach_read_from_6(data);
fprintf(stderr, "trx_id {%lu %lu}",
ut_dulint_get_high(id), ut_dulint_get_low(id));
fprintf(stderr, "trx_id " TRX_ID_FMT,
TRX_ID_PREP_PRINTF(id));
break;
case DATA_ROLL_PTR:
......
......@@ -12,6 +12,12 @@ Created 3/26/1996 Heikki Tuuri
#include "lock0types.h"
#include "ut0byte.h"
/* prepare trx_t::id for being printed via printf(3) */
#define TRX_ID_PREP_PRINTF(id) (ullint) ut_conv_dulint_to_longlong(id)
/* printf(3) format used for printing TRX_ID_PRINTF_PREP() */
#define TRX_ID_FMT "%llX"
/* Memory objects */
typedef struct trx_struct trx_t;
typedef struct trx_sys_struct trx_sys_t;
......
......@@ -463,14 +463,12 @@ lock_check_trx_id_sanity(
fputs("InnoDB: in ", stderr);
dict_index_name_print(stderr, NULL, index);
fprintf(stderr, "\n"
"InnoDB: is %lu %lu which is higher than the"
" global trx id counter %lu %lu!\n"
"InnoDB: is " TRX_ID_FMT " which is higher than the"
" global trx id counter " TRX_ID_FMT "!\n"
"InnoDB: The table is corrupt. You have to do"
" dump + drop + reimport.\n",
(ulong) ut_dulint_get_high(trx_id),
(ulong) ut_dulint_get_low(trx_id),
(ulong) ut_dulint_get_high(trx_sys->max_trx_id),
(ulong) ut_dulint_get_low(trx_sys->max_trx_id));
TRX_ID_PREP_PRINTF(trx_id),
TRX_ID_PREP_PRINTF(trx_sys->max_trx_id));
is_ok = FALSE;
}
......@@ -4143,8 +4141,8 @@ lock_table_print(
fputs("TABLE LOCK table ", file);
ut_print_name(file, lock->trx, TRUE,
lock->un_member.tab_lock.table->name);
fprintf(file, " trx id %lu %lu",
(ulong) (lock->trx)->id.high, (ulong) (lock->trx)->id.low);
fprintf(file, " trx id " TRX_ID_FMT,
TRX_ID_PREP_PRINTF(lock->trx->id));
if (lock_get_mode(lock) == LOCK_S) {
fputs(" lock mode S", file);
......@@ -4197,9 +4195,8 @@ lock_rec_print(
(ulong) space, (ulong) page_no,
(ulong) lock_rec_get_n_bits(lock));
dict_index_name_print(file, lock->trx, lock->index);
fprintf(file, " trx id %lu %lu",
(ulong) (lock->trx)->id.high,
(ulong) (lock->trx)->id.low);
fprintf(file, " trx id " TRX_ID_FMT,
TRX_ID_PREP_PRINTF(lock->trx->id));
if (lock_get_mode(lock) == LOCK_S) {
fputs(" lock mode S", file);
......@@ -4316,16 +4313,14 @@ lock_print_info_summary(
"TRANSACTIONS\n"
"------------\n", file);
fprintf(file, "Trx id counter %lu %lu\n",
(ulong) ut_dulint_get_high(trx_sys->max_trx_id),
(ulong) ut_dulint_get_low(trx_sys->max_trx_id));
fprintf(file, "Trx id counter " TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(trx_sys->max_trx_id));
fprintf(file,
"Purge done for trx's n:o < %lu %lu undo n:o < %lu %lu\n",
(ulong) ut_dulint_get_high(purge_sys->purge_trx_no),
(ulong) ut_dulint_get_low(purge_sys->purge_trx_no),
(ulong) ut_dulint_get_high(purge_sys->purge_undo_no),
(ulong) ut_dulint_get_low(purge_sys->purge_undo_no));
"Purge done for trx's n:o < " TRX_ID_FMT
" undo n:o < " TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(purge_sys->purge_trx_no),
TRX_ID_PREP_PRINTF(purge_sys->purge_undo_no));
fprintf(file,
"History list length %lu\n",
......@@ -4398,14 +4393,11 @@ loop:
if (trx->read_view) {
fprintf(file,
"Trx read view will not see trx with"
" id >= %lu %lu, sees < %lu %lu\n",
(ulong) ut_dulint_get_high(
" id >= " TRX_ID_FMT
", sees < " TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(
trx->read_view->low_limit_id),
(ulong) ut_dulint_get_low(
trx->read_view->low_limit_id),
(ulong) ut_dulint_get_high(
trx->read_view->up_limit_id),
(ulong) ut_dulint_get_low(
TRX_ID_PREP_PRINTF(
trx->read_view->up_limit_id));
}
......
......@@ -363,23 +363,19 @@ read_view_print(
(ulong) ut_dulint_get_high(view->low_limit_no),
(ulong) ut_dulint_get_low(view->low_limit_no));
fprintf(stderr, "Read view up limit trx id %lu %lu\n",
(ulong) ut_dulint_get_high(view->up_limit_id),
(ulong) ut_dulint_get_low(view->up_limit_id));
fprintf(stderr, "Read view up limit trx id " TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(view->up_limit_id));
fprintf(stderr, "Read view low limit trx id %lu %lu\n",
(ulong) ut_dulint_get_high(view->low_limit_id),
(ulong) ut_dulint_get_low(view->low_limit_id));
fprintf(stderr, "Read view low limit trx id " TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(view->low_limit_id));
fprintf(stderr, "Read view individually stored trx ids:\n");
n_ids = view->n_trx_ids;
for (i = 0; i < n_ids; i++) {
fprintf(stderr, "Read view trx id %lu %lu\n",
(ulong) ut_dulint_get_high(
read_view_get_nth_trx_id(view, i)),
(ulong) ut_dulint_get_low(
fprintf(stderr, "Read view trx id " TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(
read_view_get_nth_trx_id(view, i)));
}
}
......
......@@ -1144,11 +1144,10 @@ trx_purge_sys_print(void)
fprintf(stderr, "InnoDB: Purge system view:\n");
read_view_print(purge_sys->view);
fprintf(stderr, "InnoDB: Purge trx n:o %lu %lu, undo n_o %lu %lu\n",
(ulong) ut_dulint_get_high(purge_sys->purge_trx_no),
(ulong) ut_dulint_get_low(purge_sys->purge_trx_no),
(ulong) ut_dulint_get_high(purge_sys->purge_undo_no),
(ulong) ut_dulint_get_low(purge_sys->purge_undo_no));
fprintf(stderr, "InnoDB: Purge trx n:o " TRX_ID_FMT
", undo n:o " TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(purge_sys->purge_trx_no),
TRX_ID_PREP_PRINTF(purge_sys->purge_undo_no));
fprintf(stderr,
"InnoDB: Purge next stored %lu, page_no %lu, offset %lu,\n"
"InnoDB: Purge hdr_page_no %lu, hdr_offset %lu\n",
......
......@@ -1440,14 +1440,12 @@ trx_undo_prev_version_build(
"InnoDB: record version ", stderr);
rec_print_new(stderr, rec, offsets);
fprintf(stderr, "\n"
"InnoDB: Record trx id %lu %lu, update rec"
" trx id %lu %lu\n"
"InnoDB: Record trx id " TRX_ID_FMT
", update rec trx id " TRX_ID_FMT "\n"
"InnoDB: Roll ptr in rec %lu %lu, in update rec"
" %lu %lu\n",
(ulong) ut_dulint_get_high(rec_trx_id),
(ulong) ut_dulint_get_low(rec_trx_id),
(ulong) ut_dulint_get_high(trx_id),
(ulong) ut_dulint_get_low(trx_id),
TRX_ID_PREP_PRINTF(rec_trx_id),
TRX_ID_PREP_PRINTF(trx_id),
(ulong) ut_dulint_get_high(old_roll_ptr),
(ulong) ut_dulint_get_low(old_roll_ptr),
(ulong) ut_dulint_get_high(roll_ptr),
......
......@@ -436,10 +436,9 @@ trx_rollback_active(
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Rolling back trx with id %lu %lu, %lu%s"
" InnoDB: Rolling back trx with id " TRX_ID_FMT ", %lu%s"
" rows to undo\n",
(ulong) ut_dulint_get_high(trx->id),
(ulong) ut_dulint_get_low(trx->id),
TRX_ID_PREP_PRINTF(trx->id),
(ulong) rows_to_undo, unit);
mutex_exit(&kernel_mutex);
......@@ -501,9 +500,9 @@ trx_rollback_active(
row_mysql_unlock_data_dictionary(trx);
}
fprintf(stderr, "\nInnoDB: Rolling back of trx id %lu %lu completed\n",
(ulong) ut_dulint_get_high(trx->id),
(ulong) ut_dulint_get_low(trx->id));
fprintf(stderr, "\nInnoDB: Rolling back of trx id " TRX_ID_FMT
" completed\n",
TRX_ID_PREP_PRINTF(trx->id));
mem_heap_free(heap);
trx_roll_crash_recv_trx = NULL;
......@@ -556,9 +555,9 @@ loop:
case TRX_COMMITTED_IN_MEMORY:
mutex_exit(&kernel_mutex);
fprintf(stderr,
"InnoDB: Cleaning up trx with id %lu %lu\n",
(ulong) ut_dulint_get_high(trx->id),
(ulong) ut_dulint_get_low(trx->id));
"InnoDB: Cleaning up trx with id "
TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(trx->id));
trx_cleanup_at_db_startup(trx);
goto loop;
......
......@@ -978,9 +978,8 @@ trx_sys_init_at_db_start(void)
(ulong) UT_LIST_GET_LEN(trx_sys->trx_list),
(ulong) rows_to_undo, unit);
fprintf(stderr, "InnoDB: Trx id counter is %lu %lu\n",
(ulong) ut_dulint_get_high(trx_sys->max_trx_id),
(ulong) ut_dulint_get_low(trx_sys->max_trx_id));
fprintf(stderr, "InnoDB: Trx id counter is " TRX_ID_FMT "\n",
TRX_ID_PREP_PRINTF(trx_sys->max_trx_id));
}
UT_LIST_INIT(trx_sys->view_list);
......
......@@ -429,11 +429,11 @@ trx_lists_init_at_db_start(void)
if (undo->state == TRX_UNDO_PREPARED) {
fprintf(stderr,
"InnoDB: Transaction %lu %lu"
"InnoDB: Transaction "
TRX_ID_FMT
" was in the"
" XA prepared state.\n",
ut_dulint_get_high(trx->id),
ut_dulint_get_low(trx->id));
TRX_ID_PREP_PRINTF(trx->id));
if (srv_force_recovery == 0) {
......@@ -506,12 +506,10 @@ trx_lists_init_at_db_start(void)
if (undo->state == TRX_UNDO_PREPARED) {
fprintf(stderr,
"InnoDB: Transaction"
" %lu %lu was in the"
"InnoDB: Transaction "
TRX_ID_FMT " was in the"
" XA prepared state.\n",
ut_dulint_get_high(
trx->id),
ut_dulint_get_low(
TRX_ID_PREP_PRINTF(
trx->id));
if (srv_force_recovery == 0) {
......@@ -1605,9 +1603,7 @@ trx_print(
{
ibool newline;
fprintf(f, "TRANSACTION %lu %lu",
(ulong) ut_dulint_get_high(trx->id),
(ulong) ut_dulint_get_low(trx->id));
fprintf(f, "TRANSACTION " TRX_ID_FMT, TRX_ID_PREP_PRINTF(trx->id));
switch (trx->conc_state) {
case TRX_NOT_STARTED:
......@@ -1935,10 +1931,9 @@ trx_recover_for_mysql(
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Transaction %lu %lu in"
" InnoDB: Transaction " TRX_ID_FMT " in"
" prepared state after recovery\n",
(ulong) ut_dulint_get_high(trx->id),
(ulong) ut_dulint_get_low(trx->id));
TRX_ID_PREP_PRINTF(trx->id));
ut_print_timestamp(stderr);
fprintf(stderr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment