From 5f45045849c45548e288bd770ad98ff381374bf4 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 29 Sep 2022 13:51:05 -0400 Subject: [PATCH] 2022-09-29 Fred Gleason * Modified rddbmgr(8) to include the Realm name in its default output. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ utils/rddbmgr/printstatus.cpp | 26 ++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index efc12507..4d583716 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23412,3 +23412,6 @@ package. 2022-09-28 Fred Gleason * Updated the 'helpers/rdtrans.sh' utility. +2022-09-29 Fred Gleason + * Modified rddbmgr(8) to include the Realm name in its default + output. diff --git a/utils/rddbmgr/printstatus.cpp b/utils/rddbmgr/printstatus.cpp index c3ca9888..ae6b65c7 100644 --- a/utils/rddbmgr/printstatus.cpp +++ b/utils/rddbmgr/printstatus.cpp @@ -2,7 +2,7 @@ // // Print the status of a database. // -// (C) Copyright 2018-2021 Fred Gleason +// (C) Copyright 2018-2022 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -39,9 +39,27 @@ bool MainObject::PrintStatus(QString *err_msg) const printf("not a Rivendell database!\n"); return true; } - - printf("Rivendell database, schema %d [%s]\n",schema, - GetSchemaVersion(schema).toUtf8().constData()); + if(schema>=353) { + sql=QString("select ")+ + "`REALM_NAME` "+ // 00 + "from `SYSTEM`"; + q=new RDSqlQuery(sql); + if(q->first()) { + printf("Rivendell database, schema %d [%s] (%s)\n",schema, + GetSchemaVersion(schema).toUtf8().constData(), + q->value(0).toString().toUtf8().constData()); + } + else { + fprintf(stderr,"rddbmgr: WARNING - unable to read Realm value.\n"); + printf("Rivendell database, schema %d [%s]\n",schema, + GetSchemaVersion(schema).toUtf8().constData()); + } + delete q; + } + else { + printf("Rivendell database, schema %d [%s]\n",schema, + GetSchemaVersion(schema).toUtf8().constData()); + } *err_msg="ok"; return true;