mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:03:02 +01:00
Fixed CORE-6478. Added -replica switch to gbak. Support all replication features in the Services API.
This commit is contained in:
parent
03910bb920
commit
2e0957f08a
@ -2830,6 +2830,8 @@ C --
|
||||
PARAMETER (GDS__fbsvcmgr_limbo_state = 336986171)
|
||||
INTEGER*4 GDS__fbsvcmgr_limbo_advise
|
||||
PARAMETER (GDS__fbsvcmgr_limbo_advise = 336986172)
|
||||
INTEGER*4 GDS__fbsvcmgr_bad_rm
|
||||
PARAMETER (GDS__fbsvcmgr_bad_rm = 336986173)
|
||||
INTEGER*4 GDS__utl_trusted_switch
|
||||
PARAMETER (GDS__utl_trusted_switch = 337051649)
|
||||
INTEGER*4 GDS__nbackup_missing_param
|
||||
|
@ -2825,6 +2825,8 @@ const
|
||||
gds_fbsvcmgr_limbo_state = 336986171;
|
||||
isc_fbsvcmgr_limbo_advise = 336986172;
|
||||
gds_fbsvcmgr_limbo_advise = 336986172;
|
||||
isc_fbsvcmgr_bad_rm = 336986173;
|
||||
gds_fbsvcmgr_bad_rm = 336986173;
|
||||
isc_utl_trusted_switch = 337051649;
|
||||
gds_utl_trusted_switch = 337051649;
|
||||
isc_nbackup_missing_param = 337117213;
|
||||
|
@ -226,13 +226,13 @@ int alice(Firebird::UtilSvc* uSvc)
|
||||
{
|
||||
ALICE_upper_case(*argv, string, sizeof(string));
|
||||
bool found = true;
|
||||
if (strcmp(string, "NORMAL") == 0)
|
||||
if (strcmp(string, ALICE_SW_SHUT_NORMAL) == 0)
|
||||
tdgbl->ALICE_data.ua_shutdown_mode = SHUT_NORMAL;
|
||||
else if (strcmp(string, "MULTI") == 0)
|
||||
else if (strcmp(string, ALICE_SW_SHUT_MULTI) == 0)
|
||||
tdgbl->ALICE_data.ua_shutdown_mode = SHUT_MULTI;
|
||||
else if (strcmp(string, "SINGLE") == 0)
|
||||
else if (strcmp(string, ALICE_SW_SHUT_SINGLE) == 0)
|
||||
tdgbl->ALICE_data.ua_shutdown_mode = SHUT_SINGLE;
|
||||
else if (strcmp(string, "FULL") == 0)
|
||||
else if (strcmp(string, ALICE_SW_SHUT_FULL) == 0)
|
||||
tdgbl->ALICE_data.ua_shutdown_mode = SHUT_FULL;
|
||||
else
|
||||
found = false;
|
||||
@ -455,7 +455,7 @@ int alice(Firebird::UtilSvc* uSvc)
|
||||
|
||||
ALICE_upper_case(*argv++, string, sizeof(string));
|
||||
|
||||
if (!strcmp(string, "NONE"))
|
||||
if (!strcmp(string, ALICE_SW_MODE_NONE))
|
||||
tdgbl->ALICE_data.ua_replica_mode = REPL_NONE;
|
||||
else if (!strcmp(string, ALICE_SW_MODE_RO))
|
||||
tdgbl->ALICE_data.ua_replica_mode = REPL_READ_ONLY;
|
||||
|
@ -126,9 +126,16 @@ enum alice_switches
|
||||
|
||||
static const char* const ALICE_SW_ASYNC = "ASYNC";
|
||||
static const char* const ALICE_SW_SYNC = "SYNC";
|
||||
|
||||
static const char* const ALICE_SW_MODE_NONE = "NONE";
|
||||
static const char* const ALICE_SW_MODE_RO = "READ_ONLY";
|
||||
static const char* const ALICE_SW_MODE_RW = "READ_WRITE";
|
||||
|
||||
static const char* const ALICE_SW_SHUT_NORMAL = "NORMAL";
|
||||
static const char* const ALICE_SW_SHUT_MULTI = "MULTI";
|
||||
static const char* const ALICE_SW_SHUT_SINGLE = "SINGLE";
|
||||
static const char* const ALICE_SW_SHUT_FULL = "FULL";
|
||||
|
||||
// Switch table
|
||||
static const Switches::in_sw_tab_t alice_in_sw_table[] =
|
||||
{
|
||||
@ -214,7 +221,7 @@ static const Switches::in_sw_tab_t alice_in_sw_table[] =
|
||||
// msg 43: \t-quit_log\tquit logging for replay utility
|
||||
*/
|
||||
#endif
|
||||
{IN_SW_ALICE_REPLICA, 0, "REPLICA", sw_replica,
|
||||
{IN_SW_ALICE_REPLICA, isc_spb_prp_replica_mode, "REPLICA", sw_replica,
|
||||
0, ~(sw_replica | sw_user | sw_password | sw_nolinger | sw_role), false, false, 134, 2, NULL},
|
||||
// msg 134: -replica access mode <none / read_only / read_write>
|
||||
{IN_SW_ALICE_ROLE, 0, "ROLE", sw_role,
|
||||
@ -304,9 +311,14 @@ static const Switches::in_sw_tab_t alice_in_sw_table[] =
|
||||
0, 0, false, false, 0, 0, NULL}
|
||||
};
|
||||
|
||||
static const char* alice_mode_sw_table[] =
|
||||
static const char* alice_shut_mode_sw_table[] =
|
||||
{
|
||||
"NORMAL", "MULTI", "SINGLE", "FULL"
|
||||
ALICE_SW_SHUT_NORMAL, ALICE_SW_SHUT_MULTI, ALICE_SW_SHUT_SINGLE, ALICE_SW_SHUT_FULL
|
||||
};
|
||||
|
||||
static const char* alice_repl_mode_sw_table[] =
|
||||
{
|
||||
ALICE_SW_MODE_NONE, ALICE_SW_MODE_RO, ALICE_SW_MODE_RW
|
||||
};
|
||||
|
||||
#endif // ALICE_ALICESWI_H
|
||||
|
@ -183,6 +183,7 @@ const UCHAR db_info_items[] =
|
||||
isc_info_no_reserve,
|
||||
isc_info_set_page_buffers,
|
||||
isc_info_db_read_only,
|
||||
fb_info_replica_mode,
|
||||
isc_info_end
|
||||
};
|
||||
const UCHAR limbo_tpb[] =
|
||||
@ -2590,7 +2591,7 @@ void write_database( const TEXT* dbb_file)
|
||||
// msg 31 isc_database_info failed
|
||||
}
|
||||
|
||||
USHORT page_size = 0, forced_writes, no_reserve, db_read_only;
|
||||
USHORT page_size = 0, forced_writes, no_reserve, db_read_only, replica_mode;
|
||||
ULONG sweep_interval, page_buffers;
|
||||
USHORT length = 0;
|
||||
for (const UCHAR* d = buffer; *d != isc_info_end; d += length)
|
||||
@ -2641,6 +2642,11 @@ void write_database( const TEXT* dbb_file)
|
||||
put_int32(att_db_read_only, db_read_only);
|
||||
break;
|
||||
|
||||
case fb_info_replica_mode:
|
||||
if (replica_mode = (USHORT) gds__vax_integer(d, length))
|
||||
put_int32(att_replica_mode, replica_mode);
|
||||
break;
|
||||
|
||||
default:
|
||||
BURP_error_redirect(&status_vector, 31);
|
||||
// msg 31 isc_database_info failed
|
||||
|
@ -140,7 +140,6 @@ static const StatFormat STAT_FORMATS[] =
|
||||
{"writes", "%6" UQUADFORMAT" ", 7}
|
||||
};
|
||||
|
||||
|
||||
int BURP_main(Firebird::UtilSvc* uSvc)
|
||||
{
|
||||
/**************************************
|
||||
@ -607,6 +606,7 @@ int gbak(Firebird::UtilSvc* uSvc)
|
||||
bool verbint = false;
|
||||
bool noGarbage = false, ignoreDamaged = false, noDbTrig = false;
|
||||
bool transportableMentioned = false;
|
||||
Firebird::string replicaMode;
|
||||
|
||||
for (int itr = 1; itr < argc; ++itr)
|
||||
{
|
||||
@ -1050,6 +1050,29 @@ int gbak(Firebird::UtilSvc* uSvc)
|
||||
tdgbl->gbl_sw_transportable = true;
|
||||
transportableMentioned = true;
|
||||
break;
|
||||
case IN_SW_BURP_REPLICA:
|
||||
if (replicaMode.length())
|
||||
BURP_error(333, true, SafeArg() << in_sw_tab->in_sw_name << replicaMode.c_str());
|
||||
if (++itr >= argc)
|
||||
{
|
||||
BURP_error(404, true);
|
||||
// msg 404: "none", "read_only" or "read_write" required
|
||||
}
|
||||
str = argv[itr];
|
||||
str.upper();
|
||||
if (str == BURP_SW_MODE_NONE)
|
||||
tdgbl->gbl_sw_replica = REPLICA_NONE;
|
||||
else if (str == BURP_SW_MODE_RO)
|
||||
tdgbl->gbl_sw_replica = REPLICA_READ_ONLY;
|
||||
else if (str == BURP_SW_MODE_RW)
|
||||
tdgbl->gbl_sw_replica = REPLICA_READ_WRITE;
|
||||
else
|
||||
{
|
||||
BURP_error(404, true);
|
||||
// msg 404: "none", "read_only" or "read_write" required
|
||||
}
|
||||
replicaMode = str;
|
||||
break;
|
||||
}
|
||||
} // for
|
||||
|
||||
@ -1275,6 +1298,8 @@ int gbak(Firebird::UtilSvc* uSvc)
|
||||
errNum = IN_SW_BURP_S;
|
||||
else if (tdgbl->gbl_sw_no_reserve)
|
||||
errNum = IN_SW_BURP_US;
|
||||
else if (tdgbl->gbl_sw_replica.isAssigned())
|
||||
errNum = IN_SW_BURP_REPLICA;
|
||||
|
||||
if (errNum != IN_SW_BURP_0)
|
||||
{
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "../common/classes/array.h"
|
||||
#include "../common/classes/fb_pair.h"
|
||||
#include "../common/classes/MetaString.h"
|
||||
#include "../common/classes/Nullable.h"
|
||||
#include "../common/SimilarToRegex.h"
|
||||
#include "../common/status.h"
|
||||
#include "../common/sha.h"
|
||||
@ -252,6 +253,7 @@ enum att_type {
|
||||
att_db_read_only, // Is the database ReadOnly?
|
||||
att_database_linger, // Disconnection timeout
|
||||
att_database_sql_security,// default sql security value
|
||||
att_replica_mode, // replica mode
|
||||
|
||||
// Relation attributes
|
||||
|
||||
@ -1013,6 +1015,7 @@ public:
|
||||
ULONG io_buffer_size;
|
||||
redirect_vals sw_redirect;
|
||||
bool burp_throw;
|
||||
Nullable<ReplicaMode> gbl_sw_replica;
|
||||
|
||||
UCHAR* blk_io_ptr;
|
||||
int blk_io_cnt;
|
||||
|
@ -97,9 +97,11 @@ const int IN_SW_BURP_KEYNAME = 50; // name of crypt key
|
||||
const int IN_SW_BURP_CRYPT = 51; // name of crypt plugin
|
||||
|
||||
const int IN_SW_BURP_INCLUDE_DATA = 52; // backup data from tables
|
||||
const int IN_SW_BURP_REPLICA = 53; // replica mode
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
static const char* const BURP_SW_MODE_NONE = "NONE";
|
||||
static const char* const BURP_SW_MODE_RO = "READ_ONLY";
|
||||
static const char* const BURP_SW_MODE_RW = "READ_WRITE";
|
||||
static const char* const BURP_SW_OVERWRITE = "OVERWRITE"; // recreate with overwrite
|
||||
@ -168,6 +170,8 @@ static const Switches::in_sw_tab_t reference_burp_in_sw_table[] =
|
||||
// msg 284: @1R(ECREATE_DATABASE) [O(VERWRITE)] create (or replace if OVERWRITE used) database from backup file
|
||||
{IN_SW_BURP_R, isc_spb_res_replace, "REPLACE_DATABASE", 0, 0, 0, false, true, 112, 3, NULL, boMain},
|
||||
// msg 112: @1REP(LACE_DATABASE) replace database from backup file
|
||||
{IN_SW_BURP_REPLICA, isc_spb_res_replica_mode, "REPLICA", 0, 0, 0, false, false, 403, 7, NULL, boRestore},
|
||||
// msg 403: @1REPLICA replica mode
|
||||
/**************************************************************
|
||||
** msg 252: @1RO(LE) Firebird SQL role
|
||||
***************************************************************/
|
||||
@ -223,6 +227,11 @@ static const Switches::in_sw_tab_t reference_burp_in_sw_table[] =
|
||||
{IN_SW_BURP_0, 0, NULL, 0, 0, 0, false, false, 0, 0, NULL, boGeneral}
|
||||
};
|
||||
|
||||
static const char* burp_repl_mode_sw_table[] =
|
||||
{
|
||||
BURP_SW_MODE_NONE, BURP_SW_MODE_RO, BURP_SW_MODE_RW
|
||||
};
|
||||
|
||||
|
||||
#endif // BURP_BURP_H
|
||||
|
||||
|
@ -562,13 +562,15 @@ int RESTORE_restore (const TEXT* file_name, const TEXT* database_name)
|
||||
add_access_dpb(tdgbl, dpb);
|
||||
|
||||
if (tdgbl->flag_on_line)
|
||||
{
|
||||
dpb.insertTag(isc_dpb_online);
|
||||
}
|
||||
|
||||
// set forced writes to the value which was in the header
|
||||
dpb.insertByte(isc_dpb_force_write, tdgbl->hdr_forced_writes ? 1 : 0);
|
||||
|
||||
// set up the replica mode, if needed
|
||||
if (tdgbl->gbl_sw_replica.isAssigned())
|
||||
dpb.insertByte(isc_dpb_set_db_replica, tdgbl->gbl_sw_replica.value);
|
||||
|
||||
Firebird::IAttachment* db_handle = provider->attachDatabase(&tdgbl->status_vector, database_name,
|
||||
dpb.getBufferLength(), dpb.getBuffer());
|
||||
if (tdgbl->status_vector->hasData())
|
||||
@ -847,6 +849,7 @@ void create_database(BurpGlobals* tdgbl, Firebird::IProvider* provider, const TE
|
||||
bool forced_writes = true; // turned on by default
|
||||
ULONG page_buffers = 0;
|
||||
USHORT SQL_dialect = 0;
|
||||
Nullable<ReplicaMode> replica_mode;
|
||||
|
||||
tdgbl->gbl_database_file_name = file_name;
|
||||
|
||||
@ -887,6 +890,10 @@ void create_database(BurpGlobals* tdgbl, Firebird::IProvider* provider, const TE
|
||||
page_buffers = get_int32(tdgbl);
|
||||
break;
|
||||
|
||||
case att_replica_mode:
|
||||
replica_mode = (ReplicaMode) get_int32(tdgbl);
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
const SSHORT l = get(tdgbl);
|
||||
@ -931,6 +938,9 @@ void create_database(BurpGlobals* tdgbl, Firebird::IProvider* provider, const TE
|
||||
tdgbl->gbl_sw_mode_val = db_read_only;
|
||||
}
|
||||
|
||||
if (!tdgbl->gbl_sw_replica.isAssigned())
|
||||
tdgbl->gbl_sw_replica = replica_mode;
|
||||
|
||||
if (tdgbl->gbl_sw_page_buffers)
|
||||
page_buffers = tdgbl->gbl_sw_page_buffers;
|
||||
|
||||
|
@ -353,6 +353,7 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
|
||||
case isc_spb_verbose:
|
||||
return SingleTpb;
|
||||
case isc_spb_res_access_mode:
|
||||
case isc_spb_res_replica_mode:
|
||||
return ByteSpb;
|
||||
}
|
||||
invalid_structure("unknown parameter for backup/restore", tag);
|
||||
@ -420,6 +421,7 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
|
||||
case isc_spb_prp_access_mode:
|
||||
case isc_spb_prp_shutdown_mode:
|
||||
case isc_spb_prp_online_mode:
|
||||
case isc_spb_prp_replica_mode:
|
||||
return ByteSpb;
|
||||
}
|
||||
invalid_structure("unknown parameter for setting database properties", tag);
|
||||
@ -461,6 +463,8 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
|
||||
{
|
||||
case isc_spb_dbname:
|
||||
return StringSpb;
|
||||
case isc_spb_options:
|
||||
return IntSpb;
|
||||
}
|
||||
invalid_structure("unknown parameter for nbackup", tag);
|
||||
break;
|
||||
|
@ -218,6 +218,14 @@
|
||||
#define isc_dpb_shut_single 0x30
|
||||
#define isc_dpb_shut_full 0x40
|
||||
|
||||
/*****************************************/
|
||||
/* isc_dpb_set_db_replica specific flags */
|
||||
/*****************************************/
|
||||
|
||||
#define isc_dpb_replica_none 0
|
||||
#define isc_dpb_replica_read_only 1
|
||||
#define isc_dpb_replica_read_write 2
|
||||
|
||||
/**************************************/
|
||||
/* Bit assignments in RDB$SYSTEM_FLAG */
|
||||
/**************************************/
|
||||
@ -445,6 +453,7 @@
|
||||
#define isc_spb_prp_transactions_shutdown 43
|
||||
#define isc_spb_prp_shutdown_mode 44
|
||||
#define isc_spb_prp_online_mode 45
|
||||
#define isc_spb_prp_replica_mode 46
|
||||
|
||||
/********************************************
|
||||
* Parameters for isc_spb_prp_shutdown_mode *
|
||||
@ -476,6 +485,14 @@
|
||||
#define isc_spb_prp_am_readonly 39
|
||||
#define isc_spb_prp_am_readwrite 40
|
||||
|
||||
/*******************************************
|
||||
* Parameters for isc_spb_prp_replica_mode *
|
||||
*******************************************/
|
||||
|
||||
#define isc_spb_prp_rm_none 0
|
||||
#define isc_spb_prp_rm_readonly 1
|
||||
#define isc_spb_prp_rm_readwrite 2
|
||||
|
||||
/*****************************************
|
||||
* Parameters for isc_action_svc_repair *
|
||||
*****************************************/
|
||||
@ -539,6 +556,7 @@
|
||||
#define isc_spb_res_replace 0x1000
|
||||
#define isc_spb_res_create 0x2000
|
||||
#define isc_spb_res_use_all_space 0x4000
|
||||
#define isc_spb_res_replica_mode 20
|
||||
|
||||
/*****************************************
|
||||
* Parameters for isc_action_svc_validate *
|
||||
@ -557,6 +575,14 @@
|
||||
#define isc_spb_res_am_readonly isc_spb_prp_am_readonly
|
||||
#define isc_spb_res_am_readwrite isc_spb_prp_am_readwrite
|
||||
|
||||
/*******************************************
|
||||
* Parameters for isc_spb_res_replica_mode *
|
||||
*******************************************/
|
||||
|
||||
#define isc_spb_res_rm_none isc_spb_prp_rm_none
|
||||
#define isc_spb_res_rm_readonly isc_spb_prp_rm_readonly
|
||||
#define isc_spb_res_rm_readwrite isc_spb_prp_rm_readwrite
|
||||
|
||||
/*******************************************
|
||||
* Parameters for isc_info_svc_svr_db_info *
|
||||
*******************************************/
|
||||
@ -596,6 +622,7 @@
|
||||
#define isc_spb_nbk_guid 8
|
||||
#define isc_spb_nbk_no_triggers 0x01
|
||||
#define isc_spb_nbk_inplace 0x02
|
||||
#define isc_spb_nbk_sequence 0x04
|
||||
|
||||
/***************************************
|
||||
* Parameters for isc_action_svc_trace *
|
||||
|
@ -3797,6 +3797,9 @@ const
|
||||
isc_dpb_shut_multi = $20;
|
||||
isc_dpb_shut_single = $30;
|
||||
isc_dpb_shut_full = $40;
|
||||
isc_dpb_replica_none = byte(0);
|
||||
isc_dpb_replica_read_only = byte(1);
|
||||
isc_dpb_replica_read_write = byte(2);
|
||||
RDB_system = byte(1);
|
||||
RDB_id_assigned = byte(2);
|
||||
isc_tpb_version1 = byte(1);
|
||||
@ -3954,6 +3957,7 @@ const
|
||||
isc_spb_prp_transactions_shutdown = byte(43);
|
||||
isc_spb_prp_shutdown_mode = byte(44);
|
||||
isc_spb_prp_online_mode = byte(45);
|
||||
isc_spb_prp_replica_mode = byte(46);
|
||||
isc_spb_prp_sm_normal = byte(0);
|
||||
isc_spb_prp_sm_multi = byte(1);
|
||||
isc_spb_prp_sm_single = byte(2);
|
||||
@ -3964,6 +3968,9 @@ const
|
||||
isc_spb_prp_wm_sync = byte(38);
|
||||
isc_spb_prp_am_readonly = byte(39);
|
||||
isc_spb_prp_am_readwrite = byte(40);
|
||||
isc_spb_prp_rm_none = byte(0);
|
||||
isc_spb_prp_rm_readonly = byte(1);
|
||||
isc_spb_prp_rm_readwrite = byte(2);
|
||||
isc_spb_rpr_commit_trans = byte(15);
|
||||
isc_spb_rpr_rollback_trans = byte(34);
|
||||
isc_spb_rpr_recover_two_phase = byte(17);
|
||||
@ -4010,6 +4017,7 @@ const
|
||||
isc_spb_res_replace = $1000;
|
||||
isc_spb_res_create = $2000;
|
||||
isc_spb_res_use_all_space = $4000;
|
||||
isc_spb_res_replica_mode = byte(20);
|
||||
isc_spb_val_tab_incl = byte(1);
|
||||
isc_spb_val_tab_excl = byte(2);
|
||||
isc_spb_val_idx_incl = byte(3);
|
||||
@ -4032,6 +4040,7 @@ const
|
||||
isc_spb_nbk_guid = byte(8);
|
||||
isc_spb_nbk_no_triggers = $01;
|
||||
isc_spb_nbk_inplace = $02;
|
||||
isc_spb_nbk_sequence = $04;
|
||||
isc_spb_trc_id = byte(1);
|
||||
isc_spb_trc_name = byte(2);
|
||||
isc_spb_trc_cfg = byte(3);
|
||||
@ -5498,6 +5507,7 @@ const
|
||||
isc_fbsvcmgr_info_limbo = 336986170;
|
||||
isc_fbsvcmgr_limbo_state = 336986171;
|
||||
isc_fbsvcmgr_limbo_advise = 336986172;
|
||||
isc_fbsvcmgr_bad_rm = 336986173;
|
||||
isc_utl_trusted_switch = 337051649;
|
||||
isc_nbackup_missing_param = 337117213;
|
||||
isc_nbackup_allowed_switches = 337117214;
|
||||
|
@ -1411,6 +1411,7 @@ static const struct {
|
||||
{"fbsvcmgr_info_limbo", 336986170},
|
||||
{"fbsvcmgr_limbo_state", 336986171},
|
||||
{"fbsvcmgr_limbo_advise", 336986172},
|
||||
{"fbsvcmgr_bad_rm", 336986173},
|
||||
{"utl_trusted_switch", 337051649},
|
||||
{"nbackup_missing_param", 337117213},
|
||||
{"nbackup_allowed_switches", 337117214},
|
||||
|
@ -1445,6 +1445,7 @@ const ISC_STATUS isc_fbsvcmgr_bad_arg = 336986164L;
|
||||
const ISC_STATUS isc_fbsvcmgr_info_limbo = 336986170L;
|
||||
const ISC_STATUS isc_fbsvcmgr_limbo_state = 336986171L;
|
||||
const ISC_STATUS isc_fbsvcmgr_limbo_advise = 336986172L;
|
||||
const ISC_STATUS isc_fbsvcmgr_bad_rm = 336986173L;
|
||||
const ISC_STATUS isc_utl_trusted_switch = 337051649L;
|
||||
const ISC_STATUS isc_nbackup_missing_param = 337117213L;
|
||||
const ISC_STATUS isc_nbackup_allowed_switches = 337117214L;
|
||||
@ -1499,7 +1500,7 @@ const ISC_STATUS isc_trace_switch_user_only = 337182757L;
|
||||
const ISC_STATUS isc_trace_switch_param_miss = 337182758L;
|
||||
const ISC_STATUS isc_trace_param_act_notcompat = 337182759L;
|
||||
const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L;
|
||||
const ISC_STATUS isc_err_max = 1443;
|
||||
const ISC_STATUS isc_err_max = 1444;
|
||||
|
||||
#else /* c definitions */
|
||||
|
||||
@ -2914,6 +2915,7 @@ const ISC_STATUS isc_err_max = 1443;
|
||||
#define isc_fbsvcmgr_info_limbo 336986170L
|
||||
#define isc_fbsvcmgr_limbo_state 336986171L
|
||||
#define isc_fbsvcmgr_limbo_advise 336986172L
|
||||
#define isc_fbsvcmgr_bad_rm 336986173L
|
||||
#define isc_utl_trusted_switch 337051649L
|
||||
#define isc_nbackup_missing_param 337117213L
|
||||
#define isc_nbackup_allowed_switches 337117214L
|
||||
@ -2968,7 +2970,7 @@ const ISC_STATUS isc_err_max = 1443;
|
||||
#define isc_trace_switch_param_miss 337182758L
|
||||
#define isc_trace_param_act_notcompat 337182759L
|
||||
#define isc_trace_mandatory_switch_miss 337182760L
|
||||
#define isc_err_max 1443
|
||||
#define isc_err_max 1444
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1414,6 +1414,7 @@ Data source : @4"}, /* eds_statement */
|
||||
{336986170, "Unknown tag (@1) in isc_info_svc_limbo_trans block after isc_svc_query()"}, /* fbsvcmgr_info_limbo */
|
||||
{336986171, "Unknown tag (@1) in isc_spb_tra_state block after isc_svc_query()"}, /* fbsvcmgr_limbo_state */
|
||||
{336986172, "Unknown tag (@1) in isc_spb_tra_advise block after isc_svc_query()"}, /* fbsvcmgr_limbo_advise */
|
||||
{336986173, "Wrong value for replica mode"}, /* fbsvcmgr_bad_rm */
|
||||
{337051649, "Switches trusted_user and trusted_role are not supported from command line"}, /* utl_trusted_switch */
|
||||
{337117213, "Missing parameter for switch @1"}, /* nbackup_missing_param */
|
||||
{337117214, "Only one of -LOCK, -UNLOCK, -FIXUP, -BACKUP or -RESTORE should be specified"}, /* nbackup_allowed_switches */
|
||||
|
@ -1410,6 +1410,7 @@ static const struct {
|
||||
{336986170, -901}, /* 58 fbsvcmgr_info_limbo */
|
||||
{336986171, -901}, /* 59 fbsvcmgr_limbo_state */
|
||||
{336986172, -901}, /* 60 fbsvcmgr_limbo_advise */
|
||||
{336986173, -901}, /* 61 fbsvcmgr_bad_rm */
|
||||
{337051649, -901}, /* 1 utl_trusted_switch */
|
||||
{337117213, -901}, /* 29 nbackup_missing_param */
|
||||
{337117214, -901}, /* 30 nbackup_allowed_switches */
|
||||
|
@ -1410,6 +1410,7 @@ static const struct {
|
||||
{336986170, "00000"}, // 58 fbsvcmgr_info_limbo
|
||||
{336986171, "00000"}, // 59 fbsvcmgr_limbo_state
|
||||
{336986172, "00000"}, // 60 fbsvcmgr_limbo_advise
|
||||
{336986173, "00000"}, // 61 fbsvcmgr_bad_rm
|
||||
{337051649, "00000"}, // 1 utl_trusted_switch
|
||||
{337117213, "00000"}, // 29 nbackup_missing_param
|
||||
{337117214, "00000"}, // 30 nbackup_allowed_switches
|
||||
|
@ -2708,6 +2708,13 @@ bool Service::process_switches(ClumpletReader& spb, string& switches)
|
||||
get_action_svc_string(spb, nbk_database);
|
||||
break;
|
||||
|
||||
case isc_spb_options:
|
||||
if (!get_action_svc_bitmask(spb, nbackup_in_sw_table, switches))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -2924,6 +2931,19 @@ bool Service::process_switches(ClumpletReader& spb, string& switches)
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case isc_spb_res_replica_mode:
|
||||
if (get_action_svc_parameter(spb.getClumpTag(), reference_burp_in_sw_table, switches))
|
||||
{
|
||||
unsigned int val = spb.getInt();
|
||||
if (val >= FB_NELEM(burp_repl_mode_sw_table))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
switches += burp_repl_mode_sw_table[val];
|
||||
switches += " ";
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
case isc_spb_verbose:
|
||||
if (!get_action_svc_parameter(spb.getClumpTag(), reference_burp_in_sw_table, switches))
|
||||
{
|
||||
@ -2998,11 +3018,24 @@ bool Service::process_switches(ClumpletReader& spb, string& switches)
|
||||
if (get_action_svc_parameter(spb.getClumpTag(), alice_in_sw_table, switches))
|
||||
{
|
||||
unsigned int val = spb.getInt();
|
||||
if (val >= FB_NELEM(alice_mode_sw_table))
|
||||
if (val >= FB_NELEM(alice_shut_mode_sw_table))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
switches += alice_mode_sw_table[val];
|
||||
switches += alice_shut_mode_sw_table[val];
|
||||
switches += " ";
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
case isc_spb_prp_replica_mode:
|
||||
if (get_action_svc_parameter(spb.getClumpTag(), alice_in_sw_table, switches))
|
||||
{
|
||||
unsigned int val = spb.getInt();
|
||||
if (val >= FB_NELEM(alice_repl_mode_sw_table))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
switches += alice_repl_mode_sw_table[val];
|
||||
switches += " ";
|
||||
break;
|
||||
}
|
||||
|
@ -9,14 +9,14 @@ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUM
|
||||
('2018-06-22 11:46:00', 'DYN', 8, 309)
|
||||
('1996-11-07 13:39:40', 'INSTALL', 10, 1)
|
||||
('1996-11-07 13:38:41', 'TEST', 11, 4)
|
||||
('2020-03-20 12:45:00', 'GBAK', 12, 403)
|
||||
('2021-02-04 11:21:00', 'GBAK', 12, 405)
|
||||
('2019-04-13 21:10:00', 'SQLERR', 13, 1047)
|
||||
('1996-11-07 13:38:42', 'SQLWARN', 14, 613)
|
||||
('2018-02-27 14:50:31', 'JRD_BUGCHK', 15, 307)
|
||||
('2016-05-26 13:53:45', 'ISQL', 17, 197)
|
||||
('2010-07-10 10:50:30', 'GSEC', 18, 105)
|
||||
('2019-10-19 12:52:29', 'GSTAT', 21, 63)
|
||||
('2019-12-10 17:55:05', 'FBSVCMGR', 22, 61)
|
||||
('2021-02-04 10:32:00', 'FBSVCMGR', 22, 62)
|
||||
('2009-07-18 12:12:12', 'UTL', 23, 2)
|
||||
('2020-12-20 15:40:00', 'NBACKUP', 24, 82)
|
||||
('2009-07-20 07:55:48', 'FBTRACEMGR', 25, 41)
|
||||
|
@ -2574,6 +2574,8 @@ ERROR: Backup incomplete', NULL, NULL);
|
||||
(NULL, 'get_publication', 'restore.epp', NULL, 12, 400, NULL, 'publication', NULL, NULL);
|
||||
(NULL, 'get_pub_table', 'restore.epp', NULL, 12, 401, NULL, 'restoring publication for table @1', NULL, NULL);
|
||||
(NULL, 'get_pub_table', 'restore.epp', NULL, 12, 402, NULL, 'publication for table', NULL, NULL);
|
||||
('gbak_opt_replica', 'burp_usage', 'burp.c', NULL, 12, 403, NULL, ' @1REPLICA <mode> "none", "read_only" or "read_write" replica mode', NULL, NULL);
|
||||
('gbak_replica_req', 'BURP_gbak', 'burp.c', NULL, 12, 404, NULL, '"none", "read_only" or "read_write" required', NULL, NULL);
|
||||
-- SQLERR
|
||||
(NULL, NULL, NULL, NULL, 13, 1, NULL, 'Firebird error', NULL, NULL);
|
||||
(NULL, NULL, NULL, NULL, 13, 74, NULL, 'Rollback not performed', NULL, NULL);
|
||||
@ -3511,6 +3513,7 @@ Analyzing database pages ...', NULL, NULL);
|
||||
('fbsvcmgr_info_limbo', 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 58, NULL, 'Unknown tag (@1) in isc_info_svc_limbo_trans block after isc_svc_query()', NULL, NULL);
|
||||
('fbsvcmgr_limbo_state', 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 59, NULL, 'Unknown tag (@1) in isc_spb_tra_state block after isc_svc_query()', NULL, NULL);
|
||||
('fbsvcmgr_limbo_advise', 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 60, NULL, 'Unknown tag (@1) in isc_spb_tra_advise block after isc_svc_query()', NULL, NULL);
|
||||
('fbsvcmgr_bad_rm', 'putReplicaMode', 'fbsvcmgr.cpp', NULL, 22, 61, NULL, 'Wrong value for replica mode', NULL, NULL);
|
||||
-- UTL (messages common for many utilities)
|
||||
-- All messages use the new format.
|
||||
('utl_trusted_switch', 'checkService', 'UtilSvc.cpp', NULL, 23, 1, NULL, 'Switches trusted_user and trusted_role are not supported from command line', NULL, NULL);
|
||||
|
@ -1407,6 +1407,7 @@ COMMIT WORK;
|
||||
(-901, '00', '000', 22, 58, 'fbsvcmgr_info_limbo', NULL, NULL)
|
||||
(-901, '00', '000', 22, 59, 'fbsvcmgr_limbo_state', NULL, NULL)
|
||||
(-901, '00', '000', 22, 60, 'fbsvcmgr_limbo_advise', NULL, NULL)
|
||||
(-901, '00', '000', 22, 61, 'fbsvcmgr_bad_rm', NULL, NULL)
|
||||
-- UTILITIES
|
||||
(-901, '00', '000', 23, 1, 'utl_trusted_switch', NULL, NULL)
|
||||
-- NBACKUP
|
||||
|
@ -272,6 +272,19 @@ bool putShutdownMode(char**& av, ClumpletWriter& spb, unsigned int tag)
|
||||
return putSpecTag(av, spb, tag, shutSwitch, isc_fbsvcmgr_bad_sm);
|
||||
}
|
||||
|
||||
const SvcSwitches rmSwitch[] =
|
||||
{
|
||||
{"prp_rm_none", 0, 0, isc_spb_prp_rm_none, 0},
|
||||
{"prp_rm_readonly", 0, 0, isc_spb_prp_rm_readonly, 0},
|
||||
{"prp_rm_readwrite", 0, 0, isc_spb_prp_rm_readwrite, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
bool putReplicaMode(char**& av, ClumpletWriter& spb, unsigned int tag)
|
||||
{
|
||||
return putSpecTag(av, spb, tag, rmSwitch, isc_fbsvcmgr_bad_rm);
|
||||
}
|
||||
|
||||
// add integer (int32) tag to spb
|
||||
|
||||
bool putIntArgument(char**& av, ClumpletWriter& spb, unsigned int tag)
|
||||
@ -439,6 +452,7 @@ const SvcSwitches restoreOptions[] =
|
||||
{"res_keyholder", putStringArgument, 0, isc_spb_res_keyholder, 0 },
|
||||
{"res_keyname", putStringArgument, 0, isc_spb_res_keyname, 0 },
|
||||
{"res_crypt", putStringArgument, 0, isc_spb_res_crypt, 0 },
|
||||
{"res_replica_mode", putReplicaMode, 0, isc_spb_res_replica_mode, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -462,6 +476,7 @@ const SvcSwitches propertiesOptions[] =
|
||||
{"prp_shutdown_mode", putShutdownMode, 0, isc_spb_prp_shutdown_mode, 0},
|
||||
{"prp_online_mode", putShutdownMode, 0, isc_spb_prp_online_mode, 0},
|
||||
{"prp_nolinger", putOption, 0, isc_spb_prp_nolinger, 0},
|
||||
{"prp_replica_mode", putReplicaMode, 0, isc_spb_prp_replica_mode, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -547,12 +562,14 @@ const SvcSwitches nrestOptions[] =
|
||||
{"dbname", putStringArgument, 0, isc_spb_dbname, 0},
|
||||
{"nbk_file", putStringArgument, 0, isc_spb_nbk_file, 0},
|
||||
{"nbk_inplace", putOption, 0, isc_spb_nbk_inplace, 0},
|
||||
{"nbk_sequence", putOption, 0, isc_spb_nbk_sequence, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
const SvcSwitches nfixOptions[] =
|
||||
{
|
||||
{"dbname", putStringArgument, 0, isc_spb_dbname, 0},
|
||||
{"nbk_sequence", putOption, 0, isc_spb_nbk_sequence, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -1021,6 +1038,7 @@ struct TypeText
|
||||
{ putWriteMode, "prp_wm_async | prp_wm_sync", "prp_wm_sync" },
|
||||
{ putReserveSpace, "prp_res_use_full | prp_res", "prp_res_use_full" },
|
||||
{ putShutdownMode, "prp_sm_normal | prp_sm_multi | prp_sm_single | prp_sm_full", "prp_sm_single" },
|
||||
{ putReplicaMode, "prp_rm_none | prp_rm_readonly | prp_rm_readwrite", "prp_rm_none" },
|
||||
{ putIntArgument, "int32 value", "123" },
|
||||
{ putBigIntArgument, "int64 value", "456" },
|
||||
{ putOption, NULL, "" },
|
||||
|
@ -56,6 +56,7 @@ static const struct Switches::in_sw_tab_t nbackup_in_sw_table [] =
|
||||
{IN_SW_NBK_NODBTRIG, isc_spb_nbk_no_triggers, "T", 0, 0, 0, false, true, 0, 1, NULL},
|
||||
{IN_SW_NBK_DIRECT, isc_spb_nbk_direct, "DIRECT", 0, 0, 0, false, false, 0, 1, NULL},
|
||||
{IN_SW_NBK_INPLACE, isc_spb_nbk_inplace, "INPLACE", 0, 0, 0, false, true, 0, 1, NULL},
|
||||
{IN_SW_NBK_SEQUENCE, isc_spb_nbk_sequence, "SEQUENCE", 0, 0, 0, false, true, 0, 3, NULL},
|
||||
{IN_SW_NBK_0, 0, NULL, 0, 0, 0, false, false, 0, 0, NULL} // End of List
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user