8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 05:23:03 +01:00

Merging changes from fb1.

This commit is contained in:
dimitr 2002-07-02 09:49:19 +00:00
parent cbc78dc98e
commit e110ba6559
10 changed files with 229 additions and 81 deletions

View File

@ -148,6 +148,14 @@ CSALIAS("ISO_8859_1", CS_LATIN1)
/* V3 SUB_TYPE 154 */
COLLATION("PT_PT", CC_PORTUGAL, CS_LATIN1, 15, LAT154_init)
END_CHARSET
CHARSET("ISO8859_2", CS_LATIN2, 0, 1, 256, CS_iso_latin2, LATIN2_cp_init)
CSALIAS("ISO_8859_2", CS_LATIN2)
CSALIAS("ISO88591", CS_LATIN2)
CSALIAS("LATIN2", CS_LATIN2)
CSALIAS("ISO-8859-2", CS_LATIN2) /* Prefered MIME name */
/* Czech national collation */
COLLATION("CS_CZ", CC_CZECH, CS_LATIN2, 1, ISO88592_c1_init)
END_CHARSET
CHARSET("DOS852", CS_DOS_852, 0, 1, 256, CS_dos_852, DOS852_c0_init)
CSALIAS("DOS_852", CS_DOS_852)
COLLATION("DB_CSY", CC_CZECH, CS_DOS_852, 1, DOS852_c1_init)
@ -189,6 +197,7 @@ CSALIAS("WIN_1250", CS_WIN1250)
COLLATION("PXW_HUNDC", CC_HUNGARY, CS_WIN1250, 2, WIN1250_c2_init)
COLLATION("PXW_PLK", CC_POLAND, CS_WIN1250, 3, WIN1250_c3_init)
COLLATION("PXW_SLOV", CC_YUGOSLAVIA, CS_WIN1250, 4, WIN1250_c4_init)
COLLATION("PXW_HUN", CC_HUNGARY, CS_WIN1250, 5, WIN1250_c5_init)
END_CHARSET
CHARSET("WIN1251", CS_WIN1251, 0, 1, 256, CS_win1251, WIN1251_c0_init)
CSALIAS("WIN_1251", CS_WIN1251)

View File

