Skip to content

Commit

Permalink
Implement #7425: Add REPLICA MODE to the output of the isql SHOW DATA…
Browse files Browse the repository at this point in the history
…BASE command
  • Loading branch information
dyemanov committed Apr 20, 2023
1 parent 5af209a commit 59af726
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/isql/show.epp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ static const UCHAR db_items[] =
fb_info_wire_crypt,
fb_info_creation_timestamp_tz,
isc_info_creation_date,
fb_info_replica_mode,
isc_info_end
};

Expand Down Expand Up @@ -587,9 +588,9 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
struct tm time;
isc_decode_timestamp(&ts, &time);

sprintf(info, "Creation date: %s %d, %d %d:%02d:%02d\n",
sprintf(info, "Creation date: %s %d, %d %d:%02d:%02d%s",
FB_SHORT_MONTHS[time.tm_mon], time.tm_mday, time.tm_year + 1900,
time.tm_hour, time.tm_min, time.tm_sec);
time.tm_hour, time.tm_min, time.tm_sec, separator);
}
break;

Expand All @@ -614,9 +615,9 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
if (ISQL_errmsg(fbStatus))
break;

sprintf(info, "Creation date: %s %d, %d %d:%02d:%02d %s\n",
sprintf(info, "Creation date: %s %d, %d %d:%02d:%02d %s%s",
FB_SHORT_MONTHS[month - 1], day, year,
hours, minutes, seconds, timeZone);
hours, minutes, seconds, timeZone, separator);

crdatePrinted = true;
}
Expand All @@ -643,6 +644,18 @@ bool SHOW_dbb_parameters(Firebird::IAttachment* db_handle,
break;
#endif

case fb_info_replica_mode:
{
value_out = p.getInt();
const char* mode =
(value_out == fb_info_replica_none) ? "NONE" :
(value_out == fb_info_replica_read_only) ? "READ_ONLY" :
(value_out == fb_info_replica_read_write) ? "READ_WRITE" :
"unknown";
sprintf(info, "Replica mode: %s%s", mode, separator);
}
break;

case isc_info_truncated:
return info > info_buf; // If we got some items, we are (partially) successful.
}
Expand Down

0 comments on commit 59af726

Please sign in to comment.