diff --git a/doc/README.fbsvcmgr b/doc/README.fbsvcmgr index 1fd8f44b27..cb4f579966 100644 --- a/doc/README.fbsvcmgr +++ b/doc/README.fbsvcmgr @@ -64,10 +64,11 @@ first for correct form. 3. Everything concerning licensing was removed from interbase 6.0 and therefore not supported here. Config file view/modification is not supported in firebird since 1.5 and therefore is not implemented -here. isc_info_svc_limbo_trans and appropriate information items never worked in interbase 6.0, do -not work now in firebird and therefore not supported by fbsvcmgr. +here. -4. Two new items, not mentioned by Borland beta documentation, were added to firebird 2.1 and are +4. isc_spb_rpr_list_limbo_trans was forgotten in Borland beta documentation, but present in fbsvcmgr. + +5. Two new items, not mentioned by Borland beta documentation, were added to firebird 2.1 and are supported by fbsvcmgr. One of them works only for windows, this is isc_spb_trusted_auth, which (type as trusted_auth) forces use of windows trusted authentication by firebird. Another one is availability to set (isc_spb_)dbname parameter in all security database related actions, it's an diff --git a/src/msgs/facilities2.sql b/src/msgs/facilities2.sql index 77f5e7f8f9..4a4fec7569 100644 --- a/src/msgs/facilities2.sql +++ b/src/msgs/facilities2.sql @@ -29,7 +29,7 @@ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUM ('2002-03-05 02:30:12', 'LICENSE', 19, 60) ('2002-03-05 02:31:54', 'DOS', 20, 74) ('2007-04-07 13:11:00', 'GSTAT', 21, 37) -('2007-05-02 13:15:27', 'FBSVCMGR', 22, 34) +('2007-05-02 13:15:27', 'FBSVCMGR', 22, 47) stop COMMIT WORK; diff --git a/src/msgs/messages2.sql b/src/msgs/messages2.sql index a154d31de3..fa75a6651d 100644 --- a/src/msgs/messages2.sql +++ b/src/msgs/messages2.sql @@ -3202,6 +3202,19 @@ Analyzing database pages ...', NULL, NULL); ('', 'usage', 'gserv.cpp', NULL, 22, 31, NULL, ' (will list header info in database employee on local machine)', NULL, NULL); ('', 'usage', 'gserv.cpp', NULL, 22, 32, NULL, 'fbsvcmgr yourserver:service_mgr user sysdba password masterke info_server_version info_svr_db_info', NULL, NULL); ('', 'usage', 'gserv.cpp', NULL, 22, 33, NULL, ' (will show firebird version and databases usage on yourserver)', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 34, NULL, 'Transaction @1 is in limbo', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 35, NULL, 'Multidatabase transaction @1 is in limbo', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 36, NULL, 'Host Site: @1', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 37, NULL, 'Transaction @1', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 38, NULL, 'has been prepared', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 39, NULL, 'has been committed', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 40, NULL, 'has been rolled back', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 41, NULL, 'is not available', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 42, NULL, 'Remote Site: @1', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 43, NULL, 'Database Path: @1', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 44, NULL, 'Automated recovery would commit this transaction', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 45, NULL, 'Automated recovery would rollback this transaction', NULL, NULL); +('', 'printInfo', 'gserv.cpp', NULL, 22, 46, NULL, 'No idea should it be commited or rolled back', NULL, NULL); stop COMMIT WORK; diff --git a/src/utilities/fbsvcmgr.cpp b/src/utilities/fbsvcmgr.cpp index b71f5103c7..6b4470fd15 100644 --- a/src/utilities/fbsvcmgr.cpp +++ b/src/utilities/fbsvcmgr.cpp @@ -294,6 +294,7 @@ const Switches repairOptions[] = { {"rpr_validate_db", putOption, 0, isc_spb_rpr_validate_db, 0}, {"rpr_full", putOption, 0, isc_spb_rpr_full, 0}, {"rpr_sweep_db", putOption, 0, isc_spb_rpr_sweep_db, 0}, + {"rpr_list_limbo_trans", putOption, 0, isc_spb_rpr_list_limbo_trans, isc_info_svc_limbo_trans}, {0, 0, 0, 0, 0} }; @@ -378,6 +379,11 @@ void printString(const char*& p, int num) } } +void printMessage(int num) +{ + printf ("%s\n", getMessage(num).c_str()); +} + void printNumeric(const char*& p, int num) { printf ("%s: %d\n", getMessage(num).c_str(), getNumeric(p)); @@ -473,6 +479,73 @@ bool printInfo(const char* p, UserPrint& up) p++; break; + case isc_info_svc_limbo_trans: + while (*p != isc_info_flag_end) { + switch (*p++) + { + case isc_spb_tra_host_site: + printString(p, 36); + break; + case isc_spb_tra_state: + switch(*p++) + { + case isc_spb_tra_state_limbo: + printMessage(38); + break; + case isc_spb_tra_state_commit: + printMessage(39); + break; + case isc_spb_tra_state_rollback: + printMessage(40); + break; + case isc_spb_tra_state_unknown: + printMessage(41); + break; + default: + Firebird::status_exception::raise(isc_fbsvcmgr_info_err, isc_arg_number, + static_cast(p[-1]), 0); + } + break; + case isc_spb_tra_remote_site: + printString(p, 42); + break; + case isc_spb_tra_db_path: + printString(p, 43); + break; + case isc_spb_tra_advise: + switch(*p++) + { + case isc_spb_tra_advise_commit: + printMessage(44); + break; + case isc_spb_tra_advise_rollback: + printMessage(45); + break; + case isc_spb_tra_advise_unknown: + printMessage(46); + break; + default: + Firebird::status_exception::raise(isc_fbsvcmgr_info_err, isc_arg_number, + static_cast(p[-1]), 0); + } + break; + case isc_spb_multi_tra_id: + printNumeric(p, 35); + break; + case isc_spb_single_tra_id: + printNumeric(p, 34); + break; + case isc_spb_tra_id: + printNumeric(p, 37); + break; + default: + Firebird::status_exception::raise(isc_fbsvcmgr_info_err, isc_arg_number, + static_cast(p[-1]), 0); + } + } + p++; + break; + case isc_info_svc_get_users: p += sizeof(unsigned short); break;