Commit d90516a8 authored by vasil's avatar vasil

branches/zip:

Fix a bug where the condition (prtype & DATA_ROW_ID) is unexpectedly
always false becasue DATA_ROW_ID is 0.

Use a switch instead of if-else in order to avoid repeating
(prtype & DATA_SYS_PRTYPE_MASK).

Approved by:	Heikki
parent 23f80a6f
......@@ -411,22 +411,29 @@ dfield_print_also_hex(
break;
case DATA_SYS:
if (prtype & DATA_TRX_ID) {
switch (prtype & DATA_SYS_PRTYPE_MASK) {
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));
} else if (prtype & DATA_ROLL_PTR) {
break;
case DATA_ROLL_PTR:
id = mach_read_from_7(data);
fprintf(stderr, "roll_ptr {%lu %lu}",
ut_dulint_get_high(id), ut_dulint_get_low(id));
} else if (prtype & DATA_ROW_ID) {
break;
case DATA_ROW_ID:
id = mach_read_from_6(data);
fprintf(stderr, "row_id {%lu %lu}",
ut_dulint_get_high(id), ut_dulint_get_low(id));
} else {
break;
default:
id = mach_dulint_read_compressed(data);
fprintf(stderr, "mix_id {%lu %lu}",
......
......@@ -122,6 +122,8 @@ be less than 256 */
#define DATA_N_SYS_COLS 3 /* number of system columns defined above */
#define DATA_SYS_PRTYPE_MASK 0xF /* mask to extract the above from prtype */
/* Flags ORed to the precise data type */
#define DATA_NOT_NULL 256 /* this is ORed to the precise type when
the column is declared as NOT NULL */
......
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