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