@ -19,6 +19,9 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* 2001.10.09 Claudio Valderrama: reinstall the missing "license mask" field
* in the texttype struct so we remain compatible with any IB WRT intl module.
*/
#ifndef _JRD_INTLOBJ_H_
@ -82,7 +85,7 @@ typedef struct texttype {
but never put back by Firebird until 2001.10.09. Originally it was named
texttype_license_mask, but since it's useless in the open source version, I
followed the new name given in the BSC tree. */
ULONG texttype_obsolete_field; /* required bits for license */
ULONG texttype_obsolete_field; /* required bits for license */
/* MUST BE ALIGNED */
FPTR_SHORT texttype_fn_init;

View File

@ -19,6 +19,9 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* 2001.6.25 Claudio Valderrama: add irq_r_gen_id_num to support
* new MET_lookup_generator_id().
*/
#ifndef _JRD_IRQ_H_
@ -64,7 +67,7 @@
#define irq_s_deps 35 /* store RDB$DEPENDENCIES */
#define irq_d_deps 36 /* delete RDB$DEPENDENCIES */
#define irq_r_fld_dim 37 /* read RDB$FIELD_DIMENSIONS */
#define irq_r_gen_id 38 /* read RDB$GENERATORS */
#define irq_r_gen_id 38 /* read RDB$GENERATORS, lookup by name. */
#define irq_s_gen_id 39 /* store RDB$GENERATORS */
#define irq_ch_f_dpd 40 /* check object field dependencies */
#define irq_ch_dpd 41 /* check object dependencies */
@ -102,8 +105,10 @@
#define irq_get_role_mem 69 /* get SQL role membership */
#define irq_get_role_name 70 /* get SQL role name */
#define irq_format6 71 /* make a new format for a record */
#define irq_r_gen_id_num 72 /* lookup generator by ID. */
#define irq_verify_role_name 73 /* ensure role exists in roles & user_privileges. */
#define irq_l_relation_defsec 74 /* check the default sec class name against rel. */
#define irq_MAX 72
#define irq_MAX 75
#endif /* _JRD_IRQ_H_ */

View File

@ -19,12 +19,16 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* Added TCP_NO_DELAY option for superserver on Linux
* FSG 16.03.2001
* Solaris x86 changes - Konstantin Kuznetsov, Neil McCalden
* 26-Sept-2001 Paul Beach - External File Directory Config. Parameter
* 17-Oct-2001 Mike Nordell: CPU affinity
* 01-Feb-2002 Paul Reeves: Removed hard-coded registry path
*/
/*
$Id: isc.cpp,v 1.8 2002-02-16 03:27:32 seanleyne Exp $
$Id: isc.cpp,v 1.9 2002-07-02 09:49:19 dimitr Exp $
*/
#ifdef DARWIN
#define _STLP_CCTYPE
@ -47,6 +51,7 @@ $Id: isc.cpp,v 1.8 2002-02-16 03:27:32 seanleyne Exp $
#include "../jrd/gds_proto.h"
#include "../jrd/isc_proto.h"
#include "../jrd/jrd_proto.h"
#include "../utilities/registry.h"
/* Initialize the structure that hold all the config information */
@ -75,7 +80,10 @@ static struct cfgtbl ISC_def_cfg_tbl[] = {
#ifdef SET_TCP_NO_DELAY
{ISCCFG_NO_NAGLE, ISCCFG_NO_NAGLE_KEY, ISCCFG_NO_NAGLE_DEF, ISCCFG_NO_NAGLE_DEF},
#endif
{NULL, 0, 0, 0}
#ifdef WIN_NT
{ISCCFG_CPU_AFFINITY_TAG, ISCCFG_CPU_AFFINITY_KEY, ISCCFG_CPU_AFFINITY_DEF, ISCCFG_CPU_AFFINITY_DEF},
#endif
{NULL, 0, 0, 0}
};
static struct cfgtbl *ISC_cfg_tbl = NULL;
@ -89,6 +97,8 @@ static BOOLEAN dls_init = FALSE;
static BOOLEAN dls_flag = FALSE;
static BOOLEAN fdls_init = FALSE;
static BOOLEAN fdls_flag = FALSE;
static BOOLEAN edls_init = FALSE;
static BOOLEAN edls_flag = FALSE;
/* End of temporary file management specific stuff */
@ -144,6 +154,7 @@ static LKSB wake_lock;
#include <pwd.h>
#include <unistd.h>
#include <signal.h>
#include <ctype.h>
#ifndef O_RDWR
#include <fcntl.h>
@ -433,6 +444,30 @@ void DLL_EXPORT ISC_get_config(TEXT * config_file, IPCCFG config_table)
continue;
}
/* The external file directory keyword can also be used
more than once, so handle it separately. */
if (0 == strncmp(buf, ISCCFG_EXT_FILE_DIR,
sizeof(ISCCFG_EXT_FILE_DIR) - 1))
{
#ifdef SUPERSERVER
/* There is external file directory definition */
if (!edls_init)
if (1 == sscanf(buf + sizeof(ISCCFG_EXT_FILE_DIR) - 1,
" \"%[^\"]", dir_name))
{
if DLS_add_file_dir(dir_name))
edls_flag = TRUE;
else
{
gds__log("Unable to use config parameter %s : No memory ",
ISCCFG_EXT_FILE_DIR);
edls_flag = FALSE;
}
}
#endif
continue;
}
for (tbl = ISC_cfg_tbl; (q = tbl->cfgtbl_keyword) ; tbl++)
{
p = buf;
@ -489,6 +524,9 @@ void DLL_EXPORT ISC_get_config(TEXT * config_file, IPCCFG config_table)
dls_init = TRUE; /* Temp dir config should be read only once */
fdls_init = TRUE; /* Ext func dir config should be read only once. */
edls_init = TRUE; /* Ext file dir config should be read only once. */
} /* if ICS_cfg_tbl == NULL */
/* The master configuration options are in memory, now for

View File

@ -20,12 +20,12 @@
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* 2001.06.14: Claudio Valderrama: Possible buffer overrun in
* expand_share_name(TEXT*) has been closed. Parameter is return value, too.
* This function and its caller in this same file don't report error conditions.
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete "EPSON" port
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete "DELTA" port
*
* 2002-02-23 Sean Leyne - Code Cleanup, removed old M88K and NCR3000 port
*
*
*/
#ifdef SHLIB_DEFS
@ -91,7 +91,8 @@ typedef struct itm {
#define GETWD(buf) getcwd (buf, MAXPATHLEN)
#define MTAB "/etc/mnttab"
#include <sys/types.h>
#ifndef HP10
/* RITTER - added HP11 to the pre-processor condition below */
#if !(defined HP10 || defined HP11)
#include <cluster.h>
#endif
#endif
@ -129,6 +130,15 @@ typedef struct itm {
#include <sys/mount.h>
#endif
#ifdef SINIXZ
#include <sys/mnttab.h>
#define SV_MNTENT
#define NON_MNTENT
#define MTAB "/etc/mnttab"
#define MTAB_OPEN(path,type) fopen (path, type)
#define MTAB_CLOSE(stream) fclose (stream)
#endif
#ifdef ultrix
#define NON_MNTENT
#include <sys/mount.h>
@ -140,7 +150,7 @@ typedef struct itm {
#include <sys/vmount.h>
#endif
#if (defined SOLARIS || defined UNIXWARE || defined linux || defined FREEBSD || defined NETBSD || defined DARWIN)
#if (defined SOLARIS || defined UNIXWARE || defined linux || defined FREEBSD || defined NETBSD || defined DARWIN || defined SINIXZ)
#define GETWD(buf) getcwd (buf, MAXPATHLEN)
#endif
@ -459,7 +469,8 @@ int ISC_analyze_nfs(TEXT * expanded_filename, TEXT * node_name)
#endif
#ifdef hpux
#ifndef HP10
/* RITTER - added HP11 to the pre-processor condition below */
#if !(defined HP10 || defined HP11)
if (!flag)
flag = get_server(expanded_filename, node_name);
#endif
@ -1180,7 +1191,7 @@ int ISC_expand_filename(
length =
(USHORT) GetShortPathName(expanded_name, expanded_name2,
MAXPATHLEN);
if (length)
if (length && length < MAXPATHLEN)
strcpy(expanded_name, expanded_name2);
}
else
@ -1202,13 +1213,21 @@ int ISC_expand_filename(
file_length =
(USHORT) GetShortPathName(expanded_name, expanded_name2,
MAXPATHLEN);
if (!file_length)
file_length = (USHORT) strlen(expanded_name);
else
if (file_length && file_length < MAXPATHLEN)
strcpy(expanded_name, expanded_name2);
else
file_length = (USHORT) strlen(expanded_name);
}
else
length = 0;
file_length = (USHORT) strlen(expanded_name);
/* CVC: I know this is incorrect. If _fullpath (that in turn calls GetFullPathName)
returns NULL, the path + file given are invalid, but the original and useless code
set length=0 that has no effect and setting file_length to zero stops the code below
from uppercasing the filename. Following the logic in the prior block of code, the
action to take is to get the length of the output buffer. Unfortunately, there's
no function that checks the result of ISC_expand_filename. Since _fullpath is
GetFullPathName with some checks, the code above looks strange when SUPERSERVER
is not defined. I decided to make file_length as the length of the output buffer. */
}
/* Filenames are case insensitive on NT. If filenames are
@ -1703,6 +1722,7 @@ static void expand_share_name(TEXT * share_name)
#ifdef STACK_EFFICIENT
gds__free((SLONG *) data_buf);
#endif /* STACK_EFFICIENT */
RegCloseKey(hkey);
return; /* Error not really handled */
}
ret =
@ -1714,8 +1734,15 @@ static void expand_share_name(TEXT * share_name)
for (q = data; q && *q;
q = (type_code == REG_MULTI_SZ) ? q + strlen(q) + 1 : NULL) {
if (!strnicmp(q, "path", 4)) {
/* CVC: Paranoid protection against buffer overrun.
MAXPATHLEN minus NULL terminator, the possible backslash and p==db_name.
Otherwise, it's possible to create long share plus long db_name => crash. */
idx = strlen(q + 5);
if (idx + 1 + (q[4 + idx] == '\\' ? 1 : 0) + strlen(p) >= MAXPATHLEN)
break;
strcpy(workspace, q + 5); /* step past the "Path=" part */
idx = strlen(workspace);
/* idx = strlen (workspace); Done previously. */
if (workspace[idx - 1] != '\\')
workspace[idx++] = '\\';
strcpy(workspace + idx, p);
@ -1953,7 +1980,7 @@ static BOOLEAN get_mounts(MNT * mount, TEXT * buffer, IB_FILE * file)
p = buffer;
mptr = &mnttab;
while (getmntent(file, mptr) == 0) {
if (getmntent(file, mptr) == 0) {
/* Include non-NFS (local) mounts - some may be longer than
NFS mount points */
@ -1967,12 +1994,12 @@ static BOOLEAN get_mounts(MNT * mount, TEXT * buffer, IB_FILE * file)
if (*q)
q++;
mount->mnt_path = p;
while (*p++ = *q++);
while ((*p++ = *q++) != 0);
mount->mnt_mount = mptr->mnt_mountp;
return TRUE;
}
return FALSE;
else
return FALSE;
}
#endif
#ifdef SOLARIS
@ -2215,7 +2242,8 @@ static BOOLEAN get_mounts(MNT * mount, TEXT * buffer, IB_FILE * file)
#ifdef hpux
#ifndef HP10
/* RITTER - added HP11 to the pre-processor condition below */
#if !(defined HP10 || defined HP11)
static BOOLEAN get_server(TEXT * file_name, TEXT * node_name)
{
/**************************************

View File

@ -26,7 +26,7 @@
*
*/
/* $Id: isc_ipc.cpp,v 1.12 2002-02-16 05:06:17 seanleyne Exp $ */
/* $Id: isc_ipc.cpp,v 1.13 2002-07-02 09:49:19 dimitr Exp $ */
#ifdef SHLIB_DEFS
#define LOCAL_SHLIB_DEFS
@ -144,7 +144,7 @@ static int process_id = 0;
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
#ifdef NETBSD
#if defined(NETBSD) || defined(SINIXZ)
#include <signal.h>
#else
#include <sys/signal.h>
@ -240,8 +240,12 @@ static SLONG overflow_handler(void *);
static SIG que_signal(int, FPTR_VOID, void *, int);
#if !(defined HANDLER_ADDR_ARG)
#ifdef SINIXZ
static void CLIB_ROUTINE signal_handler(int, int);
#else
static void CLIB_ROUTINE signal_handler(int, int, struct sigcontext *);
#endif
#endif
#ifdef HANDLER_ADDR_ARG
static void CLIB_ROUTINE signal_handler(int, int, void *, void *);
@ -1087,12 +1091,17 @@ static SIG que_signal(
#ifndef REQUESTER
static void CLIB_ROUTINE signal_handler(int number, int code,
static void CLIB_ROUTINE signal_handler(int number,
#ifdef SINIXZ
int code)
#else
int code,
#ifdef HANDLER_ADDR_ARG
void *scp, void *addr)
#else
struct sigcontext *scp)
#endif
#endif /* SINIXZ */
{
/**************************************
*
@ -1136,6 +1145,8 @@ static void CLIB_ROUTINE signal_handler(int number, int code,
#pragma FB_COMPILER_MESSAGE("Fix! Ugly function pointer cast!")
#ifdef HANDLER_ADDR_ARG
((void (*)(...)) (*sig->sig_routine)) (number, code, scp, addr);
#elif defined(SINIXZ)
((void (*)(...)) (*sig->sig_routine)) (number, code);
#else
((void (*)(...)) (*sig->sig_routine)) (number, code, scp);
#endif

View File

@ -121,7 +121,7 @@ static UCHAR *next_shared_memory;
#include <sys/stat.h>
#include <sys/file.h>
#ifdef NETBSD
#if defined(NETBSD) || defined(SINIXZ)
#include <signal.h>
#else
#include <sys/signal.h>
@ -216,11 +216,16 @@ union semun {
#endif
#if !(defined M88K || defined hpux || defined DECOSF || defined SOLARIS || \
defined DG_X86 || defined linux || defined FREEBSD || defined NETBSD)
defined DG_X86 || defined linux || defined FREEBSD || defined NETBSD || defined SINIXZ)
extern SLONG ftok();
#endif
#endif
#ifdef SINIXZ
#include <sys/param.h>
static int getpagesize() {return PAGESIZE;}
#endif /* SINIXZ*/
/* Windows NT */
@ -740,7 +745,8 @@ int ISC_event_init(EVENT event, int semid, int semnum)
pthread_mutex_init(event->event_mutex, pthread_mutexattr_default);
pthread_cond_init(event->event_semnum, pthread_condattr_default);
#else
#if (defined linux || defined DARWIN)
/* RITTER - added HP11 to the preprocessor condition below */
#if (defined linux || defined DARWIN || defined HP11)
pthread_mutex_init(event->event_mutex, NULL);
pthread_cond_init(event->event_semnum, NULL);
#else
@ -873,7 +879,8 @@ int ISC_event_wait(
#ifdef HP10
if (micro_seconds > 0 && (ret == -1) && (errno == EAGAIN))
#else
#if (defined linux || defined DARWIN)
/* RITTER - added HP11 to the preprocessor condition below */
#if (defined linux || defined DARWIN || defined HP11)
if (micro_seconds > 0 && (ret == ETIMEDOUT))
#else
if (micro_seconds > 0 && (ret == ETIME))
@ -1835,13 +1842,13 @@ void ISC_exception_post(ULONG sig_num, TEXT * err_msg)
sprintf(log_msg, "%s Segmentation Fault.\n"
"\t\tThe code attempted to access memory\n"
"\t\twithout privilege to do so.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case SIGBUS:
sprintf(log_msg, "%s Bus Error.\n"
"\t\tThe code caused a system bus error.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case SIGILL:
@ -1849,7 +1856,7 @@ void ISC_exception_post(ULONG sig_num, TEXT * err_msg)
sprintf(log_msg, "%s Illegal Instruction.\n"
"\t\tThe code attempted to perfrom an\n"
"\t\tillegal operation."
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
@ -1857,13 +1864,13 @@ void ISC_exception_post(ULONG sig_num, TEXT * err_msg)
sprintf(log_msg, "%s Floating Point Error.\n"
"\t\tThe code caused an arithmetic exception\n"
"\t\tor floating point exception."
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
default:
sprintf(log_msg, "%s Unknown Exception.\n"
"\t\tException number %d."
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg, sig_num);
break;
}
@ -1908,21 +1915,21 @@ ULONG ISC_exception_post(ULONG except_code, TEXT * err_msg)
sprintf(log_msg, "%s Access violation.\n"
"\t\tThe code attempted to access a virtual\n"
"\t\taddress without privilege to do so.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_DATATYPE_MISALIGNMENT:
sprintf(log_msg, "%s Datatype misalignment.\n"
"\t\tThe attempted to read or write a value\n"
"\t\tthat was not stored on a memory boundary.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
sprintf(log_msg, "%s Array bounds exceeded.\n"
"\t\tThe code attempted to access an array\n"
"\t\telement that is out of bounds.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_FLT_DENORMAL_OPERAND:
@ -1930,63 +1937,63 @@ ULONG ISC_exception_post(ULONG except_code, TEXT * err_msg)
"\t\tOne of the floating-point operands is too\n"
"\t\tsmall to represent as a standard floating-point\n"
"\t\tvalue.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
sprintf(log_msg, "%s Floating-point divide by zero.\n"
"\t\tThe code attempted to divide a floating-point\n"
"\t\tvalue by a floating-point divisor of zero.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_FLT_INEXACT_RESULT:
sprintf(log_msg, "%s Floating-point inexact result.\n"
"\t\tThe result of a floating-point operation cannot\n"
"\t\tbe represented exactly as a decimal fraction.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_FLT_INVALID_OPERATION:
sprintf(log_msg, "%s Floating-point invalid operand.\n"
"\t\tAn indeterminant error occurred during a\n"
"\t\tfloating-point operation.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_FLT_OVERFLOW:
sprintf(log_msg, "%s Floating-point overflow.\n"
"\t\tThe exponent of a floating-point operation\n"
"\t\tis greater than the magnitude allowed.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_FLT_STACK_CHECK:
sprintf(log_msg, "%s Floating-point stack check.\n"
"\t\tThe stack overflowed or underflowed as the\n"
"result of a floating-point operation.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_FLT_UNDERFLOW:
sprintf(log_msg, "%s Floating-point underflow.\n"
"\t\tThe exponent of a floating-point operation\n"
"\t\tis less than the magnitude allowed.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_INT_DIVIDE_BY_ZERO:
sprintf(log_msg, "%s Integer divide by zero.\n"
"\t\tThe code attempted to divide an integer value\n"
"\t\tby an integer divisor of zero.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_INT_OVERFLOW:
sprintf(log_msg, "%s Interger overflow.\n"
"\t\tThe result of an integer operation caused the\n"
"\t\tmost significant bit of the result to carry.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg);
break;
case EXCEPTION_STACK_OVERFLOW:
@ -2010,7 +2017,7 @@ ULONG ISC_exception_post(ULONG except_code, TEXT * err_msg)
default:
sprintf(log_msg, "%s An exception occurred that does\n"
"\t\tnot have a description. Exception number %X.\n"
"\tThis exception will cause the InterBase server\n"
"\tThis exception will cause the Firebird server\n"
"\tto terminate abnormally.", err_msg, except_code);
break;
}
@ -3586,7 +3593,8 @@ int ISC_mutex_init(MTX mutex, SLONG semaphore)
**************************************/
int state;
#if (!defined HP10 && !defined linux && !defined DARWIN)
/* RITTER - replaced HP10 with HPUX in the line below */
#if (!defined HPUX && !defined linux && !defined DARWIN)
pthread_mutexattr_t mattr;
@ -3606,7 +3614,7 @@ int ISC_mutex_init(MTX mutex, SLONG semaphore)
server (until we are to implement local IPC using shared
memory in which case we need interprocess thread sync.
*/
#if (defined linux || defined DARWIN)
#if (defined linux || defined DARWIN || defined HP11) /* RITTER - added HP11 */
return pthread_mutex_init(mutex->mtx_mutex, NULL);
#else
state = pthread_mutex_init(mutex->mtx_mutex, pthread_mutexattr_default);

View File

@ -19,9 +19,14 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* 2001.07.06 Sean Leyne - Code Cleanup, removed "#ifdef READONLY_DATABASE"
* conditionals, as the engine now fully supports
* readonly databases.
* 2001.07.09 Sean Leyne - Restore default setting to Force Write = "On", for
* Windows NT platform, for new database files. This was changed
* with IB 6.0 to OFF and has introduced many reported database
* corruptions.
*/
#ifdef SHLIB_DEFS
@ -311,9 +316,9 @@ static BOOLEAN drop_files(FIL);
static STATUS error(STATUS*);
static void find_intl_charset(TDBB, ATT, DPB*);
static TRA find_transaction(TDBB, TRA, STATUS);
static void get_options(UCHAR*, USHORT, TEXT**, DPB*);
static void get_options(UCHAR *, USHORT, TEXT **, ULONG, DPB *);
static SLONG get_parameter(UCHAR**);
static TEXT* get_string_parameter(UCHAR**, TEXT**);
static TEXT* get_string_parameter(UCHAR **, TEXT **, ULONG *);
static STATUS handle_error(STATUS*, STATUS, TDBB);
#if defined (WIN_NT)
@ -665,7 +670,7 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
/* Process database parameter block */
get_options((UCHAR *) dpb, dpb_length, &opt_ptr, &options);
get_options((UCHAR *) dpb, dpb_length, &opt_ptr, DPB_EXPAND_BUFFER, &options);
#ifndef NO_NFS
/* Don't check nfs if single user */
@ -1741,6 +1746,7 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status,
STATUS temp_status[ISC_STATUS_LENGTH], *status;
DPB options;
struct tdbb thd_context;
FIL first_dbb_file;
api_entry_point_init(user_status);
@ -1805,7 +1811,7 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status,
opt_ptr = opt_buffer;
#endif
get_options((UCHAR *) dpb, dpb_length, &opt_ptr, &options);
get_options((UCHAR *)dpb, dpb_length, &opt_ptr, DPB_EXPAND_BUFFER, &options);
if (invalid_client_SQL_dialect == FALSE && options.dpb_sql_dialect == 99)
options.dpb_sql_dialect = 0;
@ -1933,6 +1939,7 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status,
expanded_name);
dbb->dbb_file =
PIO_create(dbb, expanded_name, length, options.dpb_overwrite);
first_dbb_file = dbb->dbb_file;
if (options.dpb_set_page_buffers)
dbb->dbb_page_buffers = options.dpb_page_buffers;
CCH_init(tdbb, (ULONG) options.dpb_buffers);
@ -2007,7 +2014,12 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status,
find_intl_charset(tdbb, attachment, &options);
#ifdef WIN_NT
dbb->dbb_filename = copy_string(first_dbb_file->fil_string,
first_dbb_file->fil_length);
#else
dbb->dbb_filename = copy_string(expanded_name, length);
#endif
#ifdef GOVERNOR
if (!options.dpb_sec_attach) {
@ -4961,6 +4973,7 @@ static void find_intl_charset(TDBB tdbb, ATT attachment, DPB * options)
static void get_options(UCHAR* dpb,
USHORT dpb_length,
TEXT** scratch,
ULONG buf_size,
DPB* options)
{
/**************************************
@ -4996,7 +5009,7 @@ static void get_options(UCHAR* dpb,
if (p < end_dpb && *p++ != gds_dpb_version1)
ERR_post(gds_bad_dpb_form, gds_arg_gds, gds_wrodpbver, 0);
while (p < end_dpb)
while (p < end_dpb && buf_size)
{
switch (*p++)
{
@ -5005,7 +5018,7 @@ static void get_options(UCHAR* dpb,
// CLASSIC have no thread data. Init to zero.
char* t_data = 0;
options->dpb_working_directory =
get_string_parameter(&p, scratch);
get_string_parameter(&p, scratch, &buf_size);
THD_getspecific_data((void **) &t_data);
@ -5020,16 +5033,26 @@ static void get_options(UCHAR* dpb,
if (t_data)
passwd = getpwnam(t_data);
if (passwd) {
strcpy(*scratch, passwd->pw_dir);
l = strlen(passwd->pw_dir) + 1;
if (l <= buf_size)
strcpy(*scratch, passwd->pw_dir);
else
{
**scratch = 0;
l = buf_size;
}
}
else { /*No home dir for this users here. Default to server dir */
getcwd(*scratch, MAXPATHLEN);
l = strlen(*scratch) + 1;
**scratch = 0;
if (getcwd(*scratch, MIN(MAXPATHLEN, buf_size)))
l = strlen(*scratch) + 1;
else
l = buf_size;
}
options->dpb_working_directory = *scratch;
*scratch += l;
buf_size -= l;
}
#endif
if (t_data)
@ -5091,11 +5114,11 @@ static void get_options(UCHAR* dpb,
break;
case gds_dpb_enable_journal:
options->dpb_journal = get_string_parameter(&p, scratch);
options->dpb_journal = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_wal_backup_dir:
options->dpb_wal_backup_dir = get_string_parameter(&p, scratch);
options->dpb_wal_backup_dir = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_drop_walfile:
@ -5134,8 +5157,8 @@ static void get_options(UCHAR* dpb,
if (num_old_files >= MAX_OLD_FILES)
ERR_post(gds_num_old_files, 0);
options->dpb_old_file[num_old_files] =
get_string_parameter(&p, scratch);
options->dpb_old_file [num_old_files] =
get_string_parameter(&p, scratch, &buf_size);
num_old_files++;
break;
@ -5160,28 +5183,28 @@ static void get_options(UCHAR* dpb,
break;
case gds_dpb_sys_user_name:
options->dpb_sys_user_name = get_string_parameter(&p, scratch);
options->dpb_sys_user_name = get_string_parameter(&p, scratch, &buf_size);
break;
case isc_dpb_sql_role_name:
options->dpb_role_name = get_string_parameter(&p, scratch);
options->dpb_role_name = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_user_name:
options->dpb_user_name = get_string_parameter(&p, scratch);
options->dpb_user_name = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_password:
options->dpb_password = get_string_parameter(&p, scratch);
options->dpb_password = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_password_enc:
options->dpb_password_enc = get_string_parameter(&p, scratch);
options->dpb_password_enc = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_encrypt_key:
#ifdef ISC_DATABASE_ENCRYPTION
options->dpb_key = get_string_parameter(&p, scratch);
options->dpb_key = get_string_parameter(&p, scratch, &buf_size);
#else
/* Just in case there WAS a customer using this unsupported
* feature - post an error when they try to access it in 4.0
@ -5221,7 +5244,7 @@ static void get_options(UCHAR* dpb,
break;
case gds_dpb_begin_log:
options->dpb_log = get_string_parameter(&p, scratch);
options->dpb_log = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_quit_log:
@ -5240,11 +5263,11 @@ static void get_options(UCHAR* dpb,
break;
case gds_dpb_lc_messages:
options->dpb_lc_messages = get_string_parameter(&p, scratch);
options->dpb_lc_messages = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_lc_ctype:
options->dpb_lc_ctype = get_string_parameter(&p, scratch);
options->dpb_lc_ctype = get_string_parameter(&p, scratch, &buf_size);
break;
case gds_dpb_shutdown:
@ -5263,8 +5286,8 @@ static void get_options(UCHAR* dpb,
case isc_dpb_reserved:
single =
reinterpret_cast<UCHAR*>(get_string_parameter(&p, scratch));
if (!strcmp(reinterpret_cast < char *>(single), "YES"))
reinterpret_cast<UCHAR*>(get_string_parameter(&p, scratch, &buf_size));
if (single && !strcmp(reinterpret_cast < char *>(single), "YES"))
options->dpb_single_user = TRUE;
break;
@ -5279,7 +5302,7 @@ static void get_options(UCHAR* dpb,
break;
case isc_dpb_gbak_attach:
options->dpb_gbak_attach = get_string_parameter(&p, scratch);
options->dpb_gbak_attach = get_string_parameter(&p, scratch, &buf_size);
break;
case isc_dpb_gstat_attach:
@ -5360,7 +5383,7 @@ static SLONG get_parameter(UCHAR** ptr)
}
static TEXT* get_string_parameter(UCHAR** dpb_ptr, TEXT** opt_ptr)
static TEXT* get_string_parameter(UCHAR** dpb_ptr, TEXT** opt_ptr, ULONG* buf_avail)
{
/**************************************
*
@ -5377,14 +5400,26 @@ static TEXT* get_string_parameter(UCHAR** dpb_ptr, TEXT** opt_ptr)
UCHAR *dpb;
USHORT l;
if (!*buf_avail) /* Because "l" may be zero but the NULL term still is set. */
return 0;
opt = *opt_ptr;
dpb = *dpb_ptr;
if ( (l = *(dpb++)) )
if ((l = *(dpb++)))
{
if (l >= *buf_avail) /* >= to count the NULL term. */
{
*buf_avail = 0;
return 0;
}
*buf_avail -= l;
do
*opt++ = *dpb++;
while (--l);
}
--*buf_avail;
*opt++ = 0;
*dpb_ptr = dpb;
dpb = (UCHAR *) * opt_ptr;

View File

@ -695,12 +695,15 @@ typedef struct que {
/* symbol definitions */
typedef ENUM sym_t { SYM_rel, /* relation block */
typedef ENUM sym_t {
SYM_rel, /* relation block */
SYM_fld, /* field block */
SYM_fun, /* UDF function block */
SYM_prc, /* stored procedure block */
SYM_sql, /* SQL request cache block */
SYM_blr /* BLR request cache block */ } SYM_T;
SYM_blr, /* BLR request cache block */
SYM_label /* CVC: I need to track labels if LEAVE is implemented. */
} SYM_T;
class sym : public pool_alloc<type_sym>
{
@ -854,10 +857,11 @@ typedef struct ihndl
#define PLATFORM_GET_THREAD_DATA ((TDBB) THD_get_specific())
#endif
/* RITTER - changed HP10 to HPUX in the expression below */
#ifdef MULTI_THREAD
#if (defined DECOSF || defined NETWARE_386 || \
defined SOLARIS_MT || defined WIN_NT || \
defined HP10 || defined LINUX || defined DARWIN )
defined HPUX || defined LINUX || defined DARWIN )
#define PLATFORM_GET_THREAD_DATA ((TDBB) THD_get_specific())
#endif
#endif

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: license.h,v 1.15 2002-06-29 13:33:51 skywalker Exp $
* $Id: license.h,v 1.16 2002-07-02 09:49:19 dimitr Exp $
* Revision 1.5 2000/12/08 16:18:21 fsg
* Preliminary changes to get IB_BUILD_NO automatically
* increased on commits.
@ -60,6 +60,9 @@
#ifdef HP10
#define FB_PLATFORM "HU"
#endif /* HP10 */
#ifdef HP11 /* RITTER */
#define FB_PLATFORM "HU"
#endif /* HP11 */
#endif
#ifdef sun
@ -167,6 +170,10 @@
#define FB_PLATFORM "LI" /* Linux on Intel */
#endif
#ifdef SINIXZ
#define FB_PLATFORM "SZ" /* SINIX for PC */
#endif
#ifdef FREEBSD
#define FB_PLATFORM "FB" /* FreeBSD/i386 */
#endif