8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 18:43:02 +01:00

Add On/Off parameter to switch -D(irect)

This commit is contained in:
alexpeshkoff 2009-12-17 11:00:47 +00:00
parent 2adbcaa018
commit 0ce66da575
6 changed files with 29 additions and 5 deletions

View File

@ -332,6 +332,7 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
switch (tag)
{
case isc_spb_nbk_file:
case isc_spb_nbk_direct:
case isc_spb_dbname:
return StringSpb;
case isc_spb_nbk_level:

View File

@ -500,8 +500,8 @@
#define isc_spb_nbk_level 5
#define isc_spb_nbk_file 6
#define isc_spb_nbk_direct 7
#define isc_spb_nbk_no_triggers 0x01
#define isc_spb_nbk_direct 0x02
/***************************************
* Parameters for isc_action_svc_trace *

View File

@ -2487,6 +2487,13 @@ bool Service::process_switches(ClumpletReader& spb, string& switches)
return false;
}
break;
case isc_spb_nbk_direct:
if (!get_action_svc_parameter(spb.getClumpTag(), nbackup_in_sw_table, switches))
{
return false;
}
get_action_svc_string(spb, switches);
}
break;

View File

@ -3459,7 +3459,7 @@ Analyzing database pages ...', NULL, NULL);
(NULL, 'nbackup.cpp', 'usage', NULL, 24, 21, NULL, ' incremental backups of multi-file databases are not supported yet', NULL, NULL)
(NULL, 'nbackup.cpp', 'usage', NULL, 24, 22, NULL, ' "stdout" may be used as a value of <filename> for -B option', NULL, NULL)
(NULL, 'nbackup.cpp', 'usage', NULL, 24, 23, NULL, 'PROBLEM ON "%s".', NULL, NULL)
(NULL, 'nbackup.cpp', 'usage', NULL, 24, 70, NULL, ' -D Use direct I/O when scanning database', NULL, NULL)
(NULL, 'nbackup.cpp', 'usage', NULL, 24, 70, NULL, ' -D [ON | OFF] Use or not direct I/O when scanning database', NULL, NULL)
--(NULL, 'nbackup.cpp', 'usage', NULL, 24, 71, NULL, '', NULL, NULL);
stop

View File

@ -446,7 +446,7 @@ const SvcSwitches nbackOptions[] =
{"nbk_file", putStringArgument, 0, isc_spb_nbk_file, 0},
{"nbk_level", putNumericArgument, 0, isc_spb_nbk_level, 0},
{"nbk_no_triggers", putOption, 0, isc_spb_nbk_no_triggers, 0},
{"nbk_direct", putOption, 0, isc_spb_nbk_direct, 0},
{"nbk_direct", putStringArgument, 0, isc_spb_nbk_direct, 0},
{0, 0, 0, 0, 0}
};

View File

@ -1206,12 +1206,18 @@ void nbackup(UtilSvc* uSvc)
string username, password;
PathName database, filename;
bool run_db_triggers = true;
bool direct_io = false;
bool direct_io =
#ifdef WIN_NT
true;
#else
false;
#endif
NBackup::BackupFiles backup_files;
int level;
bool print_size = false, version = false;
string trustedUser;
bool trustedRole = false;
string onOff;
// Read global command line parameters
for (int itr = 1; itr < argc; ++itr)
@ -1261,7 +1267,17 @@ void nbackup(UtilSvc* uSvc)
break;
case 'D':
direct_io = true;
if (++itr >= argc)
missing_parameter_for_switch(uSvc, argv[itr - 1]);
onOff = argv[itr];
onOff.upper();
if (onOff == "ON")
direct_io = true;
else if (onOff == "OFF")
direct_io = false;
else
usage(uSvc, "Wrong parameter %s for switch -D, need ON or OFF", onOff.c_str());
break;
case 'F':