mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 06:03:02 +01:00
Misc
This commit is contained in:
parent
902e828032
commit
c986de33a2
@ -1,6 +1,4 @@
|
||||
/*
|
||||
* tab=4
|
||||
*
|
||||
*____________________________________________________________
|
||||
*
|
||||
* PROGRAM: Alice (All Else) Utility
|
||||
@ -63,7 +61,6 @@ static USHORT snarf_blob(ISC_QUAD*, USHORT, TEXT*);
|
||||
// table used to determine capabilities, checking for specific
|
||||
// fields in system relations
|
||||
|
||||
|
||||
struct rfr_tab_t
|
||||
{
|
||||
const TEXT* relation;
|
||||
|
@ -188,7 +188,7 @@ static int api_gbak(Firebird::UtilSvc* uSvc, in_sw_tab_t* const in_sw_tab)
|
||||
case IN_SW_BURP_SE: // service name
|
||||
if (itr >= argc - 1)
|
||||
{
|
||||
// user name parameter missing
|
||||
// user name parameter missing
|
||||
BURP_error(inSw->in_sw == IN_SW_BURP_USER ? 188 :
|
||||
// password parameter missing
|
||||
inSw->in_sw == IN_SW_BURP_PASS ? 189 :
|
||||
@ -1660,6 +1660,7 @@ static gbak_action open_files(const TEXT* file1,
|
||||
flag = QUIT;
|
||||
break;
|
||||
}
|
||||
|
||||
// We ignore SIGPIPE so that we can report an IO error when we
|
||||
// try to write to the broken pipe.
|
||||
|
||||
@ -1729,40 +1730,39 @@ static gbak_action open_files(const TEXT* file1,
|
||||
}
|
||||
|
||||
|
||||
// If we got to here, then we're really not backing up a database,
|
||||
// If we got to here, then we're really not backing up a database,
|
||||
// so open a backup file.
|
||||
|
||||
/* There are four possible cases such as:
|
||||
*
|
||||
* 1. restore single backup file to single db file
|
||||
* 2. restore single backup file to multiple db files
|
||||
* 3. restore multiple backup files (join operation) to single db file
|
||||
* 4. restore multiple backup files (join operation) to multiple db files
|
||||
*
|
||||
* Just looking at the command line, we can't say for sure whether it is a
|
||||
* specification of the last file to be join or it is a specification of the
|
||||
* primary db file (case 4), for example:
|
||||
*
|
||||
* gbak -c gbk1 gbk2 gbk3 db1 200 db2 500 db3 -v
|
||||
* ^^^
|
||||
* db1 could be either the last file to be join or primary db file
|
||||
*
|
||||
* Since 'gbk' and 'gsplit' formats are different (gsplit file has its own
|
||||
* header record) hence we can use it as follows:
|
||||
*
|
||||
* - open first file
|
||||
* - read & check a header record
|
||||
*
|
||||
* If a header is identified as a 'gsplit' one then we know exactly how
|
||||
* many files need to be join and in which order. We keep opening a file by
|
||||
* file till we reach the last one to be join. During this step we check
|
||||
* that the files are accessible and are in proper order. It gives us
|
||||
* possibility to let silly customer know about an error as soon as possible.
|
||||
* Besides we have to find out which file is going to be a db file.
|
||||
*
|
||||
* If header is not identified as a 'gsplit' record then we assume that
|
||||
* we got a single backup file.
|
||||
*/
|
||||
// There are four possible cases such as:
|
||||
//
|
||||
// 1. restore single backup file to single db file
|
||||
// 2. restore single backup file to multiple db files
|
||||
// 3. restore multiple backup files (join operation) to single db file
|
||||
// 4. restore multiple backup files (join operation) to multiple db files
|
||||
//
|
||||
// Just looking at the command line, we can't say for sure whether it is a
|
||||
// specification of the last file to be join or it is a specification of the
|
||||
// primary db file (case 4), for example:
|
||||
//
|
||||
// gbak -c gbk1 gbk2 gbk3 db1 200 db2 500 db3 -v
|
||||
// ^^^
|
||||
// db1 could be either the last file to be join or primary db file
|
||||
//
|
||||
// Since 'gbk' and 'gsplit' formats are different (gsplit file has its own
|
||||
// header record) hence we can use it as follows:
|
||||
//
|
||||
// - open first file
|
||||
// - read & check a header record
|
||||
//
|
||||
// If a header is identified as a 'gsplit' one then we know exactly how
|
||||
// many files need to be join and in which order. We keep opening a file by
|
||||
// file till we reach the last one to be join. During this step we check
|
||||
// that the files are accessible and are in proper order. It gives us
|
||||
// possibility to let silly customer know about an error as soon as possible.
|
||||
// Besides we have to find out which file is going to be a db file.
|
||||
//
|
||||
// If header is not identified as a 'gsplit' record then we assume that
|
||||
// we got a single backup file.
|
||||
|
||||
fil = tdgbl->gbl_sw_files;
|
||||
tdgbl->gbl_sw_backup_files = tdgbl->gbl_sw_files;
|
||||
@ -1929,6 +1929,7 @@ static gbak_action open_files(const TEXT* file1,
|
||||
// if we got an error from attach database and we have replace switch set
|
||||
// then look for error from attach returned due to not owner, if we are
|
||||
// not owner then return the error status back up
|
||||
|
||||
BURP_error(274, true);
|
||||
// msg # 274 : Cannot restore over current database, must be sysdba
|
||||
// or owner of the existing database.
|
||||
|
@ -1165,12 +1165,10 @@ static int flush_io_buff(const UCHAR* remaining_io,
|
||||
|
||||
SLONG write_cnt;
|
||||
|
||||
if (file_size > remaining_io_len) {
|
||||
if (file_size > remaining_io_len)
|
||||
write_cnt = write(output_fl_desc, remaining_io, remaining_io_len);
|
||||
}
|
||||
else { // file_size <= remaining_io_len
|
||||
else // file_size <= remaining_io_len
|
||||
write_cnt = write(output_fl_desc, remaining_io, (unsigned int) file_size);
|
||||
}
|
||||
|
||||
switch (write_cnt)
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ using namespace Firebird;
|
||||
#define LONG_LIMIT ((1L << 30) / 5)
|
||||
|
||||
// NOTE: The syntax for the below line may need modification to ensure
|
||||
// the result of 1 << 62 is a quad
|
||||
// the result of 1 << 62 is a quad
|
||||
|
||||
#define QUAD_LIMIT ((((SINT64) 1) << 62) / 5)
|
||||
#define INT64_LIMIT ((((SINT64) 1) << 62) / 5)
|
||||
@ -869,7 +869,8 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, ErrorFunction err)
|
||||
val64 = *((SINT64 *) p);
|
||||
|
||||
// adjust for scale first, *before* range-checking the value.
|
||||
if (scale > 0) {
|
||||
if (scale > 0)
|
||||
{
|
||||
SLONG fraction = 0;
|
||||
do {
|
||||
if (scale == 1)
|
||||
@ -886,11 +887,13 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, ErrorFunction err)
|
||||
val64--;
|
||||
}
|
||||
else if (scale < 0)
|
||||
{
|
||||
do {
|
||||
if ((val64 > INT64_LIMIT) || (val64 < -INT64_LIMIT))
|
||||
err(Arg::Gds(isc_arith_except) << Arg::Gds(isc_numeric_out_of_range));
|
||||
val64 *= 10;
|
||||
} while (++scale);
|
||||
}
|
||||
|
||||
if ((val64 > LONG_MAX_int64) || (val64 < LONG_MIN_int64))
|
||||
err(Arg::Gds(isc_arith_except) << Arg::Gds(isc_numeric_out_of_range));
|
||||
@ -976,6 +979,7 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, ErrorFunction err)
|
||||
fraction = value % 10;
|
||||
value /= 10;
|
||||
} while (--scale);
|
||||
|
||||
if (fraction > 4)
|
||||
value++;
|
||||
// The following 2 lines are correct for platforms where
|
||||
|
@ -1590,7 +1590,6 @@ static void gen_constant( CompiledStatement* statement, const dsc* desc, bool ne
|
||||
// If the value will fit into a 32-bit signed integer, generate
|
||||
// it that way, else as an INT64.
|
||||
|
||||
|
||||
if ((i64value >= (SINT64) MIN_SLONG) && (i64value <= (SINT64) MAX_SLONG))
|
||||
{
|
||||
stuff(statement, blr_long);
|
||||
|
@ -410,8 +410,7 @@ static const TOK tokens[] =
|
||||
// This method is currently used in isql/isql.epp to check if a
|
||||
// user field is a reserved word, and hence needs to be quoted.
|
||||
// Obviously a hash table would make this a little quicker.
|
||||
//
|
||||
// MOD 29-June-2002
|
||||
// MOD 29-June-2002
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
@ -59,8 +59,8 @@ using namespace Jrd;
|
||||
using namespace Firebird;
|
||||
|
||||
// NOTE: The static definition of DB and gds_trans by gpre will not
|
||||
// be used by the meta data routines. Each of those routines has
|
||||
// its own local definition of these variables.
|
||||
// be used by the meta data routines. Each of those routines has
|
||||
// its own local definition of these variables.
|
||||
|
||||
DATABASE DB = STATIC "yachts.lnk";
|
||||
|
||||
|
@ -2074,6 +2074,7 @@ static bool setSharedMemoryAccessRights(ISC_STATUS* status_vector, SLONG shmid)
|
||||
char secDb[MAXPATHLEN];
|
||||
SecurityDatabase::getPath(secDb);
|
||||
struct stat st;
|
||||
|
||||
if (stat(secDb, &st) == 0)
|
||||
{
|
||||
shmid_ds ds;
|
||||
@ -2199,7 +2200,7 @@ UCHAR* ISC_map_file(ISC_STATUS* status_vector,
|
||||
*/
|
||||
if ((shmid = shmget(key, 0, 0)) == -1) {
|
||||
string msg;
|
||||
msg.printf("shmget(0x%x, 0, PRIV)", key);
|
||||
msg.printf("shmget(0x%x, 0, 0)", key);
|
||||
error(status_vector, msg.c_str(), errno);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
@ -2217,8 +2218,7 @@ UCHAR* ISC_map_file(ISC_STATUS* status_vector,
|
||||
we use IPC_EXCL flag to get an error if by some miracle
|
||||
the sagment with the same key is already exists
|
||||
*/
|
||||
if ((shmid = shmget(key, length, IPC_CREAT | IPC_EXCL | PRIV)) ==
|
||||
-1)
|
||||
if ((shmid = shmget(key, length, IPC_CREAT | IPC_EXCL | PRIV)) == -1)
|
||||
{
|
||||
string msg;
|
||||
msg.printf("shmget(0x%x, %d, IPC_CREAT | IPC_EXCL | PRIV)", key, length);
|
||||
@ -2291,7 +2291,7 @@ UCHAR* ISC_map_file(ISC_STATUS* status_vector,
|
||||
length = buf.shm_segsz;
|
||||
if ((shmid = shmget(key, length, 0)) == -1) {
|
||||
string msg;
|
||||
msg.printf("shmget(0x%x, %d, PRIV)", key, length);
|
||||
msg.printf("shmget(0x%x, %d, 0)", key, length);
|
||||
error(status_vector, msg.c_str(), errno);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
@ -2314,7 +2314,7 @@ UCHAR* ISC_map_file(ISC_STATUS* status_vector,
|
||||
|
||||
if ((shmid = shmget(key, length, 0)) == -1) {
|
||||
string msg;
|
||||
msg.printf("shmget(0x%x, %d, PRIV)", key, length);
|
||||
msg.printf("shmget(0x%x, %d, 0)", key, length);
|
||||
error(status_vector, msg.c_str(), errno);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
|
@ -503,8 +503,10 @@ BOOL WriteFBSettings(HWND hDlg)
|
||||
isc_vax_integer((SCHAR *) & lCachePages, sizeof(long));
|
||||
pchPtr += sizeof(long);
|
||||
*/
|
||||
|
||||
*psLen = pchPtr - pchSendBuf - sizeof(short) - sizeof(char);
|
||||
*psLen = (short) isc_vax_integer((SCHAR *) psLen, sizeof(short));
|
||||
|
||||
// Query service with set_config
|
||||
|
||||
char szResBuf[16]; // Response buffer
|
||||
|
@ -57,7 +57,7 @@
|
||||
#include "../remote/os/win32/ibsvrhlp.h"
|
||||
#include "../remote/os/win32/chop_proto.h"
|
||||
|
||||
#include "../common/thd.h" // get jrd_proto.h to declare the function
|
||||
#include "../common/thd.h" // get jrd_proto.h to declare the function
|
||||
#include "../jrd/jrd_proto.h" // JRD_num_attachments()
|
||||
#include <stdio.h> // sprintf()
|
||||
|
||||
|
@ -312,7 +312,7 @@ int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst, LPSTR lpszArgs, int
|
||||
|
||||
#ifdef DEBUG_GDS_ALLOC
|
||||
// In Debug mode - this will report all server-side memory leaks
|
||||
// due to remote access
|
||||
// due to remote access
|
||||
|
||||
//gds_alloc_report(0, __FILE__, __LINE__);
|
||||
char name[MAXPATHLEN];
|
||||
|
@ -74,7 +74,7 @@ static void exit_handler(void*);
|
||||
#endif
|
||||
static void force_close(rem_port*);
|
||||
static rem_str* make_pipe_name(const TEXT*, const TEXT*, const TEXT*);
|
||||
static rem_port* receive(rem_port*, PACKET*);
|
||||
static rem_port* receive(rem_port*, PACKET*);
|
||||
static int send_full(rem_port*, PACKET*);
|
||||
static int send_partial(rem_port*, PACKET*);
|
||||
static int xdrwnet_create(XDR*, rem_port*, UCHAR*, USHORT, xdr_op);
|
||||
@ -167,7 +167,7 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
|
||||
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
|
||||
|
||||
// Note: prior to V3.1E a receivers could not in truth handle more
|
||||
// then 5 protocol descriptions; however, this restriction does not
|
||||
// than 5 protocol descriptions; however, this restriction does not
|
||||
// apply to Windows since it was created in 4.0
|
||||
|
||||
// If we want user verification, we can't speak anything less than version 7
|
||||
@ -798,7 +798,7 @@ static void disconnect(rem_port* port)
|
||||
port->port_async = NULL;
|
||||
}
|
||||
|
||||
// If this is a sub-port, unlink it from it's parent
|
||||
// If this is a sub-port, unlink it from its parent
|
||||
|
||||
rem_port* const parent = port->port_parent;
|
||||
if (parent)
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "../jrd/gds_proto.h"
|
||||
|
||||
#ifdef BURP
|
||||
#include "../burp/misc_proto.h" // Was "../burp/misc_pro.h" -Jeevan
|
||||
#include "../burp/misc_proto.h"
|
||||
inline UCHAR* XDR_ALLOC(ULONG size)
|
||||
{
|
||||
return MISC_alloc_burp(size);
|
||||
|
Loading…
Reference in New Issue
Block a user