mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 05:23:03 +01:00
Cleanup
Some minor corrections Second step to rename
This commit is contained in:
parent
6d78f54f01
commit
2ab1f94dd2
@ -32,7 +32,7 @@
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* $Id: alloc.cpp,v 1.43 2004-03-09 00:16:55 skidder Exp $
|
||||
* $Id: alloc.cpp,v 1.44 2004-03-11 05:03:44 robocop Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -266,7 +266,8 @@ void* MemoryPool::allocate_nothrow(size_t size, SSHORT type
|
||||
, file, line
|
||||
#endif
|
||||
);
|
||||
if (needSpare) updateSpare();
|
||||
if (needSpare)
|
||||
updateSpare();
|
||||
lock.leave();
|
||||
// test with older behavior
|
||||
// memset(result,0,size);
|
||||
|
@ -28,8 +28,8 @@
|
||||
* Contributor(s): ______________________________________.
|
||||
*/
|
||||
|
||||
#ifndef AUTO_Ptr_H
|
||||
#define AUTO_Ptr_H
|
||||
#ifndef CLASSES_AUTO_PTR_H
|
||||
#define CLASSES_AUTO_PTR_H
|
||||
|
||||
template <typename Where>
|
||||
class AutoPtr {
|
||||
@ -42,4 +42,30 @@ public:
|
||||
~AutoPtr<Where>() {delete ptr;}
|
||||
};
|
||||
|
||||
#endif // AUTO_Ptr_H
|
||||
|
||||
// CVC: It turns out that AutoPtr was designed to deallocate single objects,
|
||||
// not arrays. Worse even, we need in many places to allocate dynamically an
|
||||
// array of char*/UCHAR* that's later converted into a pointer to a single
|
||||
// object and passed to AutoPtr. In that case, AutoPtr will invoke the wrong
|
||||
// deallocation logic and therefore we have undefined behavior, typically a leak.
|
||||
// See execute_statement.cpp for an example. This is the reason this
|
||||
// AutoPtrFromString beast was created.
|
||||
|
||||
template <typename Where>
|
||||
class AutoPtrFromString {
|
||||
private:
|
||||
Where* ptr;
|
||||
public:
|
||||
AutoPtrFromString<Where>(Where* v) {ptr = v;}
|
||||
operator Where* () {return ptr;}
|
||||
Where* operator-> () {return ptr;}
|
||||
~AutoPtrFromString<Where>()
|
||||
{
|
||||
char* p = reinterpret_cast<char*>(ptr);
|
||||
delete[] p;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // CLASSES_AUTO_PTR_H
|
||||
|
||||
|
@ -3694,7 +3694,8 @@ static USHORT get_plan_info(
|
||||
// NOMEM. Do not attempt one more try
|
||||
i++;
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
buffer_ptr = temp;
|
||||
buffer_length = BUFFER_XLARGE;
|
||||
}
|
||||
|
@ -93,7 +93,8 @@ void HSHD_init(void)
|
||||
|
||||
UCHAR* p = (UCHAR *) gds__alloc(sizeof(DSQL_SYM) * HASH_SIZE);
|
||||
// This is appropriate to throw exception here, callers check for it
|
||||
if(!p) throw std::bad_alloc();
|
||||
if(!p)
|
||||
throw std::bad_alloc();
|
||||
|
||||
memset(p, 0, sizeof(DSQL_SYM) * HASH_SIZE);
|
||||
|
||||
|
@ -84,10 +84,12 @@ enum act_t {
|
||||
act_s_generator /* reset generator value */
|
||||
};
|
||||
|
||||
struct dbb;
|
||||
|
||||
typedef struct act {
|
||||
enum act_t act_type; // what to do
|
||||
act* act_next; // next action in system
|
||||
struct dbb* act_object; // object in question (dudley_rel, dudley_fld, idx, etc.)
|
||||
dbb* act_object; // object in question (dudley_rel, dudley_fld, idx, etc.)
|
||||
USHORT act_line; // line the action started on
|
||||
USHORT act_flags;
|
||||
} *ACT;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* PROGRAM: InterBase International support
|
||||
* MODULE: cs_gb2312.cpp
|
||||
* PROGRAM: InterBase International support
|
||||
* MODULE: cs_gb2312.cpp
|
||||
* DESCRIPTION: Character Set definitions for GB2312 family.
|
||||
*
|
||||
* The contents of this file are subject to the Interbase Public
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* PROGRAM: InterBase International support
|
||||
* MODULE: cs_ksc.cpp
|
||||
* MODULE: cs_ksc.cpp
|
||||
* DESCRIPTION: Character set definitions for KSC-5601.
|
||||
*
|
||||
* The contents of this file are subject to the Interbase Public
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "../intl/ldcommon.h"
|
||||
#include "cv_narrow.h"
|
||||
|
||||
static void common_8bit_init(CHARSET csptr,
|
||||
static void common_8bit_init(charset* csptr,
|
||||
SSHORT id,
|
||||
const ASCII* name,
|
||||
const USHORT* to_unicode_tbl,
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "../intl/cv_big5.h"
|
||||
#include "ld_proto.h"
|
||||
|
||||
USHORT CVBIG5_big5_to_unicode(CSCONVERT obj,
|
||||
USHORT CVBIG5_big5_to_unicode(csconvert* obj,
|
||||
UCS2_CHAR *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const UCHAR* src_ptr,
|
||||
@ -92,16 +92,16 @@ USHORT CVBIG5_big5_to_unicode(CSCONVERT obj,
|
||||
*dest_ptr++ = ch;
|
||||
dest_len -= sizeof(UCS2_CHAR);
|
||||
src_len -= this_len;
|
||||
};
|
||||
}
|
||||
if (src_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
};
|
||||
}
|
||||
*err_position = src_start - src_len;
|
||||
return ((dest_ptr - start) * sizeof(*dest_ptr));
|
||||
}
|
||||
|
||||
|
||||
USHORT CVBIG5_unicode_to_big5(CSCONVERT obj,
|
||||
USHORT CVBIG5_unicode_to_big5(csconvert* obj,
|
||||
UCHAR *big5_str,
|
||||
USHORT big5_len,
|
||||
const UCS2_CHAR* unicode_str,
|
||||
@ -134,7 +134,7 @@ USHORT CVBIG5_unicode_to_big5(CSCONVERT obj,
|
||||
if ((big5_ch == CS_CANT_MAP) && !(wide == CS_CANT_MAP)) {
|
||||
*err_code = CS_CONVERT_ERROR;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
// int ???
|
||||
const int tmp1 = big5_ch / 256;
|
||||
@ -144,7 +144,7 @@ USHORT CVBIG5_unicode_to_big5(CSCONVERT obj,
|
||||
big5_len--;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
continue;
|
||||
};
|
||||
}
|
||||
if (big5_len < 2) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
break;
|
||||
@ -156,7 +156,7 @@ USHORT CVBIG5_unicode_to_big5(CSCONVERT obj,
|
||||
*big5_str++ = tmp2;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
big5_len -= 2;
|
||||
};
|
||||
}
|
||||
}
|
||||
if (unicode_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
@ -231,7 +231,7 @@ USHORT CVBIG5_big5_byte2short(TEXTTYPE obj,
|
||||
if (src_len < 2) {
|
||||
*err_code = CS_BAD_INPUT;
|
||||
break;
|
||||
};
|
||||
}
|
||||
x = (*src << 8) + (*(src + 1));
|
||||
src += 2;
|
||||
src_len -= 2;
|
||||
@ -239,7 +239,7 @@ USHORT CVBIG5_big5_byte2short(TEXTTYPE obj,
|
||||
else {
|
||||
x = *src++;
|
||||
src_len--;
|
||||
};
|
||||
}
|
||||
*dst = x; /* Assumes alignment */
|
||||
++dst;
|
||||
dst_len -= sizeof(USHORT);
|
||||
@ -270,7 +270,7 @@ SSHORT CVBIG5_big5_mbtowc(TEXTTYPE obj,
|
||||
if (BIG51(*src)) {
|
||||
if (src_len < 2) {
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
if (wc)
|
||||
*wc = (*src << 8) + (*(src + 1));
|
||||
return 2;
|
||||
@ -279,6 +279,6 @@ SSHORT CVBIG5_big5_mbtowc(TEXTTYPE obj,
|
||||
if (wc)
|
||||
*wc = *src++;
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,10 +29,10 @@
|
||||
#define BIG52(uc) ((UCHAR)((uc)&0xff)>=0x40 && \
|
||||
(UCHAR)((uc)&0xff)<=0xfe) /* BIG-5 2nd-byte */
|
||||
|
||||
USHORT CVBIG5_big5_to_unicode(CSCONVERT obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
USHORT CVBIG5_big5_to_unicode(csconvert* obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
const UCHAR* src_ptr,
|
||||
USHORT src_len, SSHORT *err_code, USHORT *err_position);
|
||||
USHORT CVBIG5_unicode_to_big5(CSCONVERT obj, UCHAR *big5_str, USHORT big5_len,
|
||||
USHORT CVBIG5_unicode_to_big5(csconvert* obj, UCHAR *big5_str, USHORT big5_len,
|
||||
const USHORT* unicode_str,
|
||||
USHORT unicode_len, SSHORT *err_code, USHORT *err_position);
|
||||
USHORT CVBIG5_check_big5(const UCHAR* big5_str, USHORT big5_len);
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "../intl/cv_gb2312.h"
|
||||
#include "ld_proto.h"
|
||||
|
||||
USHORT CVGB_gb2312_to_unicode(CSCONVERT obj,
|
||||
USHORT CVGB_gb2312_to_unicode(csconvert* obj,
|
||||
UCS2_CHAR *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const UCHAR* src_ptr,
|
||||
@ -93,16 +93,16 @@ USHORT CVGB_gb2312_to_unicode(CSCONVERT obj,
|
||||
*dest_ptr++ = ch;
|
||||
dest_len -= sizeof(*dest_ptr);
|
||||
src_len -= this_len;
|
||||
};
|
||||
}
|
||||
if (src_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
};
|
||||
}
|
||||
*err_position = src_start - src_len;
|
||||
return ((dest_ptr - start) * sizeof(*dest_ptr));
|
||||
}
|
||||
|
||||
|
||||
USHORT CVGB_unicode_to_gb2312(CSCONVERT obj,
|
||||
USHORT CVGB_unicode_to_gb2312(csconvert* obj,
|
||||
UCHAR *gb_str,
|
||||
USHORT gb_len,
|
||||
const UCS2_CHAR* unicode_str,
|
||||
@ -137,7 +137,7 @@ USHORT CVGB_unicode_to_gb2312(CSCONVERT obj,
|
||||
if ((gb_ch == CS_CANT_MAP) && !(wide == CS_CANT_MAP)) {
|
||||
*err_code = CS_CONVERT_ERROR;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
const int tmp1 = gb_ch / 256;
|
||||
const int tmp2 = gb_ch % 256;
|
||||
@ -146,7 +146,7 @@ USHORT CVGB_unicode_to_gb2312(CSCONVERT obj,
|
||||
gb_len--;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
continue;
|
||||
};
|
||||
}
|
||||
if (gb_len < 2) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
break;
|
||||
@ -158,7 +158,7 @@ USHORT CVGB_unicode_to_gb2312(CSCONVERT obj,
|
||||
*gb_str++ = tmp2;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
gb_len -= 2;
|
||||
};
|
||||
}
|
||||
}
|
||||
if (unicode_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
@ -233,7 +233,7 @@ USHORT CVGB_gb2312_byte2short(TEXTTYPE obj,
|
||||
if (src_len < 2) {
|
||||
*err_code = CS_BAD_INPUT;
|
||||
break;
|
||||
};
|
||||
}
|
||||
x = (*src << 8) + (*(src + 1));
|
||||
src += 2;
|
||||
src_len -= 2;
|
||||
@ -241,7 +241,7 @@ USHORT CVGB_gb2312_byte2short(TEXTTYPE obj,
|
||||
else {
|
||||
x = *src++;
|
||||
src_len--;
|
||||
};
|
||||
}
|
||||
*dst = x; /* Assumes alignment */
|
||||
++dst;
|
||||
dst_len -= sizeof(USHORT);
|
||||
@ -272,7 +272,7 @@ SSHORT CVGB_gb2312_mbtowc(TEXTTYPE obj,
|
||||
if (GB1(*src)) {
|
||||
if (src_len < 2) {
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
if (wc)
|
||||
*wc = (*src << 8) + (*(src + 1));
|
||||
return 2;
|
||||
@ -281,6 +281,6 @@ SSHORT CVGB_gb2312_mbtowc(TEXTTYPE obj,
|
||||
if (wc)
|
||||
*wc = *src++;
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,11 +27,11 @@
|
||||
#define GB2(uc) ((UCHAR)((uc)&0xff)>=0xa1 && \
|
||||
(UCHAR)((uc)&0xff)<=0xfe) /* GB2312 2nd-byte */
|
||||
|
||||
USHORT CVGB_gb2312_to_unicode(CSCONVERT obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
USHORT CVGB_gb2312_to_unicode(csconvert* obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
const UCHAR* src_ptr,
|
||||
USHORT src_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CVGB_unicode_to_gb2312(CSCONVERT obj, UCHAR *gb_str, USHORT gb_len,
|
||||
USHORT CVGB_unicode_to_gb2312(csconvert* obj, UCHAR *gb_str, USHORT gb_len,
|
||||
const USHORT* unicode_str,
|
||||
USHORT unicode_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "cv_narrow.h"
|
||||
#include "ld_proto.h"
|
||||
|
||||
USHORT CVJIS_eucj_to_unicode(CSCONVERT obj,
|
||||
USHORT CVJIS_eucj_to_unicode(csconvert* obj,
|
||||
UCS2_CHAR *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const UCHAR* src_ptr,
|
||||
@ -83,7 +83,7 @@ USHORT CVJIS_eucj_to_unicode(CSCONVERT obj,
|
||||
[((const USHORT*) obj->csconvert_misc)
|
||||
[(USHORT)wide / 256]
|
||||
+ (wide % 256)];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/* No need to check for CS_CONVERT_ERROR -
|
||||
@ -93,10 +93,10 @@ USHORT CVJIS_eucj_to_unicode(CSCONVERT obj,
|
||||
*dest_ptr++ = ch;
|
||||
dest_len -= sizeof(*dest_ptr);
|
||||
src_len -= this_len;
|
||||
};
|
||||
}
|
||||
if (src_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
};
|
||||
}
|
||||
*err_position = src_start - src_len;
|
||||
return ((dest_ptr - start) * sizeof(*dest_ptr));
|
||||
}
|
||||
@ -124,7 +124,7 @@ static void S2E(const UCHAR s1, const UCHAR s2, UCHAR& j1, UCHAR& j2)
|
||||
}
|
||||
|
||||
|
||||
USHORT CVJIS_sjis_to_unicode(CSCONVERT obj,
|
||||
USHORT CVJIS_sjis_to_unicode(csconvert* obj,
|
||||
UCS2_CHAR *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const UCHAR* sjis_str,
|
||||
@ -205,13 +205,13 @@ USHORT CVJIS_sjis_to_unicode(CSCONVERT obj,
|
||||
fb_assert(wide <= 255);
|
||||
ch = sjis_to_unicode_mapping_array
|
||||
[sjis_to_unicode_map[(USHORT) wide / 256] + (wide % 256)];
|
||||
};
|
||||
}
|
||||
|
||||
/* This is only important for bad-SJIS in input stream */
|
||||
if ((ch == CS_CANT_MAP) && !(wide == CS_CANT_MAP)) {
|
||||
*err_code = CS_CONVERT_ERROR;
|
||||
break;
|
||||
};
|
||||
}
|
||||
*dest_ptr++ = ch;
|
||||
dest_len -= sizeof(*dest_ptr);
|
||||
sjis_len -= this_len;
|
||||
@ -379,7 +379,7 @@ I hope this helps in the discussion.
|
||||
*/
|
||||
|
||||
|
||||
USHORT CVJIS_unicode_to_sjis(CSCONVERT obj,
|
||||
USHORT CVJIS_unicode_to_sjis(csconvert* obj,
|
||||
UCHAR* sjis_str,
|
||||
USHORT sjis_len,
|
||||
const UCS2_CHAR* unicode_str,
|
||||
@ -418,8 +418,8 @@ USHORT CVJIS_unicode_to_sjis(CSCONVERT obj,
|
||||
if ((jis_ch == CS_CANT_MAP) && !(wide == CS_CANT_MAP)) {
|
||||
*err_code = CS_CONVERT_ERROR;
|
||||
break;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 2: Convert from JIS code to SJIS */
|
||||
USHORT tmp1 = jis_ch / 256;
|
||||
@ -429,7 +429,7 @@ USHORT CVJIS_unicode_to_sjis(CSCONVERT obj,
|
||||
sjis_len--;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
continue;
|
||||
};
|
||||
}
|
||||
seven2eight(&tmp1, &tmp2);
|
||||
if (tmp1 == 0) { /* half-width kana ? */
|
||||
fb_assert(SJIS_SINGLE(tmp2));
|
||||
@ -448,7 +448,7 @@ USHORT CVJIS_unicode_to_sjis(CSCONVERT obj,
|
||||
*sjis_str++ = tmp2;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
sjis_len -= 2;
|
||||
};
|
||||
}
|
||||
}
|
||||
if (unicode_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
@ -458,7 +458,7 @@ USHORT CVJIS_unicode_to_sjis(CSCONVERT obj,
|
||||
}
|
||||
|
||||
|
||||
USHORT CVJIS_unicode_to_eucj(CSCONVERT obj, UCHAR *eucj_str, USHORT eucj_len,
|
||||
USHORT CVJIS_unicode_to_eucj(csconvert* obj, UCHAR *eucj_str, USHORT eucj_len,
|
||||
const UCS2_CHAR* unicode_str,
|
||||
USHORT unicode_len, SSHORT *err_code, USHORT *err_position)
|
||||
{
|
||||
@ -494,7 +494,7 @@ USHORT CVJIS_unicode_to_eucj(CSCONVERT obj, UCHAR *eucj_str, USHORT eucj_len,
|
||||
if ((jis_ch == CS_CANT_MAP) && !(wide == CS_CANT_MAP)) {
|
||||
*err_code = CS_CONVERT_ERROR;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
/* Step 2: Convert from JIS code to EUC-J */
|
||||
const USHORT tmp1 = jis_ch / 256;
|
||||
@ -505,7 +505,7 @@ USHORT CVJIS_unicode_to_eucj(CSCONVERT obj, UCHAR *eucj_str, USHORT eucj_len,
|
||||
eucj_len--;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
continue;
|
||||
};
|
||||
}
|
||||
if (eucj_len < 2) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
break;
|
||||
@ -517,7 +517,7 @@ USHORT CVJIS_unicode_to_eucj(CSCONVERT obj, UCHAR *eucj_str, USHORT eucj_len,
|
||||
*eucj_str++ = tmp2 | 0x80;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
eucj_len -= 2;
|
||||
};
|
||||
}
|
||||
}
|
||||
if (unicode_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
@ -553,7 +553,6 @@ static USHORT CVJIS_check_euc(const UCHAR* euc_str, USHORT euc_len)
|
||||
}
|
||||
}
|
||||
else { /* it is a ASCII */
|
||||
|
||||
euc_str++;
|
||||
}
|
||||
}
|
||||
@ -590,12 +589,10 @@ static USHORT CVJIS_check_sjis(const UCHAR* sjis_str, USHORT sjis_len)
|
||||
}
|
||||
}
|
||||
else { /*It is a KANA */
|
||||
|
||||
sjis_str++;
|
||||
}
|
||||
}
|
||||
else { /* it is a ASCII */
|
||||
|
||||
sjis_str++;
|
||||
}
|
||||
}
|
||||
@ -604,7 +601,7 @@ static USHORT CVJIS_check_sjis(const UCHAR* sjis_str, USHORT sjis_len)
|
||||
#endif
|
||||
|
||||
|
||||
static USHORT CVJIS_euc2sjis(CSCONVERT obj, UCHAR *sjis_str, USHORT sjis_len,
|
||||
static USHORT CVJIS_euc2sjis(csconvert* obj, UCHAR *sjis_str, USHORT sjis_len,
|
||||
const UCHAR* euc_str,
|
||||
USHORT euc_len, SSHORT *err_code, USHORT *err_position)
|
||||
{
|
||||
@ -657,7 +654,7 @@ static USHORT CVJIS_euc2sjis(CSCONVERT obj, UCHAR *sjis_str, USHORT sjis_len,
|
||||
if (sjis_len < 2) { /*buffer full */
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
break;
|
||||
};
|
||||
}
|
||||
sjis_len -= 2;
|
||||
euc_len -= 2;
|
||||
c1 ^= 0x80;
|
||||
@ -678,7 +675,6 @@ static USHORT CVJIS_euc2sjis(CSCONVERT obj, UCHAR *sjis_str, USHORT sjis_len,
|
||||
}
|
||||
}
|
||||
else { /* ASCII */
|
||||
|
||||
euc_len--;
|
||||
sjis_len--;
|
||||
*sjis_str++ = *euc_str++;
|
||||
@ -728,7 +724,7 @@ USHORT CVJIS_euc_byte2short(TEXTTYPE obj, USHORT* dst, USHORT dst_len, // length
|
||||
if (src_len <= 1) {
|
||||
*err_code = CS_BAD_INPUT;
|
||||
break;
|
||||
};
|
||||
}
|
||||
x = (*src << 8) + (*(src + 1));
|
||||
src += 2;
|
||||
src_len -= 2;
|
||||
@ -736,7 +732,7 @@ USHORT CVJIS_euc_byte2short(TEXTTYPE obj, USHORT* dst, USHORT dst_len, // length
|
||||
else {
|
||||
x = *src++;
|
||||
src_len--;
|
||||
};
|
||||
}
|
||||
*dst = x; /* Assumes alignment */
|
||||
++dst;
|
||||
dst_len -= sizeof(USHORT);
|
||||
@ -769,7 +765,7 @@ SSHORT CVJIS_euc_mbtowc(TEXTTYPE obj, UCS2_CHAR* wc, const UCHAR* src, USHORT sr
|
||||
if (EUC1(*src)) {
|
||||
if (src_len <= 1) {
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
if (wc)
|
||||
*wc = (*src << 8) + (*(src + 1));
|
||||
return 2;
|
||||
@ -778,10 +774,10 @@ SSHORT CVJIS_euc_mbtowc(TEXTTYPE obj, UCS2_CHAR* wc, const UCHAR* src, USHORT sr
|
||||
if (wc)
|
||||
*wc = *src++;
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static USHORT CVJIS_sjis2euc(CSCONVERT obj, UCHAR *euc_str, USHORT euc_len,
|
||||
static USHORT CVJIS_sjis2euc(csconvert* obj, UCHAR *euc_str, USHORT euc_len,
|
||||
const UCHAR* sjis_str,
|
||||
USHORT sjis_len, SSHORT *err_code, USHORT *err_position)
|
||||
{
|
||||
@ -823,7 +819,7 @@ static USHORT CVJIS_sjis2euc(CSCONVERT obj, UCHAR *euc_str, USHORT euc_len,
|
||||
if (euc_len < 2) { /*buffer full */
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
break;
|
||||
};
|
||||
}
|
||||
S2E(c1, c2, *euc_str, *(euc_str + 1));
|
||||
euc_str += 2;
|
||||
euc_len -= 2;
|
||||
@ -840,13 +836,11 @@ static USHORT CVJIS_sjis2euc(CSCONVERT obj, UCHAR *euc_str, USHORT euc_len,
|
||||
*euc_str++ = c1;
|
||||
}
|
||||
else { /* It is some bad character */
|
||||
|
||||
*err_code = CS_BAD_INPUT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else { /* it is a ASCII */
|
||||
|
||||
euc_len--;
|
||||
sjis_len--;
|
||||
*euc_str++ = *sjis_str++;
|
||||
@ -897,7 +891,7 @@ USHORT CVJIS_sjis_byte2short(TEXTTYPE obj, USHORT* dst, USHORT dst_len, // byte
|
||||
if (src_len <= 1) {
|
||||
*err_code = CS_BAD_INPUT;
|
||||
break;
|
||||
};
|
||||
}
|
||||
x = (*src << 8) + *(src + 1);
|
||||
src_len -= 2;
|
||||
src += 2;
|
||||
@ -940,7 +934,7 @@ SSHORT CVJIS_sjis_mbtowc(TEXTTYPE obj, UCS2_CHAR* wc, const UCHAR* src, USHORT s
|
||||
if (SJIS1(*src)) {
|
||||
if (src_len <= 1) {
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
if (wc)
|
||||
*wc = (*src << 8) + (*(src + 1));
|
||||
return 2;
|
||||
@ -949,7 +943,7 @@ SSHORT CVJIS_sjis_mbtowc(TEXTTYPE obj, UCS2_CHAR* wc, const UCHAR* src, USHORT s
|
||||
if (wc)
|
||||
*wc = *src++;
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
CONVERT_ENTRY(CS_SJIS, CS_EUCJ, CVJIS_sjis_x_eucj)
|
||||
|
@ -21,19 +21,19 @@
|
||||
* Contributor(s): ______________________________________.
|
||||
*/
|
||||
|
||||
USHORT CVJIS_sjis_to_unicode(CSCONVERT obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
USHORT CVJIS_sjis_to_unicode(csconvert* obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
const UCHAR* sjis_str,
|
||||
USHORT sjis_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CVJIS_unicode_to_sjis(CSCONVERT obj, UCHAR *sjis_str, USHORT sjis_len,
|
||||
USHORT CVJIS_unicode_to_sjis(csconvert* obj, UCHAR *sjis_str, USHORT sjis_len,
|
||||
const USHORT* unicode_str,
|
||||
USHORT unicode_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CVJIS_eucj_to_unicode(CSCONVERT obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
USHORT CVJIS_eucj_to_unicode(csconvert* obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
const UCHAR* src_ptr,
|
||||
USHORT src_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CVJIS_unicode_to_eucj(CSCONVERT obj, UCHAR *eucj_str, USHORT eucj_len,
|
||||
USHORT CVJIS_unicode_to_eucj(csconvert* obj, UCHAR *eucj_str, USHORT eucj_len,
|
||||
const USHORT* unicode_str,
|
||||
USHORT unicode_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
@ -42,9 +42,9 @@ static USHORT CVJIS_check_euc(UCHAR *euc_str, USHORT euc_len);
|
||||
|
||||
static USHORT CVJIS_check_sjis(UCHAR *sjis_str, USHORT sjis_len);
|
||||
|
||||
static USHORT CVJIS_euc2sjis(CSCONVERT obj, UCHAR *sjis_str, USHORT sjis_len, UCHAR *euc_str
|
||||
static USHORT CVJIS_euc2sjis(csconvert* obj, UCHAR *sjis_str, USHORT sjis_len, UCHAR *euc_str
|
||||
, USHORT euc_len, SSHORT *err_code, USHORT *err_position);
|
||||
static USHORT CVJIS_sjis2euc(CSCONVERT obj, UCHAR *euc_str, USHORT euc_len, UCHAR *sjis_str
|
||||
static USHORT CVJIS_sjis2euc(csconvert* obj, UCHAR *euc_str, USHORT euc_len, UCHAR *sjis_str
|
||||
, USHORT sjis_len, SSHORT *err_code, USHORT *err_position);
|
||||
*/
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
* KSC-5601 to EUC is not needed.
|
||||
*/
|
||||
|
||||
USHORT CVKSC_ksc_to_unicode(CSCONVERT obj,
|
||||
USHORT CVKSC_ksc_to_unicode(csconvert* obj,
|
||||
UCS2_CHAR *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const UCHAR* ksc_str,
|
||||
@ -80,7 +80,6 @@ USHORT CVKSC_ksc_to_unicode(CSCONVERT obj,
|
||||
}
|
||||
}
|
||||
else { /* it is ASCII */
|
||||
|
||||
wide = *ksc_str++;
|
||||
this_len = 1;
|
||||
}
|
||||
@ -105,7 +104,7 @@ USHORT CVKSC_ksc_to_unicode(CSCONVERT obj,
|
||||
}
|
||||
|
||||
|
||||
USHORT CVKSC_unicode_to_ksc(CSCONVERT obj,
|
||||
USHORT CVKSC_unicode_to_ksc(csconvert* obj,
|
||||
UCHAR *ksc_str,
|
||||
USHORT ksc_len,
|
||||
const UCS2_CHAR* unicode_str,
|
||||
@ -229,7 +228,6 @@ USHORT CVKSC_ksc_byte2short(TEXTTYPE obj,
|
||||
break;
|
||||
}
|
||||
else { /* ASCII */
|
||||
|
||||
x = *src++;
|
||||
src_len -= 1;
|
||||
}
|
||||
@ -273,7 +271,6 @@ SSHORT CVKSC_ksc_mbtowc(TEXTTYPE obj,
|
||||
else if (*src > 0x7f) /* error */
|
||||
return -1;
|
||||
else { /* ASCII */
|
||||
|
||||
if (wc)
|
||||
*wc = *src++;
|
||||
return 1;
|
||||
|
@ -37,11 +37,11 @@
|
||||
|
||||
#define LANGKSC_MAX_KEY 4096
|
||||
|
||||
USHORT CVKSC_ksc_to_unicode(CSCONVERT obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
USHORT CVKSC_ksc_to_unicode(csconvert* obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
const UCHAR* ksc_str, USHORT ksc_len,
|
||||
SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CVKSC_unicode_to_ksc(CSCONVERT obj, UCHAR *ksc_str, USHORT ksc_len,
|
||||
USHORT CVKSC_unicode_to_ksc(csconvert* obj, UCHAR *ksc_str, USHORT ksc_len,
|
||||
const USHORT* unicode_str,
|
||||
USHORT unicode_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "ld_proto.h"
|
||||
#include "cv_narrow.h"
|
||||
|
||||
void CV_convert_init(CSCONVERT csptr,
|
||||
void CV_convert_init(csconvert* csptr,
|
||||
SSHORT to_cs,
|
||||
SSHORT from_cs,
|
||||
pfn_INTL_convert cvt_fn,
|
||||
@ -44,7 +44,7 @@ void CV_convert_init(CSCONVERT csptr,
|
||||
|
||||
|
||||
|
||||
USHORT CV_unicode_to_nc(CSCONVERT obj,
|
||||
USHORT CV_unicode_to_nc(csconvert* obj,
|
||||
BYTE *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const BYTE* src_ptr,
|
||||
@ -82,20 +82,20 @@ USHORT CV_unicode_to_nc(CSCONVERT obj,
|
||||
src_ptr += 2;
|
||||
src_len -= 2;
|
||||
dest_len -= 1;
|
||||
};
|
||||
}
|
||||
if (src_len && !*err_code) {
|
||||
if (src_len == 1)
|
||||
*err_code = CS_BAD_INPUT;
|
||||
else
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
};
|
||||
}
|
||||
*err_position = src_start - src_len;
|
||||
return (dest_ptr - start);
|
||||
}
|
||||
|
||||
|
||||
USHORT CV_wc_to_wc(CSCONVERT obj,
|
||||
USHORT *dest_ptr,
|
||||
USHORT CV_wc_to_wc(csconvert* obj,
|
||||
USHORT* dest_ptr,
|
||||
USHORT dest_len,
|
||||
const USHORT* src_ptr,
|
||||
USHORT src_len,
|
||||
@ -133,19 +133,19 @@ USHORT CV_wc_to_wc(CSCONVERT obj,
|
||||
src_ptr++;
|
||||
src_len -= 2;
|
||||
dest_len -= 2;
|
||||
};
|
||||
}
|
||||
if (src_len && !*err_code) {
|
||||
if (src_len == 1)
|
||||
*err_code = CS_BAD_INPUT;
|
||||
else
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
};
|
||||
}
|
||||
*err_position = src_start - src_len;
|
||||
return ((dest_ptr - start) * sizeof(*dest_ptr));
|
||||
}
|
||||
|
||||
|
||||
USHORT CV_nc_to_unicode(CSCONVERT obj,
|
||||
USHORT CV_nc_to_unicode(csconvert* obj,
|
||||
BYTE *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const BYTE* src_ptr,
|
||||
@ -180,16 +180,16 @@ USHORT CV_nc_to_unicode(CSCONVERT obj,
|
||||
src_len--;
|
||||
dest_len -= sizeof(UNICODE);
|
||||
dest_ptr += sizeof(UNICODE);
|
||||
};
|
||||
}
|
||||
if (src_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
};
|
||||
}
|
||||
*err_position = src_start - src_len;
|
||||
return (dest_ptr - start);
|
||||
}
|
||||
|
||||
|
||||
USHORT CV_wc_copy(CSCONVERT obj,
|
||||
USHORT CV_wc_copy(csconvert* obj,
|
||||
BYTE *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const BYTE* src_ptr,
|
||||
@ -216,19 +216,19 @@ USHORT CV_wc_copy(CSCONVERT obj,
|
||||
*dest_ptr++ = *src_ptr++; /* 2nd byte of unicode */
|
||||
src_len -= 2;
|
||||
dest_len -= 2;
|
||||
};
|
||||
}
|
||||
if (src_len && !*err_code) {
|
||||
if (src_len == 1)
|
||||
*err_code = CS_BAD_INPUT;
|
||||
else
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
};
|
||||
}
|
||||
*err_position = src_start - src_len;
|
||||
return (dest_ptr - start);
|
||||
}
|
||||
|
||||
|
||||
USHORT eight_bit_convert(CSCONVERT obj,
|
||||
USHORT eight_bit_convert(csconvert* obj,
|
||||
BYTE *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const BYTE* src_ptr,
|
||||
@ -256,15 +256,15 @@ USHORT eight_bit_convert(CSCONVERT obj,
|
||||
if ((ch == CS_CANT_MAP) && (*src_ptr != CS_CANT_MAP)) {
|
||||
*err_code = CS_CONVERT_ERROR;
|
||||
break;
|
||||
};
|
||||
}
|
||||
*dest_ptr++ = ch;
|
||||
src_ptr++;
|
||||
src_len--;
|
||||
dest_len--;
|
||||
};
|
||||
}
|
||||
if (src_len && !*err_code) {
|
||||
*err_code = CS_TRUNCATION_ERROR;
|
||||
};
|
||||
}
|
||||
*err_position = src_start - src_len;
|
||||
return (dest_ptr - start);
|
||||
}
|
||||
|
@ -21,26 +21,26 @@
|
||||
* Contributor(s): ______________________________________.
|
||||
*/
|
||||
|
||||
void CV_convert_init(CSCONVERT csptr, SSHORT to_cs, SSHORT from_cs,
|
||||
void CV_convert_init(csconvert* csptr, SSHORT to_cs, SSHORT from_cs,
|
||||
pfn_INTL_convert cvt_fn, const void *datatable, const void *datatable2);
|
||||
|
||||
USHORT CV_wc_to_wc(CSCONVERT obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
USHORT CV_wc_to_wc(csconvert* obj, USHORT *dest_ptr, USHORT dest_len,
|
||||
const USHORT* src_ptr, USHORT src_len,
|
||||
SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CV_unicode_to_nc(CSCONVERT obj, BYTE *dest_ptr, USHORT dest_len,
|
||||
USHORT CV_unicode_to_nc(csconvert* obj, BYTE *dest_ptr, USHORT dest_len,
|
||||
const BYTE* src_ptr, USHORT src_len,
|
||||
SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CV_nc_to_unicode(CSCONVERT obj, BYTE *dest_ptr, USHORT dest_len,
|
||||
USHORT CV_nc_to_unicode(csconvert* obj, BYTE *dest_ptr, USHORT dest_len,
|
||||
const BYTE* src_ptr, USHORT src_len,
|
||||
SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CV_wc_copy(CSCONVERT obj, BYTE *dest_ptr, USHORT dest_len,
|
||||
USHORT CV_wc_copy(csconvert* obj, BYTE *dest_ptr, USHORT dest_len,
|
||||
const BYTE* src_ptr, USHORT src_len,
|
||||
SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT eight_bit_convert(CSCONVERT obj, BYTE *dest_ptr, USHORT dest_len,
|
||||
USHORT eight_bit_convert(csconvert* obj, BYTE *dest_ptr, USHORT dest_len,
|
||||
const BYTE* src_ptr,
|
||||
USHORT src_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
|
@ -190,17 +190,15 @@ SSHORT CS_UTFFSS_fss_mbtowc(TEXTTYPE obj, UCS2_CHAR* wc, const NCHAR* p, USHORT
|
||||
|
||||
static fss_size_t fss_mbtowc( fss_wchar_t* p, const NCHAR* s, fss_size_t n)
|
||||
{
|
||||
long l;
|
||||
int c0, c, nc;
|
||||
|
||||
if (s == 0)
|
||||
return 0;
|
||||
|
||||
nc = 0;
|
||||
int nc = 0;
|
||||
if (n <= nc)
|
||||
return -1;
|
||||
c0 = *s & 0xff;
|
||||
l = c0;
|
||||
|
||||
const int c0 = *s & 0xff;
|
||||
long l = c0;
|
||||
for (const Fss_table* t = fss_sequence_table; t->cmask; t++) {
|
||||
nc++;
|
||||
if ((c0 & t->cmask) == t->cval) {
|
||||
@ -213,7 +211,7 @@ static fss_size_t fss_mbtowc( fss_wchar_t* p, const NCHAR* s, fss_size_t n)
|
||||
if (n <= nc)
|
||||
return -1;
|
||||
s++;
|
||||
c = (*s ^ 0x80) & 0xFF;
|
||||
const int c = (*s ^ 0x80) & 0xFF;
|
||||
if (c & 0xC0)
|
||||
return -1;
|
||||
l = (l << 6) | c;
|
||||
@ -224,18 +222,15 @@ static fss_size_t fss_mbtowc( fss_wchar_t* p, const NCHAR* s, fss_size_t n)
|
||||
|
||||
static fss_size_t fss_wctomb(MBCHAR* s, fss_wchar_t wc)
|
||||
{
|
||||
long l;
|
||||
int c, nc;
|
||||
|
||||
if (s == 0)
|
||||
return 0;
|
||||
|
||||
l = wc;
|
||||
nc = 0;
|
||||
const long l = wc;
|
||||
int nc = 0;
|
||||
for (const Fss_table* t = fss_sequence_table; t->cmask; t++) {
|
||||
nc++;
|
||||
if (l <= t->lmask) {
|
||||
c = t->shift;
|
||||
int c = t->shift;
|
||||
*s = t->cval | (l >> c);
|
||||
while (c > 0) {
|
||||
c -= 6;
|
||||
@ -263,8 +258,8 @@ USHORT fss_to_unicode(UNICODE *dest_ptr,
|
||||
if (dest_ptr == NULL)
|
||||
return (src_len * 2); /* All single byte narrow characters */
|
||||
|
||||
UNICODE* start = dest_ptr;
|
||||
USHORT src_start = src_len;
|
||||
const UNICODE* const start = dest_ptr;
|
||||
const USHORT src_start = src_len;
|
||||
while ((src_len) && (dest_len >= sizeof(*dest_ptr))) {
|
||||
const fss_size_t res = fss_mbtowc(dest_ptr, src_ptr, src_len);
|
||||
if (res == -1) {
|
||||
@ -285,7 +280,7 @@ USHORT fss_to_unicode(UNICODE *dest_ptr,
|
||||
}
|
||||
|
||||
|
||||
USHORT CS_UTFFSS_fss_to_unicode_cc(CSCONVERT obj,
|
||||
USHORT CS_UTFFSS_fss_to_unicode_cc(csconvert* obj,
|
||||
UNICODE *dest_ptr,
|
||||
USHORT dest_len,
|
||||
const NCHAR* src_ptr,
|
||||
@ -322,7 +317,7 @@ USHORT CS_UTFFSS_fss_to_unicode_tt(TEXTTYPE obj,
|
||||
}
|
||||
|
||||
|
||||
USHORT CS_UTFFSS_unicode_to_fss(CSCONVERT obj,
|
||||
USHORT CS_UTFFSS_unicode_to_fss(csconvert* obj,
|
||||
MBCHAR *fss_str,
|
||||
USHORT fss_len,
|
||||
const UNICODE* unicode_str,
|
||||
@ -330,28 +325,24 @@ USHORT CS_UTFFSS_unicode_to_fss(CSCONVERT obj,
|
||||
SSHORT *err_code,
|
||||
USHORT *err_position)
|
||||
{
|
||||
MBCHAR *start;
|
||||
USHORT src_start = unicode_len;
|
||||
MBCHAR tmp_buffer[6];
|
||||
MBCHAR *p;
|
||||
fss_size_t res;
|
||||
|
||||
fb_assert(unicode_str != NULL || fss_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == reinterpret_cast<pfn_INTL_convert>(CS_UTFFSS_unicode_to_fss));
|
||||
|
||||
const USHORT src_start = unicode_len;
|
||||
*err_code = 0;
|
||||
|
||||
/* See if we're only after a length estimate */
|
||||
if (fss_str == NULL)
|
||||
return ((USHORT) (unicode_len + 1) / 2 * 3); /* worst case - all han character input */
|
||||
|
||||
start = fss_str;
|
||||
MBCHAR tmp_buffer[6];
|
||||
const MBCHAR* const start = fss_str;
|
||||
while ((fss_len) && (unicode_len >= sizeof(*unicode_str))) {
|
||||
/* Convert the wide character into temp buffer */
|
||||
res = fss_wctomb(tmp_buffer, *unicode_str);
|
||||
fss_size_t res = fss_wctomb(tmp_buffer, *unicode_str);
|
||||
if (res == -1) {
|
||||
*err_code = CS_BAD_INPUT;
|
||||
break;
|
||||
@ -362,7 +353,7 @@ USHORT CS_UTFFSS_unicode_to_fss(CSCONVERT obj,
|
||||
break;
|
||||
}
|
||||
/* copy the converted bytes into the destination */
|
||||
p = tmp_buffer;
|
||||
const MBCHAR* p = tmp_buffer;
|
||||
for (; res; res--, fss_len--)
|
||||
*fss_str++ = *p++;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/* Note: all routines have cousins in jrd/intl.cpp */
|
||||
|
||||
USHORT CS_UTFFSS_fss_to_unicode_cc(CSCONVERT obj, UNICODE *dest_ptr, USHORT dest_len,
|
||||
USHORT CS_UTFFSS_fss_to_unicode_cc(csconvert* obj, UNICODE *dest_ptr, USHORT dest_len,
|
||||
const NCHAR* src_ptr,
|
||||
USHORT src_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
@ -31,7 +31,7 @@ USHORT CS_UTFFSS_fss_to_unicode_tt(TEXTTYPE obj, UNICODE *dest_ptr, USHORT dest_
|
||||
const NCHAR* src_ptr,
|
||||
USHORT src_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
USHORT CS_UTFFSS_unicode_to_fss(CSCONVERT obj, MBCHAR *fss_str, USHORT fss_len,
|
||||
USHORT CS_UTFFSS_unicode_to_fss(csconvert* obj, MBCHAR *fss_str, USHORT fss_len,
|
||||
const UNICODE* unicode_str,
|
||||
USHORT unicode_len, SSHORT *err_code, USHORT *err_position);
|
||||
|
||||
|
@ -76,7 +76,6 @@ USHORT KANJI_check_euc(const UCHAR* euc_str, USHORT euc_len)
|
||||
}
|
||||
}
|
||||
else { /* it is a ASCII */
|
||||
|
||||
euc_str++;
|
||||
}
|
||||
}
|
||||
@ -111,12 +110,10 @@ USHORT KANJI_check_sjis(const UCHAR* sjis_str, USHORT sjis_len)
|
||||
}
|
||||
}
|
||||
else { /*It is a KANA */
|
||||
|
||||
sjis_str++;
|
||||
}
|
||||
}
|
||||
else { /* it is a ASCII */
|
||||
|
||||
sjis_str++;
|
||||
}
|
||||
}
|
||||
@ -164,7 +161,6 @@ USHORT KANJI_euc2sjis(const UCHAR* euc_str,
|
||||
*sjis_str++ = c2;
|
||||
}
|
||||
else { /* Kanji */
|
||||
|
||||
*sjis_len += 2;
|
||||
if (*sjis_len > sjis_buf_len) /*buffer full */
|
||||
return (1);
|
||||
@ -182,7 +178,6 @@ USHORT KANJI_euc2sjis(const UCHAR* euc_str,
|
||||
return (1);
|
||||
}
|
||||
else { /* ASCII */
|
||||
|
||||
euc_len--;
|
||||
*sjis_len += 1;
|
||||
*sjis_str++ = *euc_str++;
|
||||
@ -315,7 +310,6 @@ USHORT KANJI_sjis2euc(const UCHAR* sjis_str,
|
||||
return (1); /* It is some bad character */
|
||||
}
|
||||
else { /* it is a ASCII */
|
||||
|
||||
*euc_len += 1;
|
||||
sjis_len--;
|
||||
*euc_str++ = *sjis_str++;
|
||||
@ -419,7 +413,6 @@ USHORT KANJI_sjis2euc5(const UCHAR* sjis_str,
|
||||
return (2); /* It is some bad character */
|
||||
}
|
||||
else { /* it is a ASCII */
|
||||
|
||||
*euc_len += 1;
|
||||
sjis_len--;
|
||||
*euc_str++ = *sjis_str++;
|
||||
@ -467,7 +460,6 @@ USHORT KANJI_sjis_len(const UCHAR* euc_str, USHORT euc_len, USHORT* sjis_len)
|
||||
return (1);
|
||||
}
|
||||
else { /* ASCII */
|
||||
|
||||
euc_len--;
|
||||
*sjis_len += 1;
|
||||
euc_str++;
|
||||
|
@ -31,7 +31,7 @@ static inline void FAMILY_ASCII(TEXTTYPE cache,
|
||||
pfn_INTL_init name,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
const ASCII *POSIX)
|
||||
const ASCII* POSIX)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
cache->texttype_type = id_number;
|
||||
@ -51,7 +51,7 @@ static inline void FAMILY_ASCII(TEXTTYPE cache,
|
||||
cache->texttype_tolower_table = NULL;
|
||||
cache->texttype_compress_table = NULL;
|
||||
cache->texttype_expand_table = NULL;
|
||||
cache->texttype_name = (SCHAR *) POSIX;
|
||||
cache->texttype_name = POSIX;
|
||||
}
|
||||
|
||||
|
||||
@ -581,9 +581,10 @@ static bool all_spaces(const BYTE* s, SSHORT len)
|
||||
{
|
||||
fb_assert(s != NULL);
|
||||
|
||||
while (len-- > 0)
|
||||
while (len-- > 0) {
|
||||
if (*s++ != ASCII_SPACE)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -643,7 +644,7 @@ SSHORT famasc_str_to_upper(TEXTTYPE obj, USHORT iLen, const BYTE* pStr, USHORT i
|
||||
pStr++;
|
||||
iLen--;
|
||||
iOutLen--;
|
||||
};
|
||||
}
|
||||
if (iLen != 0)
|
||||
return (-1);
|
||||
return (pOutStr - p);
|
||||
@ -651,7 +652,6 @@ SSHORT famasc_str_to_upper(TEXTTYPE obj, USHORT iLen, const BYTE* pStr, USHORT i
|
||||
|
||||
|
||||
|
||||
|
||||
USHORT famasc_to_lower(TEXTTYPE obj, BYTE ch)
|
||||
{
|
||||
return (ASCII7_LOWER(ch));
|
||||
@ -678,7 +678,7 @@ SSHORT cp1251_str_to_upper(TEXTTYPE obj, USHORT iLen, const BYTE* pStr, USHORT i
|
||||
pStr++;
|
||||
iLen--;
|
||||
iOutLen--;
|
||||
};
|
||||
}
|
||||
if (iLen != 0)
|
||||
return (-1);
|
||||
return (pOutStr - p);
|
||||
|
@ -33,7 +33,7 @@ static inline void FAMILY_MULTIBYTE(TEXTTYPE cache,
|
||||
pfn_INTL_init name,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
const ASCII *POSIX)
|
||||
const ASCII* POSIX)
|
||||
//#define FAMILY_MULTIBYTE(id_number, name, charset, country)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
|
@ -33,12 +33,12 @@ static inline void FAMILY1(TEXTTYPE cache,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
USHORT flags,
|
||||
const SortOrderTblEntry * NoCaseOrderTbl,
|
||||
const BYTE * ToUpperConversionTbl,
|
||||
const BYTE * ToLowerConversionTbl,
|
||||
const CompressPair * CompressTbl,
|
||||
const ExpandChar * ExpansionTbl,
|
||||
const ASCII *POSIX)
|
||||
const SortOrderTblEntry* NoCaseOrderTbl,
|
||||
const BYTE* ToUpperConversionTbl,
|
||||
const BYTE* ToLowerConversionTbl,
|
||||
const CompressPair* CompressTbl,
|
||||
const ExpandChar* ExpansionTbl,
|
||||
const ASCII* POSIX)
|
||||
//#define FAMILY1(id_number, name, charset, country)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
@ -54,11 +54,11 @@ static inline void FAMILY1(TEXTTYPE cache,
|
||||
cache->texttype_fn_to_lower = fam1_to_lower;
|
||||
cache->texttype_fn_str_to_upper = fam1_str_to_upper;
|
||||
cache->texttype_fn_mbtowc = LC_DOS_nc_mbtowc;
|
||||
cache->texttype_collation_table = (BYTE *) NoCaseOrderTbl;
|
||||
cache->texttype_toupper_table = (BYTE *) ToUpperConversionTbl;
|
||||
cache->texttype_tolower_table = (BYTE *) ToLowerConversionTbl;
|
||||
cache->texttype_compress_table = (BYTE *) CompressTbl;
|
||||
cache->texttype_expand_table = (BYTE *) ExpansionTbl;
|
||||
cache->texttype_collation_table = (const BYTE*) NoCaseOrderTbl;
|
||||
cache->texttype_toupper_table = ToUpperConversionTbl;
|
||||
cache->texttype_tolower_table = ToLowerConversionTbl;
|
||||
cache->texttype_compress_table = (const BYTE*) CompressTbl;
|
||||
cache->texttype_expand_table = (const BYTE*) ExpansionTbl;
|
||||
cache->texttype_name = POSIX;
|
||||
cache->texttype_flags |= ((flags) & REVERSE) ?
|
||||
(TEXTTYPE_reverse_secondary | TEXTTYPE_ignore_specials) : 0;
|
||||
@ -633,7 +633,7 @@ SSHORT fam1_str_to_upper(TEXTTYPE obj, USHORT iLen, const BYTE* pStr, USHORT iOu
|
||||
pStr++;
|
||||
iLen--;
|
||||
iOutLen--;
|
||||
};
|
||||
}
|
||||
if (iLen != 0)
|
||||
return (-1);
|
||||
return (pOutStr - p);
|
||||
|
@ -38,7 +38,7 @@ static inline void FAMILY_MULTIBYTE(TEXTTYPE cache,
|
||||
pfn_INTL_init name,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
const ASCII *POSIX)
|
||||
const ASCII* POSIX)
|
||||
//#define FAMILY_MULTIBYTE(id_number, name, charset, country)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
|
@ -39,12 +39,12 @@ static inline void FAMILY2(TEXTTYPE cache,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
USHORT flags,
|
||||
const SortOrderTblEntry * NoCaseOrderTbl,
|
||||
const BYTE * ToUpperConversionTbl,
|
||||
const BYTE * ToLowerConversionTbl,
|
||||
const CompressPair * CompressTbl,
|
||||
const ExpandChar * ExpansionTbl,
|
||||
const ASCII *POSIX)
|
||||
const SortOrderTblEntry* NoCaseOrderTbl,
|
||||
const BYTE* ToUpperConversionTbl,
|
||||
const BYTE* ToLowerConversionTbl,
|
||||
const CompressPair* CompressTbl,
|
||||
const ExpandChar* ExpansionTbl,
|
||||
const ASCII* POSIX)
|
||||
//#define FAMILY2(id_number, name, charset, country)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
@ -60,11 +60,11 @@ static inline void FAMILY2(TEXTTYPE cache,
|
||||
cache->texttype_fn_to_lower = fam2_to_lower;
|
||||
cache->texttype_fn_str_to_upper = fam2_str_to_upper;
|
||||
cache->texttype_fn_mbtowc = LC_DOS_nc_mbtowc;
|
||||
cache->texttype_collation_table = (BYTE *) NoCaseOrderTbl;
|
||||
cache->texttype_toupper_table = (BYTE *) ToUpperConversionTbl;
|
||||
cache->texttype_tolower_table = (BYTE *) ToLowerConversionTbl;
|
||||
cache->texttype_compress_table = (BYTE *) CompressTbl;
|
||||
cache->texttype_expand_table = (BYTE *) ExpansionTbl;
|
||||
cache->texttype_collation_table = (const BYTE*) NoCaseOrderTbl;
|
||||
cache->texttype_toupper_table = ToUpperConversionTbl;
|
||||
cache->texttype_tolower_table = ToLowerConversionTbl;
|
||||
cache->texttype_compress_table = (const BYTE*) CompressTbl;
|
||||
cache->texttype_expand_table = (const BYTE*) ExpansionTbl;
|
||||
cache->texttype_name = POSIX;
|
||||
cache->texttype_flags |= ((flags) & REVERSE) ?
|
||||
TEXTTYPE_reverse_secondary : 0;
|
||||
@ -553,7 +553,7 @@ static SSHORT fam2_str_to_upper(TEXTTYPE obj, USHORT iLen, const BYTE* pStr, USH
|
||||
pStr++;
|
||||
iLen--;
|
||||
iOutLen--;
|
||||
};
|
||||
}
|
||||
if (iLen != 0)
|
||||
return (-1);
|
||||
return (pOutStr - p);
|
||||
|
@ -35,12 +35,12 @@ static inline void FAMILY2(TEXTTYPE cache,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
USHORT flags,
|
||||
const SortOrderTblEntry * NoCaseOrderTbl,
|
||||
const BYTE * ToUpperConversionTbl,
|
||||
const BYTE * ToLowerConversionTbl,
|
||||
const CompressPair * CompressTbl,
|
||||
const ExpandChar * ExpansionTbl,
|
||||
const ASCII *POSIX)
|
||||
const SortOrderTblEntry* NoCaseOrderTbl,
|
||||
const BYTE* ToUpperConversionTbl,
|
||||
const BYTE* ToLowerConversionTbl,
|
||||
const CompressPair* CompressTbl,
|
||||
const ExpandChar* ExpansionTbl,
|
||||
const ASCII* POSIX)
|
||||
//#define FAMILY2(id_number, name, charset, country)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
@ -56,11 +56,11 @@ static inline void FAMILY2(TEXTTYPE cache,
|
||||
cache->texttype_fn_to_lower = fam2_to_lower;
|
||||
cache->texttype_fn_str_to_upper = fam2_str_to_upper;
|
||||
cache->texttype_fn_mbtowc = LC_DOS_nc_mbtowc;
|
||||
cache->texttype_collation_table = (BYTE *) NoCaseOrderTbl;
|
||||
cache->texttype_toupper_table = (BYTE *) ToUpperConversionTbl;
|
||||
cache->texttype_tolower_table = (BYTE *) ToLowerConversionTbl;
|
||||
cache->texttype_compress_table = (BYTE *) CompressTbl;
|
||||
cache->texttype_expand_table = (BYTE *) ExpansionTbl;
|
||||
cache->texttype_collation_table = (const BYTE*) NoCaseOrderTbl;
|
||||
cache->texttype_toupper_table = ToUpperConversionTbl;
|
||||
cache->texttype_tolower_table = ToLowerConversionTbl;
|
||||
cache->texttype_compress_table = (const BYTE*) CompressTbl;
|
||||
cache->texttype_expand_table = (const BYTE*) ExpansionTbl;
|
||||
cache->texttype_name = POSIX;
|
||||
cache->texttype_flags |= ((flags) & REVERSE) ?
|
||||
TEXTTYPE_reverse_secondary : 0;
|
||||
@ -123,7 +123,7 @@ static SSHORT fam2_str_to_upper (TEXTTYPE obj, USHORT iLen, const BYTE* pStr, US
|
||||
pStr++;
|
||||
iLen--;
|
||||
iOutLen--;
|
||||
};
|
||||
}
|
||||
if (iLen != 0)
|
||||
return (-1);
|
||||
return (pOutStr - p);
|
||||
|
@ -38,7 +38,7 @@ static inline void FAMILY_MULTIBYTE(TEXTTYPE cache,
|
||||
pfn_INTL_init name,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
const ASCII *POSIX)
|
||||
const ASCII* POSIX)
|
||||
//#define FAMILY_MULTIBYTE(id_number, name, charset, country)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
|
@ -32,15 +32,15 @@ static USHORT LCKSC_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInCh
|
||||
static USHORT LCKSC_key_length(TEXTTYPE obj, USHORT inLen);
|
||||
static SSHORT LCKSC_compare(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2, const BYTE* s2);
|
||||
|
||||
static int GetGenHanNdx(unsigned char b1, unsigned char b2);
|
||||
static int GetSpeHanNdx(unsigned char b1, unsigned char b2);
|
||||
static int GetGenHanNdx(UCHAR b1, UCHAR b2);
|
||||
static int GetSpeHanNdx(UCHAR b1, UCHAR b2);
|
||||
|
||||
static inline void FAMILY_MULTIBYTE(TEXTTYPE cache,
|
||||
TTYPE_ID id_number,
|
||||
pfn_INTL_init name,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
const ASCII *POSIX)
|
||||
const ASCII* POSIX)
|
||||
{
|
||||
//static inline void FAMILY_MULTIBYTE(id_number, name, charset, country)
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
@ -92,7 +92,8 @@ TEXTTYPE_ENTRY(ksc_5601_dict_init)
|
||||
}
|
||||
|
||||
|
||||
unsigned char spe_han[18][2] = {
|
||||
const UCHAR spe_han[18][2] =
|
||||
{
|
||||
/* special hangul -> character sets with dictionary collation */
|
||||
{ 0xa4, 0xa2 },
|
||||
{ 0xa4, 0xa4 },
|
||||
@ -114,7 +115,8 @@ unsigned char spe_han[18][2] = {
|
||||
{ 0xa4, 0xbe }
|
||||
};
|
||||
|
||||
unsigned char gen_han[18][2] = {
|
||||
const UCHAR gen_han[18][2] =
|
||||
{
|
||||
/* general hangul -> character sets with binary collation */
|
||||
{ 0xb1, 0xed },
|
||||
{ 0xb3, 0xa9 },
|
||||
@ -144,29 +146,24 @@ static USHORT LCKSC_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInCh
|
||||
USHORT iOutLen, BYTE *pOutChar,
|
||||
USHORT partial) // unused
|
||||
{
|
||||
USHORT i;
|
||||
int idx;
|
||||
const BYTE *inbuff;
|
||||
BYTE *outbuff;
|
||||
|
||||
fb_assert(pOutChar != NULL);
|
||||
fb_assert(pInChar != NULL);
|
||||
fb_assert(iInLen <= LANGKSC_MAX_KEY);
|
||||
fb_assert(iOutLen <= LANGKSC_MAX_KEY);
|
||||
fb_assert(iOutLen >= LCKSC_key_length(obj, iInLen));
|
||||
|
||||
inbuff = pInChar + iInLen - 1;
|
||||
const BYTE* inbuff = pInChar + iInLen - 1;
|
||||
while ((inbuff >= pInChar) && (*inbuff == ASCII_SPACE))
|
||||
inbuff--;
|
||||
iInLen = (inbuff - pInChar + 1);
|
||||
|
||||
outbuff = pOutChar;
|
||||
BYTE* outbuff = pOutChar;
|
||||
|
||||
for (i = 0; i < iInLen && iOutLen; i++, pInChar++) {
|
||||
for (USHORT i = 0; i < iInLen && iOutLen; i++, pInChar++) {
|
||||
if (GEN_HAN(*pInChar, *(pInChar + 1))) { /* general hangul */
|
||||
if (!iOutLen)
|
||||
break;
|
||||
idx = GetGenHanNdx(*pInChar, *(pInChar + 1));
|
||||
const int idx = GetGenHanNdx(*pInChar, *(pInChar + 1));
|
||||
if (idx >= 0) {
|
||||
*outbuff++ = gen_han[idx][0];
|
||||
*outbuff++ = gen_han[idx][1];
|
||||
@ -184,7 +181,7 @@ static USHORT LCKSC_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInCh
|
||||
else if (SPE_HAN(*pInChar, *(pInChar + 1))) { /* special hangul */
|
||||
if (!iOutLen)
|
||||
break;
|
||||
idx = GetSpeHanNdx(*pInChar, *(pInChar + 1));
|
||||
const int idx = GetSpeHanNdx(*pInChar, *(pInChar + 1));
|
||||
fb_assert(idx >= 0);
|
||||
*outbuff++ = gen_han[idx][0];
|
||||
*outbuff++ = gen_han[idx][1];
|
||||
@ -221,11 +218,9 @@ static USHORT LCKSC_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInCh
|
||||
* description : in case of gen_han, get the index number from gen_han table
|
||||
*/
|
||||
|
||||
static int GetGenHanNdx(unsigned char b1, unsigned char b2)
|
||||
static int GetGenHanNdx(UCHAR b1, UCHAR b2)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 18; i++) {
|
||||
for (int i = 0; i < 18; i++) {
|
||||
if (gen_han[i][0] == b1 && b2 == gen_han[i][1])
|
||||
return i;
|
||||
}
|
||||
@ -238,11 +233,9 @@ static int GetGenHanNdx(unsigned char b1, unsigned char b2)
|
||||
* description : in case of spe_han, get index from spe_han table
|
||||
*/
|
||||
|
||||
static int GetSpeHanNdx(unsigned char b1, unsigned char b2)
|
||||
static int GetSpeHanNdx(UCHAR b1, UCHAR b2)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 18; i++) {
|
||||
for (int i = 0; i < 18; i++) {
|
||||
if (b2 == spe_han[i][1])
|
||||
return i;
|
||||
}
|
||||
@ -266,12 +259,11 @@ static SSHORT LCKSC_compare(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2,
|
||||
{
|
||||
BYTE key1[LANGKSC_MAX_KEY];
|
||||
BYTE key2[LANGKSC_MAX_KEY];
|
||||
USHORT i;
|
||||
|
||||
const USHORT len1 = LCKSC_string_to_key(obj, l1, s1, sizeof(key1), key1, FALSE);
|
||||
const USHORT len2 = LCKSC_string_to_key(obj, l2, s2, sizeof(key2), key2, FALSE);
|
||||
const USHORT len = MIN(len1, len2);
|
||||
for (i = 0; i < len; i++) {
|
||||
for (USHORT i = 0; i < len; i++) {
|
||||
if (key1[i] == key2[i])
|
||||
continue;
|
||||
else if (key1[i] < key2[i])
|
||||
|
@ -90,9 +90,8 @@
|
||||
*/
|
||||
USHORT LC_NARROW_key_length(TEXTTYPE obj, USHORT inLen)
|
||||
{
|
||||
USHORT len;
|
||||
/* fb_assert (inLen <= LANGFAM2_MAX_KEY); *//* almost certainly an error */
|
||||
len = 3 * MAX(inLen, 2);
|
||||
const USHORT len = 3 * MAX(inLen, 2);
|
||||
return (MIN(len, LANGFAM2_MAX_KEY));
|
||||
}
|
||||
|
||||
@ -113,20 +112,6 @@ static ULONG do_debug = 0;
|
||||
USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInChar, USHORT iOutLen, BYTE *pOutChar,
|
||||
USHORT partial)
|
||||
{
|
||||
USHORT lprimary;
|
||||
BYTE secondary[LANGFAM2_MAX_KEY];
|
||||
USHORT lsecondary;
|
||||
BYTE tertiary[LANGFAM2_MAX_KEY];
|
||||
USHORT ltertiary;
|
||||
BYTE special[LANGFAM2_MAX_KEY * 2];
|
||||
USHORT lspecial;
|
||||
|
||||
USHORT i, j;
|
||||
|
||||
BYTE *outbuff;
|
||||
const BYTE *inbuff;
|
||||
SortOrderTblEntry* coll;
|
||||
|
||||
fb_assert(pOutChar != NULL);
|
||||
fb_assert(pInChar != NULL);
|
||||
/* fb_assert (iInLen <= LANGFAM2_MAX_KEY); */
|
||||
@ -138,22 +123,28 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInChar,
|
||||
if (do_debug) {
|
||||
ib_printf("string: (%02d) '%*s'\n", iInLen, iInLen, pInChar);
|
||||
ib_fflush(ib_stdout);
|
||||
};
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
outbuff = pOutChar;
|
||||
lprimary = 0;
|
||||
lsecondary = 0;
|
||||
ltertiary = 0;
|
||||
lspecial = 0;
|
||||
BYTE* outbuff = pOutChar;
|
||||
USHORT lprimary = 0;
|
||||
USHORT lsecondary = 0;
|
||||
USHORT ltertiary = 0;
|
||||
USHORT lspecial = 0;
|
||||
|
||||
BYTE secondary[LANGFAM2_MAX_KEY];
|
||||
BYTE tertiary[LANGFAM2_MAX_KEY];
|
||||
BYTE special[LANGFAM2_MAX_KEY * 2];
|
||||
|
||||
/* point inbuff at last character */
|
||||
inbuff = pInChar + iInLen - 1;
|
||||
const BYTE* inbuff = pInChar + iInLen - 1;
|
||||
|
||||
/* skip backwards over all spaces & reset input length */
|
||||
while ((inbuff >= pInChar) && (*inbuff == ASCII_SPACE))
|
||||
inbuff--;
|
||||
iInLen = (inbuff - pInChar + 1);
|
||||
|
||||
USHORT i;
|
||||
|
||||
for (i = 0; i < iInLen; i++, pInChar++) {
|
||||
fb_assert(lprimary < iOutLen);
|
||||
@ -161,8 +152,8 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInChar,
|
||||
fb_assert(ltertiary < sizeof(tertiary));
|
||||
fb_assert(lspecial < sizeof(special));
|
||||
|
||||
coll =
|
||||
&((SortOrderTblEntry*) obj->
|
||||
const SortOrderTblEntry* coll =
|
||||
&((const SortOrderTblEntry*) obj->
|
||||
texttype_collation_table)[*pInChar];
|
||||
if (!(coll->IsExpand || coll->IsCompress)) {
|
||||
if (coll->Primary != NULL_WEIGHT)
|
||||
@ -175,20 +166,21 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInChar,
|
||||
else if (coll->IsExpand && coll->IsCompress) {
|
||||
/* Both flags set indicate a special value */
|
||||
if ((coll->Primary != NULL_WEIGHT) &&
|
||||
!(obj->texttype_flags & TEXTTYPE_ignore_specials)) {
|
||||
!(obj->texttype_flags & TEXTTYPE_ignore_specials))
|
||||
{
|
||||
special[lspecial++] = (i + 1); /* position */
|
||||
special[lspecial++] = coll->Primary;
|
||||
};
|
||||
}
|
||||
}
|
||||
else if (coll->IsExpand) {
|
||||
ExpandChar* exp = &((ExpandChar*) obj->texttype_expand_table)[0];
|
||||
const ExpandChar* exp = &((const ExpandChar*) obj->texttype_expand_table)[0];
|
||||
while (exp->Ch && exp->Ch != *pInChar)
|
||||
exp++;
|
||||
fb_assert(exp->Ch == *pInChar);
|
||||
for (j = 0; j < 2; j++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
if (j)
|
||||
coll =
|
||||
&((SortOrderTblEntry*) obj->
|
||||
&((const SortOrderTblEntry*) obj->
|
||||
texttype_collation_table)[exp->ExpCh2];
|
||||
if (coll->Primary != NULL_WEIGHT)
|
||||
outbuff[lprimary++] = coll->Primary;
|
||||
@ -200,15 +192,14 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInChar,
|
||||
}
|
||||
else { /* (col->IsCompress) */
|
||||
|
||||
CompressPair* cmp;
|
||||
if ((USHORT) (i + 1) < iInLen) {
|
||||
cmp =
|
||||
&((CompressPair*) obj->
|
||||
const CompressPair* cmp =
|
||||
&((const CompressPair*) obj->
|
||||
texttype_compress_table)[0];
|
||||
while (cmp->CharPair[0]) {
|
||||
if ((cmp->CharPair[0] == *pInChar) &&
|
||||
(cmp->CharPair[1] == *(pInChar + 1))) {
|
||||
|
||||
(cmp->CharPair[1] == *(pInChar + 1)))
|
||||
{
|
||||
/* Gobble the two-to-1 entry */
|
||||
coll = &cmp->NoCaseWeight;
|
||||
pInChar++;
|
||||
@ -225,7 +216,7 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInChar,
|
||||
if (coll->Tertiary != NULL_TERTIARY)
|
||||
tertiary[ltertiary++] = coll->Tertiary;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* primary keys are already in output key */
|
||||
|
||||
@ -247,37 +238,37 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInChar,
|
||||
for (i = 0; i < lsecondary && iOutLen; i++) {
|
||||
*outbuff++ = secondary[i];
|
||||
iOutLen--;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/* put tertiary keys into output key */
|
||||
for (i = 0; i < ltertiary && iOutLen; i++) {
|
||||
*outbuff++ = tertiary[i];
|
||||
iOutLen--;
|
||||
};
|
||||
}
|
||||
|
||||
/* put special keys into output key */
|
||||
if ((lspecial && iOutLen) &&
|
||||
!(obj->texttype_flags & TEXTTYPE_ignore_specials)) {
|
||||
!(obj->texttype_flags & TEXTTYPE_ignore_specials))
|
||||
{
|
||||
/* Insert the marker-byte */
|
||||
*outbuff++ = 0;
|
||||
iOutLen--;
|
||||
for (i = 0; i < lspecial && iOutLen; i++) {
|
||||
*outbuff++ = special[i];
|
||||
iOutLen--;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Dump out the computed key */
|
||||
if (do_debug) {
|
||||
UCHAR *p;
|
||||
ib_printf(" key: (%02d) ", (outbuff - pOutChar));
|
||||
for (p = pOutChar; p < outbuff; p++)
|
||||
for (const UCHAR* p = pOutChar; p < outbuff; p++)
|
||||
ib_printf("%2x ", *p);
|
||||
ib_printf("\n");
|
||||
ib_fflush(ib_stdout);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
/* return length of key */
|
||||
@ -292,27 +283,27 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, const BYTE* pInChar,
|
||||
/* expansion char go before the expansion. */
|
||||
/* eg: S-set collates before ss */
|
||||
|
||||
typedef struct coltab_status {
|
||||
struct coltab_status {
|
||||
USHORT stat_flags;
|
||||
SortOrderTblEntry* stat_waiting;
|
||||
} *COLSTAT;
|
||||
const SortOrderTblEntry* stat_waiting;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
static SSHORT special_scan(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2, const BYTE* s2)
|
||||
{
|
||||
SortOrderTblEntry* col1;
|
||||
SortOrderTblEntry* col2;
|
||||
const SortOrderTblEntry* col1 = 0;
|
||||
const SortOrderTblEntry* col2 = 0;
|
||||
|
||||
USHORT index1 = 0;
|
||||
USHORT index2 = 0;
|
||||
|
||||
while (1) {
|
||||
while (true) {
|
||||
/* Scan to find ignore char from l1 */
|
||||
while (l1) {
|
||||
col1 =
|
||||
&((SortOrderTblEntry*) obj->
|
||||
&((const SortOrderTblEntry*) obj->
|
||||
texttype_collation_table)[*s1];
|
||||
if (col1->IsExpand && col1->IsCompress)
|
||||
break;
|
||||
@ -324,7 +315,7 @@ static SSHORT special_scan(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2, c
|
||||
/* Scan to find ignore char from l2 */
|
||||
while (l2) {
|
||||
col2 =
|
||||
&((SortOrderTblEntry*) obj->
|
||||
&((const SortOrderTblEntry*) obj->
|
||||
texttype_collation_table)[*s2];
|
||||
if (col2->IsExpand && col2->IsCompress)
|
||||
break;
|
||||
@ -354,10 +345,9 @@ static SSHORT special_scan(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2, c
|
||||
}
|
||||
|
||||
|
||||
SortOrderTblEntry* get_coltab_entry(TEXTTYPE obj, const UCHAR** p, USHORT *l, COLSTAT stat)
|
||||
static const SortOrderTblEntry* get_coltab_entry(TEXTTYPE obj, const UCHAR** p,
|
||||
USHORT* l, coltab_status* stat)
|
||||
{
|
||||
SortOrderTblEntry* col;
|
||||
|
||||
if (stat->stat_flags & HAVE_WAITING) {
|
||||
(*l)--;
|
||||
(*p)++;
|
||||
@ -368,8 +358,8 @@ SortOrderTblEntry* get_coltab_entry(TEXTTYPE obj, const UCHAR** p, USHORT *l, CO
|
||||
|
||||
stat->stat_waiting = NULL;
|
||||
while (*l) {
|
||||
col =
|
||||
&((SortOrderTblEntry*) obj->
|
||||
const SortOrderTblEntry* col =
|
||||
&((const SortOrderTblEntry*) obj->
|
||||
texttype_collation_table)[**p];
|
||||
if (!(col->IsExpand || col->IsCompress)) {
|
||||
/* Have col */
|
||||
@ -386,7 +376,7 @@ SortOrderTblEntry* get_coltab_entry(TEXTTYPE obj, const UCHAR** p, USHORT *l, CO
|
||||
continue;
|
||||
}
|
||||
else if (col->IsExpand) {
|
||||
ExpandChar* exp = &((ExpandChar*) obj->texttype_expand_table)[0];
|
||||
const ExpandChar* exp = &((const ExpandChar*) obj->texttype_expand_table)[0];
|
||||
while (exp->Ch && exp->Ch != **p)
|
||||
exp++;
|
||||
fb_assert(exp->Ch == **p);
|
||||
@ -394,21 +384,20 @@ SortOrderTblEntry* get_coltab_entry(TEXTTYPE obj, const UCHAR** p, USHORT *l, CO
|
||||
/* Have waiting */
|
||||
|
||||
stat->stat_waiting =
|
||||
&((SortOrderTblEntry*) obj->
|
||||
&((const SortOrderTblEntry*) obj->
|
||||
texttype_collation_table)[exp->ExpCh2];
|
||||
stat->stat_flags |= HAVE_WAITING;
|
||||
return col;
|
||||
}
|
||||
else { /* (col->IsCompress) */
|
||||
|
||||
CompressPair* cmp;
|
||||
if (*l > 1) {
|
||||
cmp =
|
||||
&((CompressPair*) obj->
|
||||
const CompressPair* cmp =
|
||||
&((const CompressPair*) obj->
|
||||
texttype_compress_table)[0];
|
||||
while (cmp->CharPair[0]) {
|
||||
if ((cmp->CharPair[0] == **p) &&
|
||||
(cmp->CharPair[1] == *(*p + 1))) {
|
||||
(cmp->CharPair[1] == *(*p + 1)))
|
||||
{
|
||||
/* Have Col */
|
||||
col = &cmp->NoCaseWeight;
|
||||
(*l) -= 2;
|
||||
@ -433,17 +422,6 @@ SortOrderTblEntry* get_coltab_entry(TEXTTYPE obj, const UCHAR** p, USHORT *l, CO
|
||||
|
||||
SSHORT LC_NARROW_compare(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2, const BYTE* s2)
|
||||
{
|
||||
SortOrderTblEntry* col1;
|
||||
SortOrderTblEntry* col2;
|
||||
coltab_status stat1, stat2;
|
||||
SSHORT save_secondary = 0;
|
||||
SSHORT save_tertiary = 0;
|
||||
SSHORT save_quandary = 0;
|
||||
USHORT save_l1, save_l2;
|
||||
|
||||
stat1.stat_flags = 0;
|
||||
stat2.stat_flags = 0;
|
||||
|
||||
/* Start at EOS, scan backwards to find non-space */
|
||||
const BYTE* p = s1 + l1 - 1;
|
||||
while ((p >= s1) && (*p == ASCII_SPACE))
|
||||
@ -455,12 +433,22 @@ SSHORT LC_NARROW_compare(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2, con
|
||||
p--;
|
||||
l2 = (p - s2 + 1);
|
||||
|
||||
save_l1 = l1;
|
||||
save_l2 = l2;
|
||||
const BYTE* save_s1 = s1;
|
||||
const BYTE* save_s2 = s2;
|
||||
const USHORT save_l1 = l1;
|
||||
const USHORT save_l2 = l2;
|
||||
const BYTE* const save_s1 = s1;
|
||||
const BYTE* const save_s2 = s2;
|
||||
SSHORT save_secondary = 0;
|
||||
SSHORT save_tertiary = 0;
|
||||
SSHORT save_quandary = 0;
|
||||
|
||||
while (1) {
|
||||
coltab_status stat1, stat2;
|
||||
stat1.stat_flags = 0;
|
||||
stat2.stat_flags = 0;
|
||||
|
||||
const SortOrderTblEntry* col1 = 0;
|
||||
const SortOrderTblEntry* col2 = 0;
|
||||
|
||||
while (true) {
|
||||
col1 = get_coltab_entry(obj, &s1, &l1, &stat1);
|
||||
col2 = get_coltab_entry(obj, &s2, &l2, &stat2);
|
||||
if (!col1 || !col2)
|
||||
@ -470,14 +458,17 @@ SSHORT LC_NARROW_compare(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2, con
|
||||
if (col1->Secondary != col2->Secondary) {
|
||||
if ((obj->texttype_flags & TEXTTYPE_reverse_secondary) ||
|
||||
!save_secondary)
|
||||
save_secondary = (col1->Secondary - col2->Secondary);
|
||||
{
|
||||
save_secondary = (col1->Secondary - col2->Secondary);
|
||||
}
|
||||
}
|
||||
else if (col1->Tertiary != col2->Tertiary) {
|
||||
if (!save_tertiary)
|
||||
save_tertiary = (col1->Tertiary - col2->Tertiary);
|
||||
}
|
||||
else if (((stat1.stat_flags & HAVE_WAITING) XOR
|
||||
(stat2.stat_flags & HAVE_WAITING)) && !save_quandary) {
|
||||
(stat2.stat_flags & HAVE_WAITING)) && !save_quandary)
|
||||
{
|
||||
if (obj->texttype_flags & TEXTTYPE_expand_before)
|
||||
save_quandary = (stat1.stat_flags & HAVE_WAITING) ? -1 : 1;
|
||||
else
|
||||
@ -527,7 +518,8 @@ SSHORT LC_NARROW_compare(TEXTTYPE obj, USHORT l1, const BYTE* s1, USHORT l2, con
|
||||
* Routine used for comparing results from comparision algorithm
|
||||
* to results from key creation algorithm
|
||||
*/
|
||||
static SSHORT old_fam2_compare(TEXTTYPE obj, USHORT l1, BYTE *s1, USHORT l2, BYTE *s2)
|
||||
static SSHORT old_fam2_compare(TEXTTYPE obj, USHORT l1, const BYTE* s1,
|
||||
USHORT l2, const BYTE* s2)
|
||||
{
|
||||
BYTE key1[LANGFAM2_MAX_KEY];
|
||||
BYTE key2[LANGFAM2_MAX_KEY];
|
||||
@ -546,7 +538,7 @@ static SSHORT old_fam2_compare(TEXTTYPE obj, USHORT l1, BYTE *s1, USHORT l2, BYT
|
||||
return (-1);
|
||||
else
|
||||
return (1);
|
||||
};
|
||||
}
|
||||
if (len1 < len2)
|
||||
return (-1);
|
||||
else if (len1 > len2)
|
||||
@ -558,19 +550,18 @@ static SSHORT old_fam2_compare(TEXTTYPE obj, USHORT l1, BYTE *s1, USHORT l2, BYT
|
||||
|
||||
#ifdef DEBUG_COMPARE
|
||||
|
||||
#define SIGN(x) (((x) < 0)?-1:(((x) == 0)?0:1))
|
||||
#define SIGN(x) (((x) < 0) ? -1 : (((x) == 0)? 0 : 1))
|
||||
|
||||
/*
|
||||
* Debugging only
|
||||
* Routine used for comparing results from comparision algorithm
|
||||
* to results from key creation algorithm
|
||||
*/
|
||||
static SSHORT fam2_compare(TEXTTYPE obj, USHORT l1, BYTE *s1, USHORT l2, BYTE *s2)
|
||||
static SSHORT fam2_compare(TEXTTYPE obj, USHORT l1, const BYTE* s1,
|
||||
USHORT l2, const BYTE* s2)
|
||||
{
|
||||
SSHORT res1, res2;
|
||||
|
||||
res1 = old_fam2_compare(obj, l1, s1, l2, s2);
|
||||
res2 = LC_NARROW_compare(obj, l1, s1, l2, s2);
|
||||
SSHORT res1 = old_fam2_compare(obj, l1, s1, l2, s2);
|
||||
SSHORT res2 = LC_NARROW_compare(obj, l1, s1, l2, s2);
|
||||
|
||||
if (SIGN(res1) != SIGN(res2)) {
|
||||
ib_printf("different compares:\n%d %s\n%d %s\nold = %d new = %d\n",
|
||||
@ -594,3 +585,4 @@ static SSHORT fam2_compare(TEXTTYPE obj, USHORT l1, BYTE *s1, USHORT l2, BYTE *s
|
||||
#undef NULL_WEIGHT
|
||||
#undef NULL_SECONDARY
|
||||
#undef NULL_TERTIARY
|
||||
|
||||
|
@ -34,7 +34,7 @@ static inline void FAMILY_UNICODE_WIDE_BIN(TEXTTYPE cache,
|
||||
pfn_INTL_init name,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
const ASCII *POSIX)
|
||||
const ASCII* POSIX)
|
||||
//#define FAMILY_UNICODE_WIDE_BIN(id_number, name, charset, country)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
@ -62,7 +62,7 @@ static inline void FAMILY_UNICODE_MB_BIN(TEXTTYPE cache,
|
||||
pfn_INTL_init name,
|
||||
CHARSET_ID charset,
|
||||
SSHORT country,
|
||||
const ASCII *POSIX)
|
||||
const ASCII* POSIX)
|
||||
//#define FAMILY_UNICODE_MB_BIN(id_number, name, charset, country)
|
||||
{
|
||||
cache->texttype_version = IB_LANGDRV_VERSION;
|
||||
|
@ -36,8 +36,8 @@ void gds__log(UCHAR*, ...);
|
||||
*/
|
||||
|
||||
#define EXTERN_texttype(name) USHORT name (TEXTTYPE, USHORT, USHORT)
|
||||
#define EXTERN_convert(name) USHORT name (CSCONVERT, SSHORT, SSHORT)
|
||||
#define EXTERN_charset(name) USHORT name (CHARSET, SSHORT, SSHORT)
|
||||
#define EXTERN_convert(name) USHORT name (csconvert*, SSHORT, SSHORT)
|
||||
#define EXTERN_charset(name) USHORT name (charset*, SSHORT, SSHORT)
|
||||
|
||||
EXTERN_texttype(DOS101_init);
|
||||
EXTERN_texttype(DOS101_c2_init);
|
||||
@ -273,12 +273,12 @@ void LD_assert(const SCHAR* filename, int lineno)
|
||||
case (num): \
|
||||
*fun = (FPTR_SHORT) (name); \
|
||||
return (0);
|
||||
*/
|
||||
|
||||
#define CHARSET_INIT(num, name) \
|
||||
case (num): \
|
||||
*fun = (FPTR_SHORT) (name); \
|
||||
return (0);
|
||||
*/
|
||||
|
||||
#define CONVERT_INIT_BI(to_cs, from_cs, name)\
|
||||
if (((parm1 == (to_cs)) && (parm2 == (from_cs))) ||\
|
||||
@ -379,7 +379,7 @@ USHORT FB_DLL_EXPORT LD_lookup(USHORT objtype,
|
||||
default:
|
||||
*fun = NULL;
|
||||
return (1);
|
||||
};
|
||||
}
|
||||
case type_charset:
|
||||
switch (parm1) {
|
||||
#define CHARSET(name, cs_id, coll_id, bytes, num, cs_symbol, cp_symbol) \
|
||||
@ -414,7 +414,7 @@ USHORT FB_DLL_EXPORT LD_lookup(USHORT objtype,
|
||||
default:
|
||||
*fun = NULL;
|
||||
return (1);
|
||||
};
|
||||
}
|
||||
case type_csconvert:
|
||||
{
|
||||
CONVERT_INIT_BI(CS_DOS_437, CS_ISO8859_1, CV_dos_437_x_iso8859_1);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* PROGRAM: InterBase International support
|
||||
* MODULE: ld2.c
|
||||
* MODULE: ld2.cpp
|
||||
* DESCRIPTION: Additional Language Driver lookup & support routines
|
||||
*
|
||||
* The contents of this file are subject to the Interbase Public
|
||||
@ -35,9 +35,7 @@
|
||||
|
||||
|
||||
#ifdef DEV_BUILD
|
||||
void LD2_assert(filename, lineno)
|
||||
SCHAR *filename;
|
||||
int lineno;
|
||||
void LD2_assert(const char* filename, int lineno)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -69,6 +67,7 @@ void LD2_assert(filename, lineno)
|
||||
* shared libraries
|
||||
*/
|
||||
|
||||
/*
|
||||
#define DRIVER(num, name) \
|
||||
case (num): \
|
||||
*fun = (FPTR_SHORT) (name); \
|
||||
@ -86,11 +85,11 @@ void LD2_assert(filename, lineno)
|
||||
*fun = (FPTR_SHORT) (name);\
|
||||
return (0);\
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
USHORT FB_DLL_EXPORT LD2_lookup(USHORT objtype,
|
||||
FPTR_SHORT * fun, SSHORT parm1, SSHORT parm2)
|
||||
FPTR_SHORT* fun, SSHORT parm1, SSHORT parm2)
|
||||
{
|
||||
|
||||
switch (objtype) {
|
||||
@ -99,13 +98,13 @@ USHORT FB_DLL_EXPORT LD2_lookup(USHORT objtype,
|
||||
default:
|
||||
*fun = NULL;
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
case type_charset:
|
||||
switch (parm1) {
|
||||
default:
|
||||
*fun = NULL;
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
case type_csconvert:
|
||||
{
|
||||
*fun = NULL;
|
||||
@ -124,3 +123,4 @@ USHORT FB_DLL_EXPORT LD2_lookup(USHORT objtype,
|
||||
#undef DRIVER
|
||||
#undef CHARSET_INIT
|
||||
#undef CONVERT_INIT_BI
|
||||
|
||||
|
@ -67,18 +67,18 @@ typedef USHORT UNICODE;
|
||||
|
||||
|
||||
|
||||
#define CONVERT_ENTRY(cs1, cs2, name) USHORT name (CSCONVERT csptr, SSHORT dest_cs, SSHORT source_cs)
|
||||
#define CONVERT_ENTRY(cs1, cs2, name) USHORT name (csconvert* csptr, SSHORT dest_cs, SSHORT source_cs)
|
||||
|
||||
#define CONVERT_RETURN return (0)
|
||||
|
||||
|
||||
|
||||
|
||||
#define CHARSET_ENTRY(name) USHORT name (CHARSET csptr, SSHORT cs_id, SSHORT dummy)
|
||||
#define CHARSET_ENTRY(name) USHORT name (charset* csptr, SSHORT cs_id, SSHORT dummy)
|
||||
|
||||
#define CHARSET_RETURN return (0)
|
||||
|
||||
void CV_convert_init(CSCONVERT, SSHORT, SSHORT, pfn_INTL_convert, const void*, const void*);
|
||||
void CV_convert_init(csconvert*, SSHORT, SSHORT, pfn_INTL_convert, const void*, const void*);
|
||||
|
||||
#endif /* INTL_LDCOMMON_H */
|
||||
|
||||
|
@ -69,50 +69,42 @@ char *defaults[] = {
|
||||
#endif
|
||||
|
||||
|
||||
try(c, f)
|
||||
char *c;
|
||||
FPTR_INT f;
|
||||
void try_fc(char* c, FPTR_INT f)
|
||||
{
|
||||
unsigned char buffer[200];
|
||||
int res;
|
||||
int i;
|
||||
res = (*f) (strlen(c), c, sizeof(buffer), buffer);
|
||||
const int res = (*f) (strlen(c), c, sizeof(buffer), buffer);
|
||||
ib_printf("%s => ", c);
|
||||
for (i = 0; i < res; i++)
|
||||
for (int i = 0; i < res; i++)
|
||||
ib_printf("%d ", buffer[i]);
|
||||
ib_printf("\n");
|
||||
};
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
FPTR_INT func;
|
||||
char buffer[200];
|
||||
int i;
|
||||
struct texttype this_textobj;
|
||||
char **vector;
|
||||
|
||||
#ifdef VMS
|
||||
vector = defaults;
|
||||
char** vector = defaults;
|
||||
argc = FB_NELEM(defaults);
|
||||
#else
|
||||
if (argc <= 1) {
|
||||
ib_printf("usage: dtest Intl_module_name\n");
|
||||
return (1);
|
||||
};
|
||||
vector = argv;
|
||||
}
|
||||
char** vector = argv;
|
||||
#endif
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
FPTR_INT func = 0;
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
|
||||
#ifdef LIKE_JRD
|
||||
{
|
||||
char module[200];
|
||||
char path[MAXPATHLEN];
|
||||
char entry[200];
|
||||
int t_type;
|
||||
t_type = atoi(vector[i]);
|
||||
const int t_type = atoi(vector[i]);
|
||||
sprintf(module, INTL_MODULE, t_type);
|
||||
gds__prefix(path, module);
|
||||
sprintf(entry, INTL_INIT_ENTRY, t_type);
|
||||
@ -151,7 +143,7 @@ main(argc, argv)
|
||||
(*func) (sizeof(buffer), buffer);
|
||||
FULL_DEBUG("Back from ID fn \n");
|
||||
ib_printf("%s.id => %s\n", vector[i], buffer);
|
||||
};
|
||||
}
|
||||
|
||||
func = this_textobj.texttype_functions[intl_fn_string_to_key];
|
||||
|
||||
@ -159,13 +151,14 @@ main(argc, argv)
|
||||
if (func == NULL)
|
||||
ib_printf("%s: Can't find str_to_key\n", vector[i]);
|
||||
else {
|
||||
try("cote", func);
|
||||
try("COTE", func);
|
||||
try("co-te", func);
|
||||
try("CO-TE", func);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
try_fc("cote", func);
|
||||
try_fc("COTE", func);
|
||||
try_fc("co-te", func);
|
||||
try_fc("CO-TE", func);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -41,50 +41,41 @@ char *defaults[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
try(c, f)
|
||||
char *c;
|
||||
FUN_PTR f;
|
||||
/*
|
||||
void try_fc(char* c, FUN_PTR f)
|
||||
{
|
||||
unsigned char buffer[200];
|
||||
int res;
|
||||
int i;
|
||||
res = (*f) (strlen(c), c, sizeof(buffer), buffer);
|
||||
const int res = (*f) (strlen(c), c, sizeof(buffer), buffer);
|
||||
ib_printf("%s => ", c);
|
||||
for (i = 0; i < res; i++)
|
||||
for (int i = 0; i < res; i++)
|
||||
ib_printf("%d ", buffer[i]);
|
||||
ib_printf("\n");
|
||||
};
|
||||
}
|
||||
*/
|
||||
|
||||
my_err()
|
||||
void my_err()
|
||||
{
|
||||
ib_printf("Error routine called!\n");
|
||||
};
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
struct texttype this_textobj;
|
||||
char **vector;
|
||||
int i;
|
||||
|
||||
#ifdef VMS
|
||||
vector = defaults;
|
||||
char** vector = defaults;
|
||||
argc = FB_NELEM(defaults);
|
||||
#else
|
||||
if (argc <= 1) {
|
||||
ib_printf("usage: dtest Intl_module_name\n");
|
||||
return (1);
|
||||
};
|
||||
vector = argv;
|
||||
char** vector = argv;
|
||||
#endif
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
|
||||
int t_type;
|
||||
t_type = atoi(vector[i]);
|
||||
struct texttype this_textobj;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
const int t_type = atoi(vector[i]);
|
||||
INTL_fn_init(t_type, &this_textobj, my_err);
|
||||
};
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -61,11 +61,9 @@ No errors
|
||||
#define UNICODE_INDEX(u) (((u) % 256) + from_unicode_map [((u) / 256)])
|
||||
#define UNICODE_LOOKUP(u) from_unicode_mapping_array [ UNICODE_INDEX(u) ]
|
||||
|
||||
main()
|
||||
int main()
|
||||
{
|
||||
unsigned short uch, uch2;
|
||||
int i, j, k;
|
||||
unsigned char ch2;
|
||||
int i;
|
||||
|
||||
if (sizeof(to_unicode_map) != 256 * sizeof(to_unicode_map[0]))
|
||||
ib_printf("The to_unicode_map is too small! %d entries!\n",
|
||||
@ -76,16 +74,17 @@ main()
|
||||
sizeof(from_unicode_map) / sizeof(from_unicode_map[0]));
|
||||
|
||||
for (i = 0; i <= 255; i++) {
|
||||
uch = to_unicode_map[i];
|
||||
const unsigned short uch = to_unicode_map[i];
|
||||
if (uch == CANT_MAP_CHARACTER)
|
||||
continue;
|
||||
ch2 = UNICODE_LOOKUP(uch);
|
||||
const unsigned char ch2 = UNICODE_LOOKUP(uch);
|
||||
if (ch2 != i) {
|
||||
ib_printf
|
||||
("Mapping error: Character %02x -> Unicode %04x (index %3d) -> Char %02x\n",
|
||||
i, uch, UNICODE_INDEX(uch), ch2);
|
||||
|
||||
/* Find the Character in the from_unicode_mapping_array */
|
||||
int j;
|
||||
for (j = 0; j < sizeof(from_unicode_mapping_array); j++)
|
||||
if (from_unicode_mapping_array[j] == i) {
|
||||
/* Mapping table is wrong - recommend a fix for it */
|
||||
@ -114,17 +113,18 @@ main()
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j <= 255; j++) {
|
||||
uch = i * 256 + j;
|
||||
ch2 = UNICODE_LOOKUP(uch);
|
||||
for (int j = 0; j <= 255; j++) {
|
||||
const unsigned short uch = i * 256 + j;
|
||||
const unsigned char ch2 = UNICODE_LOOKUP(uch);
|
||||
if (ch2 == CANT_MAP_CHARACTER)
|
||||
continue;
|
||||
uch2 = to_unicode_map[ch2];
|
||||
const unsigned short uch2 = to_unicode_map[ch2];
|
||||
if (uch != uch2) {
|
||||
ib_printf
|
||||
("Mapping error: Unicode %04x -> ch %02x -> Unicode %04x\n",
|
||||
uch, ch2, uch2);
|
||||
|
||||
int k;
|
||||
for (k = 0; k <= 255; k++)
|
||||
if (to_unicode_map[k] == uch) {
|
||||
/* Can map this character from charset to unicode */
|
||||
@ -142,4 +142,6 @@ main()
|
||||
}
|
||||
|
||||
ib_printf("Test completed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ class codepage_map {
|
||||
unsigned short sizeof_to_unicode_map;
|
||||
unsigned short sizeof_from_unicode_mapping_array;
|
||||
unsigned short sizeof_from_unicode_map;
|
||||
char *name;
|
||||
const char* name;
|
||||
|
||||
codepage_map(void) {
|
||||
to_unicode_map = NULL;
|
||||
@ -42,14 +42,15 @@ class codepage_map {
|
||||
sizeof_from_unicode_map = 0;
|
||||
sizeof_from_unicode_mapping_array = 0;
|
||||
name = NULL;
|
||||
};
|
||||
}
|
||||
|
||||
codepage_map(unsigned short *_to,
|
||||
unsigned char *_from_array,
|
||||
unsigned short *_from_map,
|
||||
unsigned short sizeof_to,
|
||||
codepage_map(const unsigned short *_to,
|
||||
const unsigned char *_from_array,
|
||||
const unsigned short *_from_map,
|
||||
const unsigned short sizeof_to,
|
||||
unsigned short sizeof_from_array,
|
||||
unsigned short sizeof_from_map, char *_name) {
|
||||
unsigned short sizeof_from_map, const char *_name)
|
||||
{
|
||||
to_unicode_map = _to;
|
||||
from_unicode_mapping_array = _from_array;
|
||||
from_unicode_map = _from_map;
|
||||
@ -58,16 +59,16 @@ class codepage_map {
|
||||
sizeof_from_unicode_map = sizeof_from_map;
|
||||
name = _name;
|
||||
test_codepage();
|
||||
};
|
||||
}
|
||||
|
||||
unsigned short to_unicode(unsigned char c) {
|
||||
return to_unicode_map[c];
|
||||
};
|
||||
}
|
||||
|
||||
unsigned short from_unicode(unsigned short c) {
|
||||
return from_unicode_mapping_array[from_unicode_map[c / 256] +
|
||||
(c % 256)];
|
||||
};
|
||||
}
|
||||
|
||||
void test_codepage(void) {
|
||||
if (sizeof_to_unicode_map != 256 * sizeof(to_unicode_map[0]))
|
||||
@ -149,8 +150,8 @@ class codepage_map {
|
||||
}
|
||||
|
||||
printf("Test of %s completed\n", name);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -174,7 +175,7 @@ codepage_map *get_w1250(void)
|
||||
sizeof(to_unicode_map),
|
||||
sizeof(from_unicode_mapping_array),
|
||||
sizeof(from_unicode_map), "cs_w1250.h");
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
@ -174,7 +174,7 @@ TEXT* ALL_cstring(const TEXT* in_string)
|
||||
* return to the user or where ever.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
JrdMemoryPool* pool = tdbb->tdbb_default;
|
||||
if (!pool) {
|
||||
@ -236,7 +236,7 @@ void ALL_init(void)
|
||||
* have been locked before entry.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
JrdMemoryPool* pool = tdbb->tdbb_default = dbb->dbb_permanent;
|
||||
@ -258,7 +258,7 @@ void JrdMemoryPool::ALL_push(BLK object, LLS* stack)
|
||||
* Push an object on an LLS stack.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
JrdMemoryPool* pool = tdbb->tdbb_default;
|
||||
lls* node = pool->lls_cache.newBlock();
|
||||
|
@ -33,7 +33,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: blb.cpp,v 1.56 2004-03-07 07:58:39 robocop Exp $
|
||||
$Id: blb.cpp,v 1.57 2004-03-11 05:03:57 robocop Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -78,25 +78,25 @@ inline bool SEGMENTED(const blb* blob)
|
||||
}
|
||||
|
||||
static ARR alloc_array(jrd_tra*, ADS);
|
||||
static blb* allocate_blob(TDBB, jrd_tra*);
|
||||
static blb* allocate_blob(thread_db*, jrd_tra*);
|
||||
static ISC_STATUS blob_filter(USHORT, CTL, SSHORT, SLONG);
|
||||
static void check_BID_validity(const blb*, TDBB);
|
||||
static blb* copy_blob(TDBB, const bid*, bid*);
|
||||
static void delete_blob(TDBB, blb*, ULONG);
|
||||
static void delete_blob_id(TDBB, const bid*, ULONG, jrd_rel*);
|
||||
static void check_BID_validity(const blb*, thread_db*);
|
||||
static blb* copy_blob(thread_db*, const bid*, bid*);
|
||||
static void delete_blob(thread_db*, blb*, ULONG);
|
||||
static void delete_blob_id(thread_db*, const bid*, ULONG, jrd_rel*);
|
||||
static ARR find_array(jrd_tra*, const bid*);
|
||||
static BLF find_filter(TDBB, SSHORT, SSHORT);
|
||||
static blob_page* get_next_page(TDBB, blb*, WIN *);
|
||||
static BLF find_filter(thread_db*, SSHORT, SSHORT);
|
||||
static blob_page* get_next_page(thread_db*, blb*, WIN *);
|
||||
#ifdef REPLAY_OSRI_API_CALLS_SUBSYSTEM
|
||||
static void get_replay_blob(TDBB, const bid*);
|
||||
static void get_replay_blob(thread_db*, const bid*);
|
||||
#endif
|
||||
static void insert_page(TDBB, blb*);
|
||||
static void insert_page(thread_db*, blb*);
|
||||
static void release_blob(blb*, const bool);
|
||||
static void slice_callback(SLICE, ULONG, DSC *);
|
||||
static blb* store_array(TDBB, jrd_tra*, bid*);
|
||||
static blb* store_array(thread_db*, jrd_tra*, bid*);
|
||||
|
||||
|
||||
void BLB_cancel(TDBB tdbb, blb* blob)
|
||||
void BLB_cancel(thread_db* tdbb, blb* blob)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -122,7 +122,7 @@ void BLB_cancel(TDBB tdbb, blb* blob)
|
||||
}
|
||||
|
||||
|
||||
void BLB_close(TDBB tdbb, class blb* blob)
|
||||
void BLB_close(thread_db* tdbb, class blb* blob)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -159,7 +159,7 @@ void BLB_close(TDBB tdbb, class blb* blob)
|
||||
}
|
||||
|
||||
|
||||
blb* BLB_create(TDBB tdbb, jrd_tra* transaction, bid* blob_id)
|
||||
blb* BLB_create(thread_db* tdbb, jrd_tra* transaction, bid* blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -177,7 +177,7 @@ blb* BLB_create(TDBB tdbb, jrd_tra* transaction, bid* blob_id)
|
||||
}
|
||||
|
||||
|
||||
blb* BLB_create2(TDBB tdbb,
|
||||
blb* BLB_create2(thread_db* tdbb,
|
||||
jrd_tra* transaction, bid* blob_id,
|
||||
USHORT bpb_length, const UCHAR* bpb)
|
||||
{
|
||||
@ -276,7 +276,7 @@ blb* BLB_create2(TDBB tdbb,
|
||||
|
||||
|
||||
void BLB_garbage_collect(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
LLS going,
|
||||
LLS staying, SLONG prior_page, jrd_rel* relation)
|
||||
{
|
||||
@ -360,7 +360,7 @@ void BLB_garbage_collect(
|
||||
}
|
||||
|
||||
|
||||
blb* BLB_get_array(TDBB tdbb, jrd_tra* transaction, const bid* blob_id, ADS desc)
|
||||
blb* BLB_get_array(thread_db* tdbb, jrd_tra* transaction, const bid* blob_id, ADS desc)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -392,7 +392,7 @@ blb* BLB_get_array(TDBB tdbb, jrd_tra* transaction, const bid* blob_id, ADS desc
|
||||
}
|
||||
|
||||
|
||||
SLONG BLB_get_data(TDBB tdbb, blb* blob, UCHAR* buffer, SLONG length)
|
||||
SLONG BLB_get_data(thread_db* tdbb, blb* blob, UCHAR* buffer, SLONG length)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -428,7 +428,7 @@ SLONG BLB_get_data(TDBB tdbb, blb* blob, UCHAR* buffer, SLONG length)
|
||||
}
|
||||
|
||||
|
||||
USHORT BLB_get_segment(TDBB tdbb,
|
||||
USHORT BLB_get_segment(thread_db* tdbb,
|
||||
blb* blob, UCHAR* segment, USHORT buffer_length)
|
||||
{
|
||||
/**************************************
|
||||
@ -632,7 +632,7 @@ USHORT BLB_get_segment(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
SLONG BLB_get_slice(TDBB tdbb,
|
||||
SLONG BLB_get_slice(thread_db* tdbb,
|
||||
jrd_tra* transaction,
|
||||
const bid* blob_id,
|
||||
const UCHAR* sdl,
|
||||
@ -785,7 +785,7 @@ SLONG BLB_lseek(blb* blob, USHORT mode, SLONG offset)
|
||||
|
||||
#ifdef REPLAY_OSRI_API_CALLS_SUBSYSTEM
|
||||
|
||||
void BLB_map_blobs(TDBB tdbb, blb* old_blob, blb* new_blob)
|
||||
void BLB_map_blobs(thread_db* tdbb, blb* old_blob, blb* new_blob)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -821,7 +821,7 @@ void BLB_map_blobs(TDBB tdbb, blb* old_blob, blb* new_blob)
|
||||
// which in turn calls BLB_create2 that writes in the blob id. Although the
|
||||
// compiler allows to modify from_desc->dsc_address' contents when from_desc is
|
||||
// constant, this is misleading so I didn't make the source descriptor constant.
|
||||
void BLB_move(TDBB tdbb, dsc* from_desc, dsc* to_desc, jrd_nod* field)
|
||||
void BLB_move(thread_db* tdbb, dsc* from_desc, dsc* to_desc, jrd_nod* field)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -946,7 +946,7 @@ void BLB_move(TDBB tdbb, dsc* from_desc, dsc* to_desc, jrd_nod* field)
|
||||
}
|
||||
|
||||
|
||||
void BLB_move_from_string(TDBB tdbb, const dsc* from_desc, dsc* to_desc, jrd_nod* field)
|
||||
void BLB_move_from_string(thread_db* tdbb, const dsc* from_desc, dsc* to_desc, jrd_nod* field)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1002,7 +1002,7 @@ void BLB_move_from_string(TDBB tdbb, const dsc* from_desc, dsc* to_desc, jrd_nod
|
||||
}
|
||||
|
||||
|
||||
blb* BLB_open(TDBB tdbb, jrd_tra* transaction, const bid* blob_id)
|
||||
blb* BLB_open(thread_db* tdbb, jrd_tra* transaction, const bid* blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1020,7 +1020,7 @@ blb* BLB_open(TDBB tdbb, jrd_tra* transaction, const bid* blob_id)
|
||||
}
|
||||
|
||||
|
||||
blb* BLB_open2(TDBB tdbb,
|
||||
blb* BLB_open2(thread_db* tdbb,
|
||||
jrd_tra* transaction, const bid* blob_id,
|
||||
USHORT bpb_length, const UCHAR* bpb)
|
||||
{
|
||||
@ -1180,7 +1180,7 @@ blb* BLB_open2(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void BLB_put_segment(TDBB tdbb, blb* blob, const UCHAR* seg, USHORT segment_length)
|
||||
void BLB_put_segment(thread_db* tdbb, blb* blob, const UCHAR* seg, USHORT segment_length)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1325,7 +1325,7 @@ void BLB_put_segment(TDBB tdbb, blb* blob, const UCHAR* seg, USHORT segment_leng
|
||||
}
|
||||
|
||||
|
||||
void BLB_put_slice( TDBB tdbb,
|
||||
void BLB_put_slice( thread_db* tdbb,
|
||||
jrd_tra* transaction,
|
||||
bid* blob_id,
|
||||
const UCHAR* sdl,
|
||||
@ -1513,7 +1513,7 @@ void BLB_release_array(ARR array)
|
||||
}
|
||||
|
||||
|
||||
void BLB_scalar(TDBB tdbb,
|
||||
void BLB_scalar(thread_db* tdbb,
|
||||
jrd_tra* transaction,
|
||||
const bid* blob_id,
|
||||
USHORT count,
|
||||
@ -1628,7 +1628,7 @@ static ARR alloc_array(jrd_tra* transaction, ADS proto_desc)
|
||||
}
|
||||
|
||||
|
||||
static blb* allocate_blob(TDBB tdbb, jrd_tra* transaction)
|
||||
static blb* allocate_blob(thread_db* tdbb, jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1686,7 +1686,7 @@ static ISC_STATUS blob_filter( USHORT action,
|
||||
/* Note: Cannot remove this GET_THREAD_DATA without API change to
|
||||
blob filter routines */
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
jrd_tra* transaction = (jrd_tra*) control->ctl_internal[1];
|
||||
bid* blob_id = reinterpret_cast<bid*>(control->ctl_internal[2]);
|
||||
@ -1755,7 +1755,7 @@ static ISC_STATUS blob_filter( USHORT action,
|
||||
}
|
||||
|
||||
|
||||
static void check_BID_validity(const blb* blob, TDBB tdbb)
|
||||
static void check_BID_validity(const blb* blob, thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1799,7 +1799,7 @@ static void check_BID_validity(const blb* blob, TDBB tdbb)
|
||||
}
|
||||
|
||||
|
||||
static blb* copy_blob(TDBB tdbb, const bid* source, bid* destination)
|
||||
static blb* copy_blob(thread_db* tdbb, const bid* source, bid* destination)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1854,7 +1854,7 @@ static blb* copy_blob(TDBB tdbb, const bid* source, bid* destination)
|
||||
}
|
||||
|
||||
|
||||
static void delete_blob(TDBB tdbb, blb* blob, ULONG prior_page)
|
||||
static void delete_blob(thread_db* tdbb, blb* blob, ULONG prior_page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1924,7 +1924,7 @@ static void delete_blob(TDBB tdbb, blb* blob, ULONG prior_page)
|
||||
|
||||
|
||||
static void delete_blob_id(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
const bid* blob_id, ULONG prior_page, jrd_rel* relation)
|
||||
{
|
||||
/**************************************
|
||||
@ -1988,7 +1988,7 @@ static ARR find_array(jrd_tra* transaction, const bid* blob_id)
|
||||
}
|
||||
|
||||
|
||||
static BLF find_filter(TDBB tdbb, SSHORT from, SSHORT to)
|
||||
static BLF find_filter(thread_db* tdbb, SSHORT from, SSHORT to)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2024,7 +2024,7 @@ static BLF find_filter(TDBB tdbb, SSHORT from, SSHORT to)
|
||||
}
|
||||
|
||||
|
||||
static blob_page* get_next_page(TDBB tdbb, blb* blob, WIN * window)
|
||||
static blob_page* get_next_page(thread_db* tdbb, blb* blob, WIN * window)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2114,7 +2114,7 @@ static blob_page* get_next_page(TDBB tdbb, blb* blob, WIN * window)
|
||||
|
||||
|
||||
#ifdef REPLAY_OSRI_API_CALLS_SUBSYSTEM
|
||||
static void get_replay_blob(TDBB tdbb, bid* blob_id)
|
||||
static void get_replay_blob(thread_db* tdbb, bid* blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2150,7 +2150,7 @@ static void get_replay_blob(TDBB tdbb, bid* blob_id)
|
||||
#endif
|
||||
|
||||
|
||||
static void insert_page(TDBB tdbb, blb* blob)
|
||||
static void insert_page(thread_db* tdbb, blb* blob)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2335,7 +2335,7 @@ static void slice_callback(SLICE arg, ULONG count, DSC * descriptors)
|
||||
{
|
||||
/* Note: cannot remove this GET_THREAD_DATA without api change
|
||||
to slice callback routines */
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
const USHORT tmp_len = array_desc->dsc_length;
|
||||
STR tmp_buffer = FB_NEW_RPT(*tdbb->tdbb_default, tmp_len) str();
|
||||
@ -2403,7 +2403,7 @@ static void slice_callback(SLICE arg, ULONG count, DSC * descriptors)
|
||||
}
|
||||
|
||||
|
||||
static blb* store_array(TDBB tdbb, jrd_tra* transaction, bid* blob_id)
|
||||
static blb* store_array(thread_db* tdbb, jrd_tra* transaction, bid* blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
@ -30,31 +30,31 @@
|
||||
#include "../jrd/lls.h"
|
||||
#include "../jrd/val.h"
|
||||
|
||||
void BLB_cancel(TDBB, blb*);
|
||||
void BLB_close(TDBB, blb*);
|
||||
blb* BLB_create(TDBB, jrd_tra*, bid*);
|
||||
blb* BLB_create2(TDBB, jrd_tra*, bid*, USHORT, const UCHAR*);
|
||||
void BLB_garbage_collect(TDBB, lls*, lls*, SLONG, jrd_rel*);
|
||||
blb* BLB_get_array(TDBB, jrd_tra*, const bid*, ads*);
|
||||
SLONG BLB_get_data(TDBB, blb*, UCHAR*, SLONG);
|
||||
USHORT BLB_get_segment(TDBB, blb*, UCHAR*, USHORT);
|
||||
SLONG BLB_get_slice(TDBB, jrd_tra*, const bid*, const UCHAR*, USHORT,
|
||||
void BLB_cancel(thread_db*, blb*);
|
||||
void BLB_close(thread_db*, blb*);
|
||||
blb* BLB_create(thread_db*, jrd_tra*, bid*);
|
||||
blb* BLB_create2(thread_db*, jrd_tra*, bid*, USHORT, const UCHAR*);
|
||||
void BLB_garbage_collect(thread_db*, lls*, lls*, SLONG, jrd_rel*);
|
||||
blb* BLB_get_array(thread_db*, jrd_tra*, const bid*, ads*);
|
||||
SLONG BLB_get_data(thread_db*, blb*, UCHAR*, SLONG);
|
||||
USHORT BLB_get_segment(thread_db*, blb*, UCHAR*, USHORT);
|
||||
SLONG BLB_get_slice(thread_db*, jrd_tra*, const bid*, const UCHAR*, USHORT,
|
||||
const SLONG*, SLONG, UCHAR*);
|
||||
SLONG BLB_lseek(blb*, USHORT, SLONG);
|
||||
|
||||
void BLB_move(TDBB, dsc*, dsc*, jrd_nod*);
|
||||
void BLB_move_from_string(TDBB, const dsc*, dsc*, jrd_nod*);
|
||||
blb* BLB_open(TDBB, jrd_tra*, const bid*);
|
||||
blb* BLB_open2(TDBB, jrd_tra*, const bid*, USHORT, const UCHAR*);
|
||||
void BLB_put_segment(TDBB, blb*, const UCHAR*, USHORT);
|
||||
void BLB_put_slice(TDBB, jrd_tra*, bid*, const UCHAR*, USHORT,
|
||||
void BLB_move(thread_db*, dsc*, dsc*, jrd_nod*);
|
||||
void BLB_move_from_string(thread_db*, const dsc*, dsc*, jrd_nod*);
|
||||
blb* BLB_open(thread_db*, jrd_tra*, const bid*);
|
||||
blb* BLB_open2(thread_db*, jrd_tra*, const bid*, USHORT, const UCHAR*);
|
||||
void BLB_put_segment(thread_db*, blb*, const UCHAR*, USHORT);
|
||||
void BLB_put_slice(thread_db*, jrd_tra*, bid*, const UCHAR*, USHORT,
|
||||
const SLONG*, SLONG, UCHAR*);
|
||||
void BLB_release_array(arr*);
|
||||
void BLB_scalar(TDBB, jrd_tra*, const bid*, USHORT, SLONG*, vlu*);
|
||||
void BLB_scalar(thread_db*, jrd_tra*, const bid*, USHORT, SLONG*, vlu*);
|
||||
|
||||
|
||||
#ifdef REPLAY_OSRI_API_CALLS_SUBSYSTEM
|
||||
void BLB_map_blobs(TDBB, blb*, blb*);
|
||||
void BLB_map_blobs(thread_db*, blb*, blb*);
|
||||
#endif
|
||||
|
||||
#endif // JRD_BLB_PROTO_H
|
||||
|
@ -27,16 +27,16 @@
|
||||
// Does this file really need the extern C for external blob filters?
|
||||
extern "C" {
|
||||
|
||||
ISC_STATUS BLF_close_blob(TDBB, ctl**);
|
||||
ISC_STATUS BLF_create_blob(TDBB, jrd_tra*, ctl**, struct bid*,
|
||||
ISC_STATUS BLF_close_blob(thread_db*, ctl**);
|
||||
ISC_STATUS BLF_create_blob(thread_db*, jrd_tra*, ctl**, struct bid*,
|
||||
USHORT, const UCHAR*,
|
||||
FPTR_BFILTER_CALLBACK, BLF);
|
||||
ISC_STATUS BLF_get_segment(TDBB, ctl**, USHORT*, USHORT, UCHAR*);
|
||||
BLF BLF_lookup_internal_filter(TDBB, SSHORT, SSHORT);
|
||||
ISC_STATUS BLF_open_blob(TDBB, jrd_tra*, ctl**, const struct bid*,
|
||||
ISC_STATUS BLF_get_segment(thread_db*, ctl**, USHORT*, USHORT, UCHAR*);
|
||||
BLF BLF_lookup_internal_filter(thread_db*, SSHORT, SSHORT);
|
||||
ISC_STATUS BLF_open_blob(thread_db*, jrd_tra*, ctl**, const struct bid*,
|
||||
USHORT, const UCHAR*,
|
||||
FPTR_BFILTER_CALLBACK, BLF);
|
||||
ISC_STATUS BLF_put_segment(TDBB, ctl**, USHORT, const UCHAR*);
|
||||
ISC_STATUS BLF_put_segment(thread_db*, ctl**, USHORT, const UCHAR*);
|
||||
|
||||
} /* extern "C" */
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
BLKDEF(type_vec, vec, sizeof(((VEC) NULL)->vec_object[0]))
|
||||
BLKDEF(type_dbb, Database, 0)
|
||||
BLKDEF(type_bcb, bcb, sizeof(((BCB) NULL)->bcb_rpt[0])) /* Done 2 */
|
||||
BLKDEF(type_bdb, bdb, 0)
|
||||
BLKDEF(type_bdb, Buffer_desc, 0)
|
||||
BLKDEF(type_pre, Precedence, 0)
|
||||
BLKDEF(type_lck, lck, 1)
|
||||
BLKDEF(type_fil, jrd_file, 1)
|
||||
|
@ -73,11 +73,11 @@ static const FPTR_BFILTER_CALLBACK filters[] =
|
||||
};
|
||||
|
||||
|
||||
static ISC_STATUS open_blob(TDBB, jrd_tra*, CTL*, bid*, USHORT, const UCHAR*,
|
||||
static ISC_STATUS open_blob(thread_db*, jrd_tra*, CTL*, bid*, USHORT, const UCHAR*,
|
||||
FPTR_BFILTER_CALLBACK,
|
||||
USHORT, BLF);
|
||||
|
||||
ISC_STATUS BLF_close_blob(TDBB tdbb, CTL * filter_handle)
|
||||
ISC_STATUS BLF_close_blob(thread_db* tdbb, CTL * filter_handle)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -128,7 +128,7 @@ ISC_STATUS BLF_close_blob(TDBB tdbb, CTL * filter_handle)
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS BLF_create_blob(TDBB tdbb,
|
||||
ISC_STATUS BLF_create_blob(thread_db* tdbb,
|
||||
jrd_tra* tra_handle,
|
||||
CTL* filter_handle,
|
||||
bid* blob_id,
|
||||
@ -155,7 +155,7 @@ ISC_STATUS BLF_create_blob(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS BLF_get_segment(TDBB tdbb,
|
||||
ISC_STATUS BLF_get_segment(thread_db* tdbb,
|
||||
CTL * filter_handle,
|
||||
USHORT * length,
|
||||
USHORT buffer_length,
|
||||
@ -204,7 +204,7 @@ ISC_STATUS BLF_get_segment(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
BLF BLF_lookup_internal_filter(TDBB tdbb, SSHORT from, SSHORT to)
|
||||
BLF BLF_lookup_internal_filter(thread_db* tdbb, SSHORT from, SSHORT to)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -239,7 +239,7 @@ BLF BLF_lookup_internal_filter(TDBB tdbb, SSHORT from, SSHORT to)
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS BLF_open_blob(TDBB tdbb,
|
||||
ISC_STATUS BLF_open_blob(thread_db* tdbb,
|
||||
jrd_tra* tra_handle,
|
||||
CTL* filter_handle,
|
||||
const bid* blob_id,
|
||||
@ -270,7 +270,7 @@ ISC_STATUS BLF_open_blob(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS BLF_put_segment(TDBB tdbb,
|
||||
ISC_STATUS BLF_put_segment(thread_db* tdbb,
|
||||
CTL* filter_handle,
|
||||
USHORT length,
|
||||
const UCHAR* buffer)
|
||||
@ -316,7 +316,7 @@ ISC_STATUS BLF_put_segment(TDBB tdbb,
|
||||
}
|
||||
|
||||
static ISC_STATUS open_blob(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
jrd_tra* tra_handle,
|
||||
CTL* filter_handle,
|
||||
bid* blob_id,
|
||||
|
@ -48,7 +48,7 @@ BKM BKM_allocate(Rsb* rsb, USHORT length)
|
||||
* Allocate and initialize a bookmark structure.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
jrd_req* request = tdbb->tdbb_request;
|
||||
irsb* impure = (irsb*) ((UCHAR *) request + rsb->rsb_impure);
|
||||
@ -124,7 +124,7 @@ BKM BKM_lookup(NOD node)
|
||||
bookmark = (BKM) MOV_get_long(EVL_expr(tdbb, node), 0);
|
||||
#else
|
||||
{
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
att* attachment = tdbb->tdbb_attachment;
|
||||
|
||||
bookmark = NULL;
|
||||
@ -157,7 +157,7 @@ void BKM_release(NOD node)
|
||||
* Release a bookmark using a user supplied value.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
att* attachment = tdbb->tdbb_attachment;
|
||||
|
||||
bkm* bookmark = BKM_lookup(node);
|
||||
|
@ -36,7 +36,8 @@
|
||||
#include "../common/classes/array.h"
|
||||
|
||||
// format of expanded index node, used for backwards navigation
|
||||
typedef struct btx {
|
||||
typedef struct btx
|
||||
{
|
||||
UCHAR btx_previous_length; // AB: total size for previous node --length of data for previous node
|
||||
UCHAR btx_btr_previous_length; // length of data for previous node on btree page
|
||||
UCHAR btx_data[1]; // expanded data element
|
||||
@ -51,7 +52,8 @@ typedef struct btx {
|
||||
#define BTN_DUPLICATE_MARKER 1
|
||||
|
||||
// format of expanded index buffer
|
||||
struct jrd_exp {
|
||||
struct jrd_exp
|
||||
{
|
||||
USHORT exp_length;
|
||||
ULONG exp_incarnation;
|
||||
btx exp_nodes[1];
|
||||
@ -59,7 +61,8 @@ struct jrd_exp {
|
||||
|
||||
#define EXP_SIZE OFFSETA (jrd_exp*, exp_nodes)
|
||||
|
||||
struct dynKey {
|
||||
struct dynKey
|
||||
{
|
||||
USHORT keyLength;
|
||||
UCHAR* keyData;
|
||||
};
|
||||
@ -108,3 +111,4 @@ namespace BTreeNode {
|
||||
} // namespace BTreeNode
|
||||
|
||||
#endif // JRD_BTN_H_
|
||||
|
||||
|
126
src/jrd/btr.cpp
126
src/jrd/btr.cpp
@ -167,32 +167,32 @@ typedef enum contents {
|
||||
contents_above_threshold
|
||||
} CONTENTS;
|
||||
|
||||
static SLONG add_node(TDBB, WIN *, IIB *, KEY *, SLONG *, SLONG *, SLONG *);
|
||||
static SLONG add_node(thread_db*, WIN *, IIB *, KEY *, SLONG *, SLONG *, SLONG *);
|
||||
static void complement_key(KEY *);
|
||||
static void compress(TDBB, DSC *, KEY *, USHORT, bool, bool, USHORT);
|
||||
static USHORT compress_root(TDBB, index_root_page*);
|
||||
static void compress(thread_db*, const dsc*, KEY *, USHORT, bool, bool, bool);
|
||||
static USHORT compress_root(thread_db*, index_root_page*);
|
||||
static void copy_key(const KEY*, KEY*);
|
||||
static CONTENTS delete_node(TDBB, WIN *, UCHAR *);
|
||||
static void delete_tree(TDBB, USHORT, USHORT, SLONG, SLONG);
|
||||
static DSC *eval(TDBB, jrd_nod*, DSC *, bool *);
|
||||
static SLONG fast_load(TDBB, jrd_rel*, IDX *, USHORT, SCB, SelectivityList&);
|
||||
static index_root_page* fetch_root(TDBB, WIN *, jrd_rel*);
|
||||
static CONTENTS delete_node(thread_db*, WIN *, UCHAR *);
|
||||
static void delete_tree(thread_db*, USHORT, USHORT, SLONG, SLONG);
|
||||
static DSC *eval(thread_db*, jrd_nod*, DSC *, bool *);
|
||||
static SLONG fast_load(thread_db*, jrd_rel*, IDX *, USHORT, SCB, SelectivityList&);
|
||||
static index_root_page* fetch_root(thread_db*, WIN *, jrd_rel*);
|
||||
static UCHAR *find_node_start_point(btree_page*, KEY *, UCHAR *, USHORT *, bool, bool, bool = false, SLONG = NO_VALUE);
|
||||
static UCHAR* find_area_start_point(btree_page*, const KEY*, UCHAR *, USHORT *, bool, bool, SLONG = NO_VALUE);
|
||||
static SLONG find_page(btree_page*, const KEY*, UCHAR, SLONG = NO_VALUE, bool = false);
|
||||
static CONTENTS garbage_collect(TDBB, WIN *, SLONG);
|
||||
static void generate_jump_nodes(TDBB, btree_page*, jumpNodeList*, USHORT, USHORT*, USHORT*, USHORT*);
|
||||
static SLONG insert_node(TDBB, WIN *, IIB *, KEY *, SLONG *, SLONG *, SLONG *);
|
||||
static CONTENTS garbage_collect(thread_db*, WIN *, SLONG);
|
||||
static void generate_jump_nodes(thread_db*, btree_page*, jumpNodeList*, USHORT, USHORT*, USHORT*, USHORT*);
|
||||
static SLONG insert_node(thread_db*, WIN *, IIB *, KEY *, SLONG *, SLONG *, SLONG *);
|
||||
static INT64_KEY make_int64_key(SINT64, SSHORT);
|
||||
#ifdef DEBUG_INDEXKEY
|
||||
static void print_int64_key(SINT64, SSHORT, INT64_KEY);
|
||||
#endif
|
||||
static CONTENTS remove_node(TDBB, IIB *, WIN *);
|
||||
static CONTENTS remove_leaf_node(TDBB, IIB *, WIN *);
|
||||
static bool scan(TDBB, UCHAR *, SBM *, USHORT, USHORT, KEY *, USHORT, SCHAR);
|
||||
static CONTENTS remove_node(thread_db*, IIB *, WIN *);
|
||||
static CONTENTS remove_leaf_node(thread_db*, IIB *, WIN *);
|
||||
static bool scan(thread_db*, UCHAR *, SBM *, USHORT, USHORT, KEY *, USHORT, SCHAR);
|
||||
static void update_selectivity(index_root_page*, USHORT, const SelectivityList&);
|
||||
|
||||
USHORT BTR_all(TDBB tdbb,
|
||||
USHORT BTR_all(thread_db* tdbb,
|
||||
jrd_rel* relation,
|
||||
IDX** start_buffer,
|
||||
IDX** csb_idx,
|
||||
@ -246,7 +246,7 @@ USHORT BTR_all(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void BTR_create(TDBB tdbb,
|
||||
void BTR_create(thread_db* tdbb,
|
||||
jrd_rel* relation,
|
||||
IDX * idx,
|
||||
USHORT key_length,
|
||||
@ -286,7 +286,7 @@ void BTR_create(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void BTR_delete_index(TDBB tdbb, WIN * window, USHORT id)
|
||||
void BTR_delete_index(thread_db* tdbb, WIN * window, USHORT id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -393,7 +393,7 @@ bool BTR_description(jrd_rel* relation, index_root_page* root, IDX * idx, SSHORT
|
||||
}
|
||||
|
||||
|
||||
void BTR_evaluate(TDBB tdbb, IRB retrieval, SBM * bitmap)
|
||||
void BTR_evaluate(thread_db* tdbb, IRB retrieval, SBM * bitmap)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -499,7 +499,7 @@ UCHAR *BTR_find_leaf(btree_page* bucket, KEY *key, UCHAR *value,
|
||||
}
|
||||
|
||||
|
||||
btree_page* BTR_find_page(TDBB tdbb,
|
||||
btree_page* BTR_find_page(thread_db* tdbb,
|
||||
IRB retrieval,
|
||||
WIN * window,
|
||||
IDX * idx, KEY * lower, KEY * upper, bool backwards)
|
||||
@ -530,14 +530,14 @@ btree_page* BTR_find_page(TDBB tdbb,
|
||||
retrieval->irb_value +
|
||||
retrieval->irb_desc.idx_count,
|
||||
&retrieval->irb_desc, upper,
|
||||
(USHORT) (retrieval->irb_generic & irb_starting));
|
||||
(retrieval->irb_generic & irb_starting) != 0);
|
||||
}
|
||||
|
||||
if (retrieval->irb_lower_count) {
|
||||
BTR_make_key(tdbb, retrieval->irb_lower_count,
|
||||
retrieval->irb_value,
|
||||
&retrieval->irb_desc, lower,
|
||||
(USHORT) (retrieval->irb_generic & irb_starting));
|
||||
(retrieval->irb_generic & irb_starting) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -611,7 +611,7 @@ btree_page* BTR_find_page(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void BTR_insert(TDBB tdbb, WIN * root_window, IIB * insertion)
|
||||
void BTR_insert(thread_db* tdbb, WIN * root_window, IIB * insertion)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -743,7 +743,7 @@ void BTR_insert(TDBB tdbb, WIN * root_window, IIB * insertion)
|
||||
}
|
||||
|
||||
|
||||
IDX_E BTR_key(TDBB tdbb, jrd_rel* relation, REC record, IDX * idx, KEY * key, idx_null_state * null_state)
|
||||
IDX_E BTR_key(thread_db* tdbb, jrd_rel* relation, REC record, IDX * idx, KEY * key, idx_null_state * null_state)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -807,7 +807,7 @@ IDX_E BTR_key(TDBB tdbb, jrd_rel* relation, REC record, IDX * idx, KEY * key, id
|
||||
}
|
||||
|
||||
compress(tdbb, desc_ptr, key, tail->idx_itype, isNull,
|
||||
(idx->idx_flags & idx_descending), (USHORT) FALSE);
|
||||
(idx->idx_flags & idx_descending), false);
|
||||
}
|
||||
else {
|
||||
UCHAR* p = key->key_data;
|
||||
@ -828,7 +828,7 @@ IDX_E BTR_key(TDBB tdbb, jrd_rel* relation, REC record, IDX * idx, KEY * key, id
|
||||
}
|
||||
|
||||
compress(tdbb, desc_ptr, &temp, tail->idx_itype, isNull,
|
||||
(idx->idx_flags & idx_descending), (USHORT) FALSE);
|
||||
(idx->idx_flags & idx_descending), false);
|
||||
|
||||
const UCHAR* q = temp.key_data;
|
||||
for (USHORT l = temp.key_length; l; --l, --stuff_count) {
|
||||
@ -881,7 +881,7 @@ USHORT BTR_key_length(jrd_rel* relation, IDX * idx)
|
||||
**************************************/
|
||||
USHORT length;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
const fmt* format = MET_current(tdbb, relation);
|
||||
idx::idx_repeat* tail = idx->idx_rpt;
|
||||
@ -1009,7 +1009,7 @@ UCHAR *BTR_last_node(btree_page* page, jrd_exp* expanded_page, BTX * expanded_no
|
||||
|
||||
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
btree_page* BTR_left_handoff(TDBB tdbb, WIN * window, btree_page* page, SSHORT lock_level)
|
||||
btree_page* BTR_left_handoff(thread_db* tdbb, WIN * window, btree_page* page, SSHORT lock_level)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1051,9 +1051,7 @@ btree_page* BTR_left_handoff(TDBB tdbb, WIN * window, btree_page* page, SSHORT l
|
||||
lock_level, pag_index);
|
||||
sibling = page->btr_sibling;
|
||||
}
|
||||
WIN fix_win;
|
||||
fix_win.win_page = original_page;
|
||||
fix_win.win_flags = 0;
|
||||
WIN fix_win(original_page);
|
||||
btree_page* fix_page = (btree_page*) CCH_FETCH(tdbb, &fix_win, LCK_write, pag_index);
|
||||
|
||||
// if someone else already fixed it, just return
|
||||
@ -1072,7 +1070,7 @@ btree_page* BTR_left_handoff(TDBB tdbb, WIN * window, btree_page* page, SSHORT l
|
||||
#endif
|
||||
|
||||
|
||||
USHORT BTR_lookup(TDBB tdbb, jrd_rel* relation, USHORT id, IDX * buffer)
|
||||
USHORT BTR_lookup(thread_db* tdbb, jrd_rel* relation, USHORT id, IDX * buffer)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1103,9 +1101,9 @@ USHORT BTR_lookup(TDBB tdbb, jrd_rel* relation, USHORT id, IDX * buffer)
|
||||
}
|
||||
|
||||
|
||||
void BTR_make_key(TDBB tdbb,
|
||||
void BTR_make_key(thread_db* tdbb,
|
||||
USHORT count,
|
||||
jrd_nod** exprs, IDX * idx, KEY * key, USHORT fuzzy)
|
||||
jrd_nod** exprs, IDX * idx, KEY * key, bool fuzzy)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1118,9 +1116,8 @@ void BTR_make_key(TDBB tdbb,
|
||||
* a vector of value expressions, and a place to put the key.
|
||||
*
|
||||
**************************************/
|
||||
DSC *desc, temp_desc;
|
||||
DSC temp_desc;
|
||||
KEY temp;
|
||||
bool isNull;
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
@ -1135,7 +1132,8 @@ void BTR_make_key(TDBB tdbb,
|
||||
// If the index is a single segment index, don't sweat the compound
|
||||
// stuff.
|
||||
if (idx->idx_count == 1) {
|
||||
desc = eval(tdbb, *exprs, &temp_desc, &isNull);
|
||||
bool isNull;
|
||||
const dsc* desc = eval(tdbb, *exprs, &temp_desc, &isNull);
|
||||
compress(tdbb, desc, key, tail->idx_itype, isNull,
|
||||
(idx->idx_flags & idx_descending), fuzzy);
|
||||
}
|
||||
@ -1148,10 +1146,11 @@ void BTR_make_key(TDBB tdbb,
|
||||
for (; stuff_count; --stuff_count) {
|
||||
*p++ = 0;
|
||||
}
|
||||
desc = eval(tdbb, *exprs++, &temp_desc, &isNull);
|
||||
bool isNull;
|
||||
const dsc* desc = eval(tdbb, *exprs++, &temp_desc, &isNull);
|
||||
compress(tdbb, desc, &temp, tail->idx_itype, isNull,
|
||||
(idx->idx_flags & idx_descending),
|
||||
(USHORT) ((n == count - 1) ? fuzzy : FALSE));
|
||||
((n == count - 1) ? fuzzy : false));
|
||||
const UCHAR* q = temp.key_data;
|
||||
for (USHORT l = temp.key_length; l; --l, --stuff_count)
|
||||
{
|
||||
@ -1171,7 +1170,7 @@ void BTR_make_key(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
bool BTR_next_index(TDBB tdbb,
|
||||
bool BTR_next_index(thread_db* tdbb,
|
||||
jrd_rel* relation, jrd_tra* transaction, IDX * idx, WIN * window)
|
||||
{
|
||||
/**************************************
|
||||
@ -1293,7 +1292,7 @@ UCHAR *BTR_previousNode(IndexNode * node, UCHAR * pointer,
|
||||
}
|
||||
|
||||
|
||||
void BTR_remove(TDBB tdbb, WIN * root_window, IIB * insertion)
|
||||
void BTR_remove(thread_db* tdbb, WIN * root_window, IIB * insertion)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1373,7 +1372,7 @@ void BTR_remove(TDBB tdbb, WIN * root_window, IIB * insertion)
|
||||
}
|
||||
|
||||
|
||||
void BTR_reserve_slot(TDBB tdbb, jrd_rel* relation, jrd_tra* transaction, IDX * idx)
|
||||
void BTR_reserve_slot(thread_db* tdbb, jrd_rel* relation, jrd_tra* transaction, IDX * idx)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1487,7 +1486,7 @@ retry:
|
||||
}
|
||||
|
||||
|
||||
void BTR_selectivity(TDBB tdbb, jrd_rel* relation, USHORT id, SelectivityList& selectivity)
|
||||
void BTR_selectivity(thread_db* tdbb, jrd_rel* relation, USHORT id, SelectivityList& selectivity)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1682,7 +1681,7 @@ void BTR_selectivity(TDBB tdbb, jrd_rel* relation, USHORT id, SelectivityList& s
|
||||
}
|
||||
|
||||
|
||||
static SLONG add_node(TDBB tdbb,
|
||||
static SLONG add_node(thread_db* tdbb,
|
||||
WIN * window,
|
||||
IIB * insertion,
|
||||
KEY * new_key,
|
||||
@ -1817,11 +1816,11 @@ static void complement_key(KEY * key)
|
||||
}
|
||||
|
||||
|
||||
static void compress(TDBB tdbb,
|
||||
DSC * desc,
|
||||
KEY * key,
|
||||
static void compress(thread_db* tdbb,
|
||||
const dsc* desc,
|
||||
KEY* key,
|
||||
USHORT itype,
|
||||
bool isNull, bool descending, USHORT fuzzy)
|
||||
bool isNull, bool descending, bool fuzzy)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1986,8 +1985,8 @@ static void compress(TDBB tdbb,
|
||||
temp_is_negative = (temp.temp_sint64 < 0);
|
||||
#ifdef DEBUG_INDEXKEY
|
||||
ib_fprintf(ib_stderr, "TIMESTAMP2: %d:%u ",
|
||||
((SLONG *) desc->dsc_address)[0],
|
||||
((ULONG *) desc->dsc_address)[1]);
|
||||
((const SLONG*) desc->dsc_address)[0],
|
||||
((const ULONG*) desc->dsc_address)[1]);
|
||||
ib_fprintf(ib_stderr, "TIMESTAMP2: %20" QUADFORMAT "d ",
|
||||
temp.temp_sint64);
|
||||
#endif
|
||||
@ -2015,7 +2014,7 @@ static void compress(TDBB tdbb,
|
||||
temp_copy_length = sizeof(temp.temp_int64_key.d_part);
|
||||
temp_is_negative = (temp.temp_int64_key.d_part < 0);
|
||||
#ifdef DEBUG_INDEXKEY
|
||||
print_int64_key(*(SINT64 *) desc->dsc_address,
|
||||
print_int64_key(*(const SINT64*) desc->dsc_address,
|
||||
desc->dsc_scale, temp.temp_int64_key);
|
||||
#endif
|
||||
}
|
||||
@ -2148,9 +2147,8 @@ static void compress(TDBB tdbb,
|
||||
key->key_length = (p - key->key_data) + 1;
|
||||
#ifdef DEBUG_INDEXKEY
|
||||
{
|
||||
USHORT i;
|
||||
ib_fprintf(ib_stderr, "KEY: length: %d Bytes: ", key->key_length);
|
||||
for (i = 0; i < key->key_length; i++)
|
||||
for (int i = 0; i < key->key_length; i++)
|
||||
ib_fprintf(ib_stderr, "%02x ", key->key_data[i]);
|
||||
ib_fprintf(ib_stderr, "\n");
|
||||
}
|
||||
@ -2158,7 +2156,7 @@ static void compress(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static USHORT compress_root(TDBB tdbb, index_root_page* page)
|
||||
static USHORT compress_root(thread_db* tdbb, index_root_page* page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2224,7 +2222,7 @@ static void copy_key(const KEY* in, KEY* out)
|
||||
}
|
||||
|
||||
|
||||
static CONTENTS delete_node(TDBB tdbb, WIN *window, UCHAR *pointer)
|
||||
static CONTENTS delete_node(thread_db* tdbb, WIN *window, UCHAR *pointer)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2402,7 +2400,7 @@ static CONTENTS delete_node(TDBB tdbb, WIN *window, UCHAR *pointer)
|
||||
}
|
||||
|
||||
|
||||
static void delete_tree(TDBB tdbb,
|
||||
static void delete_tree(thread_db* tdbb,
|
||||
USHORT rel_id, USHORT idx_id, SLONG next, SLONG prior)
|
||||
{
|
||||
/**************************************
|
||||
@ -2468,7 +2466,7 @@ static void delete_tree(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static DSC *eval(TDBB tdbb, jrd_nod* node, DSC * temp, bool *isNull)
|
||||
static DSC *eval(thread_db* tdbb, jrd_nod* node, DSC * temp, bool *isNull)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2505,7 +2503,7 @@ static DSC *eval(TDBB tdbb, jrd_nod* node, DSC * temp, bool *isNull)
|
||||
}
|
||||
|
||||
|
||||
static SLONG fast_load(TDBB tdbb,
|
||||
static SLONG fast_load(thread_db* tdbb,
|
||||
jrd_rel* relation,
|
||||
IDX * idx,
|
||||
USHORT key_length,
|
||||
@ -3302,7 +3300,7 @@ static SLONG fast_load(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static index_root_page* fetch_root(TDBB tdbb, WIN * window, jrd_rel* relation)
|
||||
static index_root_page* fetch_root(thread_db* tdbb, WIN * window, jrd_rel* relation)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4053,7 +4051,7 @@ static SLONG find_page(btree_page* bucket, const KEY* key, UCHAR idx_flags, SLON
|
||||
}
|
||||
|
||||
|
||||
static CONTENTS garbage_collect(TDBB tdbb, WIN * window, SLONG parent_number)
|
||||
static CONTENTS garbage_collect(thread_db* tdbb, WIN * window, SLONG parent_number)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4624,7 +4622,7 @@ static CONTENTS garbage_collect(TDBB tdbb, WIN * window, SLONG parent_number)
|
||||
}
|
||||
|
||||
|
||||
static void generate_jump_nodes(TDBB tdbb, btree_page* page, jumpNodeList* jumpNodes,
|
||||
static void generate_jump_nodes(thread_db* tdbb, btree_page* page, jumpNodeList* jumpNodes,
|
||||
USHORT excludeOffset, USHORT* jumpersSize,
|
||||
USHORT* splitIndex, USHORT* splitPrefix)
|
||||
{
|
||||
@ -4776,7 +4774,7 @@ static void generate_jump_nodes(TDBB tdbb, btree_page* page, jumpNodeList* jumpN
|
||||
}
|
||||
|
||||
|
||||
static SLONG insert_node(TDBB tdbb,
|
||||
static SLONG insert_node(thread_db* tdbb,
|
||||
WIN * window,
|
||||
IIB * insertion,
|
||||
KEY * new_key,
|
||||
@ -5454,7 +5452,7 @@ static void print_int64_key(SINT64 value, SSHORT scale, INT64_KEY key)
|
||||
#endif /* DEBUG_INDEXKEY */
|
||||
|
||||
|
||||
static CONTENTS remove_node(TDBB tdbb, IIB * insertion, WIN * window)
|
||||
static CONTENTS remove_node(thread_db* tdbb, IIB * insertion, WIN * window)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -5528,7 +5526,7 @@ static CONTENTS remove_node(TDBB tdbb, IIB * insertion, WIN * window)
|
||||
}
|
||||
|
||||
|
||||
static CONTENTS remove_leaf_node(TDBB tdbb, IIB * insertion, WIN * window)
|
||||
static CONTENTS remove_leaf_node(thread_db* tdbb, IIB * insertion, WIN * window)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -5675,7 +5673,7 @@ static CONTENTS remove_leaf_node(TDBB tdbb, IIB * insertion, WIN * window)
|
||||
}
|
||||
|
||||
|
||||
static bool scan(TDBB tdbb, UCHAR *pointer, SBM *bitmap, USHORT to_segment,
|
||||
static bool scan(thread_db* tdbb, UCHAR *pointer, SBM *bitmap, USHORT to_segment,
|
||||
USHORT prefix, KEY *key, USHORT flag, SCHAR page_flags)
|
||||
{
|
||||
/**************************************
|
||||
|
@ -39,6 +39,8 @@
|
||||
|
||||
#define MAX_KEY_LIMIT (dbb->dbb_page_size / 4)
|
||||
|
||||
class jrd_rel;
|
||||
|
||||
enum idx_null_state {
|
||||
idx_nulls_none,
|
||||
idx_nulls_some,
|
||||
@ -124,7 +126,7 @@ typedef struct iib {
|
||||
SLONG iib_number; /* record number (or lower level page) */
|
||||
SLONG iib_sibling; /* right sibling page */
|
||||
idx* iib_descriptor; /* index descriptor */
|
||||
struct jrd_rel *iib_relation; /* relation block */
|
||||
jrd_rel* iib_relation; /* relation block */
|
||||
struct key *iib_key; /* varying string for insertion */
|
||||
struct sbm *iib_duplicates; /* spare bit map of duplicates */
|
||||
class jrd_tra *iib_transaction; /* insertion transaction */
|
||||
@ -166,7 +168,7 @@ class irb : public pool_alloc_rpt<jrd_nod*, type_irb>
|
||||
IDX irb_desc; /* Index descriptor */
|
||||
USHORT irb_index; /* Index id */
|
||||
USHORT irb_generic; /* Flags for generic search */
|
||||
struct jrd_rel *irb_relation; /* Relation for retrieval */
|
||||
jrd_rel* irb_relation; /* Relation for retrieval */
|
||||
USHORT irb_lower_count; /* Number of segments for retrieval */
|
||||
USHORT irb_upper_count; /* Number of segments for retrieval */
|
||||
KEY *irb_key; /* key for equality retrival */
|
||||
|
@ -28,25 +28,25 @@
|
||||
#include "../jrd/ods.h"
|
||||
#include "../jrd/req.h"
|
||||
|
||||
USHORT BTR_all(TDBB, jrd_rel*, idx**, idx**, str**, SLONG*);
|
||||
void BTR_create(TDBB, jrd_rel*, idx*, USHORT, scb*, SelectivityList&);
|
||||
void BTR_delete_index(TDBB, win*, USHORT);
|
||||
//USHORT BTR_delete_node(TDBB, btree_page*, USHORT);
|
||||
USHORT BTR_all(thread_db*, jrd_rel*, idx**, idx**, str**, SLONG*);
|
||||
void BTR_create(thread_db*, jrd_rel*, idx*, USHORT, scb*, SelectivityList&);
|
||||
void BTR_delete_index(thread_db*, win*, USHORT);
|
||||
//USHORT BTR_delete_node(thread_db*, btree_page*, USHORT);
|
||||
bool BTR_description(jrd_rel*, index_root_page*, idx*, SSHORT);
|
||||
void BTR_evaluate(tdbb*, irb*, sbm**);
|
||||
void BTR_evaluate(thread_db*, irb*, sbm**);
|
||||
UCHAR* BTR_find_leaf(btree_page*, key*, UCHAR*, USHORT*, int, bool);
|
||||
btree_page* BTR_find_page(tdbb*, irb*, win*, idx*, key*, key*, bool);
|
||||
void BTR_insert(tdbb*, win*, iib*);
|
||||
enum idx_e BTR_key(tdbb*, jrd_rel*, rec*, idx*, key*, idx_null_state*);
|
||||
btree_page* BTR_find_page(thread_db*, irb*, win*, idx*, key*, key*, bool);
|
||||
void BTR_insert(thread_db*, win*, iib*);
|
||||
enum idx_e BTR_key(thread_db*, jrd_rel*, rec*, idx*, key*, idx_null_state*);
|
||||
USHORT BTR_key_length(jrd_rel*, idx*);
|
||||
UCHAR* BTR_last_node(btree_page*, jrd_exp*, struct btx**);
|
||||
btree_page* BTR_left_handoff(tdbb*, win*, btree_page*, SSHORT);
|
||||
USHORT BTR_lookup(TDBB, jrd_rel*, USHORT, idx*);
|
||||
void BTR_make_key(tdbb*, USHORT, jrd_nod**, idx*, key*, USHORT);
|
||||
bool BTR_next_index(TDBB, jrd_rel*, jrd_tra*, idx*, win*);
|
||||
void BTR_remove(tdbb*, win*, iib*);
|
||||
void BTR_reserve_slot(TDBB, jrd_rel*, jrd_tra*, idx*);
|
||||
void BTR_selectivity(TDBB, jrd_rel*, USHORT, SelectivityList&);
|
||||
btree_page* BTR_left_handoff(thread_db*, win*, btree_page*, SSHORT);
|
||||
USHORT BTR_lookup(thread_db*, jrd_rel*, USHORT, idx*);
|
||||
void BTR_make_key(thread_db*, USHORT, jrd_nod**, idx*, key*, bool);
|
||||
bool BTR_next_index(thread_db*, jrd_rel*, jrd_tra*, idx*, win*);
|
||||
void BTR_remove(thread_db*, win*, iib*);
|
||||
void BTR_reserve_slot(thread_db*, jrd_rel*, jrd_tra*, idx*);
|
||||
void BTR_selectivity(thread_db*, jrd_rel*, USHORT, SelectivityList&);
|
||||
|
||||
#endif // JRD_BTR_PROTO_H
|
||||
|
||||
|
337
src/jrd/cch.cpp
337
src/jrd/cch.cpp
File diff suppressed because it is too large
Load Diff
@ -28,8 +28,9 @@
|
||||
|
||||
class lck;
|
||||
class Precedence;
|
||||
struct tdbb;
|
||||
struct thread_db;
|
||||
struct que;
|
||||
class Buffer_desc;
|
||||
|
||||
/* Page buffer cache size constraints. */
|
||||
|
||||
@ -39,8 +40,8 @@ struct que;
|
||||
/* BCB -- Buffer control block -- one per system */
|
||||
struct bcb_repeat
|
||||
{
|
||||
class bdb* bcb_bdb; /* Buffer descriptor block */
|
||||
que bcb_page_mod; /* Que of buffers with page mod n */
|
||||
Buffer_desc* bcb_bdb; /* Buffer descriptor block */
|
||||
que bcb_page_mod; /* Que of buffers with page mod n */
|
||||
};
|
||||
|
||||
class bcb : public pool_alloc_rpt<bcb_repeat, type_bcb>
|
||||
@ -49,7 +50,7 @@ class bcb : public pool_alloc_rpt<bcb_repeat, type_bcb>
|
||||
class lls* bcb_memory; /* Large block partitioned into buffers */
|
||||
que bcb_in_use; /* Que of buffers in use */
|
||||
que bcb_empty; /* Que of empty buffers */
|
||||
class bdb* bcb_btree; /* root of dirty page btree */
|
||||
Buffer_desc* bcb_btree; /* root of dirty page btree */
|
||||
Precedence* bcb_free; /* Free precedence blocks */
|
||||
que bcb_free_lwt; /* Free latch wait blocks */
|
||||
SSHORT bcb_flags; /* see below */
|
||||
@ -70,11 +71,11 @@ typedef bcb *BCB;
|
||||
#define BCB_free_pending 64 /* request cache writer to free pages */
|
||||
|
||||
|
||||
/* BDB -- Buffer descriptor block */
|
||||
/* Buffer_desc -- Buffer descriptor block */
|
||||
|
||||
#define BDB_max_shared 20 /* maximum number of shared latch owners per bdb */
|
||||
#define BDB_max_shared 20 /* maximum number of shared latch owners per Buffer_desc */
|
||||
|
||||
class bdb : public pool_alloc<type_bdb>
|
||||
class Buffer_desc : public pool_alloc<type_bdb>
|
||||
{
|
||||
public:
|
||||
class Database* bdb_dbb; /* Database block (for ASTs) */
|
||||
@ -89,14 +90,14 @@ class bdb : public pool_alloc<type_bdb>
|
||||
SLONG bdb_incarnation;
|
||||
ULONG bdb_transactions; /* vector of dirty flags to reduce commit overhead */
|
||||
SLONG bdb_mark_transaction; /* hi-water mark transaction to defer header page I/O */
|
||||
bdb* bdb_left; /* dirty page binary tree link */
|
||||
bdb* bdb_right; /* dirty page binary tree link */
|
||||
bdb* bdb_parent; /* dirty page binary tree link */
|
||||
Buffer_desc* bdb_left; /* dirty page binary tree link */
|
||||
Buffer_desc* bdb_right; /* dirty page binary tree link */
|
||||
Buffer_desc* bdb_parent; /* dirty page binary tree link */
|
||||
que bdb_lower; /* lower precedence que */
|
||||
que bdb_higher; /* higher precedence que */
|
||||
que bdb_waiters; /* latch wait que */
|
||||
tdbb* bdb_exclusive; /* thread holding exclusive latch */
|
||||
tdbb* bdb_io; /* thread holding io latch */
|
||||
thread_db* bdb_exclusive; /* thread holding exclusive latch */
|
||||
thread_db* bdb_io; /* thread holding io latch */
|
||||
UATOM bdb_ast_flags; /* flags manipulated at AST level */
|
||||
USHORT bdb_flags;
|
||||
SSHORT bdb_use_count; /* Number of active users */
|
||||
@ -106,9 +107,8 @@ class bdb : public pool_alloc<type_bdb>
|
||||
SLONG bdb_diff_generation; /* Number of backup/restore cycle for
|
||||
this database in current process.
|
||||
Used in CS only. */
|
||||
tdbb* bdb_shared[BDB_max_shared]; /* threads holding shared latches */
|
||||
thread_db* bdb_shared[BDB_max_shared]; /* threads holding shared latches */
|
||||
};
|
||||
typedef bdb *BDB;
|
||||
|
||||
/* bdb_flags */
|
||||
|
||||
@ -146,11 +146,11 @@ typedef bdb *BDB;
|
||||
class Precedence : public pool_alloc<type_pre>
|
||||
{
|
||||
public:
|
||||
bdb* pre_hi;
|
||||
bdb* pre_low;
|
||||
que pre_lower;
|
||||
que pre_higher;
|
||||
SSHORT pre_flags;
|
||||
Buffer_desc* pre_hi;
|
||||
Buffer_desc* pre_low;
|
||||
que pre_lower;
|
||||
que pre_higher;
|
||||
SSHORT pre_flags;
|
||||
};
|
||||
|
||||
#define PRE_cleared 1
|
||||
@ -195,7 +195,7 @@ typedef enum
|
||||
class Latch_wait : public pool_alloc<type_lwt>
|
||||
{
|
||||
public:
|
||||
tdbb* lwt_tdbb;
|
||||
thread_db* lwt_tdbb;
|
||||
LATCH lwt_latch; /* latch type requested */
|
||||
que lwt_waiters; /* latch queue */
|
||||
struct event_t lwt_event; /* grant event to wait on */
|
||||
@ -216,7 +216,7 @@ class Latch_wait : public pool_alloc<type_lwt>
|
||||
class Prefetch : public pool_alloc<type_prf>
|
||||
{
|
||||
public:
|
||||
tdbb* prf_tdbb; /* thread database context */
|
||||
thread_db* prf_tdbb; /* thread database context */
|
||||
SLONG prf_start_page; /* starting page of multipage prefetch */
|
||||
USHORT prf_max_prefetch; /* maximum no. of pages to prefetch */
|
||||
USHORT prf_page_count; /* actual no. of pages being prefetched */
|
||||
@ -224,7 +224,7 @@ class Prefetch : public pool_alloc<type_prf>
|
||||
SCHAR* prf_aligned_buffer; /* buffer address aligned for raw (OS cache bypass) I/O */
|
||||
SCHAR* prf_io_buffer; /* I/O buffer address */
|
||||
UCHAR prf_flags;
|
||||
bdb* prf_bdbs[PREFETCH_MAX_TRANSFER / MIN_PAGE_SIZE];
|
||||
Buffer_desc* prf_bdbs[PREFETCH_MAX_TRANSFER / MIN_PAGE_SIZE];
|
||||
SCHAR prf_unaligned_buffer[PREFETCH_MAX_TRANSFER + MIN_PAGE_SIZE];
|
||||
};
|
||||
|
||||
|
@ -26,36 +26,36 @@
|
||||
|
||||
void CCH_shutdown_database(Database*);
|
||||
|
||||
USHORT CCH_checksum(bdb*);
|
||||
USHORT CCH_checksum(Buffer_desc*);
|
||||
int CCH_down_grade_dbb(void* ast_argument);
|
||||
bool CCH_exclusive(TDBB, USHORT, SSHORT);
|
||||
bool CCH_exclusive_attachment(TDBB, USHORT, SSHORT);
|
||||
void CCH_expand(TDBB, ULONG);
|
||||
pag* CCH_fake(TDBB, win*, SSHORT);
|
||||
pag* CCH_fetch(TDBB, win*, USHORT, SSHORT, SSHORT, SSHORT, bool);
|
||||
SSHORT CCH_fetch_lock(TDBB, win*, USHORT, SSHORT, SSHORT, SSHORT);
|
||||
void CCH_fetch_page(TDBB, win*, SSHORT, bool);
|
||||
void CCH_fini(TDBB);
|
||||
void CCH_flush(TDBB, USHORT, SLONG);
|
||||
bool CCH_free_page(TDBB);
|
||||
bool CCH_exclusive(thread_db*, USHORT, SSHORT);
|
||||
bool CCH_exclusive_attachment(thread_db*, USHORT, SSHORT);
|
||||
void CCH_expand(thread_db*, ULONG);
|
||||
pag* CCH_fake(thread_db*, win*, SSHORT);
|
||||
pag* CCH_fetch(thread_db*, win*, USHORT, SSHORT, SSHORT, SSHORT, bool);
|
||||
SSHORT CCH_fetch_lock(thread_db*, win*, USHORT, SSHORT, SSHORT, SSHORT);
|
||||
void CCH_fetch_page(thread_db*, win*, SSHORT, bool);
|
||||
void CCH_fini(thread_db*);
|
||||
void CCH_flush(thread_db*, USHORT, SLONG);
|
||||
bool CCH_free_page(thread_db*);
|
||||
SLONG CCH_get_incarnation(win*);
|
||||
pag* CCH_handoff(TDBB, win*, SLONG, SSHORT, SSHORT, SSHORT, SSHORT);
|
||||
void CCH_init(TDBB, ULONG);
|
||||
void CCH_mark(TDBB, win*, USHORT);
|
||||
void CCH_mark_must_write(TDBB, win*);
|
||||
pag* CCH_handoff(thread_db*, win*, SLONG, SSHORT, SSHORT, SSHORT, SSHORT);
|
||||
void CCH_init(thread_db*, ULONG);
|
||||
void CCH_mark(thread_db*, win*, USHORT);
|
||||
void CCH_mark_must_write(thread_db*, win*);
|
||||
void CCH_must_write(win*);
|
||||
lck* CCH_page_lock(TDBB);
|
||||
void CCH_precedence(TDBB, win*, SLONG);
|
||||
void CCH_prefetch(tdbb*, SLONG*, SSHORT);
|
||||
bool CCH_prefetch_pages(TDBB);
|
||||
void CCH_release(TDBB, win*, bool);
|
||||
lck* CCH_page_lock(thread_db*);
|
||||
void CCH_precedence(thread_db*, win*, SLONG);
|
||||
void CCH_prefetch(thread_db*, SLONG*, SSHORT);
|
||||
bool CCH_prefetch_pages(thread_db*);
|
||||
void CCH_release(thread_db*, win*, bool);
|
||||
void CCH_release_and_free(win*);
|
||||
void CCH_release_exclusive(TDBB);
|
||||
void CCH_release_exclusive(thread_db*);
|
||||
bool CCH_rollover_to_shadow(Database*, jrd_file*, const bool);
|
||||
void CCH_unwind(TDBB, bool);
|
||||
void CCH_unwind(thread_db*, bool);
|
||||
bool CCH_validate(win*);
|
||||
void CCH_flush_database(TDBB tdbb);
|
||||
bool CCH_write_all_shadows(TDBB, Shadow*, bdb*,
|
||||
void CCH_flush_database(thread_db*);
|
||||
bool CCH_write_all_shadows(thread_db*, Shadow*, Buffer_desc*,
|
||||
ISC_STATUS*, USHORT, const bool);
|
||||
|
||||
/* macros for dealing with cache pages */
|
||||
|
129
src/jrd/cmp.cpp
129
src/jrd/cmp.cpp
@ -84,7 +84,7 @@
|
||||
#include "../jrd/mov_proto.h"
|
||||
#include "../jrd/dsc_proto.h"
|
||||
#include "../jrd/dbg_proto.h" // DBG_supervisor
|
||||
#include "../jrd/ExecuteStatement.h"
|
||||
#include "../jrd/execute_statement.h"
|
||||
|
||||
/* Pick up relation ids */
|
||||
|
||||
@ -125,31 +125,31 @@ rel_MAX} RIDS;
|
||||
|
||||
#define MAX_REQUEST_SIZE 10485760 // 10 MB - just to be safe
|
||||
|
||||
static UCHAR* alloc_map(TDBB, Csb*, USHORT);
|
||||
static jrd_nod* catenate_nodes(TDBB, LLS);
|
||||
static jrd_nod* copy(TDBB, Csb*, jrd_nod*, UCHAR *, USHORT, jrd_nod*, bool);
|
||||
static void expand_view_nodes(TDBB, Csb*, USHORT, LLS *, NOD_T);
|
||||
static void ignore_dbkey(TDBB, Csb*, RSE, const jrd_rel*);
|
||||
static jrd_nod* make_defaults(TDBB, Csb*, USHORT, jrd_nod*);
|
||||
static jrd_nod* make_validation(TDBB, Csb*, USHORT);
|
||||
static jrd_nod* pass1(TDBB, Csb*, jrd_nod*, jrd_rel*, USHORT, bool);
|
||||
static void pass1_erase(TDBB, Csb*, jrd_nod*);
|
||||
static jrd_nod* pass1_expand_view(TDBB, Csb*, USHORT, USHORT, bool);
|
||||
static void pass1_modify(TDBB, Csb*, jrd_nod*);
|
||||
static RSE pass1_rse(TDBB, Csb*, RSE, jrd_rel*, USHORT);
|
||||
static void pass1_source(TDBB, Csb*, RSE, jrd_nod*, jrd_nod**, LLS *, jrd_rel*, USHORT);
|
||||
static jrd_nod* pass1_store(TDBB, Csb*, jrd_nod*);
|
||||
static jrd_nod* pass1_update(TDBB, Csb*, jrd_rel*, trig_vec*, USHORT, USHORT, USHORT, jrd_rel*,
|
||||
static UCHAR* alloc_map(thread_db*, Csb*, USHORT);
|
||||
static jrd_nod* catenate_nodes(thread_db*, LLS);
|
||||
static jrd_nod* copy(thread_db*, Csb*, jrd_nod*, UCHAR *, USHORT, jrd_nod*, bool);
|
||||
static void expand_view_nodes(thread_db*, Csb*, USHORT, LLS *, NOD_T);
|
||||
static void ignore_dbkey(thread_db*, Csb*, RSE, const jrd_rel*);
|
||||
static jrd_nod* make_defaults(thread_db*, Csb*, USHORT, jrd_nod*);
|
||||
static jrd_nod* make_validation(thread_db*, Csb*, USHORT);
|
||||
static jrd_nod* pass1(thread_db*, Csb*, jrd_nod*, jrd_rel*, USHORT, bool);
|
||||
static void pass1_erase(thread_db*, Csb*, jrd_nod*);
|
||||
static jrd_nod* pass1_expand_view(thread_db*, Csb*, USHORT, USHORT, bool);
|
||||
static void pass1_modify(thread_db*, Csb*, jrd_nod*);
|
||||
static RSE pass1_rse(thread_db*, Csb*, RSE, jrd_rel*, USHORT);
|
||||
static void pass1_source(thread_db*, Csb*, RSE, jrd_nod*, jrd_nod**, LLS *, jrd_rel*, USHORT);
|
||||
static jrd_nod* pass1_store(thread_db*, Csb*, jrd_nod*);
|
||||
static jrd_nod* pass1_update(thread_db*, Csb*, jrd_rel*, trig_vec*, USHORT, USHORT, USHORT, jrd_rel*,
|
||||
USHORT);
|
||||
static jrd_nod* pass2(TDBB, Csb*, jrd_nod* const, jrd_nod*);
|
||||
static void pass2_rse(TDBB, Csb*, RSE);
|
||||
static jrd_nod* pass2_union(TDBB, Csb*, jrd_nod*);
|
||||
static void plan_check(Csb*, RSE);
|
||||
static jrd_nod* pass2(thread_db*, Csb*, jrd_nod* const, jrd_nod*);
|
||||
static void pass2_rse(thread_db*, Csb*, RSE);
|
||||
static jrd_nod* pass2_union(thread_db*, Csb*, jrd_nod*);
|
||||
static void plan_check(const Csb*, const class rse*);
|
||||
static void plan_set(Csb*, RSE, jrd_nod*);
|
||||
static void post_procedure_access(TDBB, Csb*, jrd_prc*);
|
||||
static Rsb* post_rse(TDBB, Csb*, RSE);
|
||||
static void post_trigger_access(TDBB, Csb*, jrd_rel*, trig_vec*, jrd_rel*);
|
||||
static void process_map(TDBB, Csb*, jrd_nod*, fmt**);
|
||||
static void post_procedure_access(thread_db*, Csb*, jrd_prc*);
|
||||
static Rsb* post_rse(thread_db*, Csb*, RSE);
|
||||
static void post_trigger_access(thread_db*, Csb*, jrd_rel*, trig_vec*, jrd_rel*);
|
||||
static void process_map(thread_db*, Csb*, jrd_nod*, fmt**);
|
||||
static bool stream_in_rse(USHORT, RSE);
|
||||
static SSHORT strcmp_space(const TEXT*, const TEXT*);
|
||||
|
||||
@ -206,7 +206,7 @@ bool CMP_clone_is_active(const jrd_req* request)
|
||||
}
|
||||
|
||||
|
||||
jrd_nod* CMP_clone_node(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
jrd_nod* CMP_clone_node(thread_db* tdbb, Csb* csb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -235,7 +235,7 @@ jrd_nod* CMP_clone_node(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
jrd_req* CMP_clone_request(TDBB tdbb, jrd_req* request, USHORT level, bool validate)
|
||||
jrd_req* CMP_clone_request(thread_db* tdbb, jrd_req* request, USHORT level, bool validate)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -346,7 +346,7 @@ jrd_req* CMP_compile(USHORT blr_length, const UCHAR* blr, USHORT internal_flag)
|
||||
}
|
||||
|
||||
|
||||
jrd_req* CMP_compile2(TDBB tdbb, const UCHAR* blr, USHORT internal_flag)
|
||||
jrd_req* CMP_compile2(thread_db* tdbb, const UCHAR* blr, USHORT internal_flag)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -463,7 +463,7 @@ void CMP_expunge_transaction(jrd_tra* transaction)
|
||||
}
|
||||
|
||||
|
||||
jrd_req* CMP_find_request(TDBB tdbb, USHORT id, USHORT which)
|
||||
jrd_req* CMP_find_request(thread_db* tdbb, USHORT id, USHORT which)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -517,7 +517,7 @@ jrd_req* CMP_find_request(TDBB tdbb, USHORT id, USHORT which)
|
||||
}
|
||||
|
||||
|
||||
void CMP_fini(TDBB tdbb)
|
||||
void CMP_fini(thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -534,7 +534,7 @@ void CMP_fini(TDBB tdbb)
|
||||
}
|
||||
|
||||
|
||||
fmt* CMP_format(TDBB tdbb, Csb* csb, USHORT stream)
|
||||
fmt* CMP_format(thread_db* tdbb, Csb* csb, USHORT stream)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -568,7 +568,7 @@ fmt* CMP_format(TDBB tdbb, Csb* csb, USHORT stream)
|
||||
}
|
||||
|
||||
|
||||
void CMP_get_desc(TDBB tdbb, Csb* csb, jrd_nod* node, DSC * desc)
|
||||
void CMP_get_desc(thread_db* tdbb, Csb* csb, jrd_nod* node, DSC * desc)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1663,7 +1663,7 @@ void CMP_get_desc(TDBB tdbb, Csb* csb, jrd_nod* node, DSC * desc)
|
||||
}
|
||||
|
||||
|
||||
IDL CMP_get_index_lock(TDBB tdbb, jrd_rel* relation, USHORT id)
|
||||
IDL CMP_get_index_lock(thread_db* tdbb, jrd_rel* relation, USHORT id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1739,7 +1739,7 @@ SLONG CMP_impure(Csb* csb, USHORT size)
|
||||
}
|
||||
|
||||
|
||||
jrd_req* CMP_make_request(TDBB tdbb, Csb* csb)
|
||||
jrd_req* CMP_make_request(thread_db* tdbb, Csb* csb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1965,7 +1965,7 @@ jrd_req* CMP_make_request(TDBB tdbb, Csb* csb)
|
||||
}
|
||||
|
||||
|
||||
void CMP_post_access(TDBB tdbb,
|
||||
void CMP_post_access(thread_db* tdbb,
|
||||
Csb* csb,
|
||||
const TEXT* security_name,
|
||||
SLONG view_id,
|
||||
@ -2051,7 +2051,7 @@ void CMP_post_access(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void CMP_post_resource(TDBB tdbb,
|
||||
void CMP_post_resource(thread_db* tdbb,
|
||||
Resource** rsc_ptr,
|
||||
BLK rel_or_prc,
|
||||
enum Resource::rsc_s type,
|
||||
@ -2127,7 +2127,7 @@ void CMP_release_resource(Resource** rsc_ptr, enum Resource::rsc_s type, USHORT
|
||||
}
|
||||
|
||||
|
||||
void CMP_decrement_prc_use_count(TDBB tdbb, jrd_prc* procedure)
|
||||
void CMP_decrement_prc_use_count(thread_db* tdbb, jrd_prc* procedure)
|
||||
{
|
||||
/*********************************************
|
||||
*
|
||||
@ -2148,7 +2148,8 @@ void CMP_decrement_prc_use_count(TDBB tdbb, jrd_prc* procedure)
|
||||
if (!procedure->prc_use_count)
|
||||
return;
|
||||
|
||||
if (procedure->prc_int_use_count > 0) procedure->prc_int_use_count--;
|
||||
if (procedure->prc_int_use_count > 0)
|
||||
procedure->prc_int_use_count--;
|
||||
|
||||
--procedure->prc_use_count;
|
||||
|
||||
@ -2180,7 +2181,7 @@ void CMP_decrement_prc_use_count(TDBB tdbb, jrd_prc* procedure)
|
||||
}
|
||||
|
||||
|
||||
void CMP_release(TDBB tdbb, jrd_req* request)
|
||||
void CMP_release(thread_db* tdbb, jrd_req* request)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2268,7 +2269,7 @@ void CMP_release(TDBB tdbb, jrd_req* request)
|
||||
}
|
||||
|
||||
|
||||
void CMP_shutdown_database(TDBB tdbb)
|
||||
void CMP_shutdown_database(thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2334,7 +2335,7 @@ void CMP_shutdown_database(TDBB tdbb)
|
||||
}
|
||||
|
||||
|
||||
static UCHAR* alloc_map(TDBB tdbb, Csb* csb, USHORT stream)
|
||||
static UCHAR* alloc_map(thread_db* tdbb, Csb* csb, USHORT stream)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2408,7 +2409,7 @@ static USHORT base_stream(Csb* csb, jrd_nod** stream_number, bool nav_stream)
|
||||
#endif
|
||||
|
||||
|
||||
static jrd_nod* catenate_nodes(TDBB tdbb, LLS stack)
|
||||
static jrd_nod* catenate_nodes(thread_db* tdbb, LLS stack)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2439,7 +2440,7 @@ static jrd_nod* catenate_nodes(TDBB tdbb, LLS stack)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* copy(TDBB tdbb,
|
||||
static jrd_nod* copy(thread_db* tdbb,
|
||||
Csb* csb,
|
||||
jrd_nod* input,
|
||||
UCHAR * remap,
|
||||
@ -2851,7 +2852,7 @@ static jrd_nod* copy(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static void expand_view_nodes(TDBB tdbb,
|
||||
static void expand_view_nodes(thread_db* tdbb,
|
||||
Csb* csb,
|
||||
USHORT stream,
|
||||
LLS * stack,
|
||||
@ -2899,7 +2900,7 @@ static void expand_view_nodes(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static void ignore_dbkey(TDBB tdbb, Csb* csb, RSE rse, const jrd_rel* view)
|
||||
static void ignore_dbkey(thread_db* tdbb, Csb* csb, RSE rse, const jrd_rel* view)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2959,7 +2960,7 @@ static void ignore_dbkey(TDBB tdbb, Csb* csb, RSE rse, const jrd_rel* view)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* make_defaults(TDBB tdbb, Csb* csb, USHORT stream, jrd_nod* statement)
|
||||
static jrd_nod* make_defaults(thread_db* tdbb, Csb* csb, USHORT stream, jrd_nod* statement)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3022,7 +3023,7 @@ static jrd_nod* make_defaults(TDBB tdbb, Csb* csb, USHORT stream, jrd_nod* state
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* make_validation(TDBB tdbb, Csb* csb, USHORT stream)
|
||||
static jrd_nod* make_validation(thread_db* tdbb, Csb* csb, USHORT stream)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3090,7 +3091,7 @@ static jrd_nod* make_validation(TDBB tdbb, Csb* csb, USHORT stream)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* pass1(TDBB tdbb,
|
||||
static jrd_nod* pass1(thread_db* tdbb,
|
||||
Csb* csb,
|
||||
jrd_nod* node,
|
||||
jrd_rel* view,
|
||||
@ -3503,7 +3504,7 @@ static jrd_nod* pass1(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static void pass1_erase(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
static void pass1_erase(thread_db* tdbb, Csb* csb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3606,7 +3607,7 @@ static void pass1_erase(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* pass1_expand_view(TDBB tdbb,
|
||||
static jrd_nod* pass1_expand_view(thread_db* tdbb,
|
||||
Csb* csb,
|
||||
USHORT org_stream,
|
||||
USHORT new_stream,
|
||||
@ -3671,7 +3672,7 @@ static jrd_nod* pass1_expand_view(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static void pass1_modify(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
static void pass1_modify(thread_db* tdbb, Csb* csb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3789,7 +3790,7 @@ static void pass1_modify(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static RSE pass1_rse(TDBB tdbb,
|
||||
static RSE pass1_rse(thread_db* tdbb,
|
||||
Csb* csb,
|
||||
RSE rse,
|
||||
jrd_rel* view,
|
||||
@ -3940,7 +3941,7 @@ static RSE pass1_rse(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static void pass1_source(TDBB tdbb,
|
||||
static void pass1_source(thread_db* tdbb,
|
||||
Csb* csb,
|
||||
RSE rse,
|
||||
jrd_nod* source,
|
||||
@ -4184,7 +4185,7 @@ static void pass1_source(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* pass1_store(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
static jrd_nod* pass1_store(thread_db* tdbb, Csb* csb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4293,7 +4294,7 @@ static jrd_nod* pass1_store(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* pass1_update(TDBB tdbb,
|
||||
static jrd_nod* pass1_update(thread_db* tdbb,
|
||||
Csb* csb,
|
||||
jrd_rel* relation,
|
||||
trig_vec* trigger,
|
||||
@ -4367,7 +4368,7 @@ static jrd_nod* pass1_update(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* pass2(TDBB tdbb, Csb* csb, jrd_nod* const node, jrd_nod* parent)
|
||||
static jrd_nod* pass2(thread_db* tdbb, Csb* csb, jrd_nod* const node, jrd_nod* parent)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4943,7 +4944,7 @@ static jrd_nod* pass2(TDBB tdbb, Csb* csb, jrd_nod* const node, jrd_nod* parent)
|
||||
}
|
||||
|
||||
|
||||
static void pass2_rse(TDBB tdbb, Csb* csb, RSE rse)
|
||||
static void pass2_rse(thread_db* tdbb, Csb* csb, RSE rse)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -5032,7 +5033,7 @@ static void pass2_rse(TDBB tdbb, Csb* csb, RSE rse)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* pass2_union(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
static jrd_nod* pass2_union(thread_db* tdbb, Csb* csb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -5069,7 +5070,7 @@ static jrd_nod* pass2_union(TDBB tdbb, Csb* csb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static void plan_check(Csb* csb, RSE rse)
|
||||
static void plan_check(const Csb* csb, const class rse* rse)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -5090,7 +5091,7 @@ static void plan_check(Csb* csb, RSE rse)
|
||||
|
||||
// if any streams are not marked with a plan, give an error
|
||||
|
||||
jrd_nod** ptr = rse->rse_relation;
|
||||
const jrd_nod* const* ptr = rse->rse_relation;
|
||||
for (const jrd_nod* const* const end = ptr + rse->rse_count;
|
||||
ptr < end; ptr++)
|
||||
{
|
||||
@ -5102,7 +5103,7 @@ static void plan_check(Csb* csb, RSE rse)
|
||||
}
|
||||
}
|
||||
else if ((*ptr)->nod_type == nod_rse) {
|
||||
plan_check(csb, (RSE) *ptr);
|
||||
plan_check(csb, (const class rse*) *ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5343,7 +5344,7 @@ static void plan_set(Csb* csb, RSE rse, jrd_nod* plan)
|
||||
}
|
||||
|
||||
|
||||
static void post_procedure_access(TDBB tdbb, Csb* csb, jrd_prc* procedure)
|
||||
static void post_procedure_access(thread_db* tdbb, Csb* csb, jrd_prc* procedure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -5401,7 +5402,7 @@ static void post_procedure_access(TDBB tdbb, Csb* csb, jrd_prc* procedure)
|
||||
}
|
||||
|
||||
|
||||
static Rsb* post_rse(TDBB tdbb, Csb* csb, RSE rse)
|
||||
static Rsb* post_rse(thread_db* tdbb, Csb* csb, RSE rse)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -5462,7 +5463,7 @@ static Rsb* post_rse(TDBB tdbb, Csb* csb, RSE rse)
|
||||
}
|
||||
|
||||
|
||||
static void post_trigger_access(TDBB tdbb, Csb* csb, jrd_rel* owner_relation,
|
||||
static void post_trigger_access(thread_db* tdbb, Csb* csb, jrd_rel* owner_relation,
|
||||
trig_vec* triggers, jrd_rel* view)
|
||||
{
|
||||
/**************************************
|
||||
@ -5614,7 +5615,7 @@ static void post_trigger_access(TDBB tdbb, Csb* csb, jrd_rel* owner_relation,
|
||||
}
|
||||
|
||||
|
||||
static void process_map(TDBB tdbb, Csb* csb, jrd_nod* map, fmt** input_format)
|
||||
static void process_map(thread_db* tdbb, Csb* csb, jrd_nod* map, fmt** input_format)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
@ -27,27 +27,27 @@
|
||||
#include "../jrd/req.h"
|
||||
|
||||
bool CMP_clone_is_active(const jrd_req*);
|
||||
jrd_nod* CMP_clone_node(TDBB, Csb*, jrd_nod*);
|
||||
jrd_req* CMP_clone_request(TDBB, jrd_req*, USHORT, bool);
|
||||
jrd_nod* CMP_clone_node(thread_db*, Csb*, jrd_nod*);
|
||||
jrd_req* CMP_clone_request(thread_db*, jrd_req*, USHORT, bool);
|
||||
jrd_req* CMP_compile(USHORT, const UCHAR*, USHORT);
|
||||
jrd_req* CMP_compile2(TDBB, const UCHAR*, USHORT);
|
||||
jrd_req* CMP_compile2(thread_db*, const UCHAR*, USHORT);
|
||||
csb_repeat* CMP_csb_element(Csb*, USHORT);
|
||||
void CMP_expunge_transaction(jrd_tra*);
|
||||
void CMP_decrement_prc_use_count(TDBB, jrd_prc*);
|
||||
jrd_req* CMP_find_request(TDBB, USHORT, USHORT);
|
||||
void CMP_fini(TDBB);
|
||||
fmt* CMP_format(TDBB, Csb*, USHORT);
|
||||
void CMP_get_desc(TDBB, Csb*, jrd_nod*, dsc*);
|
||||
idl* CMP_get_index_lock(TDBB, jrd_rel*, USHORT);
|
||||
void CMP_decrement_prc_use_count(thread_db*, jrd_prc*);
|
||||
jrd_req* CMP_find_request(thread_db*, USHORT, USHORT);
|
||||
void CMP_fini(thread_db*);
|
||||
fmt* CMP_format(thread_db*, Csb*, USHORT);
|
||||
void CMP_get_desc(thread_db*, Csb*, jrd_nod*, dsc*);
|
||||
idl* CMP_get_index_lock(thread_db*, jrd_rel*, USHORT);
|
||||
SLONG CMP_impure(Csb*, USHORT);
|
||||
jrd_req* CMP_make_request(TDBB, Csb*);
|
||||
void CMP_post_access(TDBB, Csb*, const TEXT*, SLONG,
|
||||
jrd_req* CMP_make_request(thread_db*, Csb*);
|
||||
void CMP_post_access(thread_db*, Csb*, const TEXT*, SLONG,
|
||||
const TEXT*, const TEXT*, USHORT, const TEXT*,
|
||||
const TEXT*);
|
||||
void CMP_post_resource(TDBB, Resource**, blk*, enum Resource::rsc_s, USHORT);
|
||||
void CMP_post_resource(thread_db*, Resource**, blk*, enum Resource::rsc_s, USHORT);
|
||||
void CMP_release_resource(Resource**, enum Resource::rsc_s, USHORT);
|
||||
void CMP_release(TDBB, jrd_req*);
|
||||
void CMP_shutdown_database(TDBB);
|
||||
void CMP_release(thread_db*, jrd_req*);
|
||||
void CMP_shutdown_database(thread_db*);
|
||||
|
||||
#endif // JRD_CMP_PROTO_H
|
||||
|
||||
|
@ -1361,20 +1361,18 @@ void CVT_move(const dsc* from, dsc* to, FPTR_ERROR err)
|
||||
return;
|
||||
|
||||
case dtype_sql_time:
|
||||
((GDS_TIMESTAMP *) (to->dsc_address))->timestamp_date = 0;
|
||||
((GDS_TIMESTAMP *) (to->dsc_address))->timestamp_time =
|
||||
*(GDS_TIME *) (from->dsc_address);
|
||||
((GDS_TIMESTAMP*) (to->dsc_address))->timestamp_date = 0;
|
||||
((GDS_TIMESTAMP*) (to->dsc_address))->timestamp_time =
|
||||
*(GDS_TIME*) (from->dsc_address);
|
||||
|
||||
/* Per SQL Specs, we need to set the DATE
|
||||
portion to the current date */
|
||||
{
|
||||
TDBB tdbb = NULL;
|
||||
time_t clock;
|
||||
|
||||
/** Cannot call GET_THREAD_DATA because that macro calls
|
||||
BUGCHECK i.e. ERR_bugcheck() which is not part of
|
||||
client library **/
|
||||
tdbb = PLATFORM_GET_THREAD_DATA;
|
||||
/** Cannot call GET_THREAD_DATA because that macro calls
|
||||
BUGCHECK i.e. ERR_bugcheck() which is not part of
|
||||
client library **/
|
||||
thread_db* tdbb = PLATFORM_GET_THREAD_DATA;
|
||||
|
||||
/* If we're in the engine, then the THDD type must
|
||||
be a THDD_TYPE_TDBB. So, if we're in the engine
|
||||
@ -1385,7 +1383,8 @@ void CVT_move(const dsc* from, dsc* to, FPTR_ERROR err)
|
||||
|
||||
if ((tdbb) &&
|
||||
(((THDD) tdbb)->thdd_type == THDD_TYPE_TDBB) &&
|
||||
tdbb->tdbb_request) {
|
||||
tdbb->tdbb_request)
|
||||
{
|
||||
if (tdbb->tdbb_request->req_timestamp)
|
||||
clock = tdbb->tdbb_request->req_timestamp;
|
||||
else {
|
||||
@ -1399,7 +1398,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_ERROR err)
|
||||
const tm times = *localtime(&clock);
|
||||
GDS_TIMESTAMP enc_times;
|
||||
isc_encode_timestamp(×, &enc_times);
|
||||
((GDS_TIMESTAMP *) (to->dsc_address))->timestamp_date =
|
||||
((GDS_TIMESTAMP*) (to->dsc_address))->timestamp_date =
|
||||
enc_times.timestamp_date;
|
||||
}
|
||||
return;
|
||||
@ -1800,7 +1799,7 @@ static void datetime_to_text(const dsc* from, dsc* to, FPTR_ERROR err)
|
||||
* Convert a timestamp, date or time value to text.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = NULL;
|
||||
thread_db* tdbb = NULL;
|
||||
bool version4 = true;
|
||||
|
||||
fb_assert(DTYPE_IS_TEXT(to->dsc_dtype));
|
||||
|
@ -114,7 +114,7 @@ SSHORT CVT2_compare(const dsc* arg1, const dsc* arg2, FPTR_ERROR err)
|
||||
SSHORT fill;
|
||||
USHORT t1, t2;
|
||||
CHARSET_ID charset1, charset2;
|
||||
TDBB tdbb = NULL;
|
||||
thread_db* tdbb = NULL;
|
||||
|
||||
// AB: Maybe we need a other error-message, but at least throw
|
||||
// a message when 1 or both input paramters are empty.
|
||||
@ -517,7 +517,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_ERROR err)
|
||||
TextType obj1 = NULL, obj2 = NULL;
|
||||
DSC desc1, desc2;
|
||||
|
||||
TDBB tdbb = NULL;
|
||||
thread_db* tdbb = NULL;
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
/* DEV_BLKCHK (node, type_nod); */
|
||||
@ -862,7 +862,7 @@ USHORT CVT2_make_string2(const dsc* desc,
|
||||
return from_len;
|
||||
}
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
const USHORT cs1 = INTL_charset(tdbb, to_interp, err);
|
||||
const USHORT cs2 = INTL_charset(tdbb, from_interp, err);
|
||||
if (cs1 == cs2) {
|
||||
|
@ -108,7 +108,8 @@ static TEXT *node_names[] = {
|
||||
|
||||
/* rsb types */
|
||||
|
||||
static TEXT *rsb_names[] = {
|
||||
static const TEXT* rsb_names[] =
|
||||
{
|
||||
"boolean",
|
||||
"cross",
|
||||
"dbkey",
|
||||
@ -143,7 +144,6 @@ int DBG_all(void)
|
||||
* Print all known blocks.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
Database* dbb = GET_DBB;
|
||||
|
||||
if (!dbg_file) {
|
||||
@ -329,19 +329,18 @@ int DBG_precedence(void)
|
||||
* Functional description
|
||||
*
|
||||
**************************************/
|
||||
BDB bdb;
|
||||
QUE que;
|
||||
Precedence* precedence;
|
||||
BDB hi_bdb;
|
||||
BDB lo_bdb;
|
||||
Buffer_desc* hi_bdb;
|
||||
Buffer_desc* lo_bdb;
|
||||
|
||||
Database* dbb = GET_DBB;
|
||||
|
||||
BCB bcb = dbb->dbb_bcb;
|
||||
for (unsigned int i = 0; i < bcb->bcb_count; i++) {
|
||||
bdb = bcb->bcb_rpt[i].bcb_bdb;
|
||||
const Buffer_desc* bdb = bcb->bcb_rpt[i].bcb_bdb;
|
||||
if (bdb->bdb_flags || bdb->bdb_ast_flags) {
|
||||
ib_fprintf(dbg_file, "BDB %d:\tpage %"SLONGFORMAT"", i, bdb->bdb_page);
|
||||
ib_fprintf(dbg_file, "Buffer_desc %d:\tpage %"SLONGFORMAT"", i, bdb->bdb_page);
|
||||
if (bdb->bdb_flags & BDB_dirty)
|
||||
ib_fprintf(dbg_file, ", dirty");
|
||||
if (bdb->bdb_ast_flags & BDB_blocking)
|
||||
@ -372,7 +371,8 @@ int DBG_precedence(void)
|
||||
if (QUE_NOT_EMPTY(bdb->bdb_higher)) {
|
||||
ib_fprintf(dbg_file, "\tdirect higher precedence pages:");
|
||||
for (que = bdb->bdb_higher.que_forward;
|
||||
que != &bdb->bdb_higher; que = que->que_forward) {
|
||||
que != &bdb->bdb_higher; que = que->que_forward)
|
||||
{
|
||||
precedence = BLOCK(que, Precedence*, pre_higher);
|
||||
hi_bdb = precedence->pre_hi;
|
||||
ib_fprintf(dbg_file, " %"SLONGFORMAT"", hi_bdb->bdb_page);
|
||||
@ -384,7 +384,8 @@ int DBG_precedence(void)
|
||||
if (QUE_NOT_EMPTY(bdb->bdb_lower)) {
|
||||
ib_fprintf(dbg_file, "\tdirect lower precedence pages:");
|
||||
for (que = bdb->bdb_lower.que_forward; que != &bdb->bdb_lower;
|
||||
que = que->que_forward) {
|
||||
que = que->que_forward)
|
||||
{
|
||||
precedence = BLOCK(que, Precedence*, pre_lower);
|
||||
lo_bdb = precedence->pre_low;
|
||||
ib_fprintf(dbg_file, " %"SLONGFORMAT"", lo_bdb->bdb_page);
|
||||
@ -489,15 +490,15 @@ int DBG_block(BLK block)
|
||||
case type_bdb:
|
||||
ib_fprintf(dbg_file,
|
||||
"\tUse count: %d, page: %d, flags: %x, ast flags: %x\n",
|
||||
((BDB) block)->bdb_use_count, ((BDB) block)->bdb_page,
|
||||
((BDB) block)->bdb_flags, ((BDB) block)->bdb_ast_flags);
|
||||
((Buffer_desc*) block)->bdb_use_count, ((Buffer_desc*) block)->bdb_page,
|
||||
((Buffer_desc*) block)->bdb_flags, ((Buffer_desc*) block)->bdb_ast_flags);
|
||||
ib_fprintf(dbg_file,
|
||||
"\tParent: %X, left: %X, right: %X, dirty mask: %X\n",
|
||||
((BDB) block)->bdb_parent, ((BDB) block)->bdb_left,
|
||||
((BDB) block)->bdb_right, ((BDB) block)->bdb_transactions);
|
||||
prt_que("Que", &BLOCK(BDB)->bdb_que);
|
||||
prt_que("Higher", &BLOCK(BDB)->bdb_higher);
|
||||
prt_que("Lower", &BLOCK(BDB)->bdb_lower);
|
||||
((Buffer_desc*) block)->bdb_parent, ((Buffer_desc*) block)->bdb_left,
|
||||
((Buffer_desc*) block)->bdb_right, ((Buffer_desc*) block)->bdb_transactions);
|
||||
prt_que("Que", &BLOCK(Buffer_desc*)->bdb_que);
|
||||
prt_que("Higher", &BLOCK(Buffer_desc*)->bdb_higher);
|
||||
prt_que("Lower", &BLOCK(Buffer_desc*)->bdb_lower);
|
||||
break;
|
||||
|
||||
case type_pre:
|
||||
@ -508,7 +509,8 @@ int DBG_block(BLK block)
|
||||
case type_fmt:
|
||||
ib_fprintf(dbg_file, "\t");
|
||||
for (i = 0, desc = BLOCK(fmt*)->fmt_desc;
|
||||
i < BLOCK(fmt*)->fmt_count; desc++, i++) {
|
||||
i < BLOCK(fmt*)->fmt_count; desc++, i++)
|
||||
{
|
||||
prt_dsc(desc, (i % 4) * 20);
|
||||
if (i % 4 == 3)
|
||||
ib_fprintf(dbg_file, "\n\t");
|
||||
@ -557,7 +559,8 @@ int DBG_check(int pool_id)
|
||||
break;
|
||||
}
|
||||
if (block->blk_type <= (SCHAR) type_MIN
|
||||
|| block->blk_type >= (SCHAR) type_MAX) {
|
||||
|| block->blk_type >= (SCHAR) type_MAX)
|
||||
{
|
||||
ib_fprintf(dbg_file, "%X\t*** BAD BLOCK (%d) ***\n",
|
||||
block, block->blk_type);
|
||||
++corrupt;
|
||||
@ -591,7 +594,6 @@ int DBG_close(void)
|
||||
* Close the debugging file.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
ib_fprintf(dbg_file, "\014\014");
|
||||
ib_fclose(dbg_file);
|
||||
dbg_file = ib_stdout;
|
||||
@ -611,7 +613,6 @@ int DBG_eval(int n)
|
||||
* Examine a value.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
ib_fprintf(dbg_file, "octal = %X, decimal = %d, hex = %x\n", n, n, n);
|
||||
return TRUE;
|
||||
}
|
||||
@ -629,7 +630,6 @@ int DBG_examine(int *n)
|
||||
* Examine a value.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
ib_fprintf(dbg_file, "octal = %X, decimal = %d, hex = %x\n", *n, *n, *n);
|
||||
return TRUE;
|
||||
}
|
||||
@ -869,7 +869,6 @@ int DBG_supervisor(int arg)
|
||||
* Functional description
|
||||
*
|
||||
**************************************/
|
||||
|
||||
prior_frame = (int *) *(&arg - 2);
|
||||
|
||||
debug = 0;
|
||||
@ -898,7 +897,6 @@ int DBG_rpb(RPB * rpb)
|
||||
* Print a record paramter block
|
||||
*
|
||||
**************************************/
|
||||
|
||||
ib_fprintf(dbg_file, "\n%X\tRECORD PARAMETER BLOCK", rpb);
|
||||
prt_fields(reinterpret_cast<char*>(rpb), dbt_rpb);
|
||||
DBG_window(reinterpret_cast<int*>(&rpb->rpb_window));
|
||||
@ -1086,7 +1084,6 @@ static void go_column(int column)
|
||||
* Utility function to print a bunch of spaces.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
while (column-- > 0)
|
||||
ib_fprintf(dbg_file, " ");
|
||||
}
|
||||
@ -1172,7 +1169,6 @@ static int prt_que(SCHAR * string, QUE que)
|
||||
* Print a formatted que entry.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
ib_fprintf(dbg_file, "\t%X %s forward: %X, backward: %X\n",
|
||||
que, string, que->que_forward, que->que_backward);
|
||||
return TRUE;
|
||||
@ -1254,7 +1250,6 @@ void yyerror(const char* string)
|
||||
* YACC error function. Boring.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
ib_fprintf(dbg_file, "%s\n", string);
|
||||
}
|
||||
|
||||
@ -1271,7 +1266,6 @@ int yywrap(void)
|
||||
* Wrapup function for YACC.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
@ -65,15 +65,14 @@
|
||||
#define FLD(struct, string, field) string, (SCHAR*) OFFSET (struct, field), (SCHAR*) sizeof (((struct) NULL)->field)
|
||||
|
||||
|
||||
typedef SCHAR *TEXT_PTR;
|
||||
typedef SCHAR* TEXT_PTR;
|
||||
|
||||
int
|
||||
*ptr;
|
||||
int* ptr;
|
||||
|
||||
TEXT_PTR dbt_window[] = {
|
||||
FLD(WIN *, "Page: %ld", win_page),
|
||||
FLD(WIN *, "Buffer: %x", win_buffer),
|
||||
FLD(WIN *, "BDB: %x", win_bdb),
|
||||
FLD(WIN *, "Buffer_desc: %x", win_bdb),
|
||||
FLD(WIN *, "Scans: %d", win_scans),
|
||||
FLD(WIN *, "Flags: %x", win_flags),
|
||||
0
|
||||
@ -99,14 +98,14 @@ dbt_rpb[] = {
|
||||
|
||||
static TEXT_PTR dbb_stuff[] = {
|
||||
"DATABASE",
|
||||
FLD(DBB, "BCB: %x", dbb_bcb),
|
||||
FLD(DBB, "Relations: %x", dbb_relations),
|
||||
FLD(DBB, "Lock: %x", dbb_lock),
|
||||
FLD(DBB, "File: %x", dbb_file),
|
||||
FLD(DBB, "Permanent: %x", dbb_permanent),
|
||||
FLD(DBB, "Pools: %x", dbb_pools),
|
||||
FLD(DBB, "Page_size: %d", dbb_page_size),
|
||||
FLD(DBB, "dp_per_pp: %d", dbb_dp_per_pp),
|
||||
FLD(Database*, "BCB: %x", dbb_bcb),
|
||||
FLD(Database*, "Relations: %x", dbb_relations),
|
||||
FLD(Database*, "Lock: %x", dbb_lock),
|
||||
FLD(Database*, "File: %x", dbb_file),
|
||||
FLD(Database*, "Permanent: %x", dbb_permanent),
|
||||
FLD(Database*, "Pools: %x", dbb_pools),
|
||||
FLD(Database*, "Page_size: %d", dbb_page_size),
|
||||
FLD(Database*, "dp_per_pp: %d", dbb_dp_per_pp),
|
||||
0
|
||||
},
|
||||
vec[] = {
|
||||
@ -153,11 +152,11 @@ static TEXT_PTR bcb[] = {
|
||||
},
|
||||
bdb[] = {
|
||||
"BUFFER DESCRIPTOR",
|
||||
FLD(BDB, "Page: %ld", bdb_page),
|
||||
FLD(BDB, "Lock: %x", bdb_lock),
|
||||
FLD(BDB, "Buffer: %x", bdb_buffer),
|
||||
FLD(BDB, "Use count: %x", bdb_use_count),
|
||||
FLD(BDB, "Flags: %x", bdb_flags),
|
||||
FLD(Buffer_desc*, "Page: %ld", bdb_page),
|
||||
FLD(Buffer_desc*, "Lock: %x", bdb_lock),
|
||||
FLD(Buffer_desc*, "Buffer: %x", bdb_buffer),
|
||||
FLD(Buffer_desc*, "Use count: %x", bdb_use_count),
|
||||
FLD(Buffer_desc*, "Flags: %x", bdb_flags),
|
||||
0
|
||||
},
|
||||
pre[] = {
|
||||
@ -286,7 +285,7 @@ Deferred_work[] = {
|
||||
0
|
||||
},
|
||||
tfb[] = {
|
||||
"TEMPORY FIELD BLOCK",
|
||||
"TEMPORARY FIELD BLOCK",
|
||||
FLD(TFB, "id: %d", tfb_id),
|
||||
FLD(TFB, "dtype: %d", tfb_desc.dsc_dtype),
|
||||
FLD(TFB, "scale: %d", tfb_desc.dsc_scale),
|
||||
@ -368,10 +367,12 @@ static TEXT_PTR arr[] = { "ARRAY DESCRIPTION", 0};
|
||||
static TEXT_PTR blb_map[] = { "MAP BLOCK", 0};
|
||||
static TEXT_PTR log[] = { "LOG BLOCK", 0};
|
||||
static TEXT_PTR dls[] = { "DIR LIST BLOCK", 0};
|
||||
static TEXT_PTR jrd_prc[] = {
|
||||
static TEXT_PTR jrd_prc[] =
|
||||
{
|
||||
"PROCEDURE",
|
||||
FLD(jrd_prc*, "%s", prc_name),
|
||||
FLD(jrd_prc*, "Id: %d", prc_id), 0};
|
||||
FLD(jrd_prc*, "Id: %d", prc_id), 0
|
||||
};
|
||||
static TEXT_PTR prm[] = { "PARAMETER", FLD(PRM, "%s", prm_name), 0};
|
||||
static TEXT_PTR idb[] = { "INDEX BLOCK", 0};
|
||||
static TEXT_PTR bkm[] = { "BOOKMARK BLOCK", 0};
|
||||
@ -413,26 +414,26 @@ static TEXT_PTR texttype[] = {
|
||||
};
|
||||
static TEXT_PTR charset[] = {
|
||||
/* "INTL Character Set",
|
||||
FLD(CHARSET, "Name: %s", charset_name),
|
||||
FLD(CHARSET, "Vers: %d", charset_version),
|
||||
FLD(CHARSET, "ID: %d", charset_id),
|
||||
FLD(CHARSET, "B/Ch: %d", charset_max_bytes_per_char),
|
||||
FLD(CHARSET, "B/Ch: %d", charset_min_bytes_per_char),
|
||||
FLD(CHARSET, "Flags:%d", charset_flags), */
|
||||
FLD(charset*, "Name: %s", charset_name),
|
||||
FLD(charset*, "Vers: %d", charset_version),
|
||||
FLD(charset*, "ID: %d", charset_id),
|
||||
FLD(charset*, "B/Ch: %d", charset_max_bytes_per_char),
|
||||
FLD(charset*, "B/Ch: %d", charset_min_bytes_per_char),
|
||||
FLD(charset*, "Flags:%d", charset_flags), */
|
||||
0
|
||||
};
|
||||
static TEXT_PTR csconvert[] = {
|
||||
/* "INTL Character set converter",
|
||||
FLD(CSCONVERT, "Name: %s", csconvert_name),
|
||||
FLD(CSCONVERT, "from: %d", csconvert_from),
|
||||
FLD(CSCONVERT, "to: %d", csconvert_to), */
|
||||
FLD(csconvert*, "Name: %s", csconvert_name),
|
||||
FLD(csconvert*, "from: %d", csconvert_from),
|
||||
FLD(csconvert*, "to: %d", csconvert_to), */
|
||||
0
|
||||
};
|
||||
static TEXT_PTR tdbb[] = {
|
||||
static TEXT_PTR thread_db[] = {
|
||||
|
||||
"THREAD DATA BLOCK",
|
||||
FLD(TDBB, "Status vec: %x", tdbb_status_vector),
|
||||
FLD(TDBB, "Default: %x", tdbb_default),
|
||||
FLD(thread_db*, "Status vec: %x", tdbb_status_vector),
|
||||
FLD(thread_db*, "Default: %x", tdbb_default),
|
||||
0
|
||||
};
|
||||
static TEXT_PTR svc[] = { "SERVICE MANAGER BLOCK", 0};
|
||||
@ -469,11 +470,11 @@ struct symb dbt_symbols[] = {
|
||||
{"verify", &dbg_verify, symb_routine, 0},
|
||||
|
||||
/*
|
||||
"dbb", &dbb, symb_absolute, sizeof (dbb),
|
||||
SYM (DBB, dbb_bcb)
|
||||
SYM (DBB, dbb_relations)
|
||||
SYM (DBB, dbb_pools)
|
||||
SYM (DBB, dbb_requests)
|
||||
"Database", &Database, symb_absolute, sizeof(Database),
|
||||
SYM (Database*, dbb_bcb)
|
||||
SYM (Database*, dbb_relations)
|
||||
SYM (Database*, dbb_pools)
|
||||
SYM (Database*, dbb_requests)
|
||||
SYM (REL, rel_formats)
|
||||
SYM (REL, rel_pages)
|
||||
SYM (jrd_req*, req_top_node)
|
||||
@ -484,9 +485,11 @@ struct symb dbt_symbols[] = {
|
||||
|
||||
#define BLKDEF(type, name, tail) (TEXT*) name,
|
||||
|
||||
#define dbb dbb_stuff
|
||||
#define Database dbb_stuff
|
||||
|
||||
TEXT* dbt_blocks[] = { 0,
|
||||
TEXT* dbt_blocks[] =
|
||||
{
|
||||
0,
|
||||
#include "../jrd/blk.h"
|
||||
0
|
||||
};
|
||||
|
166
src/jrd/dfw.epp
166
src/jrd/dfw.epp
@ -149,57 +149,57 @@ DATABASE DB = FILENAME "ODS.RDB";
|
||||
**
|
||||
**==================================================================
|
||||
*/
|
||||
static bool add_file(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool add_shadow(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_shadow(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool compute_security(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool create_index(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_index(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool create_procedure(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_procedure(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool modify_procedure(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool create_relation(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_relation(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool scan_relation(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool create_trigger(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_trigger(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool modify_trigger(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_exception(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_generator(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_udf(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_field(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_global(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_parameter(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_rfr(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool make_version(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool add_difference(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_difference(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool begin_backup(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool end_backup(TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool add_file(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool add_shadow(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_shadow(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool compute_security(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool create_index(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_index(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool create_procedure(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_procedure(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool modify_procedure(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool create_relation(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_relation(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool scan_relation(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool create_trigger(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_trigger(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool modify_trigger(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_exception(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_generator(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_udf(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_field(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_global(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_parameter(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_rfr(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool make_version(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool add_difference(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool delete_difference(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool begin_backup(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
static bool end_backup(thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
static void check_dependencies(TDBB, const TEXT*, const TEXT*, USHORT, jrd_tra*);
|
||||
static void check_dependencies(thread_db*, const TEXT*, const TEXT*, USHORT, jrd_tra*);
|
||||
static void check_filename(const TEXT*, USHORT);
|
||||
static bool formatsAreEqual(const fmt*, const fmt*);
|
||||
static bool find_depend_in_dfw(TDBB, TEXT*, USHORT, USHORT, jrd_tra*);
|
||||
static void get_array_desc(TDBB, const TEXT*, ads*);
|
||||
static bool find_depend_in_dfw(thread_db*, TEXT*, USHORT, USHORT, jrd_tra*);
|
||||
static void get_array_desc(thread_db*, const TEXT*, ads*);
|
||||
static void get_procedure_dependencies(Deferred_work*);
|
||||
static void get_trigger_dependencies(Deferred_work*);
|
||||
static void load_trigs(TDBB, jrd_rel*, trig_vec**);
|
||||
static fmt* make_format(TDBB, jrd_rel*, USHORT *, TFB);
|
||||
static void load_trigs(thread_db*, jrd_rel*, trig_vec**);
|
||||
static fmt* make_format(thread_db*, jrd_rel*, USHORT *, TFB);
|
||||
static USHORT name_length(const TEXT*);
|
||||
static Deferred_work* post_work(jrd_tra*, SLONG, Deferred_work**, enum dfw_t,
|
||||
dsc*, USHORT);
|
||||
static void put_summary_blob(blb*, enum rsr_t, bid*);
|
||||
static void put_summary_record(blb*, enum rsr_t, const UCHAR*, USHORT);
|
||||
static void setup_array(TDBB, blb*, const TEXT*, USHORT, TFB);
|
||||
static blb* setup_triggers(TDBB, jrd_rel*, bool, trig_vec**, blb*);
|
||||
static void setup_trigger_details(TDBB, jrd_rel*, blb*, trig_vec**, const TEXT*,
|
||||
static void setup_array(thread_db*, blb*, const TEXT*, USHORT, TFB);
|
||||
static blb* setup_triggers(thread_db*, jrd_rel*, bool, trig_vec**, blb*);
|
||||
static void setup_trigger_details(thread_db*, jrd_rel*, blb*, trig_vec**, const TEXT*,
|
||||
const TEXT*, bool);
|
||||
//static void setup_trigger_details(TDBB, jrd_rel*, blb*, VEC *, UCHAR *, UCHAR *, BOOLEAN);
|
||||
static bool shadow_defined(TDBB);
|
||||
static bool validate_text_type (TDBB, ISC_STATUS *, TFB);
|
||||
//static void setup_trigger_details(thread_db*, jrd_rel*, blb*, VEC *, UCHAR *, UCHAR *, BOOLEAN);
|
||||
static bool shadow_defined(thread_db*);
|
||||
static bool validate_text_type (thread_db*, ISC_STATUS *, TFB);
|
||||
|
||||
static const UCHAR nonnull_validation_blr[] =
|
||||
{
|
||||
@ -213,7 +213,7 @@ static const UCHAR nonnull_validation_blr[] =
|
||||
typedef struct task
|
||||
{
|
||||
enum dfw_t task_type;
|
||||
bool (*task_routine) (TDBB, SSHORT, Deferred_work*, jrd_tra*);
|
||||
bool (*task_routine) (thread_db*, SSHORT, Deferred_work*, jrd_tra*);
|
||||
} TASK;
|
||||
|
||||
static const TASK task_table[] =
|
||||
@ -267,7 +267,7 @@ USHORT DFW_assign_index_type(Deferred_work* work, SSHORT field_type, SSHORT ttyp
|
||||
* on the field's type and subtype.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
if (field_type == dtype_varying || field_type == dtype_text)
|
||||
{
|
||||
@ -471,7 +471,7 @@ void DFW_perform_work(jrd_tra* transaction)
|
||||
* come.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
/* If no deferred work or it's all deferred event posting
|
||||
don't bother */
|
||||
@ -686,7 +686,7 @@ void DFW_update_index(const TEXT* name, USHORT id, const SelectivityList& select
|
||||
* of the index.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
if (dbb->dbb_ods_version >= ODS_VERSION11) {
|
||||
@ -724,7 +724,7 @@ void DFW_update_index(const TEXT* name, USHORT id, const SelectivityList& select
|
||||
}
|
||||
|
||||
|
||||
static bool add_file(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool add_file(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -857,7 +857,7 @@ static bool add_file(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
|
||||
|
||||
|
||||
static bool add_shadow( TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool add_shadow( thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -1035,7 +1035,7 @@ static bool add_shadow( TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool add_difference( TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool add_difference( thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -1084,7 +1084,7 @@ static bool add_difference( TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_difference( TDBB tdbb,
|
||||
static bool delete_difference( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -1130,7 +1130,7 @@ static bool delete_difference( TDBB tdbb,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool begin_backup( TDBB tdbb,
|
||||
static bool begin_backup( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -1163,7 +1163,7 @@ static bool begin_backup( TDBB tdbb,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool end_backup( TDBB tdbb,
|
||||
static bool end_backup( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -1197,7 +1197,7 @@ static bool end_backup( TDBB tdbb,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void check_dependencies(TDBB tdbb,
|
||||
static void check_dependencies(thread_db* tdbb,
|
||||
const TEXT* dpdo_name,
|
||||
const TEXT* field_name,
|
||||
USHORT dpdo_type,
|
||||
@ -1407,7 +1407,7 @@ static bool formatsAreEqual(const fmt* old_format, const fmt* new_format)
|
||||
}
|
||||
|
||||
|
||||
static bool compute_security( TDBB tdbb,
|
||||
static bool compute_security( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -1480,7 +1480,7 @@ CMP_release (tdbb, handle);
|
||||
}
|
||||
|
||||
|
||||
static bool create_index( TDBB tdbb,
|
||||
static bool create_index( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -1795,7 +1795,7 @@ static bool create_index( TDBB tdbb,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool create_procedure( TDBB tdbb,
|
||||
static bool create_procedure( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -1835,7 +1835,7 @@ static bool create_procedure( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool create_relation(TDBB tdbb,
|
||||
static bool create_relation(thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -2005,7 +2005,7 @@ static bool create_relation(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool create_trigger(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool create_trigger(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -2036,7 +2036,7 @@ static bool create_trigger(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_exception( TDBB tdbb,
|
||||
static bool delete_exception( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -2079,7 +2079,7 @@ static bool delete_exception( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_generator(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool delete_generator(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -2117,7 +2117,7 @@ static bool delete_generator(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_udf(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool delete_udf(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -2155,7 +2155,7 @@ static bool delete_udf(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_field( TDBB tdbb,
|
||||
static bool delete_field( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -2226,7 +2226,7 @@ static bool delete_field( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_global(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool delete_global(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -2273,7 +2273,7 @@ static bool delete_global(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_index(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool delete_index(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -2418,7 +2418,7 @@ static bool delete_index(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_parameter( TDBB tdbb,
|
||||
static bool delete_parameter( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -2458,7 +2458,7 @@ static bool delete_parameter( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_procedure( TDBB tdbb,
|
||||
static bool delete_procedure( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -2583,7 +2583,7 @@ static bool delete_procedure( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_relation(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool delete_relation(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -2796,7 +2796,7 @@ static bool delete_relation(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_rfr(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool delete_rfr(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -2937,7 +2937,7 @@ static bool delete_rfr(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_shadow( TDBB tdbb,
|
||||
static bool delete_shadow( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -2971,7 +2971,7 @@ static bool delete_shadow( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool delete_trigger( TDBB tdbb,
|
||||
static bool delete_trigger( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -3006,7 +3006,7 @@ static bool delete_trigger( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool find_depend_in_dfw( TDBB tdbb,
|
||||
static bool find_depend_in_dfw( thread_db* tdbb,
|
||||
TEXT* object_name,
|
||||
USHORT dep_type,
|
||||
USHORT rel_id,
|
||||
@ -3099,7 +3099,7 @@ static bool find_depend_in_dfw( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static void get_array_desc(TDBB tdbb, const TEXT* field_name, ads* desc)
|
||||
static void get_array_desc(thread_db* tdbb, const TEXT* field_name, ads* desc)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3167,7 +3167,7 @@ static void get_procedure_dependencies(Deferred_work* work)
|
||||
* created or when it's modified.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
jrd_prc* procedure = NULL;
|
||||
@ -3230,7 +3230,7 @@ static void get_trigger_dependencies( Deferred_work* work)
|
||||
* created or when it's modified.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
jrd_rel* relation = NULL;
|
||||
@ -3270,7 +3270,7 @@ static void get_trigger_dependencies( Deferred_work* work)
|
||||
}
|
||||
|
||||
|
||||
static void load_trigs(TDBB tdbb, jrd_rel* relation, trig_vec** triggers)
|
||||
static void load_trigs(thread_db* tdbb, jrd_rel* relation, trig_vec** triggers)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3312,7 +3312,7 @@ static void load_trigs(TDBB tdbb, jrd_rel* relation, trig_vec** triggers)
|
||||
}
|
||||
|
||||
|
||||
static fmt* make_format(TDBB tdbb, jrd_rel* relation, USHORT* version, TFB stack)
|
||||
static fmt* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version, TFB stack)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3454,7 +3454,7 @@ static fmt* make_format(TDBB tdbb, jrd_rel* relation, USHORT* version, TFB stack
|
||||
}
|
||||
|
||||
|
||||
static bool make_version(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool make_version(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -3754,7 +3754,7 @@ static bool make_version(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool modify_procedure( TDBB tdbb,
|
||||
static bool modify_procedure( thread_db* tdbb,
|
||||
SSHORT phase,
|
||||
Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
@ -3952,7 +3952,7 @@ static bool modify_procedure( TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool modify_trigger(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool modify_trigger(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -4118,7 +4118,7 @@ static void put_summary_blob(blb* blob, RSR_T type, bid* blob_id)
|
||||
|
||||
UCHAR temp[128];
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
/* If blob is null, don't bother */
|
||||
@ -4163,7 +4163,7 @@ static void put_summary_record(blb* blob,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
UCHAR temp[129];
|
||||
|
||||
UCHAR* buffer = ((size_t) (length + 1) > sizeof(temp)) ?
|
||||
@ -4193,7 +4193,7 @@ static void put_summary_record(blb* blob,
|
||||
}
|
||||
|
||||
|
||||
static bool scan_relation(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
static bool scan_relation(thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
@ -4225,7 +4225,7 @@ static bool scan_relation(TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
}
|
||||
|
||||
|
||||
static bool shadow_defined(TDBB tdbb)
|
||||
static bool shadow_defined(thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4256,7 +4256,7 @@ static bool shadow_defined(TDBB tdbb)
|
||||
}
|
||||
|
||||
|
||||
static void setup_array(TDBB tdbb, blb* blob, const TEXT* field_name, USHORT n,
|
||||
static void setup_array(thread_db* tdbb, blb* blob, const TEXT* field_name, USHORT n,
|
||||
TFB tfb)
|
||||
{
|
||||
/**************************************
|
||||
@ -4285,7 +4285,7 @@ static void setup_array(TDBB tdbb, blb* blob, const TEXT* field_name, USHORT n,
|
||||
}
|
||||
|
||||
|
||||
static blb* setup_triggers(TDBB tdbb, jrd_rel* relation, bool null_view,
|
||||
static blb* setup_triggers(thread_db* tdbb, jrd_rel* relation, bool null_view,
|
||||
trig_vec** triggers, blb* blob)
|
||||
{
|
||||
/**************************************
|
||||
@ -4394,7 +4394,7 @@ static blb* setup_triggers(TDBB tdbb, jrd_rel* relation, bool null_view,
|
||||
}
|
||||
|
||||
|
||||
static void setup_trigger_details(TDBB tdbb,
|
||||
static void setup_trigger_details(thread_db* tdbb,
|
||||
jrd_rel* relation,
|
||||
blb* blob,
|
||||
trig_vec** triggers,
|
||||
@ -4429,7 +4429,7 @@ static void setup_trigger_details(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static bool validate_text_type(TDBB tdbb, ISC_STATUS* status, TFB tfb)
|
||||
static bool validate_text_type(thread_db* tdbb, ISC_STATUS* status, TFB tfb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
108
src/jrd/dmp.cpp
108
src/jrd/dmp.cpp
@ -45,7 +45,7 @@
|
||||
|
||||
|
||||
|
||||
int (*dbg_block) ();
|
||||
void (*dbg_block) (const Buffer_desc*);
|
||||
|
||||
void (*dmp_active) (void) = DMP_active;
|
||||
void (*dmp_dirty) (void) = DMP_dirty;
|
||||
@ -53,18 +53,18 @@ void (*dmp_page) (SLONG, USHORT) = DMP_page;
|
||||
|
||||
extern IB_FILE* dbg_file;
|
||||
|
||||
static void btc_printer(SLONG, BDB, SCHAR *);
|
||||
static void btc_printer_errors(SLONG, BDB, SCHAR *);
|
||||
static void complement_key(UCHAR *, int);
|
||||
static double decompress(SCHAR *);
|
||||
static void dmp_blob(blob_page*);
|
||||
static void dmp_data(data_page*);
|
||||
static void dmp_header(header_page*);
|
||||
static void dmp_index(btree_page*, USHORT);
|
||||
static void dmp_pip(PIP, ULONG);
|
||||
static void dmp_pointer(pointer_page*);
|
||||
static void dmp_root(index_root_page*);
|
||||
static void dmp_transactions(tx_inv_page*, ULONG);
|
||||
static void btc_printer(SLONG, const Buffer_desc*, SCHAR *);
|
||||
static void btc_printer_errors(SLONG, const Buffer_desc*, SCHAR *);
|
||||
static void complement_key(UCHAR*, int);
|
||||
static double decompress(const SCHAR*);
|
||||
static void dmp_blob(const blob_page*);
|
||||
static void dmp_data(const data_page*);
|
||||
static void dmp_header(const header_page*);
|
||||
static void dmp_index(const btree_page*, USHORT);
|
||||
static void dmp_pip(const page_inv_page*, ULONG);
|
||||
static void dmp_pointer(const pointer_page*);
|
||||
static void dmp_root(const index_root_page*);
|
||||
static void dmp_transactions(const tx_inv_page*, ULONG);
|
||||
|
||||
static int dmp_descending = 0;
|
||||
|
||||
@ -84,17 +84,17 @@ void DMP_active(void)
|
||||
* Dump all buffers that are active.
|
||||
*
|
||||
**************************************/
|
||||
Database* dbb = GET_DBB;
|
||||
const Database* dbb = GET_DBB;
|
||||
|
||||
BCB bcb = dbb->dbb_bcb;
|
||||
const BCB bcb = dbb->dbb_bcb;
|
||||
for (USHORT i = 0; i < bcb->bcb_count; i++)
|
||||
{
|
||||
BDB bdb = bcb->bcb_rpt[i].bcb_bdb;
|
||||
const Buffer_desc* bdb = bcb->bcb_rpt[i].bcb_bdb;
|
||||
if (bdb->bdb_use_count)
|
||||
{
|
||||
if (*dbg_block != NULL)
|
||||
{
|
||||
reinterpret_cast<void (*)(BDB)>(*dbg_block)(bdb);
|
||||
(*dbg_block)(bdb);
|
||||
}
|
||||
DMP_page(bdb->bdb_page, 0);
|
||||
}
|
||||
@ -116,10 +116,10 @@ void DMP_btc(void)
|
||||
**************************************/
|
||||
SCHAR buffer[250];
|
||||
|
||||
Database* dbb = GET_DBB;
|
||||
const Database* dbb = GET_DBB;
|
||||
|
||||
SLONG level = 0;
|
||||
BDB bdb = dbb->dbb_bcb->bcb_btree;
|
||||
const Buffer_desc* bdb = dbb->dbb_bcb->bcb_btree;
|
||||
|
||||
memset(buffer, ' ', sizeof(buffer));
|
||||
buffer[249] = 0;
|
||||
@ -144,10 +144,10 @@ void DMP_btc_errors(void)
|
||||
**************************************/
|
||||
SCHAR buffer[250];
|
||||
|
||||
Database* dbb = GET_DBB;
|
||||
const Database* dbb = GET_DBB;
|
||||
|
||||
SLONG level = 0;
|
||||
BDB bdb = dbb->dbb_bcb->bcb_btree;
|
||||
const Buffer_desc* bdb = dbb->dbb_bcb->bcb_btree;
|
||||
if (bdb)
|
||||
btc_printer_errors(level, bdb, buffer);
|
||||
}
|
||||
@ -173,13 +173,13 @@ void DMP_btc_ordered(void)
|
||||
"\nDirty Page Binary Tree -- Page (Transaction) { Dirty | Clean }\n");
|
||||
|
||||
SLONG max_seen = -3;
|
||||
BDB next;
|
||||
const Buffer_desc* next;
|
||||
for (next = dbb->dbb_bcb->bcb_btree; next && next->bdb_left;
|
||||
next = next->bdb_left);
|
||||
|
||||
int i = 0;
|
||||
|
||||
BDB bdb;
|
||||
const Buffer_desc* bdb;
|
||||
while (bdb = next) {
|
||||
if (!bdb->bdb_parent && bdb != dbb->dbb_bcb->bcb_btree) {
|
||||
for (bdb = dbb->dbb_bcb->bcb_btree; bdb;)
|
||||
@ -231,15 +231,15 @@ void DMP_dirty(void)
|
||||
**************************************/
|
||||
Database* dbb = GET_DBB;
|
||||
|
||||
BCB bcb = dbb->dbb_bcb;
|
||||
const BCB bcb = dbb->dbb_bcb;
|
||||
for (USHORT i = 0; i < bcb->bcb_count; i++)
|
||||
{
|
||||
BDB bdb = bcb->bcb_rpt[i].bcb_bdb;
|
||||
const Buffer_desc* bdb = bcb->bcb_rpt[i].bcb_bdb;
|
||||
if (bdb->bdb_flags & BDB_dirty)
|
||||
{
|
||||
if (*dbg_block != NULL)
|
||||
{
|
||||
reinterpret_cast<void (*)(BDB)>(*dbg_block)(bdb);
|
||||
(*dbg_block)(bdb);
|
||||
}
|
||||
DMP_page(bdb->bdb_page, 0);
|
||||
}
|
||||
@ -247,7 +247,7 @@ void DMP_dirty(void)
|
||||
}
|
||||
|
||||
|
||||
void DMP_fetched_page(PAG page,
|
||||
void DMP_fetched_page(const pag* page,
|
||||
ULONG number,
|
||||
ULONG sequence,
|
||||
USHORT page_size)
|
||||
@ -271,35 +271,35 @@ void DMP_fetched_page(PAG page,
|
||||
switch (page->pag_type)
|
||||
{
|
||||
case pag_header:
|
||||
dmp_header((header_page*) page);
|
||||
dmp_header((const header_page*) page);
|
||||
break;
|
||||
|
||||
case pag_pages:
|
||||
dmp_pip((page_inv_page*) page, sequence);
|
||||
dmp_pip((const page_inv_page*) page, sequence);
|
||||
break;
|
||||
|
||||
case pag_transactions:
|
||||
dmp_transactions((tx_inv_page*) page, sequence);
|
||||
dmp_transactions((const tx_inv_page*) page, sequence);
|
||||
break;
|
||||
|
||||
case pag_pointer:
|
||||
dmp_pointer((pointer_page*) page);
|
||||
dmp_pointer((const pointer_page*) page);
|
||||
break;
|
||||
|
||||
case pag_data:
|
||||
dmp_data((data_page*) page);
|
||||
dmp_data((const data_page*) page);
|
||||
break;
|
||||
|
||||
case pag_root:
|
||||
dmp_root((index_root_page*) page);
|
||||
dmp_root((const index_root_page*) page);
|
||||
break;
|
||||
|
||||
case pag_index:
|
||||
dmp_index((btree_page*) page, page_size);
|
||||
dmp_index((const btree_page*) page, page_size);
|
||||
break;
|
||||
|
||||
case pag_blob:
|
||||
dmp_blob((blob_page*) page);
|
||||
dmp_blob((const blob_page*) page);
|
||||
break;
|
||||
|
||||
case pag_ids:
|
||||
@ -332,16 +332,14 @@ void DMP_page(SLONG number, USHORT page_size)
|
||||
* and disptach.
|
||||
*
|
||||
**************************************/
|
||||
WIN window;
|
||||
window.win_page = number;
|
||||
window.win_flags = 0;
|
||||
PAG page = CCH_FETCH(NULL, &window, LCK_read, 0);
|
||||
WIN window(number);
|
||||
const pag* page = CCH_FETCH(NULL, &window, LCK_read, 0);
|
||||
DMP_fetched_page(page, number, 0, page_size);
|
||||
CCH_RELEASE(NULL, &window);
|
||||
}
|
||||
|
||||
|
||||
static void btc_printer(SLONG level, BDB bdb, SCHAR * buffer)
|
||||
static void btc_printer(SLONG level, const Buffer_desc* bdb, SCHAR * buffer)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -378,7 +376,7 @@ static void btc_printer(SLONG level, BDB bdb, SCHAR * buffer)
|
||||
}
|
||||
|
||||
|
||||
static void btc_printer_errors(SLONG level, BDB bdb, SCHAR * buffer)
|
||||
static void btc_printer_errors(SLONG level, const Buffer_desc* bdb, SCHAR * buffer)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -425,7 +423,7 @@ static void complement_key(UCHAR* p, int length)
|
||||
}
|
||||
|
||||
|
||||
static double decompress(SCHAR * value)
|
||||
static double decompress(const SCHAR* value)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -461,7 +459,7 @@ static double decompress(SCHAR * value)
|
||||
}
|
||||
|
||||
|
||||
static void dmp_blob(blob_page* page)
|
||||
static void dmp_blob(const blob_page* page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -480,7 +478,7 @@ static void dmp_blob(blob_page* page)
|
||||
|
||||
if (((PAG) page)->pag_flags & blp_pointers) {
|
||||
const int n = page->blp_length >> SHIFTLONG;
|
||||
ULONG* ptr = (ULONG *) page->blp_page;
|
||||
const ULONG* ptr = (ULONG *) page->blp_page;
|
||||
for (int i = 0; i < n; i++, ptr++)
|
||||
ib_fprintf(dbg_file, "%d,", *ptr);
|
||||
}
|
||||
@ -489,7 +487,7 @@ static void dmp_blob(blob_page* page)
|
||||
}
|
||||
|
||||
|
||||
static void dmp_data(data_page* page)
|
||||
static void dmp_data(const data_page* page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -506,11 +504,9 @@ static void dmp_data(data_page* page)
|
||||
SCHAR* end;
|
||||
SSHORT length;
|
||||
SSHORT expanded_length;
|
||||
USHORT i;
|
||||
RHD header;
|
||||
RHDF fragment;
|
||||
BLH blob;
|
||||
data_page::dpg_repeat* index;
|
||||
SCHAR buffer[8096 + 1];
|
||||
|
||||
ib_fprintf(dbg_file,
|
||||
@ -522,7 +518,8 @@ static void dmp_data(data_page* page)
|
||||
page->dpg_count,
|
||||
((PAG) page)->pag_flags);
|
||||
|
||||
for (i = 0, index = page->dpg_rpt; i < page->dpg_count; i++, index++)
|
||||
int i = 0;
|
||||
for (data_page::dpg_repeat* index = page->dpg_rpt; i < page->dpg_count; i++, index++)
|
||||
{
|
||||
if (index->dpg_length == 0)
|
||||
{
|
||||
@ -651,7 +648,7 @@ static void dmp_data(data_page* page)
|
||||
}
|
||||
|
||||
|
||||
static void dmp_header(header_page* page)
|
||||
static void dmp_header(const header_page* page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -756,7 +753,7 @@ static void dmp_header(header_page* page)
|
||||
}
|
||||
|
||||
|
||||
static void dmp_index(btree_page* page, USHORT page_size)
|
||||
static void dmp_index(const btree_page* page, USHORT page_size)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -879,7 +876,7 @@ static void dmp_index(btree_page* page, USHORT page_size)
|
||||
}
|
||||
|
||||
|
||||
static void dmp_pip(PIP page, ULONG sequence)
|
||||
static void dmp_pip(const page_inv_page* page, ULONG sequence)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -920,7 +917,7 @@ static void dmp_pip(PIP page, ULONG sequence)
|
||||
}
|
||||
|
||||
|
||||
static void dmp_pointer(pointer_page* page)
|
||||
static void dmp_pointer(const pointer_page* page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -957,7 +954,7 @@ static void dmp_pointer(pointer_page* page)
|
||||
}
|
||||
|
||||
|
||||
static void dmp_root(index_root_page* page)
|
||||
static void dmp_root(const index_root_page* page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -996,7 +993,7 @@ static void dmp_root(index_root_page* page)
|
||||
}
|
||||
|
||||
|
||||
static void dmp_transactions(tx_inv_page* page, ULONG sequence)
|
||||
static void dmp_transactions(const tx_inv_page* page, ULONG sequence)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1007,12 +1004,11 @@ static void dmp_transactions(tx_inv_page* page, ULONG sequence)
|
||||
* Functional description
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb;
|
||||
UCHAR *byte, s[101], *p, *end;
|
||||
ULONG transactions_per_tip, number, trans_offset;
|
||||
USHORT shift, state, hundreds;
|
||||
|
||||
tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
transactions_per_tip = dbb->dbb_pcontrol->pgc_tpt;
|
||||
|
@ -30,7 +30,7 @@ void DMP_btc_errors(void);
|
||||
void DMP_btc_ordered(void);
|
||||
void DMP_dirty(void);
|
||||
void DMP_page(SLONG, USHORT);
|
||||
void DMP_fetched_page(struct pag *, ULONG, ULONG, USHORT);
|
||||
void DMP_fetched_page(const struct pag*, ULONG, ULONG, USHORT);
|
||||
|
||||
#endif // JRD_DMP_PROTO_H
|
||||
|
||||
|
@ -79,19 +79,19 @@ DATABASE DB = FILENAME "ODS.RDB";
|
||||
#define HIGH_WATER(x) ((SSHORT) sizeof (data_page) + (SSHORT) sizeof (data_page::dpg_repeat) * (x - 1))
|
||||
#define SPACE_FUDGE RHDF_SIZE
|
||||
|
||||
static void delete_tail(TDBB, RHDF, USHORT);
|
||||
static void fragment(TDBB, RPB *, SSHORT, Dcc*, SSHORT, jrd_tra*);
|
||||
static void extend_relation(TDBB, jrd_rel*, WIN *);
|
||||
static UCHAR* find_space(TDBB, RPB *, SSHORT, LLS *, REC, USHORT);
|
||||
static void delete_tail(thread_db*, RHDF, USHORT);
|
||||
static void fragment(thread_db*, RPB *, SSHORT, Dcc*, SSHORT, jrd_tra*);
|
||||
static void extend_relation(thread_db*, jrd_rel*, WIN *);
|
||||
static UCHAR* find_space(thread_db*, RPB *, SSHORT, LLS *, REC, USHORT);
|
||||
static bool get_header(WIN *, SSHORT, RPB *);
|
||||
static pointer_page* get_pointer_page(TDBB, jrd_rel*, WIN *, USHORT, USHORT);
|
||||
static RHD locate_space(TDBB, RPB *, SSHORT, LLS *, REC, USHORT);
|
||||
static void mark_full(TDBB, RPB *);
|
||||
static pointer_page* get_pointer_page(thread_db*, jrd_rel*, WIN *, USHORT, USHORT);
|
||||
static RHD locate_space(thread_db*, RPB *, SSHORT, LLS *, REC, USHORT);
|
||||
static void mark_full(thread_db*, RPB *);
|
||||
static void release_dcc(Dcc*);
|
||||
static void store_big_record(TDBB, RPB *, LLS *, Dcc*, USHORT);
|
||||
static void store_big_record(thread_db*, RPB *, LLS *, Dcc*, USHORT);
|
||||
|
||||
|
||||
PAG DPM_allocate(TDBB tdbb, WIN* window)
|
||||
PAG DPM_allocate(thread_db* tdbb, WIN* window)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -120,7 +120,7 @@ PAG DPM_allocate(TDBB tdbb, WIN* window)
|
||||
}
|
||||
|
||||
|
||||
void DPM_backout( TDBB tdbb, RPB * rpb)
|
||||
void DPM_backout( thread_db* tdbb, RPB * rpb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -188,7 +188,7 @@ void DPM_backout( TDBB tdbb, RPB * rpb)
|
||||
}
|
||||
|
||||
|
||||
int DPM_chain( TDBB tdbb, RPB * org_rpb, RPB * new_rpb)
|
||||
int DPM_chain( thread_db* tdbb, RPB * org_rpb, RPB * new_rpb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -397,7 +397,7 @@ int DPM_chain( TDBB tdbb, RPB * org_rpb, RPB * new_rpb)
|
||||
}
|
||||
|
||||
|
||||
int DPM_compress( TDBB tdbb, data_page* page)
|
||||
int DPM_compress( thread_db* tdbb, data_page* page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -449,7 +449,7 @@ int DPM_compress( TDBB tdbb, data_page* page)
|
||||
}
|
||||
|
||||
|
||||
void DPM_create_relation( TDBB tdbb, jrd_rel* relation)
|
||||
void DPM_create_relation( thread_db* tdbb, jrd_rel* relation)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -516,7 +516,7 @@ void DPM_create_relation( TDBB tdbb, jrd_rel* relation)
|
||||
}
|
||||
|
||||
|
||||
SLONG DPM_data_pages(TDBB tdbb, jrd_rel* relation)
|
||||
SLONG DPM_data_pages(thread_db* tdbb, jrd_rel* relation)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -575,7 +575,7 @@ SLONG DPM_data_pages(TDBB tdbb, jrd_rel* relation)
|
||||
}
|
||||
|
||||
|
||||
void DPM_delete( TDBB tdbb, RPB * rpb, SLONG prior_page)
|
||||
void DPM_delete( thread_db* tdbb, RPB * rpb, SLONG prior_page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -767,7 +767,7 @@ retry_after_latch_timeout:
|
||||
}
|
||||
|
||||
|
||||
void DPM_delete_relation( TDBB tdbb, jrd_rel* relation)
|
||||
void DPM_delete_relation( thread_db* tdbb, jrd_rel* relation)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -860,7 +860,7 @@ void DPM_delete_relation( TDBB tdbb, jrd_rel* relation)
|
||||
}
|
||||
|
||||
|
||||
bool DPM_fetch(TDBB tdbb, RPB * rpb, USHORT lock)
|
||||
bool DPM_fetch(thread_db* tdbb, RPB * rpb, USHORT lock)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -910,7 +910,7 @@ bool DPM_fetch(TDBB tdbb, RPB * rpb, USHORT lock)
|
||||
}
|
||||
|
||||
|
||||
SSHORT DPM_fetch_back(TDBB tdbb,
|
||||
SSHORT DPM_fetch_back(thread_db* tdbb,
|
||||
RPB * rpb, USHORT lock, SSHORT latch_wait)
|
||||
{
|
||||
/**************************************
|
||||
@ -994,7 +994,7 @@ SSHORT DPM_fetch_back(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void DPM_fetch_fragment( TDBB tdbb, RPB * rpb, USHORT lock)
|
||||
void DPM_fetch_fragment( thread_db* tdbb, RPB * rpb, USHORT lock)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1044,7 +1044,7 @@ void DPM_fetch_fragment( TDBB tdbb, RPB * rpb, USHORT lock)
|
||||
}
|
||||
|
||||
|
||||
SINT64 DPM_gen_id(TDBB tdbb, SLONG generator, USHORT initialize, SINT64 val)
|
||||
SINT64 DPM_gen_id(thread_db* tdbb, SLONG generator, USHORT initialize, SINT64 val)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1178,7 +1178,7 @@ SINT64 DPM_gen_id(TDBB tdbb, SLONG generator, USHORT initialize, SINT64 val)
|
||||
}
|
||||
|
||||
|
||||
int DPM_get( TDBB tdbb, RPB * rpb, SSHORT lock_type)
|
||||
int DPM_get( thread_db* tdbb, RPB * rpb, SSHORT lock_type)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1246,7 +1246,7 @@ int DPM_get( TDBB tdbb, RPB * rpb, SSHORT lock_type)
|
||||
}
|
||||
|
||||
|
||||
ULONG DPM_get_blob(TDBB tdbb,
|
||||
ULONG DPM_get_blob(thread_db* tdbb,
|
||||
blb* blob,
|
||||
ULONG record_number, USHORT delete_flag, SLONG prior_page)
|
||||
{
|
||||
@ -1409,7 +1409,7 @@ punt:
|
||||
}
|
||||
|
||||
|
||||
bool DPM_next(TDBB tdbb,
|
||||
bool DPM_next(thread_db* tdbb,
|
||||
RPB * rpb,
|
||||
USHORT lock_type, bool backwards, bool onepage)
|
||||
{
|
||||
@ -1626,7 +1626,7 @@ bool DPM_next(TDBB tdbb,
|
||||
|
||||
|
||||
void DPM_pages(
|
||||
TDBB tdbb, SSHORT rel_id, int type, ULONG sequence, SLONG page)
|
||||
thread_db* tdbb, SSHORT rel_id, int type, ULONG sequence, SLONG page)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1664,7 +1664,7 @@ void DPM_pages(
|
||||
|
||||
|
||||
#ifdef SUPERSERVER_V2
|
||||
SLONG DPM_prefetch_bitmap(TDBB tdbb, jrd_rel* relation, SBM bitmap, SLONG number)
|
||||
SLONG DPM_prefetch_bitmap(thread_db* tdbb, jrd_rel* relation, SBM bitmap, SLONG number)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1728,7 +1728,7 @@ SLONG DPM_prefetch_bitmap(TDBB tdbb, jrd_rel* relation, SBM bitmap, SLONG number
|
||||
#endif
|
||||
|
||||
|
||||
void DPM_scan_pages( TDBB tdbb)
|
||||
void DPM_scan_pages( thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1808,7 +1808,7 @@ void DPM_scan_pages( TDBB tdbb)
|
||||
}
|
||||
|
||||
|
||||
void DPM_store( TDBB tdbb, RPB * rpb, LLS * stack, USHORT type)
|
||||
void DPM_store( thread_db* tdbb, RPB * rpb, LLS * stack, USHORT type)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1893,7 +1893,7 @@ void DPM_store( TDBB tdbb, RPB * rpb, LLS * stack, USHORT type)
|
||||
}
|
||||
|
||||
|
||||
SLONG DPM_store_blob(TDBB tdbb, blb* blob, REC record)
|
||||
SLONG DPM_store_blob(thread_db* tdbb, blb* blob, REC record)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1910,7 +1910,7 @@ SLONG DPM_store_blob(TDBB tdbb, blb* blob, REC record)
|
||||
CHECK_DBB(dbb);
|
||||
|
||||
RPB rpb;
|
||||
rpb.rpb_window.win_flags = 0;
|
||||
//rpb.rpb_window.win_flags = 0; redundant.
|
||||
|
||||
#ifdef VIO_DEBUG
|
||||
if (debug_flag > DEBUG_WRITES)
|
||||
@ -1990,7 +1990,7 @@ SLONG DPM_store_blob(TDBB tdbb, blb* blob, REC record)
|
||||
}
|
||||
|
||||
|
||||
void DPM_rewrite_header( TDBB tdbb, RPB * rpb)
|
||||
void DPM_rewrite_header( thread_db* tdbb, RPB * rpb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2041,7 +2041,7 @@ void DPM_rewrite_header( TDBB tdbb, RPB * rpb)
|
||||
}
|
||||
|
||||
|
||||
void DPM_update( TDBB tdbb, RPB * rpb, LLS * stack, jrd_tra* transaction)
|
||||
void DPM_update( thread_db* tdbb, RPB * rpb, LLS * stack, jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2164,7 +2164,7 @@ void DPM_update( TDBB tdbb, RPB * rpb, LLS * stack, jrd_tra* transaction)
|
||||
}
|
||||
|
||||
|
||||
static void delete_tail( TDBB tdbb, RHDF header, USHORT length)
|
||||
static void delete_tail( thread_db* tdbb, RHDF header, USHORT length)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2238,7 +2238,7 @@ static void delete_tail( TDBB tdbb, RHDF header, USHORT length)
|
||||
|
||||
|
||||
static void fragment(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
RPB * rpb,
|
||||
SSHORT available_space,
|
||||
Dcc* dcc, SSHORT length, jrd_tra* transaction)
|
||||
@ -2449,7 +2449,7 @@ static void fragment(
|
||||
}
|
||||
|
||||
|
||||
static void extend_relation( TDBB tdbb, jrd_rel* relation, WIN * window)
|
||||
static void extend_relation( thread_db* tdbb, jrd_rel* relation, WIN * window)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2604,7 +2604,7 @@ static void extend_relation( TDBB tdbb, jrd_rel* relation, WIN * window)
|
||||
}
|
||||
|
||||
|
||||
static UCHAR* find_space(TDBB tdbb,
|
||||
static UCHAR* find_space(thread_db* tdbb,
|
||||
RPB* rpb,
|
||||
SSHORT size,
|
||||
LLS* stack,
|
||||
@ -2764,7 +2764,7 @@ static bool get_header( WIN * window, SSHORT line, RPB * rpb)
|
||||
|
||||
|
||||
static pointer_page* get_pointer_page(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
jrd_rel* relation,
|
||||
WIN * window, USHORT sequence, USHORT lock)
|
||||
{
|
||||
@ -2819,7 +2819,7 @@ static pointer_page* get_pointer_page(
|
||||
|
||||
|
||||
static RHD locate_space(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
RPB * rpb,
|
||||
SSHORT size, LLS * stack, REC record, USHORT type)
|
||||
{
|
||||
@ -2932,7 +2932,7 @@ static RHD locate_space(
|
||||
}
|
||||
|
||||
|
||||
static void mark_full( TDBB tdbb, RPB * rpb)
|
||||
static void mark_full( thread_db* tdbb, RPB * rpb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3057,7 +3057,7 @@ static void release_dcc( Dcc* dcc)
|
||||
|
||||
|
||||
static void store_big_record(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
RPB * rpb,
|
||||
LLS * stack, Dcc* head_dcc, USHORT size)
|
||||
{
|
||||
|
@ -27,30 +27,33 @@
|
||||
// fwd. decl.
|
||||
class blb;
|
||||
class lls;
|
||||
class jrd_rel;
|
||||
struct rpb;
|
||||
|
||||
struct pag* DPM_allocate(TDBB, struct win*);
|
||||
void DPM_backout(TDBB, struct rpb *);
|
||||
int DPM_chain(TDBB, struct rpb *, struct rpb *);
|
||||
int DPM_compress(TDBB, struct data_page*);
|
||||
void DPM_create_relation(TDBB, struct jrd_rel *);
|
||||
SLONG DPM_data_pages(TDBB, struct jrd_rel *);
|
||||
void DPM_delete(TDBB, struct rpb *, SLONG);
|
||||
void DPM_delete_relation(TDBB, struct jrd_rel *);
|
||||
bool DPM_fetch(TDBB, struct rpb *, USHORT);
|
||||
SSHORT DPM_fetch_back(TDBB, struct rpb *, USHORT, SSHORT);
|
||||
void DPM_fetch_fragment(TDBB, struct rpb *, USHORT);
|
||||
SINT64 DPM_gen_id(TDBB, SLONG, USHORT, SINT64);
|
||||
int DPM_get(TDBB, struct rpb *, SSHORT);
|
||||
ULONG DPM_get_blob(TDBB, blb*, ULONG, USHORT, SLONG);
|
||||
bool DPM_next(TDBB, struct rpb*, USHORT, bool, bool);
|
||||
void DPM_pages(TDBB, SSHORT, int, ULONG, SLONG);
|
||||
SLONG DPM_prefetch_bitmap(struct tdbb *, struct jrd_rel *, struct sbm *,
|
||||
struct pag* DPM_allocate(thread_db*, struct win*);
|
||||
void DPM_backout(thread_db*, rpb*);
|
||||
int DPM_chain(thread_db*, rpb*, rpb*);
|
||||
int DPM_compress(thread_db*, struct data_page*);
|
||||
void DPM_create_relation(thread_db*, jrd_rel*);
|
||||
SLONG DPM_data_pages(thread_db*, jrd_rel*);
|
||||
void DPM_delete(thread_db*, rpb*, SLONG);
|
||||
void DPM_delete_relation(thread_db*, jrd_rel*);
|
||||
bool DPM_fetch(thread_db*, rpb*, USHORT);
|
||||
SSHORT DPM_fetch_back(thread_db*, rpb*, USHORT, SSHORT);
|
||||
void DPM_fetch_fragment(thread_db*, rpb*, USHORT);
|
||||
SINT64 DPM_gen_id(thread_db*, SLONG, USHORT, SINT64);
|
||||
int DPM_get(thread_db*, rpb*, SSHORT);
|
||||
ULONG DPM_get_blob(thread_db*, blb*, ULONG, USHORT, SLONG);
|
||||
bool DPM_next(thread_db*, rpb*, USHORT, bool, bool);
|
||||
void DPM_pages(thread_db*, SSHORT, int, ULONG, SLONG);
|
||||
SLONG DPM_prefetch_bitmap(struct thread_db*, jrd_rel*, struct sbm *,
|
||||
SLONG);
|
||||
void DPM_scan_pages(TDBB);
|
||||
void DPM_store(TDBB, struct rpb *, lls**, USHORT);
|
||||
SLONG DPM_store_blob(TDBB, blb*, struct rec *);
|
||||
void DPM_rewrite_header(TDBB, struct rpb *);
|
||||
void DPM_update(TDBB, struct rpb *, lls**,
|
||||
void DPM_scan_pages(thread_db*);
|
||||
void DPM_store(thread_db*, rpb*, lls**, USHORT);
|
||||
SLONG DPM_store_blob(thread_db*, blb*, class rec*);
|
||||
void DPM_rewrite_header(thread_db*, rpb*);
|
||||
void DPM_update(thread_db*, rpb*, lls**,
|
||||
class jrd_tra *);
|
||||
|
||||
#endif // JRD_DPM_PROTO_H
|
||||
|
||||
|
@ -83,7 +83,7 @@ DATABASE DB = STATIC "ODS.RDB";
|
||||
|
||||
|
||||
static void grant(GBL, const UCHAR**);
|
||||
static bool grantor_can_grant_role(TDBB, GBL, const TEXT*, const TEXT*);
|
||||
static bool grantor_can_grant_role(thread_db*, GBL, const TEXT*, const TEXT*);
|
||||
static bool grantor_can_grant(GBL, const TEXT*, const TEXT*, const TEXT*,
|
||||
const TEXT*, bool);
|
||||
static void revoke_permission(GBL, const UCHAR**);
|
||||
@ -106,7 +106,7 @@ void DYN_ddl(att* attachment, jrd_tra* transaction, USHORT length,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
#if defined(V4_THREADING) || (defined(SUPERSERVER) && defined(WIN_NT))
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
@ -213,7 +213,7 @@ void DYN_error(bool status_flag,
|
||||
* DDL failed.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
if (tdbb->tdbb_status_vector[1] == isc_no_meta_update)
|
||||
return;
|
||||
@ -287,7 +287,7 @@ void DYN_error_punt(bool status_flag,
|
||||
bool DYN_is_it_sql_role(GBL gbl,
|
||||
const TEXT* input_name,
|
||||
TEXT* output_name,
|
||||
TDBB tdbb)
|
||||
thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -678,7 +678,7 @@ USHORT DYN_put_blr_blob(GBL gbl, const UCHAR** ptr, bid* blob_id)
|
||||
* Write out a blr blob.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
const UCHAR *p = *ptr;
|
||||
USHORT length = *p++;
|
||||
@ -717,7 +717,7 @@ USHORT DYN_put_text_blob(GBL gbl, const UCHAR** ptr, bid* blob_id)
|
||||
* Write out a text blob.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
const UCHAR* p = *ptr;
|
||||
USHORT length = *p++;
|
||||
@ -766,7 +766,7 @@ void DYN_rundown_request(BLK handle, SSHORT id)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
#pragma FB_COMPILER_MESSAGE("TMN: FIXME! We do not have a jmp_buf anymore!")
|
||||
@ -828,7 +828,7 @@ static void grant( GBL gbl, const UCHAR** ptr)
|
||||
TEXT* ptr1;
|
||||
TEXT* ptr2;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
const USHORT major_version = dbb->dbb_ods_version;
|
||||
@ -1161,7 +1161,7 @@ static bool grantor_can_grant( GBL gbl,
|
||||
**************************************/
|
||||
USHORT err_num;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
/* Verify that the input relation exists. */
|
||||
@ -1424,7 +1424,7 @@ static bool grantor_can_grant( GBL gbl,
|
||||
}
|
||||
|
||||
|
||||
static bool grantor_can_grant_role( TDBB tdbb,
|
||||
static bool grantor_can_grant_role( thread_db* tdbb,
|
||||
GBL gbl,
|
||||
const TEXT* grantor,
|
||||
const TEXT* role_name)
|
||||
@ -1547,7 +1547,7 @@ static void revoke_permission(GBL gbl, const UCHAR** ptr)
|
||||
SqlIdentifier revoking_user_name, dummy_name;
|
||||
TEXT* ptr1;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
const USHORT major_version = dbb->dbb_ods_version;
|
||||
@ -1803,7 +1803,7 @@ static void set_field_class_name(GBL gbl, const TEXT* relation, const TEXT* fiel
|
||||
* field has a unique class name.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_s_f_class, DYN_REQUESTS);
|
||||
@ -1867,7 +1867,7 @@ static void store_privilege(GBL gbl,
|
||||
* routine should not.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_s_grant, DYN_REQUESTS);
|
||||
|
@ -75,7 +75,7 @@ USHORT DYN_get_string(const TEXT**, TEXT*, USHORT, bool);
|
||||
// void DYN_get_string2(TEXT**, TEXT*, USHORT);
|
||||
|
||||
// This function doesn't need to be exported currently.
|
||||
bool DYN_is_it_sql_role(GBL, const TEXT*, TEXT*, TDBB);
|
||||
bool DYN_is_it_sql_role(GBL, const TEXT*, TEXT*, thread_db*);
|
||||
USHORT DYN_put_blr_blob(GBL, const UCHAR**, struct bid*);
|
||||
|
||||
// This function is not defined anywhere.
|
||||
|
@ -117,10 +117,10 @@ static const UCHAR who_blr[] =
|
||||
};
|
||||
|
||||
|
||||
static void check_unique_name(TDBB, GBL, const TEXT*, bool);
|
||||
static bool find_field_source(TDBB, GBL, const TEXT*, USHORT, const TEXT*, TEXT*);
|
||||
static bool get_who(TDBB, GBL, SCHAR*);
|
||||
static bool is_it_user_name(GBL, const TEXT*, TDBB);
|
||||
static void check_unique_name(thread_db*, GBL, const TEXT*, bool);
|
||||
static bool find_field_source(thread_db*, GBL, const TEXT*, USHORT, const TEXT*, TEXT*);
|
||||
static bool get_who(thread_db*, GBL, SCHAR*);
|
||||
static bool is_it_user_name(GBL, const TEXT*, thread_db*);
|
||||
static USHORT skip_blr_blob(const UCHAR** ptr);
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ void DYN_define_cache( GBL gbl, const UCHAR** ptr)
|
||||
BLK request;
|
||||
SSHORT id = -1;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
request = NULL;
|
||||
|
||||
@ -247,7 +247,7 @@ void DYN_define_constraint(GBL gbl,
|
||||
USHORT primary_flag = FALSE, foreign_flag = FALSE, not_null;
|
||||
UCHAR ri_action = 0;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
constraint_name[0] = 0;
|
||||
@ -637,7 +637,7 @@ void DYN_define_dimension(GBL gbl,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
UCHAR verb;
|
||||
@ -721,7 +721,7 @@ void DYN_define_exception( GBL gbl, const UCHAR** ptr)
|
||||
UCHAR verb;
|
||||
SqlIdentifier exception_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
exception_name[0] = 0;
|
||||
@ -800,7 +800,7 @@ void DYN_define_file(GBL gbl,
|
||||
TEXT temp_f1[MAXPATHLEN], temp_f[MAXPATHLEN];
|
||||
SSHORT id;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
request = NULL;
|
||||
@ -905,7 +905,7 @@ void DYN_define_difference(GBL gbl,
|
||||
BLK request;
|
||||
SSHORT id = -1;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
request = NULL;
|
||||
|
||||
@ -988,7 +988,7 @@ void DYN_define_filter( GBL gbl, const UCHAR** ptr)
|
||||
SqlIdentifier filter_name;
|
||||
BLK request;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
filter_name[0] = 0;
|
||||
@ -1083,7 +1083,7 @@ void DYN_define_function( GBL gbl, const UCHAR** ptr)
|
||||
SqlIdentifier function_name;
|
||||
BLK request;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
function_name[0] = 0;
|
||||
@ -1182,7 +1182,7 @@ void DYN_define_function_arg(GBL gbl, const UCHAR** ptr, TEXT* function_name)
|
||||
UCHAR verb;
|
||||
BLK request = NULL;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
const USHORT major_version = dbb->dbb_ods_version;
|
||||
@ -1307,7 +1307,7 @@ void DYN_define_generator( GBL gbl, const UCHAR** ptr)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request;
|
||||
@ -1374,7 +1374,7 @@ void DYN_define_global_field(GBL gbl,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
UCHAR verb;
|
||||
@ -1646,7 +1646,7 @@ void DYN_define_index(GBL gbl,
|
||||
(*ri_actionP) = 0;
|
||||
}
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
index_name[0] = 0;
|
||||
@ -2204,7 +2204,7 @@ void DYN_define_local_field(GBL gbl,
|
||||
USHORT charset_id_flag;
|
||||
SLONG fld_pos;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
local_field_name[0] = 0;
|
||||
@ -2517,7 +2517,7 @@ void DYN_define_log_file(
|
||||
SSHORT id;
|
||||
STR db_filename;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
request = NULL;
|
||||
@ -2655,7 +2655,7 @@ void DYN_define_parameter( GBL gbl, const UCHAR** ptr, TEXT* procedure_name)
|
||||
const UCHAR* default_value_ptr = NULL;
|
||||
const UCHAR* default_source_ptr = NULL;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
parameter_name[0] = 0;
|
||||
@ -2900,7 +2900,7 @@ void DYN_define_procedure( GBL gbl, const UCHAR** ptr)
|
||||
SqlIdentifier procedure_name;
|
||||
SqlIdentifier owner_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
procedure_name[0] = 0;
|
||||
@ -3058,7 +3058,7 @@ void DYN_define_relation( GBL gbl, const UCHAR** ptr)
|
||||
ISC_STATUS *s;
|
||||
SqlIdentifier relation_name, owner_name, field_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
sql_prot = is_a_view = FALSE;
|
||||
@ -3281,7 +3281,7 @@ void DYN_define_role( GBL gbl, const UCHAR** ptr)
|
||||
BLK request = NULL;
|
||||
SqlIdentifier dummy_name, owner_name, role_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
const USHORT major_version = dbb->dbb_ods_version;
|
||||
@ -3397,7 +3397,7 @@ void DYN_define_security_class( GBL gbl, const UCHAR** ptr)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request;
|
||||
@ -3476,7 +3476,7 @@ void DYN_define_sql_field(GBL gbl,
|
||||
USHORT dtype;
|
||||
SLONG fld_pos;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
sql_field_name[0] = 0;
|
||||
@ -3755,7 +3755,7 @@ void DYN_define_shadow( GBL gbl, const UCHAR** ptr)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
UCHAR verb;
|
||||
@ -3833,7 +3833,7 @@ void DYN_define_trigger(GBL gbl,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request;
|
||||
@ -4000,7 +4000,7 @@ void DYN_define_trigger_msg(GBL gbl, const UCHAR** ptr, const TEXT* trigger_name
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request;
|
||||
@ -4076,7 +4076,7 @@ void DYN_define_view_relation( GBL gbl, const UCHAR** ptr, const TEXT* view)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request;
|
||||
@ -4177,7 +4177,7 @@ void DYN_define_view_relation( GBL gbl, const UCHAR** ptr, const TEXT* view)
|
||||
}
|
||||
|
||||
|
||||
static void check_unique_name( TDBB tdbb,
|
||||
static void check_unique_name( thread_db* tdbb,
|
||||
GBL gbl,
|
||||
const TEXT* object_name,
|
||||
bool proc_flag)
|
||||
@ -4256,7 +4256,7 @@ local_punt_false_132:
|
||||
}
|
||||
|
||||
|
||||
static bool find_field_source(TDBB tdbb,
|
||||
static bool find_field_source(thread_db* tdbb,
|
||||
GBL gbl,
|
||||
const TEXT* view_name,
|
||||
USHORT context,
|
||||
@ -4321,7 +4321,7 @@ that can be used against rdb$fields' rdb$field_name. */
|
||||
}
|
||||
|
||||
|
||||
static bool get_who( TDBB tdbb, GBL gbl, SCHAR* output_name)
|
||||
static bool get_who( thread_db* tdbb, GBL gbl, SCHAR* output_name)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4360,7 +4360,7 @@ static bool get_who( TDBB tdbb, GBL gbl, SCHAR* output_name)
|
||||
}
|
||||
|
||||
|
||||
bool is_it_user_name(GBL gbl, const TEXT* role_name, TDBB tdbb)
|
||||
bool is_it_user_name(GBL gbl, const TEXT* role_name, thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
@ -71,7 +71,7 @@ DATABASE DB = STATIC "ODS.RDB";
|
||||
|
||||
static bool delete_constraint_records(GBL, const TEXT*, const TEXT*);
|
||||
static bool delete_dimension_records(GBL, const TEXT*);
|
||||
static void delete_f_key_constraint(TDBB, GBL, const TEXT*, const TEXT*,
|
||||
static void delete_f_key_constraint(thread_db*, GBL, const TEXT*, const TEXT*,
|
||||
const TEXT*, const TEXT*);
|
||||
static void delete_gfield_for_lfield(GBL, const TEXT*);
|
||||
static bool delete_index_segment_records(GBL, const TEXT*);
|
||||
@ -160,7 +160,7 @@ void DYN_delete_exception( GBL gbl, const UCHAR** ptr)
|
||||
**************************************/
|
||||
SqlIdentifier t;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
GET_STRING(ptr, t);
|
||||
@ -214,7 +214,7 @@ void DYN_delete_filter( GBL gbl, const UCHAR** ptr)
|
||||
**************************************/
|
||||
SqlIdentifier f;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_filters, DYN_REQUESTS);
|
||||
@ -270,7 +270,7 @@ void DYN_delete_function( GBL gbl, const UCHAR** ptr)
|
||||
**************************************/
|
||||
SqlIdentifier f;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_func_args, DYN_REQUESTS);
|
||||
@ -349,7 +349,7 @@ void DYN_delete_generator(GBL gbl, const UCHAR**ptr)
|
||||
**************************************/
|
||||
SqlIdentifier t;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = NULL;
|
||||
@ -407,7 +407,7 @@ void DYN_delete_global_field( GBL gbl, const UCHAR** ptr)
|
||||
**************************************/
|
||||
SqlIdentifier f;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_l_fld_src, DYN_REQUESTS);
|
||||
@ -492,7 +492,7 @@ void DYN_delete_index( GBL gbl, const UCHAR** ptr)
|
||||
**************************************/
|
||||
SqlIdentifier idx_name, rel_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_indices, DYN_REQUESTS);
|
||||
@ -584,7 +584,7 @@ void DYN_delete_local_field(
|
||||
**************************************/
|
||||
SqlIdentifier tbl_nm, col_nm, constraint, index_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
GET_STRING(ptr, col_nm);
|
||||
@ -806,7 +806,7 @@ void DYN_delete_parameter( GBL gbl, const UCHAR** ptr, TEXT* proc_name)
|
||||
MAX_SQL_IDENTIFIER_SIZE, true);
|
||||
}
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_prm, DYN_REQUESTS);
|
||||
@ -896,7 +896,7 @@ void DYN_delete_procedure( GBL gbl, const UCHAR** ptr)
|
||||
SqlIdentifier name;
|
||||
|
||||
GET_STRING(ptr, name);
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
tdbb->tdbb_flags |= TDBB_prc_being_dropped;
|
||||
@ -1054,7 +1054,7 @@ void DYN_delete_relation( GBL gbl, const UCHAR** ptr, const TEXT* relation)
|
||||
USHORT id;
|
||||
SqlIdentifier relation_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
if (relation)
|
||||
@ -1296,7 +1296,7 @@ void DYN_delete_role( GBL gbl, const UCHAR** ptr)
|
||||
SqlIdentifier role_name, role_owner, user;
|
||||
TEXT *ptr1, *ptr2;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
const USHORT major_version = dbb->dbb_ods_version;
|
||||
@ -1449,7 +1449,7 @@ void DYN_delete_shadow( GBL gbl, const UCHAR** ptr)
|
||||
**************************************/
|
||||
int shadow_number;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
/*****
|
||||
@ -1524,7 +1524,7 @@ void DYN_delete_trigger( GBL gbl, const UCHAR** ptr)
|
||||
USHORT id;
|
||||
SqlIdentifier r, t;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_trg_msgs, DYN_REQUESTS);
|
||||
@ -1661,7 +1661,7 @@ void DYN_delete_trigger_msg( GBL gbl, const UCHAR** ptr, TEXT* trigger_name)
|
||||
int number;
|
||||
SqlIdentifier t;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
number = DYN_get_number(ptr);
|
||||
@ -1729,7 +1729,7 @@ static bool delete_constraint_records(GBL gbl,
|
||||
* based on a constraint name.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_rel_con, DYN_REQUESTS);
|
||||
@ -1779,7 +1779,7 @@ static bool delete_dimension_records(GBL gbl, const TEXT* field_name)
|
||||
* pertaining to a field.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_dims, DYN_REQUESTS);
|
||||
@ -1814,7 +1814,7 @@ static bool delete_dimension_records(GBL gbl, const TEXT* field_name)
|
||||
}
|
||||
|
||||
|
||||
static void delete_f_key_constraint(TDBB tdbb,
|
||||
static void delete_f_key_constraint(thread_db* tdbb,
|
||||
GBL gbl,
|
||||
const TEXT* tbl_nm,
|
||||
const TEXT* col_nm, // unused
|
||||
@ -1903,7 +1903,7 @@ static void delete_gfield_for_lfield( GBL gbl, const TEXT* lfield_name)
|
||||
* deletes a global field for a given local field.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
BLK request = CMP_find_request(tdbb, drq_e_l_gfld, DYN_REQUESTS);
|
||||
|
||||
@ -1944,7 +1944,7 @@ static bool delete_index_segment_records( GBL gbl, const TEXT* index_name)
|
||||
* pertaining to an index.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_idx_segs, DYN_REQUESTS);
|
||||
@ -1992,7 +1992,7 @@ static bool delete_security_class2( GBL gbl, const TEXT* security_class)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_e_class, DYN_REQUESTS);
|
||||
|
@ -95,17 +95,17 @@ static void drop_log(GBL);
|
||||
// Function not defined in this file MOD 04-July-2002
|
||||
// static void modify_lfield_type(GBL, const UCHAR**, TEXT*, TEXT*);
|
||||
|
||||
static void modify_lfield_position(TDBB, Database*, GBL, const TEXT*, const TEXT*,
|
||||
static void modify_lfield_position(thread_db*, Database*, GBL, const TEXT*, const TEXT*,
|
||||
USHORT, USHORT);
|
||||
static bool check_view_dependency(TDBB, Database*, GBL, const TEXT*, const TEXT*);
|
||||
static bool check_sptrig_dependency(TDBB, Database*, GBL, const TEXT*, const TEXT*);
|
||||
static void modify_lfield_index(TDBB, Database*, GBL, const TEXT*, const TEXT*,
|
||||
static bool check_view_dependency(thread_db*, Database*, GBL, const TEXT*, const TEXT*);
|
||||
static bool check_sptrig_dependency(thread_db*, Database*, GBL, const TEXT*, const TEXT*);
|
||||
static void modify_lfield_index(thread_db*, Database*, GBL, const TEXT*, const TEXT*,
|
||||
const TEXT*);
|
||||
static bool field_exists(TDBB, Database*, GBL, const TEXT*, const TEXT*);
|
||||
static bool domain_exists(TDBB, Database*, GBL, const TEXT*);
|
||||
static void get_domain_type(TDBB, Database*, GBL, DYN_FLD);
|
||||
static bool field_exists(thread_db*, Database*, GBL, const TEXT*, const TEXT*);
|
||||
static bool domain_exists(thread_db*, Database*, GBL, const TEXT*);
|
||||
static void get_domain_type(thread_db*, Database*, GBL, DYN_FLD);
|
||||
static ULONG check_update_fld_type(const dyn_fld*, const dyn_fld*);
|
||||
static void modify_err_punt(TDBB, ULONG, const dyn_fld*, const dyn_fld*);
|
||||
static void modify_err_punt(thread_db*, ULONG, const dyn_fld*, const dyn_fld*);
|
||||
|
||||
|
||||
void DYN_modify_database( GBL gbl, const UCHAR** ptr)
|
||||
@ -122,7 +122,7 @@ void DYN_modify_database( GBL gbl, const UCHAR** ptr)
|
||||
**************************************/
|
||||
UCHAR verb, s[128];
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = NULL;
|
||||
@ -270,7 +270,7 @@ void DYN_modify_exception( GBL gbl, const UCHAR** ptr)
|
||||
UCHAR verb;
|
||||
SqlIdentifier t;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_m_xcp, DYN_REQUESTS);
|
||||
@ -344,7 +344,7 @@ void DYN_modify_global_field(
|
||||
const TEXT* err_one_type_change_only =
|
||||
"Only one data type change to the domain allowed at a time";
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_m_gfield, DYN_REQUESTS);
|
||||
@ -889,7 +889,7 @@ void DYN_modify_index( GBL gbl, const UCHAR** ptr)
|
||||
UCHAR verb;
|
||||
SqlIdentifier name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_m_index, DYN_REQUESTS);
|
||||
@ -981,7 +981,7 @@ void DYN_modify_local_field(
|
||||
|
||||
const UCHAR *query_header, *description;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
GET_STRING(ptr, f);
|
||||
@ -1171,7 +1171,7 @@ void DYN_modify_procedure( GBL gbl, const UCHAR** ptr)
|
||||
|
||||
GET_STRING(ptr, procedure_name);
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = NULL;
|
||||
@ -1277,7 +1277,7 @@ void DYN_modify_relation( GBL gbl, const UCHAR** ptr)
|
||||
UCHAR verb;
|
||||
SqlIdentifier name, field_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
field_name[0] = 0;
|
||||
@ -1376,7 +1376,7 @@ void DYN_modify_trigger( GBL gbl, const UCHAR** ptr)
|
||||
UCHAR verb;
|
||||
SqlIdentifier trigger_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_m_trigger, DYN_REQUESTS);
|
||||
@ -1510,7 +1510,7 @@ void DYN_modify_trigger_msg( GBL gbl, const UCHAR** ptr, TEXT* trigger_name)
|
||||
UCHAR verb;
|
||||
SqlIdentifier t;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_m_trg_msg, DYN_REQUESTS);
|
||||
@ -1580,7 +1580,7 @@ void DYN_modify_view( GBL gbl, const UCHAR** ptr)
|
||||
UCHAR verb;
|
||||
SqlIdentifier view_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
view_name[0] = 0;
|
||||
@ -1675,7 +1675,7 @@ static void drop_cache( GBL gbl)
|
||||
* Drop the database cache
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_d_cache, DYN_REQUESTS);
|
||||
@ -1726,7 +1726,7 @@ static void change_backup_mode( GBL gbl, UCHAR verb)
|
||||
**************************************/
|
||||
bool invalid_state = false;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_d_difference, DYN_REQUESTS);
|
||||
@ -1841,7 +1841,7 @@ static void drop_log( GBL gbl)
|
||||
* Delete all log files
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, drq_d_log, DYN_REQUESTS);
|
||||
@ -1874,7 +1874,7 @@ static void drop_log( GBL gbl)
|
||||
}
|
||||
}
|
||||
|
||||
static void modify_lfield_position(TDBB tdbb,
|
||||
static void modify_lfield_position(thread_db* tdbb,
|
||||
Database* dbb,
|
||||
GBL gbl,
|
||||
const TEXT* relation_name,
|
||||
@ -1987,7 +1987,7 @@ static void modify_lfield_position(TDBB tdbb,
|
||||
}
|
||||
}
|
||||
|
||||
static bool check_view_dependency(TDBB tdbb,
|
||||
static bool check_view_dependency(thread_db* tdbb,
|
||||
Database* dbb,
|
||||
GBL gbl,
|
||||
const TEXT* relation_name,
|
||||
@ -2034,7 +2034,7 @@ static bool check_view_dependency(TDBB tdbb,
|
||||
|
||||
}
|
||||
|
||||
static bool check_sptrig_dependency(TDBB tdbb,
|
||||
static bool check_sptrig_dependency(thread_db* tdbb,
|
||||
Database* dbb,
|
||||
GBL gbl,
|
||||
const TEXT* relation_name,
|
||||
@ -2073,7 +2073,7 @@ static bool check_sptrig_dependency(TDBB tdbb,
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void modify_lfield_index(TDBB tdbb,
|
||||
static void modify_lfield_index(thread_db* tdbb,
|
||||
Database* dbb,
|
||||
GBL gbl,
|
||||
const TEXT* relation_name,
|
||||
@ -2113,7 +2113,7 @@ static void modify_lfield_index(TDBB tdbb,
|
||||
CMP_release(tdbb, (jrd_req*)request);
|
||||
}
|
||||
|
||||
static bool field_exists(TDBB tdbb,
|
||||
static bool field_exists(thread_db* tdbb,
|
||||
Database* dbb,
|
||||
GBL gbl,
|
||||
const TEXT* relation_name,
|
||||
@ -2141,7 +2141,7 @@ static bool field_exists(TDBB tdbb,
|
||||
return retval;
|
||||
}
|
||||
|
||||
static bool domain_exists(TDBB tdbb, Database* dbb, GBL gbl, const TEXT* field_name)
|
||||
static bool domain_exists(thread_db* tdbb, Database* dbb, GBL gbl, const TEXT* field_name)
|
||||
{
|
||||
/***********************************************************
|
||||
*
|
||||
@ -2216,7 +2216,7 @@ void DYN_modify_sql_field(GBL gbl,
|
||||
const TEXT* err_one_type_change_only =
|
||||
"Only one data type change to the field allowed at a time";
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
dyn_fld* orig_fld = 0;
|
||||
@ -2647,7 +2647,7 @@ void DYN_modify_sql_field(GBL gbl,
|
||||
}
|
||||
}
|
||||
|
||||
void get_domain_type(TDBB tdbb, Database* dbb, GBL gbl, DYN_FLD dom_fld)
|
||||
void get_domain_type(thread_db* tdbb, Database* dbb, GBL gbl, DYN_FLD dom_fld)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2935,7 +2935,7 @@ static ULONG check_update_fld_type(const dyn_fld* orig_fld,
|
||||
return FB_SUCCESS;
|
||||
}
|
||||
|
||||
static void modify_err_punt(TDBB tdbb,
|
||||
static void modify_err_punt(thread_db* tdbb,
|
||||
ULONG errorcode,
|
||||
const dyn_fld* orig_fld_def,
|
||||
const dyn_fld* new_fld_def)
|
||||
|
@ -25,14 +25,14 @@
|
||||
#ifndef JRD_DYN_UT_PROTO_H
|
||||
#define JRD_DYN_UT_PROTO_H
|
||||
|
||||
void DYN_UTIL_store_check_constraints(TDBB, GBL, const TEXT*, const TEXT*);
|
||||
bool DYN_UTIL_get_prot(TDBB, GBL, const SCHAR*, const SCHAR*, USHORT*);
|
||||
void DYN_UTIL_generate_trigger_name(TDBB, GBL, TEXT*);
|
||||
void DYN_UTIL_generate_index_name(TDBB, GBL, TEXT*, UCHAR);
|
||||
void DYN_UTIL_generate_field_position(TDBB, GBL, const TEXT*, SLONG*);
|
||||
void DYN_UTIL_generate_field_name(TDBB, GBL, TEXT*);
|
||||
void DYN_UTIL_generate_constraint_name(TDBB, GBL, TEXT*);
|
||||
SINT64 DYN_UTIL_gen_unique_id(TDBB, GBL, SSHORT, const SCHAR*, BLK*);
|
||||
void DYN_UTIL_store_check_constraints(thread_db*, GBL, const TEXT*, const TEXT*);
|
||||
bool DYN_UTIL_get_prot(thread_db*, GBL, const SCHAR*, const SCHAR*, USHORT*);
|
||||
void DYN_UTIL_generate_trigger_name(thread_db*, GBL, TEXT*);
|
||||
void DYN_UTIL_generate_index_name(thread_db*, GBL, TEXT*, UCHAR);
|
||||
void DYN_UTIL_generate_field_position(thread_db*, GBL, const TEXT*, SLONG*);
|
||||
void DYN_UTIL_generate_field_name(thread_db*, GBL, TEXT*);
|
||||
void DYN_UTIL_generate_constraint_name(thread_db*, GBL, TEXT*);
|
||||
SINT64 DYN_UTIL_gen_unique_id(thread_db*, GBL, SSHORT, const SCHAR*, BLK*);
|
||||
|
||||
#endif // JRD_DYN_UT_PROTO_H
|
||||
|
||||
|
@ -107,7 +107,7 @@ static const UCHAR prot_blr[] = {
|
||||
|
||||
|
||||
|
||||
SINT64 DYN_UTIL_gen_unique_id(TDBB tdbb,
|
||||
SINT64 DYN_UTIL_gen_unique_id(thread_db* tdbb,
|
||||
GBL gbl,
|
||||
SSHORT id,
|
||||
const SCHAR* generator_name,
|
||||
@ -162,7 +162,7 @@ SINT64 DYN_UTIL_gen_unique_id(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void DYN_UTIL_generate_constraint_name( TDBB tdbb, GBL gbl, TEXT* buffer)
|
||||
void DYN_UTIL_generate_constraint_name( thread_db* tdbb, GBL gbl, TEXT* buffer)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -223,7 +223,7 @@ void DYN_UTIL_generate_constraint_name( TDBB tdbb, GBL gbl, TEXT* buffer)
|
||||
}
|
||||
|
||||
|
||||
void DYN_UTIL_generate_field_name( TDBB tdbb, GBL gbl, TEXT* buffer)
|
||||
void DYN_UTIL_generate_field_name( thread_db* tdbb, GBL gbl, TEXT* buffer)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -284,7 +284,7 @@ void DYN_UTIL_generate_field_name( TDBB tdbb, GBL gbl, TEXT* buffer)
|
||||
|
||||
|
||||
void DYN_UTIL_generate_field_position(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
GBL gbl,
|
||||
const TEXT* relation_name,
|
||||
SLONG* field_pos)
|
||||
@ -339,7 +339,7 @@ void DYN_UTIL_generate_field_position(
|
||||
}
|
||||
|
||||
|
||||
void DYN_UTIL_generate_index_name(TDBB tdbb,
|
||||
void DYN_UTIL_generate_index_name(thread_db* tdbb,
|
||||
GBL gbl, TEXT* buffer, UCHAR verb)
|
||||
{
|
||||
/**************************************
|
||||
@ -406,7 +406,7 @@ void DYN_UTIL_generate_index_name(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void DYN_UTIL_generate_trigger_name( TDBB tdbb, GBL gbl, TEXT* buffer)
|
||||
void DYN_UTIL_generate_trigger_name( thread_db* tdbb, GBL gbl, TEXT* buffer)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -465,7 +465,7 @@ void DYN_UTIL_generate_trigger_name( TDBB tdbb, GBL gbl, TEXT* buffer)
|
||||
}
|
||||
|
||||
|
||||
bool DYN_UTIL_get_prot(TDBB tdbb,
|
||||
bool DYN_UTIL_get_prot(thread_db* tdbb,
|
||||
GBL gbl,
|
||||
const SCHAR* rname,
|
||||
const SCHAR* fname,
|
||||
@ -518,7 +518,7 @@ bool DYN_UTIL_get_prot(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void DYN_UTIL_store_check_constraints(TDBB tdbb,
|
||||
void DYN_UTIL_store_check_constraints(thread_db* tdbb,
|
||||
GBL gbl,
|
||||
const TEXT* constraint_name,
|
||||
const TEXT* trigger_name)
|
||||
|
@ -54,6 +54,7 @@
|
||||
#if defined(NOT_USED_OR_REPLACED) && defined(__cplusplus)
|
||||
class att;
|
||||
class jrd_req;
|
||||
class jrd_tra;
|
||||
|
||||
|
||||
ENTRYPOINT( "gds_attach_database",
|
||||
@ -120,7 +121,7 @@ ENTRYPOINT( "gds_commit_transaction",
|
||||
PSI5_commit_transaction,
|
||||
"_jrd8_commit_transaction",
|
||||
IPI_commit_transaction,
|
||||
(ISC_STATUS*, class jrd_tra**))
|
||||
(ISC_STATUS*, jrd_tra**))
|
||||
|
||||
ENTRYPOINT( "gds_compile_request",
|
||||
jrd8_compile_request,
|
||||
@ -225,7 +226,7 @@ ENTRYPOINT( "gds_prepare_transaction",
|
||||
PSI5_prepare_transaction,
|
||||
"_jrd8_prepare_transaction",
|
||||
IPI_prepare_transaction,
|
||||
(ISC_STATUS*, class jrd_tra**, USHORT, UCHAR*))
|
||||
(ISC_STATUS*, jrd_tra**, USHORT, UCHAR*))
|
||||
|
||||
ENTRYPOINT( "gds_put_segment",
|
||||
jrd8_put_segment,
|
||||
@ -251,7 +252,7 @@ ENTRYPOINT( "gds_reconnect_transaction",
|
||||
PSI5_reconnect_transaction,
|
||||
"_jrd8_reconnect_transaction",
|
||||
IPI_reconnect_transaction,
|
||||
(ISC_STATUS*, att**, class jrd_tra**, SSHORT, const UCHAR*))
|
||||
(ISC_STATUS*, att**, jrd_tra**, SSHORT, const UCHAR*))
|
||||
|
||||
ENTRYPOINT( "gds_receive",
|
||||
jrd8_receive,
|
||||
@ -303,7 +304,7 @@ ENTRYPOINT("gds_rollback_transaction",
|
||||
PSI5_rollback_transaction,
|
||||
"_jrd8_rollback_transaction",
|
||||
IPI_rollback_transaction,
|
||||
(ISC_STATUS *, class jrd_tra **))
|
||||
(ISC_STATUS *, jrd_tra**))
|
||||
|
||||
ENTRYPOINT("gds_send",
|
||||
jrd8_send,
|
||||
@ -329,7 +330,7 @@ ENTRYPOINT("gds_start_and_send",
|
||||
PSI5_start_and_send,
|
||||
"_jrd8_start_and_send",
|
||||
IPI_start_and_send,
|
||||
(ISC_STATUS*, jrd_req**, class jrd_tra**, USHORT, USHORT,
|
||||
(ISC_STATUS*, jrd_req**, jrd_tra**, USHORT, USHORT,
|
||||
SCHAR*, SSHORT))
|
||||
|
||||
ENTRYPOINT("gds_start_request",
|
||||
@ -343,7 +344,7 @@ ENTRYPOINT("gds_start_request",
|
||||
PSI5_start_request,
|
||||
"_jrd8_start_request",
|
||||
IPI_start_request,
|
||||
(ISC_STATUS*, jrd_req**, class jrd_tra**, SSHORT))
|
||||
(ISC_STATUS*, jrd_req**, jrd_tra**, SSHORT))
|
||||
|
||||
ENTRYPOINT( "gds_start_multiple",
|
||||
jrd8_start_multiple,
|
||||
@ -356,7 +357,7 @@ ENTRYPOINT( "gds_start_multiple",
|
||||
PSI5_start_multiple,
|
||||
"_jrd8_start_multiple",
|
||||
IPI_start_multiple,
|
||||
(ISC_STATUS *, class jrd_tra **, USHORT, struct teb *))
|
||||
(ISC_STATUS *, jrd_tra**, USHORT, struct teb *))
|
||||
|
||||
ENTRYPOINT("gds_start_transaction",
|
||||
jrd8_start_transaction,
|
||||
@ -369,7 +370,7 @@ ENTRYPOINT("gds_start_transaction",
|
||||
PSI5_start_transaction,
|
||||
"_jrd8_start_transaction",
|
||||
IPI_start_transaction,
|
||||
(ISC_STATUS*, class jrd_tra**, SSHORT, ...))
|
||||
(ISC_STATUS*, jrd_tra**, SSHORT, ...))
|
||||
|
||||
ENTRYPOINT( "gds_transaction_info",
|
||||
jrd8_transaction_info,
|
||||
@ -382,7 +383,7 @@ ENTRYPOINT( "gds_transaction_info",
|
||||
PSI5_transaction_info,
|
||||
"_jrd8_transaction_info",
|
||||
IPI_transaction_info,
|
||||
(ISC_STATUS*, class jrd_tra**, SSHORT, const SCHAR*, SSHORT, SCHAR*))
|
||||
(ISC_STATUS*, jrd_tra**, SSHORT, const SCHAR*, SSHORT, SCHAR*))
|
||||
|
||||
ENTRYPOINT("gds_unwind_request",
|
||||
jrd8_unwind_request,
|
||||
@ -408,7 +409,7 @@ ENTRYPOINT("gds_commit_retaining",
|
||||
PSI5_commit_retaining,
|
||||
"_jrd8_commit_retaining",
|
||||
IPI_commit_retaining,
|
||||
(ISC_STATUS *, class jrd_tra **))
|
||||
(ISC_STATUS *, jrd_tra**))
|
||||
|
||||
ENTRYPOINT("gds_que_events",
|
||||
jrd8_que_events,
|
||||
@ -448,7 +449,7 @@ ENTRYPOINT("gds_ddl",
|
||||
PSI5_ddl,
|
||||
"_jrd8_ddl",
|
||||
IPI_ddl,
|
||||
(ISC_STATUS*, att**, class jrd_tra**,
|
||||
(ISC_STATUS*, att**, jrd_tra**,
|
||||
USHORT, const SCHAR*))
|
||||
|
||||
ENTRYPOINT("gds_open_blob2",
|
||||
@ -462,7 +463,7 @@ ENTRYPOINT("gds_open_blob2",
|
||||
PSI5_open_blob2,
|
||||
"_jrd8_open_blob2",
|
||||
IPI_open_blob2,
|
||||
(ISC_STATUS*, att**, class jrd_tra**, struct blb**,
|
||||
(ISC_STATUS*, att**, jrd_tra**, struct blb**,
|
||||
struct bid*, USHORT, const UCHAR*))
|
||||
|
||||
ENTRYPOINT("gds_create_blob2",
|
||||
@ -476,7 +477,7 @@ ENTRYPOINT("gds_create_blob2",
|
||||
PSI5_create_blob2,
|
||||
"_jrd8_create_blob2",
|
||||
IPI_create_blob2,
|
||||
(ISC_STATUS*, att**, class jrd_tra**, struct blb**,
|
||||
(ISC_STATUS*, att**, jrd_tra**, struct blb**,
|
||||
struct bid*, USHORT, const UCHAR*))
|
||||
|
||||
ENTRYPOINT( "gds_get_slice",
|
||||
@ -490,7 +491,7 @@ ENTRYPOINT( "gds_get_slice",
|
||||
PSI5_get_slice,
|
||||
"_jrd8_get_slice",
|
||||
IPI_get_slice,
|
||||
(ISC_STATUS*, att**, class jrd_tra**, ISC_QUAD*, USHORT,
|
||||
(ISC_STATUS*, att**, jrd_tra**, ISC_QUAD*, USHORT,
|
||||
const UCHAR*, USHORT, const UCHAR*, SLONG, UCHAR*, SLONG*))
|
||||
|
||||
ENTRYPOINT( "gds_put_slice",
|
||||
@ -504,7 +505,7 @@ ENTRYPOINT( "gds_put_slice",
|
||||
PSI5_put_slice,
|
||||
"_jrd8_put_slice",
|
||||
IPI_put_slice,
|
||||
(ISC_STATUS*, att**, class jrd_tra**, ISC_QUAD*, USHORT,
|
||||
(ISC_STATUS*, att**, jrd_tra**, ISC_QUAD*, USHORT,
|
||||
const UCHAR*, USHORT, const UCHAR*, SLONG, UCHAR*))
|
||||
|
||||
ENTRYPOINT( "gds_seek_blob",
|
||||
@ -531,7 +532,7 @@ ENTRYPOINT( "isc_transact_request",
|
||||
/**** PSI5_transact_request ***/ y_valve_no_entrypoint,
|
||||
"_jrd8_transact_request",
|
||||
IPI_transact_request,
|
||||
(ISC_STATUS*, att**, class jrd_tra**, USHORT, const SCHAR*,
|
||||
(ISC_STATUS*, att**, jrd_tra**, USHORT, const SCHAR*,
|
||||
USHORT, SCHAR*, USHORT, SCHAR*))
|
||||
|
||||
ENTRYPOINT( "isc_drop_database",
|
||||
@ -755,7 +756,7 @@ ENTRYPOINT("isc_rollback_retaining", jrd8_rollback_retaining,
|
||||
/**** PSI_rollback_retaining ***/ y_valve_no_entrypoint,
|
||||
/**** PSI5_rollback_retaining ***/ y_valve_no_entrypoint,
|
||||
"_jrd8_rollback_retaining",
|
||||
IPI_rollback_retaining, (ISC_STATUS *, class jrd_tra **))
|
||||
IPI_rollback_retaining, (ISC_STATUS *, jrd_tra**))
|
||||
#ifdef CANCEL_OPERATION
|
||||
ENTRYPOINT("gds_cancel_operation", jrd8_cancel_operation,
|
||||
/*** "jrd5_cancel_operation" ***/ NULL,
|
||||
|
@ -167,7 +167,7 @@ void ERR_duplicate_error(IDX_E code,
|
||||
const TEXT* index_name;
|
||||
const TEXT* constraint_name;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
MET_lookup_index(tdbb, index, relation->rel_name, index_number + 1);
|
||||
if (index[0]) {
|
||||
@ -269,7 +269,7 @@ void ERR_log(int facility, int number, const TEXT* message)
|
||||
*
|
||||
**************************************/
|
||||
TEXT errmsg[MAX_ERRMSG_LEN + 1];
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
DEBUG;
|
||||
if (message)
|
||||
@ -315,7 +315,7 @@ bool ERR_post_warning(ISC_STATUS status, ...)
|
||||
ISC_STATUS* status_vector;
|
||||
|
||||
VA_START(args, status);
|
||||
status_vector = ((TDBB) GET_THREAD_DATA)->tdbb_status_vector;
|
||||
status_vector = ((thread_db*) GET_THREAD_DATA)->tdbb_status_vector;
|
||||
|
||||
if (status_vector[0] != isc_arg_gds ||
|
||||
(status_vector[0] == isc_arg_gds && status_vector[1] == 0 &&
|
||||
@ -404,7 +404,7 @@ void ERR_post(ISC_STATUS status, ...)
|
||||
int i, tmp_status_len = 0, status_len = 0, err_status_len = 0;
|
||||
int warning_count = 0, warning_indx = 0;
|
||||
|
||||
ISC_STATUS* status_vector = ((TDBB) GET_THREAD_DATA)->tdbb_status_vector;
|
||||
ISC_STATUS* status_vector = ((thread_db*) GET_THREAD_DATA)->tdbb_status_vector;
|
||||
|
||||
/* stuff the status into temp buffer */
|
||||
MOVE_CLEAR(tmp_status, sizeof(tmp_status));
|
||||
@ -491,7 +491,7 @@ void ERR_punt(void)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
if (dbb && (dbb->dbb_flags & DBB_bugcheck))
|
||||
@ -545,7 +545,7 @@ void ERR_warning(ISC_STATUS status, ...)
|
||||
* that subsequent errors can supersede this one.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
STUFF_STATUS(tdbb->tdbb_status_vector, status);
|
||||
DEBUG;
|
||||
|
104
src/jrd/evl.cpp
104
src/jrd/evl.cpp
@ -19,7 +19,7 @@
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
* $Id: evl.cpp,v 1.66 2004-03-07 07:58:40 robocop Exp $
|
||||
* $Id: evl.cpp,v 1.67 2004-03-11 05:03:57 robocop Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -137,29 +137,29 @@ static dsc* add_datetime(const dsc*, const jrd_nod*, VLU);
|
||||
static dsc* add_sql_date(const dsc*, const jrd_nod*, VLU);
|
||||
static dsc* add_sql_time(const dsc*, const jrd_nod*, VLU);
|
||||
static dsc* add_timestamp(const dsc*, const jrd_nod*, VLU);
|
||||
static dsc* binary_value(TDBB, const jrd_nod*, VLU);
|
||||
static dsc* cast(TDBB, const dsc*, const jrd_nod*, VLU);
|
||||
static void compute_agg_distinct(TDBB, jrd_nod*);
|
||||
static dsc* concatenate(TDBB, jrd_nod*, VLU);
|
||||
static dsc* dbkey(TDBB, const jrd_nod*, VLU);
|
||||
static dsc* eval_statistical(TDBB, jrd_nod*, VLU);
|
||||
static dsc* binary_value(thread_db*, const jrd_nod*, VLU);
|
||||
static dsc* cast(thread_db*, const dsc*, const jrd_nod*, VLU);
|
||||
static void compute_agg_distinct(thread_db*, jrd_nod*);
|
||||
static dsc* concatenate(thread_db*, jrd_nod*, VLU);
|
||||
static dsc* dbkey(thread_db*, const jrd_nod*, VLU);
|
||||
static dsc* eval_statistical(thread_db*, jrd_nod*, VLU);
|
||||
static SINT64 get_day_fraction(const dsc* d);
|
||||
static dsc* get_mask(TDBB, jrd_nod*, VLU);
|
||||
static dsc* get_mask(thread_db*, jrd_nod*, VLU);
|
||||
static SINT64 get_timestamp_to_isc_ticks(const dsc* d);
|
||||
static void init_agg_distinct(TDBB, const jrd_nod*);
|
||||
static void init_agg_distinct(thread_db*, const jrd_nod*);
|
||||
#ifdef PC_ENGINE
|
||||
static dsc* lock_record(TDBB, jrd_nod*, VLU);
|
||||
static dsc* lock_relation(TDBB, jrd_nod*, VLU);
|
||||
static dsc* lock_record(thread_db*, jrd_nod*, VLU);
|
||||
static dsc* lock_relation(thread_db*, jrd_nod*, VLU);
|
||||
#endif
|
||||
static dsc* lock_state(TDBB, jrd_nod*, VLU);
|
||||
static dsc* lock_state(thread_db*, jrd_nod*, VLU);
|
||||
static dsc* multiply(const dsc*, VLU, const jrd_nod*);
|
||||
static dsc* multiply2(const dsc*, VLU, const jrd_nod*);
|
||||
static dsc* divide2(const dsc*, VLU, const jrd_nod*);
|
||||
static dsc* negate_dsc(TDBB, const dsc*, VLU);
|
||||
static dsc* record_version(TDBB, const jrd_nod*, VLU);
|
||||
static dsc* negate_dsc(thread_db*, const dsc*, VLU);
|
||||
static dsc* record_version(thread_db*, const jrd_nod*, VLU);
|
||||
static bool reject_duplicate(const UCHAR*, const UCHAR*, void*);
|
||||
static dsc* scalar(TDBB, jrd_nod*, VLU);
|
||||
static SSHORT sleuth(TDBB, jrd_nod*, dsc*, dsc*);
|
||||
static dsc* scalar(thread_db*, jrd_nod*, VLU);
|
||||
static SSHORT sleuth(thread_db*, jrd_nod*, dsc*, dsc*);
|
||||
static bool nc_sleuth_check(TextType, USHORT, const UCHAR*, const UCHAR*,
|
||||
const UCHAR*, const UCHAR*);
|
||||
static bool nc_sleuth_class(TextType, USHORT, const UCHAR*, const UCHAR*, UCHAR);
|
||||
@ -167,11 +167,11 @@ static bool wc_sleuth_check(TextType, USHORT, const UCS2_CHAR*, const UCS2_CHAR*
|
||||
const UCS2_CHAR*, const UCS2_CHAR*);
|
||||
static bool wc_sleuth_class(TextType, USHORT, const UCS2_CHAR*, const UCS2_CHAR*,
|
||||
UCS2_CHAR);
|
||||
static SSHORT string_boolean(TDBB, jrd_nod*, dsc*, dsc*, bool);
|
||||
static SSHORT string_function(TDBB, jrd_nod*, SSHORT, const UCHAR*, SSHORT, const UCHAR*, USHORT, bool);
|
||||
static dsc* substring(TDBB, VLU, dsc*, SLONG, SLONG);
|
||||
static dsc* upcase(TDBB, const dsc*, VLU);
|
||||
static dsc* internal_info(TDBB, const dsc*, VLU);
|
||||
static SSHORT string_boolean(thread_db*, jrd_nod*, dsc*, dsc*, bool);
|
||||
static SSHORT string_function(thread_db*, jrd_nod*, SSHORT, const UCHAR*, SSHORT, const UCHAR*, USHORT, bool);
|
||||
static dsc* substring(thread_db*, VLU, dsc*, SLONG, SLONG);
|
||||
static dsc* upcase(thread_db*, const dsc*, VLU);
|
||||
static dsc* internal_info(thread_db*, const dsc*, VLU);
|
||||
|
||||
|
||||
static const UCHAR special[256] = {
|
||||
@ -209,7 +209,7 @@ static const RSE_GET_MODE g_RSE_get_mode = RSE_get_forward;
|
||||
|
||||
|
||||
|
||||
dsc* EVL_assign_to(TDBB tdbb, jrd_nod* node)
|
||||
dsc* EVL_assign_to(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -322,7 +322,7 @@ dsc* EVL_assign_to(TDBB tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
SBM* EVL_bitmap(TDBB tdbb, jrd_nod* node)
|
||||
SBM* EVL_bitmap(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -379,7 +379,7 @@ SBM* EVL_bitmap(TDBB tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN EVL_boolean(TDBB tdbb, jrd_nod* node)
|
||||
BOOLEAN EVL_boolean(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -773,7 +773,7 @@ BOOLEAN EVL_boolean(TDBB tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
dsc* EVL_expr(TDBB tdbb, jrd_nod* node)
|
||||
dsc* EVL_expr(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1263,7 +1263,7 @@ bool EVL_field(jrd_rel* relation, REC record, USHORT id, dsc* desc)
|
||||
*/
|
||||
if (!relation->rel_fields)
|
||||
{
|
||||
TDBB tdbb = NULL;
|
||||
thread_db* tdbb = NULL;
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
MET_scan_relation(tdbb, relation);
|
||||
@ -1375,7 +1375,7 @@ bool EVL_field(jrd_rel* relation, REC record, USHORT id, dsc* desc)
|
||||
}
|
||||
|
||||
|
||||
USHORT EVL_group(TDBB tdbb, Rsb* rsb, jrd_nod* node, USHORT state)
|
||||
USHORT EVL_group(thread_db* tdbb, Rsb* rsb, jrd_nod* node, USHORT state)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1830,7 +1830,7 @@ USHORT EVL_group(TDBB tdbb, Rsb* rsb, jrd_nod* node, USHORT state)
|
||||
}
|
||||
|
||||
|
||||
void EVL_make_value(TDBB tdbb, const dsc* desc, VLU value)
|
||||
void EVL_make_value(thread_db* tdbb, const dsc* desc, VLU value)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1928,7 +1928,7 @@ void EVL_make_value(TDBB tdbb, const dsc* desc, VLU value)
|
||||
|
||||
|
||||
|
||||
USHORT EVL_mb_matches(TDBB tdbb,
|
||||
USHORT EVL_mb_matches(thread_db* tdbb,
|
||||
TextType obj,
|
||||
const UCHAR* p1,
|
||||
SSHORT l1,
|
||||
@ -1982,7 +1982,7 @@ USHORT EVL_mb_matches(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
USHORT EVL_mb_sleuth_check(TDBB tdbb,
|
||||
USHORT EVL_mb_sleuth_check(thread_db* tdbb,
|
||||
TextType obj,
|
||||
USHORT flags,
|
||||
const UCHAR* search,
|
||||
@ -2037,7 +2037,7 @@ USHORT EVL_mb_sleuth_check(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
USHORT EVL_mb_sleuth_merge(TDBB tdbb,
|
||||
USHORT EVL_mb_sleuth_merge(thread_db* tdbb,
|
||||
TextType obj,
|
||||
const UCHAR* match,
|
||||
USHORT match_bytes,
|
||||
@ -2862,7 +2862,7 @@ static dsc* add_timestamp(const dsc* desc, const jrd_nod* node, VLU value)
|
||||
}
|
||||
|
||||
|
||||
static dsc* binary_value(TDBB tdbb, const jrd_nod* node, VLU impure)
|
||||
static dsc* binary_value(thread_db* tdbb, const jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2939,7 +2939,7 @@ static dsc* binary_value(TDBB tdbb, const jrd_nod* node, VLU impure)
|
||||
}
|
||||
|
||||
|
||||
static dsc* cast(TDBB tdbb, const dsc* value, const jrd_nod* node, VLU impure)
|
||||
static dsc* cast(thread_db* tdbb, const dsc* value, const jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2996,7 +2996,7 @@ static dsc* cast(TDBB tdbb, const dsc* value, const jrd_nod* node, VLU impure)
|
||||
}
|
||||
|
||||
|
||||
static void compute_agg_distinct(TDBB tdbb, jrd_nod* node)
|
||||
static void compute_agg_distinct(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3070,7 +3070,7 @@ static void compute_agg_distinct(TDBB tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static dsc* concatenate(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
static dsc* concatenate(thread_db* tdbb, jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3164,7 +3164,7 @@ static dsc* concatenate(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
}
|
||||
|
||||
|
||||
static dsc* dbkey(TDBB tdbb, const jrd_nod* node, VLU impure)
|
||||
static dsc* dbkey(thread_db* tdbb, const jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3210,7 +3210,7 @@ static dsc* dbkey(TDBB tdbb, const jrd_nod* node, VLU impure)
|
||||
}
|
||||
|
||||
|
||||
static dsc* eval_statistical(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
static dsc* eval_statistical(thread_db* tdbb, jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3457,7 +3457,7 @@ static SINT64 get_day_fraction(const dsc* d)
|
||||
|
||||
|
||||
|
||||
static dsc* get_mask(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
static dsc* get_mask(thread_db* tdbb, jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3537,7 +3537,7 @@ static SINT64 get_timestamp_to_isc_ticks(const dsc* d)
|
||||
}
|
||||
|
||||
|
||||
static void init_agg_distinct(TDBB tdbb, const jrd_nod* node)
|
||||
static void init_agg_distinct(thread_db* tdbb, const jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3557,7 +3557,7 @@ static void init_agg_distinct(TDBB tdbb, const jrd_nod* node)
|
||||
|
||||
const asb* agSortBlk = (asb*) node->nod_arg[1];
|
||||
iasb* asb_impure = (iasb*) ((char*) request + agSortBlk->nod_impure);
|
||||
const skd* sort_key = agSortBlk->asb_key_desc;
|
||||
const sort_key_def* sort_key = agSortBlk->asb_key_desc;
|
||||
|
||||
scb* handle =
|
||||
SORT_init(tdbb->tdbb_status_vector,
|
||||
@ -3571,7 +3571,7 @@ static void init_agg_distinct(TDBB tdbb, const jrd_nod* node)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static dsc* lock_record(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
static dsc* lock_record(thread_db* tdbb, jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3648,7 +3648,7 @@ static dsc* lock_record(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static dsc* lock_relation(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
static dsc* lock_relation(thread_db* tdbb, jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3716,7 +3716,7 @@ static dsc* lock_relation(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
#endif
|
||||
|
||||
|
||||
static dsc* lock_state(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
static dsc* lock_state(thread_db* tdbb, jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4109,7 +4109,7 @@ static dsc* divide2(const dsc* desc, VLU value, const jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static dsc* negate_dsc(TDBB tdbb, const dsc* desc, VLU value)
|
||||
static dsc* negate_dsc(thread_db* tdbb, const dsc* desc, VLU value)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4178,7 +4178,7 @@ static dsc* negate_dsc(TDBB tdbb, const dsc* desc, VLU value)
|
||||
}
|
||||
|
||||
|
||||
static dsc* record_version(TDBB tdbb, const jrd_nod* node, VLU impure)
|
||||
static dsc* record_version(thread_db* tdbb, const jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4260,7 +4260,7 @@ static bool reject_duplicate(const UCHAR* data1, const UCHAR* data2, void* user_
|
||||
}
|
||||
|
||||
|
||||
static dsc* scalar(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
static dsc* scalar(thread_db* tdbb, jrd_nod* node, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4310,7 +4310,7 @@ static dsc* scalar(TDBB tdbb, jrd_nod* node, VLU impure)
|
||||
}
|
||||
|
||||
|
||||
static SSHORT sleuth(TDBB tdbb, jrd_nod* node, dsc* desc1, dsc* desc2)
|
||||
static SSHORT sleuth(thread_db* tdbb, jrd_nod* node, dsc* desc1, dsc* desc2)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4409,7 +4409,7 @@ static SSHORT sleuth(TDBB tdbb, jrd_nod* node, dsc* desc1, dsc* desc2)
|
||||
}
|
||||
|
||||
|
||||
static SSHORT string_boolean(TDBB tdbb, jrd_nod* node, dsc* desc1, dsc* desc2, bool computed_invariant)
|
||||
static SSHORT string_boolean(thread_db* tdbb, jrd_nod* node, dsc* desc1, dsc* desc2, bool computed_invariant)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4604,7 +4604,7 @@ static SSHORT string_boolean(TDBB tdbb, jrd_nod* node, dsc* desc1, dsc* desc2, b
|
||||
|
||||
|
||||
static SSHORT string_function(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
jrd_nod* node,
|
||||
SSHORT l1,
|
||||
const UCHAR* p1, SSHORT l2, const UCHAR* p2,
|
||||
@ -4709,7 +4709,7 @@ static SSHORT string_function(
|
||||
|
||||
|
||||
static dsc* substring(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
VLU impure, dsc* value, SLONG offset_arg, SLONG length_arg)
|
||||
{
|
||||
/**************************************
|
||||
@ -4876,7 +4876,7 @@ static dsc* substring(
|
||||
}
|
||||
|
||||
|
||||
static dsc* upcase(TDBB tdbb, const dsc* value, VLU impure)
|
||||
static dsc* upcase(thread_db* tdbb, const dsc* value, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4917,7 +4917,7 @@ static dsc* upcase(TDBB tdbb, const dsc* value, VLU impure)
|
||||
}
|
||||
|
||||
|
||||
static dsc* internal_info(TDBB tdbb, const dsc* value, VLU impure)
|
||||
static dsc* internal_info(thread_db* tdbb, const dsc* value, VLU impure)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
@ -46,7 +46,7 @@
|
||||
#define GDML_RPAREN ')'
|
||||
|
||||
|
||||
USHORT MATCHESNAME(TDBB tdbb,
|
||||
USHORT MATCHESNAME(thread_db* tdbb,
|
||||
TextType obj,
|
||||
const MATCHESTYPE* p1,
|
||||
SSHORT l1_bytes, const MATCHESTYPE* p2, SSHORT l2_bytes)
|
||||
@ -109,7 +109,7 @@ USHORT MATCHESNAME(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
USHORT SLEUTHNAME(TDBB tdbb_dummy,
|
||||
USHORT SLEUTHNAME(thread_db* tdbb_dummy,
|
||||
TextType obj,
|
||||
USHORT flags,
|
||||
const SLEUTHTYPE* search,
|
||||
@ -139,7 +139,7 @@ USHORT SLEUTHNAME(TDBB tdbb_dummy,
|
||||
}
|
||||
|
||||
|
||||
USHORT SLEUTH_MERGE_NAME(TDBB tdbb_dummy,
|
||||
USHORT SLEUTH_MERGE_NAME(thread_db* tdbb_dummy,
|
||||
TextType obj,
|
||||
const SLEUTHTYPE* match,
|
||||
USHORT match_bytes,
|
||||
|
@ -27,29 +27,29 @@
|
||||
#include "../jrd/intl_classes.h"
|
||||
|
||||
// Implemented in evl.cpp
|
||||
dsc* EVL_assign_to(TDBB tdbb, jrd_nod*);
|
||||
sbm** EVL_bitmap(TDBB tdbb, jrd_nod*);
|
||||
BOOLEAN EVL_boolean(TDBB tdbb, jrd_nod*);
|
||||
dsc* EVL_expr(TDBB tdbb, jrd_nod*);
|
||||
bool EVL_field(jrd_rel*, rec*, USHORT, DSC*);
|
||||
USHORT EVL_group(TDBB tdbb, Rsb*, jrd_nod*, USHORT);
|
||||
void EVL_make_value(TDBB tdbb, const dsc*, vlu*);
|
||||
dsc* EVL_assign_to(thread_db* tdbb, jrd_nod*);
|
||||
sbm** EVL_bitmap(thread_db* tdbb, jrd_nod*);
|
||||
BOOLEAN EVL_boolean(thread_db* tdbb, jrd_nod*);
|
||||
dsc* EVL_expr(thread_db* tdbb, jrd_nod*);
|
||||
bool EVL_field(jrd_rel*, rec*, USHORT, dsc*);
|
||||
USHORT EVL_group(thread_db* tdbb, Rsb*, jrd_nod*, USHORT);
|
||||
void EVL_make_value(thread_db* tdbb, const dsc*, vlu*);
|
||||
|
||||
// Obsolete functions to support MATCHES and SLEUTH
|
||||
USHORT EVL_mb_matches(TDBB tdbb, TextType, const UCHAR*, SSHORT, const UCHAR*, SSHORT);
|
||||
USHORT EVL_mb_sleuth_check(TDBB tdbb, TextType, USHORT, const UCHAR*, USHORT,
|
||||
USHORT EVL_mb_matches(thread_db* tdbb, TextType, const UCHAR*, SSHORT, const UCHAR*, SSHORT);
|
||||
USHORT EVL_mb_sleuth_check(thread_db* tdbb, TextType, USHORT, const UCHAR*, USHORT,
|
||||
const UCHAR*,USHORT);
|
||||
USHORT EVL_mb_sleuth_merge(TDBB tdbb, TextType, const UCHAR*, USHORT, const UCHAR*,
|
||||
USHORT EVL_mb_sleuth_merge(thread_db* tdbb, TextType, const UCHAR*, USHORT, const UCHAR*,
|
||||
USHORT, UCHAR*, USHORT);
|
||||
USHORT EVL_nc_matches(TDBB tdbb, TextType, const UCHAR*, SSHORT, const UCHAR*, SSHORT);
|
||||
USHORT EVL_nc_sleuth_check(TDBB tdbb, TextType, USHORT, const UCHAR*, USHORT,
|
||||
USHORT EVL_nc_matches(thread_db* tdbb, TextType, const UCHAR*, SSHORT, const UCHAR*, SSHORT);
|
||||
USHORT EVL_nc_sleuth_check(thread_db* tdbb, TextType, USHORT, const UCHAR*, USHORT,
|
||||
const UCHAR*, USHORT);
|
||||
USHORT EVL_nc_sleuth_merge(TDBB tdbb, TextType, const UCHAR*, USHORT, const UCHAR*,
|
||||
USHORT EVL_nc_sleuth_merge(thread_db* tdbb, TextType, const UCHAR*, USHORT, const UCHAR*,
|
||||
USHORT, UCHAR*, USHORT);
|
||||
USHORT EVL_wc_matches(TDBB tdbb, TextType, const USHORT*, SSHORT, const USHORT*, SSHORT);
|
||||
USHORT EVL_wc_sleuth_check(TDBB tdbb, TextType, USHORT, const USHORT*, USHORT,
|
||||
USHORT EVL_wc_matches(thread_db* tdbb, TextType, const USHORT*, SSHORT, const USHORT*, SSHORT);
|
||||
USHORT EVL_wc_sleuth_check(thread_db* tdbb, TextType, USHORT, const USHORT*, USHORT,
|
||||
const USHORT*, USHORT);
|
||||
USHORT EVL_wc_sleuth_merge(TDBB tdbb, TextType, const USHORT*, USHORT, const USHORT*,
|
||||
USHORT EVL_wc_sleuth_merge(thread_db* tdbb, TextType, const USHORT*, USHORT, const USHORT*,
|
||||
USHORT, USHORT*, USHORT);
|
||||
|
||||
#endif // JRD_EVL_PROTO_H
|
||||
|
138
src/jrd/exe.cpp
138
src/jrd/exe.cpp
@ -99,7 +99,7 @@
|
||||
#include "../jrd/vio_proto.h"
|
||||
#include "../jrd/isc_s_proto.h"
|
||||
|
||||
#include "../jrd/ExecuteStatement.h"
|
||||
#include "../jrd/execute_statement.h"
|
||||
#include "../dsql/dsql_proto.h"
|
||||
#include "../jrd/rpb_chain.h"
|
||||
|
||||
@ -142,40 +142,40 @@ SLONG status_xcp::as_sqlcode() const
|
||||
return gds__sqlcode(status);
|
||||
}
|
||||
|
||||
static void assign_xcp_message(TDBB, STR*, const TEXT*);
|
||||
static void cleanup_rpb(TDBB, RPB *);
|
||||
static jrd_nod* erase(TDBB, jrd_nod*, SSHORT);
|
||||
static void execute_looper(TDBB, jrd_req*, jrd_tra*, enum jrd_req::req_s);
|
||||
static void exec_sql(TDBB, jrd_req*, DSC *);
|
||||
static void execute_procedure(TDBB, jrd_nod*);
|
||||
static jrd_req* execute_triggers(TDBB, trig_vec**, REC, REC, enum jrd_req::req_ta);
|
||||
static jrd_nod* looper(TDBB, jrd_req*, jrd_nod*);
|
||||
static jrd_nod* modify(TDBB, jrd_nod*, SSHORT);
|
||||
static jrd_nod* receive_msg(TDBB, jrd_nod*);
|
||||
static void release_blobs(TDBB, jrd_req*);
|
||||
static void assign_xcp_message(thread_db*, STR*, const TEXT*);
|
||||
static void cleanup_rpb(thread_db*, RPB *);
|
||||
static jrd_nod* erase(thread_db*, jrd_nod*, SSHORT);
|
||||
static void execute_looper(thread_db*, jrd_req*, jrd_tra*, enum jrd_req::req_s);
|
||||
static void exec_sql(thread_db*, jrd_req*, DSC *);
|
||||
static void execute_procedure(thread_db*, jrd_nod*);
|
||||
static jrd_req* execute_triggers(thread_db*, trig_vec**, REC, REC, enum jrd_req::req_ta);
|
||||
static jrd_nod* looper(thread_db*, jrd_req*, jrd_nod*);
|
||||
static jrd_nod* modify(thread_db*, jrd_nod*, SSHORT);
|
||||
static jrd_nod* receive_msg(thread_db*, jrd_nod*);
|
||||
static void release_blobs(thread_db*, jrd_req*);
|
||||
static void release_proc_save_points(jrd_req*);
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
static jrd_nod* seek_rse(TDBB, jrd_req*, jrd_nod*);
|
||||
static void seek_rsb(TDBB, jrd_req*, Rsb*, USHORT, SLONG);
|
||||
static jrd_nod* seek_rse(thread_db*, jrd_req*, jrd_nod*);
|
||||
static void seek_rsb(thread_db*, jrd_req*, Rsb*, USHORT, SLONG);
|
||||
#endif
|
||||
static jrd_nod* selct(TDBB, jrd_nod*);
|
||||
static jrd_nod* send_msg(TDBB, jrd_nod*);
|
||||
static void set_error(TDBB, const xcp_repeat*, jrd_nod*);
|
||||
static jrd_nod* stall(TDBB, jrd_nod*);
|
||||
static jrd_nod* store(TDBB, jrd_nod*, SSHORT);
|
||||
static bool test_and_fixup_error(TDBB, const XCP, jrd_req*);
|
||||
static void trigger_failure(TDBB, jrd_req*);
|
||||
static void validate(TDBB, jrd_nod*);
|
||||
inline void PreModifyEraseTriggers(TDBB, trig_vec**, SSHORT, RPB*, REC, jrd_req::req_ta);
|
||||
static jrd_nod* selct(thread_db*, jrd_nod*);
|
||||
static jrd_nod* send_msg(thread_db*, jrd_nod*);
|
||||
static void set_error(thread_db*, const xcp_repeat*, jrd_nod*);
|
||||
static jrd_nod* stall(thread_db*, jrd_nod*);
|
||||
static jrd_nod* store(thread_db*, jrd_nod*, SSHORT);
|
||||
static bool test_and_fixup_error(thread_db*, const XCP, jrd_req*);
|
||||
static void trigger_failure(thread_db*, jrd_req*);
|
||||
static void validate(thread_db*, jrd_nod*);
|
||||
inline void PreModifyEraseTriggers(thread_db*, trig_vec**, SSHORT, RPB*, REC, jrd_req::req_ta);
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static jrd_nod* find(TDBB, jrd_nod*);
|
||||
static jrd_nod* find_dbkey(TDBB, jrd_nod*);
|
||||
static jrd_nod* find(thread_db*, jrd_nod*);
|
||||
static jrd_nod* find_dbkey(thread_db*, jrd_nod*);
|
||||
static lck* implicit_record_lock(jrd_tra*, RPB *);
|
||||
static jrd_nod* release_bookmark(TDBB, jrd_nod*);
|
||||
static jrd_nod* set_bookmark(TDBB, jrd_nod*);
|
||||
static jrd_nod* set_index(TDBB, jrd_nod*);
|
||||
static jrd_nod* stream(TDBB, jrd_nod*);
|
||||
static jrd_nod* release_bookmark(thread_db*, jrd_nod*);
|
||||
static jrd_nod* set_bookmark(thread_db*, jrd_nod*);
|
||||
static jrd_nod* set_index(thread_db*, jrd_nod*);
|
||||
static jrd_nod* stream(thread_db*, jrd_nod*);
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG_GDS_ALLOC) && defined(PROD_BUILD)
|
||||
@ -235,7 +235,7 @@ private:
|
||||
#endif
|
||||
|
||||
|
||||
void EXE_assignment(TDBB tdbb, jrd_nod* node)
|
||||
void EXE_assignment(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -449,7 +449,7 @@ void EXE_assignment(TDBB tdbb, jrd_nod* node)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
bool EXE_crack(TDBB tdbb, Rsb* rsb, USHORT flags)
|
||||
bool EXE_crack(thread_db* tdbb, Rsb* rsb, USHORT flags)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -480,7 +480,7 @@ bool EXE_crack(TDBB tdbb, Rsb* rsb, USHORT flags)
|
||||
#endif
|
||||
|
||||
|
||||
jrd_req* EXE_find_request(TDBB tdbb, jrd_req* request, bool validate)
|
||||
jrd_req* EXE_find_request(thread_db* tdbb, jrd_req* request, bool validate)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -552,7 +552,7 @@ jrd_req* EXE_find_request(TDBB tdbb, jrd_req* request, bool validate)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
void EXE_mark_crack(TDBB tdbb, Rsb* rsb, USHORT flag)
|
||||
void EXE_mark_crack(thread_db* tdbb, Rsb* rsb, USHORT flag)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -587,7 +587,7 @@ void EXE_mark_crack(TDBB tdbb, Rsb* rsb, USHORT flag)
|
||||
#endif
|
||||
|
||||
|
||||
void EXE_receive(TDBB tdbb,
|
||||
void EXE_receive(thread_db* tdbb,
|
||||
jrd_req* request,
|
||||
USHORT msg,
|
||||
USHORT length,
|
||||
@ -693,7 +693,7 @@ void EXE_receive(TDBB tdbb,
|
||||
|
||||
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
void EXE_seek(TDBB tdbb, jrd_req* request, USHORT direction, ULONG offset)
|
||||
void EXE_seek(thread_db* tdbb, jrd_req* request, USHORT direction, ULONG offset)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -727,7 +727,7 @@ void EXE_seek(TDBB tdbb, jrd_req* request, USHORT direction, ULONG offset)
|
||||
#endif
|
||||
|
||||
|
||||
void EXE_send(TDBB tdbb,
|
||||
void EXE_send(thread_db* tdbb,
|
||||
jrd_req* request,
|
||||
USHORT msg,
|
||||
USHORT length,
|
||||
@ -837,7 +837,7 @@ void EXE_send(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void EXE_start(TDBB tdbb, jrd_req* request, jrd_tra* transaction)
|
||||
void EXE_start(thread_db* tdbb, jrd_req* request, jrd_tra* transaction)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -943,7 +943,7 @@ void EXE_start(TDBB tdbb, jrd_req* request, jrd_tra* transaction)
|
||||
}
|
||||
|
||||
|
||||
void EXE_unwind(TDBB tdbb, jrd_req* request)
|
||||
void EXE_unwind(thread_db* tdbb, jrd_req* request)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -992,7 +992,7 @@ void EXE_unwind(TDBB tdbb, jrd_req* request)
|
||||
}
|
||||
|
||||
|
||||
void assign_xcp_message(TDBB tdbb, STR* xcp_msg, const TEXT* msg)
|
||||
void assign_xcp_message(thread_db* tdbb, STR* xcp_msg, const TEXT* msg)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1017,7 +1017,7 @@ void assign_xcp_message(TDBB tdbb, STR* xcp_msg, const TEXT* msg)
|
||||
|
||||
|
||||
/* CVC: Moved to its own routine, originally in store(). */
|
||||
static void cleanup_rpb(TDBB tdbb, RPB *rpb)
|
||||
static void cleanup_rpb(thread_db* tdbb, RPB *rpb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1077,7 +1077,7 @@ static void cleanup_rpb(TDBB tdbb, RPB *rpb)
|
||||
}
|
||||
}
|
||||
|
||||
inline void PreModifyEraseTriggers(TDBB tdbb,
|
||||
inline void PreModifyEraseTriggers(thread_db* tdbb,
|
||||
trig_vec** trigs,
|
||||
SSHORT which_trig,
|
||||
RPB *rpb,
|
||||
@ -1112,7 +1112,7 @@ inline void PreModifyEraseTriggers(TDBB tdbb,
|
||||
}
|
||||
}
|
||||
|
||||
static jrd_nod* erase(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
static jrd_nod* erase(thread_db* tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1189,7 +1189,7 @@ static jrd_nod* erase(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
NULL,
|
||||
transaction,
|
||||
reinterpret_cast<blk*>(tdbb->tdbb_default),
|
||||
FALSE)))
|
||||
false)))
|
||||
{
|
||||
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
|
||||
}
|
||||
@ -1313,7 +1313,7 @@ static jrd_nod* erase(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
|
||||
|
||||
static void execute_looper(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
jrd_req* request,
|
||||
jrd_tra* transaction, enum jrd_req::req_s next_state)
|
||||
{
|
||||
@ -1359,7 +1359,7 @@ static void execute_looper(
|
||||
}
|
||||
|
||||
|
||||
static void exec_sql(TDBB tdbb, jrd_req* request, DSC* dsc)
|
||||
static void exec_sql(thread_db* tdbb, jrd_req* request, DSC* dsc)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1413,7 +1413,7 @@ static void exec_sql(TDBB tdbb, jrd_req* request, DSC* dsc)
|
||||
}
|
||||
|
||||
|
||||
static void execute_procedure(TDBB tdbb, jrd_nod* node)
|
||||
static void execute_procedure(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1543,7 +1543,7 @@ static void execute_procedure(TDBB tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static jrd_req* execute_triggers(TDBB tdbb,
|
||||
static jrd_req* execute_triggers(thread_db* tdbb,
|
||||
trig_vec** triggers,
|
||||
REC old_rec,
|
||||
REC new_rec,
|
||||
@ -1619,7 +1619,7 @@ static jrd_req* execute_triggers(TDBB tdbb,
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static jrd_nod* find(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* find(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1701,7 +1701,7 @@ static jrd_nod* find(TDBB tdbb, jrd_nod* node)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static jrd_nod* find_dbkey(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* find_dbkey(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1756,7 +1756,7 @@ static lck* implicit_record_lock(jrd_tra* transaction, RPB * rpb)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
DEV_BLKCHK(transaction, type_tra);
|
||||
|
||||
@ -1785,7 +1785,7 @@ static lck* implicit_record_lock(jrd_tra* transaction, RPB * rpb)
|
||||
#endif
|
||||
|
||||
|
||||
static jrd_nod* looper(TDBB tdbb, jrd_req* request, jrd_nod* in_node)
|
||||
static jrd_nod* looper(thread_db* tdbb, jrd_req* request, jrd_nod* in_node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2857,7 +2857,7 @@ static jrd_nod* looper(TDBB tdbb, jrd_req* request, jrd_nod* in_node)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* modify(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
static jrd_nod* modify(thread_db* tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2915,7 +2915,7 @@ static jrd_nod* modify(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
NULL,
|
||||
transaction,
|
||||
reinterpret_cast<blk*>(tdbb->tdbb_default),
|
||||
FALSE)))
|
||||
false)))
|
||||
{
|
||||
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
|
||||
}
|
||||
@ -3158,7 +3158,7 @@ static jrd_nod* modify(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
return node->nod_arg[e_mod_statement];
|
||||
}
|
||||
|
||||
static jrd_nod* receive_msg(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* receive_msg(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3194,7 +3194,7 @@ static jrd_nod* receive_msg(TDBB tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static void release_blobs(TDBB tdbb, jrd_req* request)
|
||||
static void release_blobs(thread_db* tdbb, jrd_req* request)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3237,7 +3237,7 @@ static void release_blobs(TDBB tdbb, jrd_req* request)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static jrd_nod* release_bookmark(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* release_bookmark(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3289,7 +3289,7 @@ static void release_proc_save_points(jrd_req* request)
|
||||
|
||||
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
static jrd_nod* seek_rse(TDBB tdbb, jrd_req* request, jrd_nod* node)
|
||||
static jrd_nod* seek_rse(thread_db* tdbb, jrd_req* request, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3329,7 +3329,7 @@ static jrd_nod* seek_rse(TDBB tdbb, jrd_req* request, jrd_nod* node)
|
||||
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
static void seek_rsb(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
jrd_req* request, Rsb* rsb, USHORT direction, SLONG offset)
|
||||
{
|
||||
/**************************************
|
||||
@ -3502,7 +3502,7 @@ static void seek_rsb(
|
||||
#endif
|
||||
|
||||
|
||||
static jrd_nod* selct(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* selct(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3539,7 +3539,7 @@ static jrd_nod* selct(TDBB tdbb, jrd_nod* node)
|
||||
|
||||
|
||||
|
||||
static jrd_nod* send_msg(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* send_msg(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3576,7 +3576,7 @@ static jrd_nod* send_msg(TDBB tdbb, jrd_nod* node)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static jrd_nod* set_bookmark(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* set_bookmark(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3628,7 +3628,7 @@ static jrd_nod* set_bookmark(TDBB tdbb, jrd_nod* node)
|
||||
#endif
|
||||
|
||||
|
||||
static void set_error(TDBB tdbb, const xcp_repeat* exception, jrd_nod* msg_node)
|
||||
static void set_error(thread_db* tdbb, const xcp_repeat* exception, jrd_nod* msg_node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3729,7 +3729,7 @@ static void set_error(TDBB tdbb, const xcp_repeat* exception, jrd_nod* msg_node)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static jrd_nod* set_index(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* set_index(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3777,7 +3777,7 @@ static jrd_nod* set_index(TDBB tdbb, jrd_nod* node)
|
||||
#endif
|
||||
|
||||
|
||||
static jrd_nod* stall(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* stall(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3813,7 +3813,7 @@ static jrd_nod* stall(TDBB tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* store(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
static jrd_nod* store(thread_db* tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3977,7 +3977,7 @@ static jrd_nod* store(TDBB tdbb, jrd_nod* node, SSHORT which_trig)
|
||||
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
static jrd_nod* stream(TDBB tdbb, jrd_nod* node)
|
||||
static jrd_nod* stream(thread_db* tdbb, jrd_nod* node)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4014,7 +4014,7 @@ static jrd_nod* stream(TDBB tdbb, jrd_nod* node)
|
||||
#endif
|
||||
|
||||
|
||||
static bool test_and_fixup_error(TDBB tdbb, XCP conditions, jrd_req* request)
|
||||
static bool test_and_fixup_error(thread_db* tdbb, XCP conditions, jrd_req* request)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4078,7 +4078,7 @@ static bool test_and_fixup_error(TDBB tdbb, XCP conditions, jrd_req* request)
|
||||
}
|
||||
|
||||
|
||||
static void trigger_failure(TDBB tdbb, jrd_req* trigger)
|
||||
static void trigger_failure(thread_db* tdbb, jrd_req* trigger)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -4134,7 +4134,7 @@ static void trigger_failure(TDBB tdbb, jrd_req* trigger)
|
||||
}
|
||||
|
||||
|
||||
static void validate(TDBB tdbb, jrd_nod* list)
|
||||
static void validate(thread_db* tdbb, jrd_nod* list)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
@ -20,7 +20,7 @@
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*
|
||||
* 2001.07.28: Added rse_skip to struct rse to support LIMIT.
|
||||
* 2001.07.28: Added rse_skip to class rse to support LIMIT.
|
||||
* 2002.09.28 Dmitry Yemanov: Reworked internal_info stuff, enhanced
|
||||
* exception handling in SPs/triggers,
|
||||
* implemented ROWS_AFFECTED system variable
|
||||
@ -59,10 +59,14 @@ DEFINE_TRACE_ROUTINE(cmp_trace);
|
||||
#define CMP_TRACE(args) /* nothing */
|
||||
#endif
|
||||
|
||||
class jrd_rel;
|
||||
class jrd_nod;
|
||||
struct sort_key_def;
|
||||
|
||||
// NOTE: The definition of structures rse and lit must be defined in
|
||||
// exactly the same way as structure jrd_nod through item nod_count.
|
||||
// Now, inheritance takes care of those common data members.
|
||||
class jrd_node_base : public pool_alloc_rpt<class jrd_nod*, type_nod>
|
||||
class jrd_node_base : public pool_alloc_rpt<jrd_nod*, type_nod>
|
||||
{
|
||||
public:
|
||||
jrd_nod* nod_parent;
|
||||
@ -163,7 +167,7 @@ public:
|
||||
SCHAR nod_scale;
|
||||
USHORT nod_count;
|
||||
dsc asb_desc;
|
||||
struct skd* asb_key_desc; /* for the aggregate */
|
||||
sort_key_def* asb_key_desc; /* for the aggregate */
|
||||
UCHAR asb_key_data[1];
|
||||
};
|
||||
typedef asb* ASB;
|
||||
@ -540,10 +544,10 @@ struct csb_repeat
|
||||
USHORT csb_flags;
|
||||
USHORT csb_indices; /* Number of indices */
|
||||
|
||||
struct jrd_rel* csb_relation;
|
||||
jrd_rel* csb_relation;
|
||||
struct str* csb_alias; /* SQL alias name for this instance of relation */
|
||||
class jrd_prc* csb_procedure;
|
||||
struct jrd_rel* csb_view; /* parent view */
|
||||
jrd_rel* csb_view; /* parent view */
|
||||
|
||||
struct idx* csb_idx; /* Packed description of indices */
|
||||
struct str* csb_idx_allocation; /* Memory allocated to hold index descriptions */
|
||||
|
@ -26,19 +26,19 @@
|
||||
|
||||
class jrd_req;
|
||||
|
||||
void EXE_assignment(TDBB, struct jrd_nod*);
|
||||
jrd_req* EXE_find_request(TDBB, jrd_req *, bool);
|
||||
void EXE_receive(TDBB, jrd_req*, USHORT, USHORT, UCHAR*);
|
||||
void EXE_send(TDBB, jrd_req*, USHORT, USHORT, UCHAR *);
|
||||
void EXE_start(TDBB, jrd_req*, class jrd_tra *);
|
||||
void EXE_unwind(TDBB, jrd_req*);
|
||||
void EXE_assignment(thread_db*, class jrd_nod*);
|
||||
jrd_req* EXE_find_request(thread_db*, jrd_req *, bool);
|
||||
void EXE_receive(thread_db*, jrd_req*, USHORT, USHORT, UCHAR*);
|
||||
void EXE_send(thread_db*, jrd_req*, USHORT, USHORT, UCHAR *);
|
||||
void EXE_start(thread_db*, jrd_req*, class jrd_tra *);
|
||||
void EXE_unwind(thread_db*, jrd_req*);
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
void EXE_seek(TDBB, jrd_req*, USHORT, ULONG);
|
||||
void EXE_seek(thread_db*, jrd_req*, USHORT, ULONG);
|
||||
#endif
|
||||
|
||||
#ifdef PC_ENGINE
|
||||
bool EXE_crack(TDBB, Rsb*, USHORT);
|
||||
void EXE_mark_crack(TDBB, Rsb*, USHORT);
|
||||
bool EXE_crack(thread_db*, Rsb*, USHORT);
|
||||
void EXE_mark_crack(thread_db*, Rsb*, USHORT);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -232,7 +232,7 @@ int EXT_get(Rsb* rsb)
|
||||
* Get a record from an external file.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
jrd_rel* relation = rsb->rsb_relation;
|
||||
external_file* file = relation->rel_file;
|
||||
@ -325,7 +325,7 @@ void EXT_open(Rsb* rsb)
|
||||
* Open a record stream for an external file.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
jrd_rel* relation = rsb->rsb_relation;
|
||||
jrd_req* request = tdbb->tdbb_request;
|
||||
@ -361,7 +361,7 @@ opt::opt_repeat *tail, *opt_end;
|
||||
SSHORT i, size;
|
||||
*/
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
Csb* csb = opt->opt_csb;
|
||||
csb_repeat* csb_tail = &csb->csb_rpt[stream];
|
||||
|
@ -654,7 +654,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, ctl* control)
|
||||
USHORT ctlaux_buffer1_unused; /* unused bytes in ctlaux_buffer1 */
|
||||
};
|
||||
|
||||
TDBB tdbb = NULL;
|
||||
thread_db* tdbb = NULL;
|
||||
/* Note: Cannot pass tdbb without API change to user filters */
|
||||
|
||||
#define EXP_SCALE 128 /* to keep expansion non-floating */
|
||||
|
@ -30,7 +30,7 @@
|
||||
* 2003.08.10 Claudio Valderrama: Fix SF Bugs #544132 and #728839.
|
||||
*/
|
||||
/*
|
||||
$Id: fun.epp,v 1.38 2004-03-07 07:58:40 robocop Exp $
|
||||
$Id: fun.epp,v 1.39 2004-03-11 05:03:57 robocop Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -122,7 +122,7 @@ void FUN_evaluate(FUN function, jrd_nod* node, VLU value)
|
||||
SLONG args[MAX_UDF_ARGUMENTS + 1];
|
||||
UCHAR temp[800];
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
// Start by constructing argument list
|
||||
str* temp_string;
|
||||
@ -745,7 +745,7 @@ void FUN_evaluate(FUN function, jrd_nod* node, VLU value)
|
||||
}
|
||||
|
||||
|
||||
void FUN_fini( TDBB tdbb)
|
||||
void FUN_fini( thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -791,7 +791,7 @@ FUN FUN_lookup_function(const TEXT* name, bool ShowAccessError)
|
||||
* Lookup function by name.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
/* Start by looking for already defined symbol */
|
||||
@ -956,7 +956,7 @@ FUN FUN_resolve(Csb* csb, FUN function, jrd_nod* args)
|
||||
**************************************/
|
||||
DSC arg;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
fun* best = NULL;
|
||||
int best_score = 0;
|
||||
@ -1030,7 +1030,7 @@ static void blob_put_segment( blb* blob, const UCHAR* buffer, USHORT length)
|
||||
engine mutex */
|
||||
|
||||
THREAD_ENTER;
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
BLB_put_segment(tdbb, blob, buffer, length);
|
||||
THREAD_EXIT;
|
||||
}
|
||||
@ -1057,7 +1057,7 @@ static SSHORT blob_get_segment(
|
||||
**************************************/
|
||||
/* add thread enter and thread_exit wrappers */
|
||||
THREAD_ENTER;
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
*return_length = BLB_get_segment(tdbb, blob, buffer, length);
|
||||
THREAD_EXIT;
|
||||
|
||||
@ -1088,7 +1088,7 @@ static SLONG get_scalar_array(fun_repeat* arg,
|
||||
* Return length of array desc.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
/* Get first the array descriptor, then the array */
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#define JRD_FUN_PROTO_H
|
||||
|
||||
void FUN_evaluate(fun*, jrd_nod*, vlu*);
|
||||
void FUN_fini(tdbb*);
|
||||
void FUN_fini(thread_db*);
|
||||
void FUN_init(void);
|
||||
fun* FUN_lookup_function(const TEXT*, bool ShowAccessError);
|
||||
fun* FUN_resolve(class Csb*, fun*, jrd_nod*);
|
||||
|
@ -72,24 +72,24 @@
|
||||
|
||||
DATABASE DB = STATIC "yachts.lnk";
|
||||
|
||||
static void define_default_class(TDBB, const TEXT*, TEXT*, const UCHAR*, USHORT);
|
||||
static void define_default_class(thread_db*, const TEXT*, TEXT*, const UCHAR*, USHORT);
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
static void delete_security_class(TDBB, TEXT *);
|
||||
static void delete_security_class(thread_db*, TEXT *);
|
||||
#endif
|
||||
static void finish_security_class(UCHAR **, USHORT, STR *, ULONG *);
|
||||
static void get_object_info(TDBB, const TEXT*, SSHORT,
|
||||
static void get_object_info(thread_db*, const TEXT*, SSHORT,
|
||||
TEXT*, TEXT*, TEXT*, bool*);
|
||||
static USHORT get_public_privs(TDBB, TEXT *, SSHORT);
|
||||
static void get_user_privs(TDBB, UCHAR **, TEXT *,
|
||||
static USHORT get_public_privs(thread_db*, TEXT *, SSHORT);
|
||||
static void get_user_privs(thread_db*, UCHAR **, TEXT *,
|
||||
SSHORT, TEXT *, USHORT, STR *, ULONG *);
|
||||
static void grant_user(UCHAR**, TEXT*, SSHORT, USHORT, STR*, ULONG*);
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
static void grant_views(UCHAR **, USHORT, STR *, ULONG *);
|
||||
static void purge_default_class(TEXT *, SSHORT);
|
||||
#endif
|
||||
static USHORT save_field_privileges(TDBB, STR *, UCHAR **,
|
||||
static USHORT save_field_privileges(thread_db*, STR *, UCHAR **,
|
||||
TEXT *, TEXT *, USHORT, ULONG *);
|
||||
static void save_security_class(TDBB, const TEXT*, const UCHAR*, USHORT);
|
||||
static void save_security_class(thread_db*, const TEXT*, const UCHAR*, USHORT);
|
||||
static USHORT trans_sql_priv(TEXT *);
|
||||
static SLONG squeeze_acl(UCHAR *, UCHAR **, TEXT *, SSHORT);
|
||||
static bool check_string(const TEXT*, const TEXT*);
|
||||
@ -129,7 +129,7 @@ STR GRANT_realloc_acl(STR start_ptr,
|
||||
}
|
||||
|
||||
|
||||
bool GRANT_privileges( TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
bool GRANT_privileges( thread_db* tdbb, SSHORT phase, Deferred_work* work,
|
||||
jrd_tra*) // unused param, makes dfw.epp happy
|
||||
{
|
||||
/**************************************
|
||||
@ -301,7 +301,7 @@ bool GRANT_privileges( TDBB tdbb, SSHORT phase, Deferred_work* work,
|
||||
|
||||
|
||||
static void define_default_class(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
const TEXT* relation_name,
|
||||
TEXT* default_class,
|
||||
const UCHAR* buffer, USHORT length)
|
||||
@ -364,7 +364,7 @@ static void define_default_class(
|
||||
}
|
||||
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
static void delete_security_class( TDBB tdbb, TEXT * s_class)
|
||||
static void delete_security_class( thread_db* tdbb, TEXT * s_class)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -421,7 +421,7 @@ static void finish_security_class(UCHAR** acl_ptr,
|
||||
|
||||
|
||||
static USHORT get_public_privs(
|
||||
TDBB tdbb, TEXT * object_name, SSHORT obj_type)
|
||||
thread_db* tdbb, TEXT * object_name, SSHORT obj_type)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -460,7 +460,7 @@ static USHORT get_public_privs(
|
||||
|
||||
|
||||
static void get_object_info(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
const TEXT* object_name,
|
||||
SSHORT obj_type,
|
||||
TEXT* owner,
|
||||
@ -530,7 +530,7 @@ static void get_object_info(
|
||||
}
|
||||
|
||||
|
||||
static void get_user_privs(TDBB tdbb,
|
||||
static void get_user_privs(thread_db* tdbb,
|
||||
UCHAR** acl_ptr,
|
||||
TEXT* object_name,
|
||||
SSHORT obj_type,
|
||||
@ -705,7 +705,7 @@ static void purge_default_class( TEXT * object_name, SSHORT obj_type)
|
||||
* default security class for this relation.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
BLK request = CMP_find_request(tdbb, irq_grant8, IRQ_REQUESTS);
|
||||
@ -742,7 +742,7 @@ static void purge_default_class( TEXT * object_name, SSHORT obj_type)
|
||||
|
||||
|
||||
static USHORT save_field_privileges(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
STR * str_relation_buffer,
|
||||
UCHAR ** acl_ptr,
|
||||
TEXT * relation_name, TEXT * owner, USHORT public_priv, ULONG * length_ptr)
|
||||
@ -1023,7 +1023,7 @@ TEXT * relation_name, TEXT * owner, USHORT public_priv, ULONG * length_ptr)
|
||||
}
|
||||
|
||||
|
||||
static void save_security_class(TDBB tdbb,
|
||||
static void save_security_class(thread_db* tdbb,
|
||||
const TEXT* s_class,
|
||||
const UCHAR* buffer,
|
||||
USHORT length)
|
||||
|
@ -24,7 +24,7 @@
|
||||
#ifndef JRD_GRANT_PROTO_H
|
||||
#define JRD_GRANT_PROTO_H
|
||||
|
||||
bool GRANT_privileges(TDBB, SSHORT, class Deferred_work*, jrd_tra*);
|
||||
bool GRANT_privileges(thread_db*, SSHORT, class Deferred_work*, jrd_tra*);
|
||||
STR GRANT_realloc_acl(STR, UCHAR **, ULONG *);
|
||||
|
||||
#endif // JRD_GRANT_PROTO_H
|
||||
|
@ -77,18 +77,18 @@ typedef struct ifl {
|
||||
USHORT ifl_key_length;
|
||||
} *IFL;
|
||||
|
||||
static IDX_E check_duplicates(TDBB, REC, IDX *, IIB *, jrd_rel*);
|
||||
static IDX_E check_foreign_key(TDBB, REC, jrd_rel*, jrd_tra*, IDX *, jrd_rel**, USHORT *);
|
||||
static IDX_E check_partner_index(TDBB, jrd_rel*, REC, jrd_tra*, IDX *, jrd_rel*, SSHORT);
|
||||
static IDX_E check_duplicates(thread_db*, REC, IDX *, IIB *, jrd_rel*);
|
||||
static IDX_E check_foreign_key(thread_db*, REC, jrd_rel*, jrd_tra*, IDX *, jrd_rel**, USHORT *);
|
||||
static IDX_E check_partner_index(thread_db*, jrd_rel*, REC, jrd_tra*, IDX *, jrd_rel*, SSHORT);
|
||||
static bool duplicate_key(const UCHAR*, const UCHAR*, void*);
|
||||
static SLONG get_root_page(TDBB, jrd_rel*);
|
||||
static SLONG get_root_page(thread_db*, jrd_rel*);
|
||||
static int index_block_flush(void *ast_object);
|
||||
static IDX_E insert_key(TDBB, jrd_rel*, REC, jrd_tra*, WIN *, IIB *, jrd_rel**, USHORT *);
|
||||
static IDX_E insert_key(thread_db*, jrd_rel*, REC, jrd_tra*, WIN *, IIB *, jrd_rel**, USHORT *);
|
||||
static bool key_equal(const KEY*, const KEY*);
|
||||
static void signal_index_deletion(TDBB, jrd_rel*, USHORT);
|
||||
static void signal_index_deletion(thread_db*, jrd_rel*, USHORT);
|
||||
|
||||
|
||||
void IDX_check_access(TDBB tdbb, Csb* csb, jrd_rel* view, jrd_rel* relation,
|
||||
void IDX_check_access(thread_db* tdbb, Csb* csb, jrd_rel* view, jrd_rel* relation,
|
||||
jrd_fld* field)
|
||||
{
|
||||
/**************************************
|
||||
@ -162,7 +162,7 @@ void IDX_check_access(TDBB tdbb, Csb* csb, jrd_rel* view, jrd_rel* relation,
|
||||
|
||||
|
||||
void IDX_create_index(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
jrd_rel* relation,
|
||||
IDX* idx,
|
||||
const TEXT* index_name,
|
||||
@ -201,7 +201,7 @@ void IDX_create_index(
|
||||
secondary.rpb_relation = relation;
|
||||
primary.rpb_relation = relation;
|
||||
primary.rpb_number = -1;
|
||||
primary.rpb_window.win_flags = secondary.rpb_window.win_flags = 0;
|
||||
//primary.rpb_window.win_flags = secondary.rpb_window.win_flags = 0; redundant
|
||||
|
||||
const USHORT key_length = ROUNDUP(BTR_key_length(relation, idx), sizeof(SLONG));
|
||||
|
||||
@ -225,7 +225,7 @@ void IDX_create_index(
|
||||
|
||||
bool key_is_null = false;
|
||||
|
||||
skd key_desc;
|
||||
sort_key_def key_desc;
|
||||
key_desc.skd_dtype = SKD_bytes;
|
||||
key_desc.skd_flags = SKD_ascending;
|
||||
key_desc.skd_length = key_length;
|
||||
@ -409,7 +409,7 @@ void IDX_create_index(
|
||||
|
||||
#ifdef SUPERSERVER
|
||||
if (--tdbb->tdbb_quantum < 0 && !tdbb->tdbb_inhibit)
|
||||
cancel = JRD_reschedule(tdbb, 0, false) == TRUE;
|
||||
cancel = JRD_reschedule(tdbb, 0, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -438,7 +438,7 @@ void IDX_create_index(
|
||||
}
|
||||
|
||||
|
||||
IDB IDX_create_index_block(TDBB tdbb, jrd_rel* relation, USHORT id)
|
||||
IDB IDX_create_index_block(thread_db* tdbb, jrd_rel* relation, USHORT id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -482,7 +482,7 @@ IDB IDX_create_index_block(TDBB tdbb, jrd_rel* relation, USHORT id)
|
||||
}
|
||||
|
||||
|
||||
void IDX_delete_index(TDBB tdbb, jrd_rel* relation, USHORT id)
|
||||
void IDX_delete_index(thread_db* tdbb, jrd_rel* relation, USHORT id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -505,7 +505,7 @@ void IDX_delete_index(TDBB tdbb, jrd_rel* relation, USHORT id)
|
||||
}
|
||||
|
||||
|
||||
void IDX_delete_indices(TDBB tdbb, jrd_rel* relation)
|
||||
void IDX_delete_indices(thread_db* tdbb, jrd_rel* relation)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -534,7 +534,7 @@ void IDX_delete_indices(TDBB tdbb, jrd_rel* relation)
|
||||
}
|
||||
|
||||
|
||||
IDX_E IDX_erase(TDBB tdbb,
|
||||
IDX_E IDX_erase(thread_db* tdbb,
|
||||
RPB * rpb,
|
||||
jrd_tra* transaction, jrd_rel** bad_relation, USHORT * bad_index)
|
||||
{
|
||||
@ -573,7 +573,7 @@ IDX_E IDX_erase(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void IDX_garbage_collect(TDBB tdbb, RPB * rpb, LLS going, LLS staying)
|
||||
void IDX_garbage_collect(thread_db* tdbb, RPB * rpb, LLS going, LLS staying)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -647,7 +647,7 @@ void IDX_garbage_collect(TDBB tdbb, RPB * rpb, LLS going, LLS staying)
|
||||
}
|
||||
|
||||
|
||||
IDX_E IDX_modify(TDBB tdbb,
|
||||
IDX_E IDX_modify(thread_db* tdbb,
|
||||
RPB * org_rpb,
|
||||
RPB * new_rpb,
|
||||
jrd_tra* transaction, jrd_rel** bad_relation, USHORT * bad_index)
|
||||
@ -680,12 +680,14 @@ IDX_E IDX_modify(TDBB tdbb,
|
||||
WIN window(-1);
|
||||
|
||||
while (BTR_next_index
|
||||
(tdbb, org_rpb->rpb_relation, transaction, &idx, &window)) {
|
||||
(tdbb, org_rpb->rpb_relation, transaction, &idx, &window))
|
||||
{
|
||||
*bad_index = idx.idx_id;
|
||||
*bad_relation = new_rpb->rpb_relation;
|
||||
if ( (error_code =
|
||||
BTR_key(tdbb, new_rpb->rpb_relation, new_rpb->rpb_record, &idx,
|
||||
&key1, 0)) ) {
|
||||
&key1, 0)) )
|
||||
{
|
||||
CCH_RELEASE(tdbb, &window);
|
||||
break;
|
||||
}
|
||||
@ -695,7 +697,10 @@ IDX_E IDX_modify(TDBB tdbb,
|
||||
if (( error_code =
|
||||
insert_key(tdbb, new_rpb->rpb_relation, new_rpb->rpb_record,
|
||||
transaction, &window, &insertion, bad_relation,
|
||||
bad_index)) ) return error_code;
|
||||
bad_index)) )
|
||||
{
|
||||
return error_code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -703,7 +708,7 @@ IDX_E IDX_modify(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
IDX_E IDX_modify_check_constraints(TDBB tdbb,
|
||||
IDX_E IDX_modify_check_constraints(thread_db* tdbb,
|
||||
RPB * org_rpb,
|
||||
RPB * new_rpb,
|
||||
jrd_tra* transaction,
|
||||
@ -779,7 +784,7 @@ IDX_E IDX_modify_check_constraints(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void IDX_statistics(TDBB tdbb, jrd_rel* relation, USHORT id, SelectivityList& selectivity)
|
||||
void IDX_statistics(thread_db* tdbb, jrd_rel* relation, USHORT id, SelectivityList& selectivity)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -799,7 +804,7 @@ void IDX_statistics(TDBB tdbb, jrd_rel* relation, USHORT id, SelectivityList& se
|
||||
}
|
||||
|
||||
|
||||
IDX_E IDX_store(TDBB tdbb,
|
||||
IDX_E IDX_store(thread_db* tdbb,
|
||||
RPB * rpb,
|
||||
jrd_tra* transaction, jrd_rel** bad_relation, USHORT * bad_index)
|
||||
{
|
||||
@ -855,7 +860,7 @@ IDX_E IDX_store(TDBB tdbb,
|
||||
|
||||
|
||||
static IDX_E check_duplicates(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
REC record,
|
||||
IDX * record_idx,
|
||||
IIB * insertion, jrd_rel* relation_2)
|
||||
@ -871,7 +876,6 @@ static IDX_E check_duplicates(
|
||||
* a unique index or a foreign key.
|
||||
*
|
||||
**************************************/
|
||||
RPB rpb;
|
||||
DSC desc1, desc2;
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
@ -879,10 +883,11 @@ static IDX_E check_duplicates(
|
||||
IDX_E result = idx_e_ok;
|
||||
IDX* insertion_idx = insertion->iib_descriptor;
|
||||
|
||||
RPB rpb;
|
||||
rpb.rpb_number = -1;
|
||||
rpb.rpb_relation = insertion->iib_relation;
|
||||
rpb.rpb_record = NULL;
|
||||
rpb.rpb_window.win_flags = 0;
|
||||
// rpb.rpb_window.win_flags = 0; redundant.
|
||||
jrd_rel* relation_1 = insertion->iib_relation;
|
||||
|
||||
while (SBM_next
|
||||
@ -958,7 +963,7 @@ static IDX_E check_duplicates(
|
||||
|
||||
|
||||
static IDX_E check_foreign_key(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
REC record,
|
||||
jrd_rel* relation,
|
||||
jrd_tra* transaction,
|
||||
@ -1036,7 +1041,7 @@ static IDX_E check_foreign_key(
|
||||
|
||||
|
||||
static IDX_E check_partner_index(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
jrd_rel* relation,
|
||||
REC record,
|
||||
jrd_tra* transaction,
|
||||
@ -1157,7 +1162,7 @@ static bool duplicate_key(const UCHAR* record1, const UCHAR* record2, void* ifl_
|
||||
}
|
||||
|
||||
|
||||
static SLONG get_root_page(TDBB tdbb, jrd_rel* relation)
|
||||
static SLONG get_root_page(thread_db* tdbb, jrd_rel* relation)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1197,7 +1202,7 @@ static int index_block_flush(void *ast_object)
|
||||
*
|
||||
**************************************/
|
||||
IDB index_block = reinterpret_cast<IDB>(ast_object);
|
||||
struct tdbb thd_context, *tdbb;
|
||||
thread_db thd_context, *tdbb;
|
||||
|
||||
/* Since this routine will be called asynchronously, we must establish
|
||||
a thread context. */
|
||||
@ -1236,7 +1241,7 @@ static int index_block_flush(void *ast_object)
|
||||
|
||||
|
||||
static IDX_E insert_key(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
jrd_rel* relation,
|
||||
REC record,
|
||||
jrd_tra* transaction,
|
||||
@ -1332,7 +1337,7 @@ static bool key_equal(const KEY* key1, const KEY* key2)
|
||||
}
|
||||
|
||||
|
||||
static void signal_index_deletion(TDBB tdbb, jrd_rel* relation, USHORT id)
|
||||
static void signal_index_deletion(thread_db* tdbb, jrd_rel* relation, USHORT id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
@ -28,26 +28,28 @@
|
||||
#include "../jrd/exe.h"
|
||||
#include "../jrd/req.h"
|
||||
|
||||
class jrd_rel;
|
||||
class jrd_tra;
|
||||
struct rpb;
|
||||
|
||||
void IDX_check_access(TDBB, class Csb *, struct jrd_rel *, struct jrd_rel *,
|
||||
void IDX_check_access(thread_db*, class Csb *, jrd_rel*, jrd_rel*,
|
||||
class jrd_fld*);
|
||||
void IDX_create_index(TDBB, struct jrd_rel*, struct idx*, const TEXT*,
|
||||
USHORT*, class jrd_tra*, SelectivityList&);
|
||||
struct idb* IDX_create_index_block(TDBB, struct jrd_rel *, USHORT);
|
||||
void IDX_delete_index(TDBB, struct jrd_rel *, USHORT);
|
||||
void IDX_delete_indices(TDBB, struct jrd_rel *);
|
||||
enum idx_e IDX_erase(TDBB, struct rpb *, class jrd_tra *, struct jrd_rel **,
|
||||
void IDX_create_index(thread_db*, jrd_rel*, struct idx*, const TEXT*,
|
||||
USHORT*, jrd_tra*, SelectivityList&);
|
||||
struct idb* IDX_create_index_block(thread_db*, jrd_rel*, USHORT);
|
||||
void IDX_delete_index(thread_db*, jrd_rel*, USHORT);
|
||||
void IDX_delete_indices(thread_db*, jrd_rel*);
|
||||
enum idx_e IDX_erase(thread_db*, rpb*, jrd_tra*, jrd_rel**,
|
||||
USHORT *);
|
||||
void IDX_garbage_collect(TDBB, struct rpb *, class lls*,
|
||||
class lls*);
|
||||
enum idx_e IDX_modify(struct tdbb *, struct rpb *, struct rpb *,
|
||||
class jrd_tra *, struct jrd_rel **, USHORT *);
|
||||
enum idx_e IDX_modify_check_constraints(TDBB, struct rpb *, struct rpb *,
|
||||
class jrd_tra *, struct jrd_rel **,
|
||||
void IDX_garbage_collect(thread_db*, rpb*, class lls*, class lls*);
|
||||
enum idx_e IDX_modify(thread_db*, rpb*, rpb*,
|
||||
jrd_tra*, jrd_rel**, USHORT *);
|
||||
enum idx_e IDX_modify_check_constraints(thread_db*, rpb*, rpb*,
|
||||
jrd_tra*, jrd_rel**,
|
||||
USHORT *);
|
||||
void IDX_statistics(TDBB, struct jrd_rel *, USHORT, SelectivityList&);
|
||||
enum idx_e IDX_store(struct tdbb *, struct rpb *, class jrd_tra *,
|
||||
struct jrd_rel **, USHORT *);
|
||||
void IDX_statistics(thread_db*, jrd_rel*, USHORT, SelectivityList&);
|
||||
enum idx_e IDX_store(thread_db*, rpb*, jrd_tra*,
|
||||
jrd_rel**, USHORT *);
|
||||
|
||||
|
||||
#endif // JRD_IDX_PROTO_H
|
||||
|
@ -206,7 +206,7 @@ int INF_database_info(const SCHAR* items,
|
||||
SLONG err_val;
|
||||
bool header_refreshed = false;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
CHECK_DBB(dbb);
|
||||
|
||||
@ -1020,7 +1020,7 @@ static USHORT get_counts(USHORT count_id, SCHAR* buffer, USHORT length)
|
||||
* Return operation counts for relation.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
vcl* vector = tdbb->tdbb_attachment->att_counts[count_id];
|
||||
if (!vector)
|
||||
|
@ -71,19 +71,19 @@ static void add_global_fields(USHORT);
|
||||
static void add_index_set(Database*, bool, USHORT, USHORT);
|
||||
static void add_new_triggers(USHORT, USHORT);
|
||||
static void add_relation_fields(USHORT);
|
||||
static void add_security_to_sys_rel(TDBB, const TEXT*, const TEXT*, const UCHAR*,
|
||||
static void add_security_to_sys_rel(thread_db*, const TEXT*, const TEXT*, const UCHAR*,
|
||||
const SSHORT);
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
static void add_trigger(TEXT*, BLK*, BLK*);
|
||||
#endif
|
||||
//static void add_user_priv(TDBB, TEXT*, TEXT*, TEXT*, TEXT);
|
||||
static void modify_relation_field(TDBB, const UCHAR*, const UCHAR*, BLK*);
|
||||
static void store_generator(TDBB, const gen*, BLK*);
|
||||
static void store_global_field(TDBB, const gfld*, BLK*);
|
||||
static void store_intlnames(TDBB, Database*);
|
||||
static void store_message(TDBB, const trigger_msg*, BLK*);
|
||||
static void store_relation_field(TDBB, const UCHAR*, const UCHAR*, int, BLK*, bool);
|
||||
static void store_trigger(TDBB, const jrd_trg*, BLK*);
|
||||
//static void add_user_priv(thread_db*, TEXT*, TEXT*, TEXT*, TEXT);
|
||||
static void modify_relation_field(thread_db*, const UCHAR*, const UCHAR*, BLK*);
|
||||
static void store_generator(thread_db*, const gen*, BLK*);
|
||||
static void store_global_field(thread_db*, const gfld*, BLK*);
|
||||
static void store_intlnames(thread_db*, Database*);
|
||||
static void store_message(thread_db*, const trigger_msg*, BLK*);
|
||||
static void store_relation_field(thread_db*, const UCHAR*, const UCHAR*, int, BLK*, bool);
|
||||
static void store_trigger(thread_db*, const jrd_trg*, BLK*);
|
||||
|
||||
|
||||
/* This is the table used in defining triggers; note that
|
||||
@ -257,7 +257,7 @@ void INI_format(const TEXT* owner, const TEXT* charset)
|
||||
* stored here.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
/* Uppercase owner name */
|
||||
@ -497,7 +497,7 @@ void INI_init(void)
|
||||
* format descriptor.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
CHECK_DBB(dbb);
|
||||
|
||||
@ -567,7 +567,7 @@ void INI_init2(void)
|
||||
* the database when it was created.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
const USHORT major_version = dbb->dbb_ods_version;
|
||||
@ -730,7 +730,7 @@ void INI_update_database()
|
||||
* %% Note %% Update the switch() statement to reflect new major ODS
|
||||
* addition
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
CHECK_DBB(dbb);
|
||||
|
||||
@ -831,7 +831,7 @@ static void add_generator(TEXT* generator_name, BLK* handle)
|
||||
**************************************/
|
||||
const gen* generator = generators;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
/* find the new generator to be stored; assume it exists in the table */
|
||||
/* TMN: If it doesn't exist in the table, we will CRASH here! */
|
||||
@ -860,7 +860,7 @@ static void add_global_fields( USHORT minor_version)
|
||||
* ODS change.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
/* add desired global fields to system relations */
|
||||
|
||||
@ -901,7 +901,7 @@ static void add_index_set(Database* dbb,
|
||||
TEXT string[32];
|
||||
IDX idx;
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
blk* handle1 = NULL;
|
||||
blk* handle2 = NULL;
|
||||
|
||||
@ -990,7 +990,7 @@ static void add_new_triggers(USHORT major_version, USHORT minor_version)
|
||||
* This routine is used to upgrade ODS versions.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
BLK handle1 = NULL;
|
||||
|
||||
@ -1039,7 +1039,7 @@ static void add_relation_fields( USHORT minor_version)
|
||||
* ODS change.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
Database* dbb = tdbb->tdbb_database;
|
||||
|
||||
/* add desired fields to system relations, forcing a new format version */
|
||||
@ -1089,7 +1089,7 @@ static void add_relation_fields( USHORT minor_version)
|
||||
// The caller used an UCHAR* to store the acl, it was converted to TEXT* to
|
||||
// be passed to this function, only to be converted to UCHAR* to be passed
|
||||
// to BLB_put_segment. Therefore, "acl" was changed to UCHAR* as param.
|
||||
static void add_security_to_sys_rel(TDBB tdbb,
|
||||
static void add_security_to_sys_rel(thread_db* tdbb,
|
||||
const TEXT* user_name,
|
||||
const TEXT* rel_name,
|
||||
const UCHAR* acl,
|
||||
@ -1237,7 +1237,7 @@ static void add_trigger(TEXT* trigger_name, BLK* handle1, BLK* handle2)
|
||||
* now, since it will be used when we go to 8.1.
|
||||
*
|
||||
**************************************/
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
/* Find the new trigger to be stored; assume it exists in the table */
|
||||
|
||||
@ -1262,7 +1262,7 @@ static void add_trigger(TEXT* trigger_name, BLK* handle1, BLK* handle2)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void modify_relation_field(TDBB tdbb,
|
||||
static void modify_relation_field(thread_db* tdbb,
|
||||
const UCHAR* fld,
|
||||
const UCHAR* relfld,
|
||||
BLK* handle)
|
||||
@ -1294,7 +1294,7 @@ static void modify_relation_field(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static void store_generator(TDBB tdbb, const gen* generator, BLK* handle)
|
||||
static void store_generator(thread_db* tdbb, const gen* generator, BLK* handle)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1318,7 +1318,7 @@ static void store_generator(TDBB tdbb, const gen* generator, BLK* handle)
|
||||
}
|
||||
|
||||
|
||||
static void store_global_field(TDBB tdbb, const gfld* gfield, BLK* handle)
|
||||
static void store_global_field(thread_db* tdbb, const gfld* gfield, BLK* handle)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1454,7 +1454,7 @@ static void store_global_field(TDBB tdbb, const gfld* gfield, BLK* handle)
|
||||
}
|
||||
|
||||
|
||||
static void store_intlnames(TDBB tdbb, Database* dbb)
|
||||
static void store_intlnames(thread_db* tdbb, Database* dbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1499,7 +1499,7 @@ static void store_intlnames(TDBB tdbb, Database* dbb)
|
||||
}
|
||||
|
||||
|
||||
static void store_message(TDBB tdbb, const trigger_msg* message, BLK* handle)
|
||||
static void store_message(thread_db* tdbb, const trigger_msg* message, BLK* handle)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1524,7 +1524,7 @@ static void store_message(TDBB tdbb, const trigger_msg* message, BLK* handle)
|
||||
}
|
||||
|
||||
|
||||
static void store_relation_field(TDBB tdbb,
|
||||
static void store_relation_field(thread_db* tdbb,
|
||||
const UCHAR* fld,
|
||||
const UCHAR* relfld,
|
||||
int field_id,
|
||||
@ -1559,7 +1559,7 @@ static void store_relation_field(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
static void store_trigger(TDBB tdbb, const jrd_trg* trigger, BLK* handle)
|
||||
static void store_trigger(thread_db* tdbb, const jrd_trg* trigger, BLK* handle)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
@ -145,8 +145,8 @@
|
||||
|
||||
typedef unsigned char FILECHAR;
|
||||
|
||||
static bool all_spaces(TDBB, CHARSET_ID, const BYTE*, USHORT, USHORT);
|
||||
static void pad_spaces(TDBB, CHARSET_ID, BYTE *, USHORT);
|
||||
static bool all_spaces(thread_db*, CHARSET_ID, const BYTE*, USHORT, USHORT);
|
||||
static void pad_spaces(thread_db*, CHARSET_ID, BYTE *, USHORT);
|
||||
static FPTR_SHORT lookup_init_function(USHORT, SSHORT, SSHORT);
|
||||
static void finish_texttype_init(TEXTTYPE);
|
||||
static USHORT nc_to_wc(TEXTTYPE, UCS2_CHAR*, USHORT, const UCHAR*, USHORT,
|
||||
@ -212,11 +212,11 @@ public:
|
||||
|
||||
CharSet getCharSet() { return cs; }
|
||||
|
||||
TextType lookupCollation(TDBB tdbb, USHORT tt_id);
|
||||
TextType lookupCollation(thread_db* tdbb, USHORT tt_id);
|
||||
|
||||
CsConvert lookupConverter(TDBB tdbb, CHARSET_ID to_cs);
|
||||
CsConvert lookupConverter(thread_db* tdbb, CHARSET_ID to_cs);
|
||||
|
||||
static CharSetContainer* lookupCharset(TDBB tdbb, SSHORT ttype, ISC_STATUS *status);
|
||||
static CharSetContainer* lookupCharset(thread_db* tdbb, SSHORT ttype, ISC_STATUS *status);
|
||||
|
||||
private:
|
||||
Firebird::SortedArray<CsConvert, CHARSET_ID, CharsetIDGetter> charset_converters;
|
||||
@ -225,7 +225,7 @@ private:
|
||||
CharSet cs;
|
||||
};
|
||||
|
||||
CharSetContainer* CharSetContainer::lookupCharset(TDBB tdbb, SSHORT ttype, ISC_STATUS *status)
|
||||
CharSetContainer* CharSetContainer::lookupCharset(thread_db* tdbb, SSHORT ttype, ISC_STATUS *status)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -282,10 +282,10 @@ CharSetContainer::CharSetContainer(MemoryPool *p, USHORT cs_id) :
|
||||
impossible_conversions(p),
|
||||
cs(NULL)
|
||||
{
|
||||
typedef USHORT (*CSInitFunc)(CHARSET, SSHORT, SSHORT);
|
||||
typedef USHORT (*CSInitFunc)(charset*, SSHORT, SSHORT);
|
||||
CSInitFunc csInitFunc =
|
||||
reinterpret_cast<CSInitFunc>(lookup_init_function(type_charset, cs_id, 0));
|
||||
CHARSET cs = FB_NEW(*p) charset;
|
||||
charset* cs = FB_NEW(*p) charset;
|
||||
memset(cs, 0, sizeof(charset));
|
||||
|
||||
if (!csInitFunc || (*csInitFunc)(cs, cs_id, 0) != 0)
|
||||
@ -297,7 +297,7 @@ CharSetContainer::CharSetContainer(MemoryPool *p, USHORT cs_id) :
|
||||
this->cs = cs;
|
||||
}
|
||||
|
||||
CsConvert CharSetContainer::lookupConverter(TDBB tdbb, CHARSET_ID to_cs)
|
||||
CsConvert CharSetContainer::lookupConverter(thread_db* tdbb, CHARSET_ID to_cs)
|
||||
{
|
||||
int pos;
|
||||
if (charset_converters.find(to_cs, pos))
|
||||
@ -314,7 +314,7 @@ CsConvert CharSetContainer::lookupConverter(TDBB tdbb, CHARSET_ID to_cs)
|
||||
return to_charset.getConvFromUnicode();
|
||||
}
|
||||
|
||||
typedef USHORT (*CVTInitFunc)(CSCONVERT, SSHORT, SSHORT);
|
||||
typedef USHORT (*CVTInitFunc)(csconvert*, SSHORT, SSHORT);
|
||||
CVTInitFunc cvtInitFunc =
|
||||
reinterpret_cast<CVTInitFunc>(lookup_init_function(type_csconvert, to_cs, cs.getId()));
|
||||
if (!cvtInitFunc) {
|
||||
@ -322,7 +322,7 @@ CsConvert CharSetContainer::lookupConverter(TDBB tdbb, CHARSET_ID to_cs)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CSCONVERT cvt = FB_NEW(*tdbb->tdbb_database->dbb_permanent) csconvert;
|
||||
csconvert* cvt = FB_NEW(*tdbb->tdbb_database->dbb_permanent) csconvert;
|
||||
memset(cvt, 0, sizeof(csconvert));
|
||||
if ((*cvtInitFunc)(cvt, to_cs, cs.getId()) != 0)
|
||||
{
|
||||
@ -337,7 +337,7 @@ CsConvert CharSetContainer::lookupConverter(TDBB tdbb, CHARSET_ID to_cs)
|
||||
return cvt;
|
||||
}
|
||||
|
||||
TextType CharSetContainer::lookupCollation(TDBB tdbb, USHORT tt_id)
|
||||
TextType CharSetContainer::lookupCollation(thread_db* tdbb, USHORT tt_id)
|
||||
{
|
||||
const USHORT id = TTYPE_TO_COLLATION(tt_id);
|
||||
|
||||
@ -367,7 +367,7 @@ TextType CharSetContainer::lookupCollation(TDBB tdbb, USHORT tt_id)
|
||||
|
||||
class MBStrConverter {
|
||||
public:
|
||||
MBStrConverter(TDBB tdbb, TextType obj, const UCHAR* &str, SSHORT &len) {
|
||||
MBStrConverter(thread_db* tdbb, TextType obj, const UCHAR* &str, SSHORT &len) {
|
||||
SSHORT err_code;
|
||||
USHORT err_pos;
|
||||
SSHORT out_len = obj.to_wc(NULL, 0, str, len, &err_code, &err_pos);
|
||||
@ -387,13 +387,13 @@ private:
|
||||
|
||||
class NullStrConverter {
|
||||
public:
|
||||
NullStrConverter(TDBB tdbb, TextType obj, const UCHAR *str, SSHORT len) { }
|
||||
NullStrConverter(thread_db* tdbb, TextType obj, const UCHAR *str, SSHORT len) { }
|
||||
};
|
||||
|
||||
template <typename PrevConverter>
|
||||
class UpcaseConverter : public PrevConverter {
|
||||
public:
|
||||
UpcaseConverter(TDBB tdbb, TextType obj, const UCHAR* &str, SSHORT &len) :
|
||||
UpcaseConverter(thread_db* tdbb, TextType obj, const UCHAR* &str, SSHORT &len) :
|
||||
PrevConverter(tdbb, obj, str, len)
|
||||
{
|
||||
if (len > (int) sizeof(tempBuffer))
|
||||
@ -414,7 +414,7 @@ private:
|
||||
template <typename Algorithm, typename StrConverter, typename CharType>
|
||||
class StringFunctions {
|
||||
public:
|
||||
static bool process(TDBB tdbb, TextType ttype, void* object, const UCHAR* str, SSHORT length)
|
||||
static bool process(thread_db* tdbb, TextType ttype, void* object, const UCHAR* str, SSHORT length)
|
||||
{
|
||||
StrConverter cvt(tdbb, ttype, str, length);
|
||||
fb_assert(length % sizeof(CharType) == 0);
|
||||
@ -435,14 +435,14 @@ public:
|
||||
template <typename StrConverter, typename CharType>
|
||||
class ContainsFunctions : public StringFunctions<Firebird::ContainsEvaluator<CharType>, StrConverter, CharType> {
|
||||
public:
|
||||
static void* create(TDBB tdbb, TextType ttype, const UCHAR* str, SSHORT length)
|
||||
static void* create(thread_db* tdbb, TextType ttype, const UCHAR* str, SSHORT length)
|
||||
{
|
||||
StrConverter cvt(tdbb, ttype, str, length);
|
||||
fb_assert(length % sizeof(CharType) == 0);
|
||||
return FB_NEW(*tdbb->tdbb_default) Firebird::ContainsEvaluator<CharType>(tdbb->tdbb_default,
|
||||
reinterpret_cast<const CharType*>(str), length / sizeof(CharType));
|
||||
}
|
||||
static bool evaluate(TDBB tdbb, TextType ttype, const UCHAR* s, SSHORT sl,
|
||||
static bool evaluate(thread_db* tdbb, TextType ttype, const UCHAR* s, SSHORT sl,
|
||||
const UCHAR* p, SSHORT pl)
|
||||
{
|
||||
StrConverter cvt1(tdbb, ttype, p, pl), cvt2(tdbb, ttype, s, sl);
|
||||
@ -466,7 +466,7 @@ public:
|
||||
template <typename StrConverter, typename CharType>
|
||||
class LikeFunctions : public StringFunctions<Firebird::LikeEvaluator<CharType>, StrConverter, CharType> {
|
||||
public:
|
||||
static void* create(TDBB tdbb, TextType ttype, const UCHAR* str, SSHORT length,
|
||||
static void* create(thread_db* tdbb, TextType ttype, const UCHAR* str, SSHORT length,
|
||||
UCS2_CHAR escape)
|
||||
{
|
||||
StrConverter cvt(tdbb, ttype, str, length);
|
||||
@ -475,7 +475,7 @@ public:
|
||||
reinterpret_cast<const CharType*>(str), length / sizeof(CharType),
|
||||
escape, SQL_MATCH_ANY_CHARS, SQL_MATCH_1_CHAR);
|
||||
}
|
||||
static bool evaluate(TDBB tdbb, TextType ttype, const UCHAR* s, SSHORT sl,
|
||||
static bool evaluate(thread_db* tdbb, TextType ttype, const UCHAR* s, SSHORT sl,
|
||||
const UCHAR* p, SSHORT pl, UCS2_CHAR escape)
|
||||
{
|
||||
StrConverter cvt1(tdbb, ttype, p, pl), cvt2(tdbb, ttype, s, sl);
|
||||
@ -717,7 +717,7 @@ static FPTR_SHORT lookup_init_function(
|
||||
}
|
||||
|
||||
|
||||
CHARSET_ID INTL_charset(TDBB tdbb, USHORT ttype, FPTR_ERROR err)
|
||||
CHARSET_ID INTL_charset(thread_db* tdbb, USHORT ttype, FPTR_ERROR err)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -749,7 +749,7 @@ CHARSET_ID INTL_charset(TDBB tdbb, USHORT ttype, FPTR_ERROR err)
|
||||
}
|
||||
|
||||
|
||||
int INTL_compare(TDBB tdbb,
|
||||
int INTL_compare(thread_db* tdbb,
|
||||
const dsc* pText1,
|
||||
const dsc* pText2,
|
||||
FPTR_ERROR err)
|
||||
@ -826,7 +826,7 @@ int INTL_compare(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
USHORT INTL_convert_bytes(TDBB tdbb,
|
||||
USHORT INTL_convert_bytes(thread_db* tdbb,
|
||||
CHARSET_ID dest_type,
|
||||
BYTE* dest_ptr,
|
||||
USHORT dest_len,
|
||||
@ -971,7 +971,7 @@ USHORT INTL_convert_bytes(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
CsConvert INTL_convert_lookup(TDBB tdbb,
|
||||
CsConvert INTL_convert_lookup(thread_db* tdbb,
|
||||
CHARSET_ID to_cs,
|
||||
CHARSET_ID from_cs)
|
||||
{
|
||||
@ -1031,7 +1031,7 @@ int INTL_convert_string(dsc* to, const dsc* from, FPTR_ERROR err)
|
||||
|
||||
/* Note: This function is called from outside the engine as
|
||||
well as inside - we likely can't get rid of GET_THREAD_DATA here */
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
if (tdbb == NULL) /* are we in the Engine? */
|
||||
return (1); /* no, then can't access intl gah */
|
||||
|
||||
@ -1178,7 +1178,7 @@ int INTL_data_or_binary(const dsc* pText)
|
||||
}
|
||||
|
||||
|
||||
int INTL_defined_type(TDBB tdbb, ISC_STATUS * status, SSHORT t_type)
|
||||
int INTL_defined_type(thread_db* tdbb, ISC_STATUS * status, SSHORT t_type)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1209,7 +1209,7 @@ int INTL_defined_type(TDBB tdbb, ISC_STATUS * status, SSHORT t_type)
|
||||
}
|
||||
|
||||
|
||||
UCS2_CHAR INTL_getch(TDBB tdbb,
|
||||
UCS2_CHAR INTL_getch(thread_db* tdbb,
|
||||
TextType* obj,
|
||||
SSHORT t_type, const UCHAR** ptr, USHORT* count)
|
||||
{
|
||||
@ -1242,7 +1242,7 @@ UCS2_CHAR INTL_getch(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
void INTL_init(TDBB tdbb)
|
||||
void INTL_init(thread_db* tdbb)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1256,7 +1256,7 @@ void INTL_init(TDBB tdbb)
|
||||
}
|
||||
|
||||
|
||||
USHORT INTL_key_length(TDBB tdbb, USHORT idxType, USHORT iLength)
|
||||
USHORT INTL_key_length(thread_db* tdbb, USHORT idxType, USHORT iLength)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1295,7 +1295,7 @@ USHORT INTL_key_length(TDBB tdbb, USHORT idxType, USHORT iLength)
|
||||
return (key_length);
|
||||
}
|
||||
|
||||
CharSet INTL_charset_lookup(TDBB tdbb, SSHORT parm1, ISC_STATUS* status)
|
||||
CharSet INTL_charset_lookup(thread_db* tdbb, SSHORT parm1, ISC_STATUS* status)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1324,7 +1324,7 @@ CharSet INTL_charset_lookup(TDBB tdbb, SSHORT parm1, ISC_STATUS* status)
|
||||
}
|
||||
|
||||
|
||||
TextType INTL_texttype_lookup(TDBB tdbb,
|
||||
TextType INTL_texttype_lookup(thread_db* tdbb,
|
||||
SSHORT parm1,
|
||||
FPTR_ERROR err,
|
||||
ISC_STATUS* status)
|
||||
@ -1362,7 +1362,7 @@ TextType INTL_texttype_lookup(TDBB tdbb,
|
||||
return csc->lookupCollation(tdbb, parm1);
|
||||
}
|
||||
|
||||
void INTL_pad_spaces(TDBB tdbb, DSC * type, UCHAR * string, USHORT length)
|
||||
void INTL_pad_spaces(thread_db* tdbb, DSC * type, UCHAR * string, USHORT length)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1386,11 +1386,11 @@ void INTL_pad_spaces(TDBB tdbb, DSC * type, UCHAR * string, USHORT length)
|
||||
}
|
||||
|
||||
|
||||
USHORT INTL_string_to_key(TDBB tdbb,
|
||||
USHORT INTL_string_to_key(thread_db* tdbb,
|
||||
USHORT idxType,
|
||||
const dsc* pString,
|
||||
DSC* pByte,
|
||||
USHORT partial)
|
||||
bool partial)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1470,7 +1470,7 @@ USHORT INTL_string_to_key(TDBB tdbb,
|
||||
reinterpret_cast<const unsigned char*>(src),
|
||||
pByte->dsc_length,
|
||||
reinterpret_cast<unsigned char*>(dest),
|
||||
partial);
|
||||
partial ? TRUE : FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1478,7 +1478,7 @@ USHORT INTL_string_to_key(TDBB tdbb,
|
||||
}
|
||||
|
||||
|
||||
int INTL_str_to_upper(TDBB tdbb, DSC * pString)
|
||||
int INTL_str_to_upper(thread_db* tdbb, DSC * pString)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1532,7 +1532,7 @@ int INTL_str_to_upper(TDBB tdbb, DSC * pString)
|
||||
}
|
||||
|
||||
|
||||
UCHAR INTL_upper(TDBB tdbb, USHORT ttype, UCHAR ch)
|
||||
UCHAR INTL_upper(thread_db* tdbb, USHORT ttype, UCHAR ch)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1566,7 +1566,7 @@ UCHAR INTL_upper(TDBB tdbb, USHORT ttype, UCHAR ch)
|
||||
|
||||
|
||||
static bool all_spaces(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
CHARSET_ID charset,
|
||||
const BYTE* ptr, USHORT len, USHORT offset)
|
||||
{
|
||||
@ -1699,7 +1699,7 @@ static USHORT wc_to_wc(TEXTTYPE obj, UCS2_CHAR* pDest, USHORT nDest, /* byte cou
|
||||
return ((pDest - pStart) * sizeof(*pDest));
|
||||
}
|
||||
|
||||
static void pad_spaces(TDBB tdbb, CHARSET_ID charset, BYTE* ptr, USHORT len)
|
||||
static void pad_spaces(thread_db* tdbb, CHARSET_ID charset, BYTE* ptr, USHORT len)
|
||||
{ /* byte count */
|
||||
/**************************************
|
||||
*
|
||||
|
@ -27,12 +27,12 @@
|
||||
cache->texttype_fn_to_lower = internal_ch_to_lower; \
|
||||
cache->texttype_fn_str_to_upper = internal_str_to_upper; \
|
||||
cache->texttype_fn_mbtowc = INTL_builtin_nc_mbtowc; \
|
||||
cache->texttype_collation_table = (BYTE *) " "; \
|
||||
cache->texttype_collation_table = (const BYTE*) " "; \
|
||||
cache->texttype_toupper_table = NULL; \
|
||||
cache->texttype_tolower_table = NULL; \
|
||||
cache->texttype_compress_table = NULL; \
|
||||
cache->texttype_expand_table = NULL; \
|
||||
cache->texttype_name = const_cast<char*>(POSIX);
|
||||
cache->texttype_name = POSIX;
|
||||
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ static USHORT internal_fss_to_unicode(TEXTTYPE obj,
|
||||
return ((dest_ptr - start) * sizeof(*dest_ptr));
|
||||
}
|
||||
|
||||
USHORT internal_unicode_to_fss(CSCONVERT obj,
|
||||
USHORT internal_unicode_to_fss(csconvert* obj,
|
||||
MBCHAR* fss_str,
|
||||
USHORT fss_len,
|
||||
const UNICODE* unicode_str,
|
||||
@ -521,7 +521,7 @@ static USHORT internal_ch_copy(TEXTTYPE obj, UCHAR ch)
|
||||
return (ch);
|
||||
}
|
||||
|
||||
static USHORT wc_to_nc(CSCONVERT obj, NCHAR* pDest, USHORT nDest, /* byte count */
|
||||
static USHORT wc_to_nc(csconvert* obj, NCHAR* pDest, USHORT nDest, /* byte count */
|
||||
const UCS2_CHAR* pSrc, USHORT nSrc, /* byte count */
|
||||
SSHORT* err_code, USHORT* err_position)
|
||||
{
|
||||
@ -564,7 +564,7 @@ static USHORT wc_to_nc(CSCONVERT obj, NCHAR* pDest, USHORT nDest, /* byte count
|
||||
}
|
||||
|
||||
|
||||
static USHORT mb_to_wc(CSCONVERT obj, UCS2_CHAR* pDest, USHORT nDest, /* byte count */
|
||||
static USHORT mb_to_wc(csconvert* obj, UCS2_CHAR* pDest, USHORT nDest, /* byte count */
|
||||
const MBCHAR* pSrc, USHORT nSrc, /* byte count */
|
||||
SSHORT* err_code, USHORT* err_position)
|
||||
{
|
||||
@ -605,7 +605,7 @@ static USHORT mb_to_wc(CSCONVERT obj, UCS2_CHAR* pDest, USHORT nDest, /* byte co
|
||||
}
|
||||
|
||||
|
||||
static USHORT wc_to_mb(CSCONVERT obj, MBCHAR* pDest, USHORT nDest, /* byte count */
|
||||
static USHORT wc_to_mb(csconvert* obj, MBCHAR* pDest, USHORT nDest, /* byte count */
|
||||
const UCS2_CHAR* pSrc, USHORT nSrc, /* byte count */
|
||||
SSHORT* err_code, USHORT* err_position)
|
||||
{
|
||||
@ -725,7 +725,7 @@ static USHORT ttype_binary_init(TEXTTYPE cache, USHORT parm1, USHORT dummy)
|
||||
cache->texttype_fn_to_upper = internal_ch_copy;
|
||||
cache->texttype_fn_to_lower = internal_ch_copy;
|
||||
cache->texttype_fn_str_to_upper = internal_str_copy;
|
||||
cache->texttype_collation_table = (BYTE *) "\0"; /* pad character */
|
||||
cache->texttype_collation_table = (const BYTE*) "\0"; /* pad character */
|
||||
|
||||
TEXTTYPE_RETURN;
|
||||
}
|
||||
@ -738,7 +738,7 @@ static USHORT ttype_binary_init(TEXTTYPE cache, USHORT parm1, USHORT dummy)
|
||||
#define CHARSET_RETURN return (0)
|
||||
|
||||
static void common_8bit_init(
|
||||
CHARSET csptr,
|
||||
charset* csptr,
|
||||
USHORT id,
|
||||
const ASCII* name,
|
||||
const USHORT* to_unicode_tbl,
|
||||
@ -768,7 +768,7 @@ static void common_8bit_init(
|
||||
|
||||
|
||||
static void common_convert_init(
|
||||
CSCONVERT csptr,
|
||||
csconvert* csptr,
|
||||
USHORT to_cs,
|
||||
USHORT from_cs,
|
||||
pfn_INTL_convert cvt_fn,
|
||||
@ -794,7 +794,7 @@ static void common_convert_init(
|
||||
csptr->csconvert_misc = datatable2;
|
||||
}
|
||||
|
||||
static USHORT cvt_ascii_to_unicode(CSCONVERT obj, UCS2_CHAR* pDest, USHORT nDest, /* byte count */
|
||||
static USHORT cvt_ascii_to_unicode(csconvert* obj, UCS2_CHAR* pDest, USHORT nDest, /* byte count */
|
||||
const UCHAR* pSrc, USHORT nSrc, /* byte count */
|
||||
SSHORT* err_code, USHORT* err_position)
|
||||
{
|
||||
@ -837,7 +837,7 @@ static USHORT cvt_ascii_to_unicode(CSCONVERT obj, UCS2_CHAR* pDest, USHORT nDest
|
||||
return ((pDest - pStart) * sizeof(*pDest));
|
||||
}
|
||||
|
||||
static USHORT cvt_unicode_to_ascii(CSCONVERT obj, NCHAR* pDest, USHORT nDest, /* byte count */
|
||||
static USHORT cvt_unicode_to_ascii(csconvert* obj, NCHAR* pDest, USHORT nDest, /* byte count */
|
||||
const UCS2_CHAR* pSrc, USHORT nSrc, /* byte count */
|
||||
SSHORT* err_code, USHORT* err_position)
|
||||
{
|
||||
@ -880,7 +880,7 @@ static USHORT cvt_unicode_to_ascii(CSCONVERT obj, NCHAR* pDest, USHORT nDest, /*
|
||||
return ((pDest - pStart) * sizeof(*pDest));
|
||||
}
|
||||
|
||||
static USHORT cvt_none_to_unicode(CSCONVERT obj, UCS2_CHAR* pDest, USHORT nDest, /* byte count */
|
||||
static USHORT cvt_none_to_unicode(csconvert* obj, UCS2_CHAR* pDest, USHORT nDest, /* byte count */
|
||||
const UCHAR* pSrc, USHORT nSrc, /* byte count */
|
||||
SSHORT* err_code, USHORT* err_position)
|
||||
{
|
||||
@ -923,7 +923,7 @@ static USHORT cvt_none_to_unicode(CSCONVERT obj, UCS2_CHAR* pDest, USHORT nDest,
|
||||
return ((pDest - pStart) * sizeof(*pDest));
|
||||
}
|
||||
|
||||
static USHORT cvt_utffss_to_ascii(CSCONVERT obj, UCHAR* pDest, USHORT nDest, /* byte count */
|
||||
static USHORT cvt_utffss_to_ascii(csconvert* obj, UCHAR* pDest, USHORT nDest, /* byte count */
|
||||
const UCHAR* pSrc, USHORT nSrc, /* byte count */
|
||||
SSHORT* err_code, USHORT* err_position)
|
||||
{
|
||||
@ -973,7 +973,7 @@ static USHORT cvt_utffss_to_ascii(CSCONVERT obj, UCHAR* pDest, USHORT nDest, /*
|
||||
return ((pDest - pStart) * sizeof(*pDest));
|
||||
}
|
||||
|
||||
static USHORT cs_ascii_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
static USHORT cs_ascii_init(charset* csptr, USHORT cs_id, USHORT dummy)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -996,7 +996,7 @@ static USHORT cs_ascii_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
}
|
||||
|
||||
|
||||
static USHORT cs_none_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
static USHORT cs_none_init(charset* csptr, USHORT cs_id, USHORT dummy)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1023,7 +1023,7 @@ common_convert_init (&csptr->charset_to_unicode, CS_UNICODE_UCS2, id,
|
||||
}
|
||||
|
||||
|
||||
static USHORT cs_unicode_fss_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
static USHORT cs_unicode_fss_init(charset* csptr, USHORT cs_id, USHORT dummy)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1049,7 +1049,7 @@ static USHORT cs_unicode_fss_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
}
|
||||
|
||||
|
||||
static USHORT cs_unicode_ucs2_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
static USHORT cs_unicode_ucs2_init(charset* csptr, USHORT cs_id, USHORT dummy)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1075,7 +1075,7 @@ static USHORT cs_unicode_ucs2_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
}
|
||||
|
||||
|
||||
static USHORT cs_binary_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
static USHORT cs_binary_init(charset* csptr, USHORT cs_id, USHORT dummy)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1107,7 +1107,7 @@ static USHORT cs_binary_init(CHARSET csptr, USHORT cs_id, USHORT dummy)
|
||||
|
||||
|
||||
static USHORT cvt_ascii_utf_init(
|
||||
CSCONVERT csptr,
|
||||
csconvert* csptr,
|
||||
USHORT dest_cs, USHORT source_cs)
|
||||
{
|
||||
/**************************************
|
||||
|
@ -44,21 +44,21 @@
|
||||
class TextType
|
||||
{
|
||||
public:
|
||||
typedef bool (*FPTR_CONTAINS)(TDBB tdbb, TextType ttype, const UCHAR* s, SSHORT ls, const UCHAR* p, SSHORT lp);
|
||||
typedef void* (*FPTR_CONTAINS_CREATE)(TDBB tdbb, TextType ttype, const UCHAR* p, SSHORT lp);
|
||||
typedef bool (*FPTR_CONTAINS)(thread_db* tdbb, TextType ttype, const UCHAR* s, SSHORT ls, const UCHAR* p, SSHORT lp);
|
||||
typedef void* (*FPTR_CONTAINS_CREATE)(thread_db* tdbb, TextType ttype, const UCHAR* p, SSHORT lp);
|
||||
typedef void (*FPTR_CONTAINS_DESTROY)(void* object);
|
||||
typedef void (*FPTR_CONTAINS_RESET)(void* object);
|
||||
typedef bool (*FPTR_CONTAINS_PROCESS)(TDBB tdbb, TextType ttype, void* object, const UCHAR* s, SSHORT ls);
|
||||
typedef bool (*FPTR_CONTAINS_PROCESS)(thread_db* tdbb, TextType ttype, void* object, const UCHAR* s, SSHORT ls);
|
||||
typedef bool (*FPTR_CONTAINS_RESULT)(void* object);
|
||||
|
||||
typedef bool (*FPTR_LIKE)(TDBB tdbb, TextType ttype, const UCHAR* s, SSHORT ls, const UCHAR* p, SSHORT lp, UCS2_CHAR escape);
|
||||
typedef void* (*FPTR_LIKE_CREATE)(TDBB tdbb, TextType ttype, const UCHAR* p, SSHORT lp, UCS2_CHAR escape);
|
||||
typedef bool (*FPTR_LIKE)(thread_db* tdbb, TextType ttype, const UCHAR* s, SSHORT ls, const UCHAR* p, SSHORT lp, UCS2_CHAR escape);
|
||||
typedef void* (*FPTR_LIKE_CREATE)(thread_db* tdbb, TextType ttype, const UCHAR* p, SSHORT lp, UCS2_CHAR escape);
|
||||
typedef void (*FPTR_LIKE_DESTROY)(void* object);
|
||||
typedef void (*FPTR_LIKE_RESET)(void* object);
|
||||
typedef bool (*FPTR_LIKE_PROCESS)(TDBB tdbb, TextType ttype, void* object, const UCHAR* s, SSHORT ls);
|
||||
typedef bool (*FPTR_LIKE_PROCESS)(thread_db* tdbb, TextType ttype, void* object, const UCHAR* s, SSHORT ls);
|
||||
typedef bool (*FPTR_LIKE_RESULT)(void* object);
|
||||
|
||||
TextType(struct texttype *_tt) : tt(_tt) {}
|
||||
TextType(texttype *_tt) : tt(_tt) {}
|
||||
|
||||
// copy constructor
|
||||
TextType(const TextType& obj) : tt(obj.tt) {}
|
||||
@ -133,14 +133,14 @@ public:
|
||||
return (*tt->texttype_fn_mbtowc)(tt, a, b, c);
|
||||
}
|
||||
|
||||
bool like(struct tdbb* tdbb, const UCHAR* s, SSHORT sl, const UCHAR* p, SSHORT pl, SSHORT escape)
|
||||
bool like(thread_db* tdbb, const UCHAR* s, SSHORT sl, const UCHAR* p, SSHORT pl, SSHORT escape)
|
||||
{
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_like);
|
||||
return reinterpret_cast<FPTR_LIKE>(tt->texttype_fn_like)(tdbb, tt, s, sl, p, pl, escape);
|
||||
}
|
||||
|
||||
void *like_create(struct tdbb* tdbb, const UCHAR* p, SSHORT pl, SSHORT escape)
|
||||
void *like_create(thread_db* tdbb, const UCHAR* p, SSHORT pl, SSHORT escape)
|
||||
{
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_like_create);
|
||||
@ -168,21 +168,21 @@ public:
|
||||
reinterpret_cast<FPTR_LIKE_DESTROY>(tt->texttype_fn_like_destroy)(object);
|
||||
}
|
||||
|
||||
bool like_process(struct tdbb* tdbb, void* object, const UCHAR* s, SSHORT sl)
|
||||
bool like_process(thread_db* tdbb, void* object, const UCHAR* s, SSHORT sl)
|
||||
{
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_like_process);
|
||||
return reinterpret_cast<FPTR_LIKE_PROCESS>(tt->texttype_fn_like_process)(tdbb, tt, object, s, sl);
|
||||
}
|
||||
|
||||
bool contains(struct tdbb* tdbb, const UCHAR* s, SSHORT sl, const UCHAR* p, SSHORT pl)
|
||||
bool contains(thread_db* tdbb, const UCHAR* s, SSHORT sl, const UCHAR* p, SSHORT pl)
|
||||
{
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_contains);
|
||||
return reinterpret_cast<FPTR_CONTAINS>(tt->texttype_fn_contains)(tdbb, tt, s, sl, p, pl);
|
||||
}
|
||||
|
||||
void *contains_create(struct tdbb* tdbb, const UCHAR* p, SSHORT pl)
|
||||
void *contains_create(thread_db* tdbb, const UCHAR* p, SSHORT pl)
|
||||
{
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_contains_create);
|
||||
@ -210,24 +210,24 @@ public:
|
||||
reinterpret_cast<FPTR_CONTAINS_DESTROY>(tt->texttype_fn_contains_destroy)(object);
|
||||
}
|
||||
|
||||
bool contains_process(struct tdbb* tdbb, void* object, const UCHAR* s, SSHORT sl)
|
||||
bool contains_process(thread_db* tdbb, void* object, const UCHAR* s, SSHORT sl)
|
||||
{
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_contains_process);
|
||||
return reinterpret_cast<FPTR_CONTAINS_PROCESS>(tt->texttype_fn_contains_process)(tdbb, tt, object, s, sl);
|
||||
}
|
||||
|
||||
USHORT matches(struct tdbb* tdbb, const UCHAR* a, SSHORT b, const UCHAR* c, SSHORT d)
|
||||
USHORT matches(thread_db* tdbb, const UCHAR* a, SSHORT b, const UCHAR* c, SSHORT d)
|
||||
{
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_matches);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT (*)(struct tdbb*, TextType, const UCHAR*, short, const UCHAR*, short)>
|
||||
USHORT (*)(thread_db*, TextType, const UCHAR*, short, const UCHAR*, short)>
|
||||
(tt->texttype_fn_matches)))
|
||||
(tdbb, tt, a, b, c, d);
|
||||
}
|
||||
|
||||
USHORT sleuth_check(struct tdbb* tdbb, USHORT a,
|
||||
USHORT sleuth_check(thread_db* tdbb, USHORT a,
|
||||
const UCHAR* b,
|
||||
USHORT c,
|
||||
const UCHAR* d,
|
||||
@ -236,12 +236,12 @@ public:
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_sleuth_check);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT(*)(struct tdbb*, TextType, USHORT, const UCHAR*, USHORT, const UCHAR*, USHORT)>
|
||||
USHORT(*)(thread_db*, TextType, USHORT, const UCHAR*, USHORT, const UCHAR*, USHORT)>
|
||||
(tt->texttype_fn_sleuth_check)))
|
||||
(tdbb, tt, a, b, c, d, e);
|
||||
}
|
||||
|
||||
USHORT sleuth_merge(struct tdbb* tdbb, const UCHAR* a,
|
||||
USHORT sleuth_merge(thread_db* tdbb, const UCHAR* a,
|
||||
USHORT b,
|
||||
const UCHAR* c,
|
||||
USHORT d,
|
||||
@ -251,7 +251,7 @@ public:
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_sleuth_merge);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT(*)(struct tdbb*, TextType, const UCHAR*, USHORT, const UCHAR*, USHORT, UCHAR*, USHORT)>
|
||||
USHORT(*)(thread_db*, TextType, const UCHAR*, USHORT, const UCHAR*, USHORT, UCHAR*, USHORT)>
|
||||
(tt->texttype_fn_sleuth_merge)))
|
||||
(tdbb, tt, a, b, c, d, e, f);
|
||||
}
|
||||
@ -287,10 +287,10 @@ public:
|
||||
return tt->texttype_bytes_per_char;
|
||||
}
|
||||
|
||||
struct texttype *getStruct() const { return tt; }
|
||||
texttype* getStruct() const { return tt; }
|
||||
|
||||
private:
|
||||
struct texttype *tt;
|
||||
texttype* tt;
|
||||
};
|
||||
|
||||
static inline bool operator ==(const TextType& tt1, const TextType& tt2) {
|
||||
@ -305,7 +305,7 @@ static inline bool operator !=(const TextType& tt1, const TextType& tt2)
|
||||
class CsConvert
|
||||
{
|
||||
public:
|
||||
CsConvert(struct csconvert *_cnvt) : cnvt(_cnvt) {}
|
||||
CsConvert(csconvert* _cnvt) : cnvt(_cnvt) {}
|
||||
CsConvert(const CsConvert& obj) : cnvt(obj.cnvt) {}
|
||||
|
||||
// CVC: Beware of this can of worms: csconvert_convert gets assigned
|
||||
@ -328,10 +328,10 @@ public:
|
||||
CHARSET_ID getFromCS() const { fb_assert(cnvt); return cnvt->csconvert_from; }
|
||||
CHARSET_ID getToCS() const { fb_assert(cnvt); return cnvt->csconvert_to; }
|
||||
|
||||
struct csconvert *getStruct() const { return cnvt; }
|
||||
csconvert* getStruct() const { return cnvt; }
|
||||
|
||||
private:
|
||||
struct csconvert *cnvt;
|
||||
csconvert* cnvt;
|
||||
};
|
||||
|
||||
static inline bool operator ==(const CsConvert& cv1, const CsConvert& cv2)
|
||||
@ -347,7 +347,7 @@ static inline bool operator !=(const CsConvert& cv1, const CsConvert& cv2)
|
||||
class CharSet
|
||||
{
|
||||
public:
|
||||
CharSet(struct charset *_cs) : cs(_cs) {}
|
||||
CharSet(charset* _cs) : cs(_cs) {}
|
||||
CharSet(const CharSet &obj) : cs(obj.cs) {};
|
||||
|
||||
CHARSET_ID getId() const { fb_assert(cs); return cs->charset_id; }
|
||||
@ -361,10 +361,10 @@ public:
|
||||
|
||||
CsConvert getConvFromUnicode() { fb_assert(cs); return &cs->charset_from_unicode; }
|
||||
|
||||
struct charset* getStruct() const { return cs; }
|
||||
charset* getStruct() const { return cs; }
|
||||
|
||||
private:
|
||||
struct charset *cs;
|
||||
charset* cs;
|
||||
};
|
||||
|
||||
static inline bool operator ==(const CharSet& cs1, const CharSet& cs2)
|
||||
|
@ -26,25 +26,25 @@
|
||||
|
||||
#include "../jrd/intl_classes.h"
|
||||
|
||||
CHARSET_ID INTL_charset(TDBB, USHORT, FPTR_ERROR);
|
||||
int INTL_compare(TDBB, const struct dsc*, const struct dsc*, FPTR_ERROR);
|
||||
USHORT INTL_convert_bytes(TDBB, CHARSET_ID, UCHAR*, USHORT, CHARSET_ID,
|
||||
CHARSET_ID INTL_charset(thread_db*, USHORT, FPTR_ERROR);
|
||||
int INTL_compare(thread_db*, const struct dsc*, const struct dsc*, FPTR_ERROR);
|
||||
USHORT INTL_convert_bytes(thread_db*, CHARSET_ID, UCHAR*, USHORT, CHARSET_ID,
|
||||
const BYTE*, USHORT, FPTR_ERROR);
|
||||
CsConvert INTL_convert_lookup(TDBB, CHARSET_ID, CHARSET_ID);
|
||||
CsConvert INTL_convert_lookup(thread_db*, CHARSET_ID, CHARSET_ID);
|
||||
int INTL_convert_string(struct dsc*, const struct dsc*, FPTR_ERROR);
|
||||
int INTL_data(const struct dsc*);
|
||||
int INTL_data_or_binary(const struct dsc*);
|
||||
int INTL_defined_type(TDBB, ISC_STATUS*, SSHORT);
|
||||
UCS2_CHAR INTL_getch(TDBB, TextType*, SSHORT, const UCHAR**, USHORT*);
|
||||
void INTL_init(TDBB);
|
||||
USHORT INTL_key_length(TDBB, USHORT, USHORT);
|
||||
CharSet INTL_charset_lookup(TDBB tdbb, SSHORT parm1, ISC_STATUS* status);
|
||||
TextType INTL_texttype_lookup(TDBB tdbb, SSHORT parm1, FPTR_ERROR err,
|
||||
int INTL_defined_type(thread_db*, ISC_STATUS*, SSHORT);
|
||||
UCS2_CHAR INTL_getch(thread_db*, TextType*, SSHORT, const UCHAR**, USHORT*);
|
||||
void INTL_init(thread_db*);
|
||||
USHORT INTL_key_length(thread_db*, USHORT, USHORT);
|
||||
CharSet INTL_charset_lookup(thread_db* tdbb, SSHORT parm1, ISC_STATUS* status);
|
||||
TextType INTL_texttype_lookup(thread_db* tdbb, SSHORT parm1, FPTR_ERROR err,
|
||||
ISC_STATUS* status);
|
||||
void INTL_pad_spaces(TDBB, struct dsc*, UCHAR*, USHORT);
|
||||
USHORT INTL_string_to_key(TDBB, USHORT, const struct dsc*, struct dsc*, USHORT);
|
||||
int INTL_str_to_upper(TDBB, struct dsc*);
|
||||
UCHAR INTL_upper(TDBB, USHORT, UCHAR);
|
||||
void INTL_pad_spaces(thread_db*, struct dsc*, UCHAR*, USHORT);
|
||||
USHORT INTL_string_to_key(thread_db*, USHORT, const struct dsc*, struct dsc*, bool);
|
||||
int INTL_str_to_upper(thread_db*, struct dsc*);
|
||||
UCHAR INTL_upper(thread_db*, USHORT, UCHAR);
|
||||
|
||||
// Built-in charsets interface
|
||||
FPTR_SHORT INTL_builtin_lookup(USHORT, SSHORT, SSHORT);
|
||||
|
@ -123,13 +123,13 @@ typedef struct texttype {
|
||||
//\\ END OF DRIVER API FUNCTIONS -----------------------------------------------
|
||||
|
||||
// DATA USED BY COLLATION DRIVERS. Never used by engine directly ---------------
|
||||
BYTE *texttype_collation_table;
|
||||
BYTE *texttype_toupper_table;
|
||||
BYTE *texttype_tolower_table;
|
||||
BYTE *texttype_expand_table;
|
||||
BYTE *texttype_compress_table;
|
||||
BYTE *texttype_misc; /* Used by some drivers */
|
||||
ULONG *texttype_unused[4]; /* spare space for use by drivers */
|
||||
const BYTE* texttype_collation_table;
|
||||
const BYTE* texttype_toupper_table;
|
||||
const BYTE* texttype_tolower_table;
|
||||
const BYTE* texttype_expand_table;
|
||||
const BYTE* texttype_compress_table;
|
||||
const BYTE* texttype_misc; /* Used by some drivers */
|
||||
ULONG* texttype_unused[4]; /* spare space for use by drivers */
|
||||
//\\ END OF COLLATION DRIVER DATA ----------------------------------------------
|
||||
|
||||
// ENGINE INTERNAL FUNCTIONS - do not implement in collation drivers -----------
|
||||
@ -157,7 +157,7 @@ typedef struct texttype {
|
||||
typedef USHORT (*pfn_INTL_convert)(csconvert*, UCHAR*, USHORT,
|
||||
const UCHAR*, USHORT, SSHORT*, USHORT*);
|
||||
|
||||
typedef struct csconvert {
|
||||
struct csconvert {
|
||||
struct intl_blk csconvert_blk;
|
||||
USHORT csconvert_version;
|
||||
USHORT csconvert_flags;
|
||||
@ -169,7 +169,7 @@ typedef struct csconvert {
|
||||
const BYTE* csconvert_datatable;
|
||||
const BYTE* csconvert_misc;
|
||||
ULONG* csconvert_unused[2];
|
||||
} *CSCONVERT;
|
||||
};
|
||||
|
||||
/* values for csconvert_flags */
|
||||
|
||||
@ -188,7 +188,7 @@ typedef struct csconvert {
|
||||
|
||||
typedef USHORT (*pfn_well_formed)(const UCHAR*, USHORT);
|
||||
|
||||
typedef struct charset
|
||||
struct charset
|
||||
{
|
||||
struct intl_blk charset_blk;
|
||||
USHORT charset_version;
|
||||
@ -207,8 +207,8 @@ typedef struct charset
|
||||
|
||||
VEC charset_converters;
|
||||
VEC charset_collations;
|
||||
ULONG *charset_unused[2];
|
||||
} *CHARSET;
|
||||
ULONG* charset_unused[2];
|
||||
};
|
||||
|
||||
/* values for charset_flags */
|
||||
|
||||
|
@ -1522,7 +1522,7 @@ ULONG ISC_exception_post(ULONG except_code, const TEXT* err_msg)
|
||||
THREAD_ENTER;
|
||||
}
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
if (!err_msg)
|
||||
{
|
||||
@ -4123,7 +4123,7 @@ void longjmp_sig_handler(int sig_num)
|
||||
actually hang the sigsetjmp menber off of THDD, and
|
||||
make sure that it is set properly for all sub-systems. */
|
||||
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
thread_db* tdbb = GET_THREAD_DATA;
|
||||
|
||||
siglongjmp(tdbb->tdbb_sigsetjmp, sig_num);
|
||||
}
|
||||
|
383
src/jrd/jrd.cpp
383
src/jrd/jrd.cpp
File diff suppressed because it is too large
Load Diff
@ -106,13 +106,14 @@ typedef union {
|
||||
|
||||
// fwd. decl.
|
||||
class vec;
|
||||
struct tdbb;
|
||||
struct thread_db;
|
||||
class att;
|
||||
class jrd_tra;
|
||||
class jrd_req;
|
||||
class lck;
|
||||
class jrd_file;
|
||||
class fmt;
|
||||
class jrd_nod;
|
||||
|
||||
|
||||
class Database : private pool_alloc<type_dbb>
|
||||
@ -496,8 +497,8 @@ class jrd_prc : public pool_alloc_rpt<SCHAR, type_prc>
|
||||
USHORT prc_inputs;
|
||||
USHORT prc_defaults;
|
||||
USHORT prc_outputs;
|
||||
struct jrd_nod *prc_input_msg;
|
||||
struct jrd_nod *prc_output_msg;
|
||||
jrd_nod* prc_input_msg;
|
||||
jrd_nod* prc_output_msg;
|
||||
fmt* prc_input_fmt;
|
||||
fmt* prc_output_fmt;
|
||||
fmt* prc_format;
|
||||
@ -534,11 +535,11 @@ class jrd_prc : public pool_alloc_rpt<SCHAR, type_prc>
|
||||
class prm : public pool_alloc_rpt<SCHAR, type_prm>
|
||||
{
|
||||
public:
|
||||
USHORT prm_number;
|
||||
struct dsc prm_desc;
|
||||
jrd_nod *prm_default_val;
|
||||
TEXT *prm_name; /* pointer to asciiz name */
|
||||
TEXT prm_string[2]; /* one byte for ALLOC and one for the terminating null */
|
||||
USHORT prm_number;
|
||||
struct dsc prm_desc;
|
||||
jrd_nod* prm_default_val;
|
||||
const TEXT* prm_name; /* pointer to asciiz name */
|
||||
TEXT prm_string[2]; /* one byte for ALLOC and one for the terminating null */
|
||||
};
|
||||
typedef prm* PRM;
|
||||
|
||||
@ -569,8 +570,8 @@ struct trig {
|
||||
USHORT flags; // Flags as they are in RDB$TRIGGERS table
|
||||
class jrd_rel* relation; // Trigger parent relation
|
||||
class str* name; // Trigger name
|
||||
void compile(tdbb* _tdbb); // Ensure that trigger is compiled
|
||||
BOOLEAN release(tdbb* _tdbb); // Try to free trigger request
|
||||
void compile(thread_db*); // Ensure that trigger is compiled
|
||||
void release(thread_db*); // Try to free trigger request
|
||||
};
|
||||
|
||||
typedef Firebird::vector<trig> trig_vec;
|
||||
@ -594,7 +595,7 @@ public:
|
||||
class vcl* rel_pages; /* vector of pointer page numbers */
|
||||
vec* rel_fields; /* vector of field blocks */
|
||||
|
||||
struct rse *rel_view_rse; /* view record select expression */
|
||||
class rse* rel_view_rse; /* view record select expression */
|
||||
class vcx *rel_view_contexts; /* linked list of view contexts */
|
||||
|
||||
TEXT *rel_security_name; /* pointer to security class name for relation */
|
||||
@ -654,13 +655,13 @@ public:
|
||||
class jrd_fld : public pool_alloc_rpt<SCHAR, type_fld>
|
||||
{
|
||||
public:
|
||||
struct jrd_nod* fld_validation; /* validation clause, if any */
|
||||
struct jrd_nod* fld_not_null; /* if field cannot be NULL */
|
||||
struct jrd_nod* fld_missing_value; /* missing value, if any */
|
||||
struct jrd_nod* fld_computation; /* computation for virtual field */
|
||||
struct jrd_nod* fld_source; /* source for view fields */
|
||||
struct jrd_nod* fld_default_value; /* default value, if any */
|
||||
TEXT * fld_security_name; /* pointer to security class name for field */
|
||||
jrd_nod* fld_validation; /* validation clause, if any */
|
||||
jrd_nod* fld_not_null; /* if field cannot be NULL */
|
||||
jrd_nod* fld_missing_value; /* missing value, if any */
|
||||
jrd_nod* fld_computation; /* computation for virtual field */
|
||||
jrd_nod* fld_source; /* source for view fields */
|
||||
jrd_nod* fld_default_value; /* default value, if any */
|
||||
TEXT* fld_security_name; /* pointer to security class name for field */
|
||||
struct arr* fld_array; /* array description, if array */
|
||||
const TEXT* fld_name; /* Field name */
|
||||
UCHAR fld_length; /* Field name length */
|
||||
@ -674,8 +675,8 @@ class jrd_fld : public pool_alloc_rpt<SCHAR, type_fld>
|
||||
class idb : public pool_alloc<type_idb>
|
||||
{
|
||||
public:
|
||||
idb* idb_next;
|
||||
struct jrd_nod* idb_expression; /* node tree for index expression */
|
||||
idb* idb_next;
|
||||
jrd_nod* idb_expression; /* node tree for index expression */
|
||||
jrd_req* idb_expression_request; /* request in which index expression is evaluated */
|
||||
struct dsc idb_expression_desc; /* descriptor for expression result */
|
||||
lck* idb_lock; /* lock to synchronize changes to index */
|
||||
@ -914,7 +915,7 @@ typedef struct win {
|
||||
SLONG win_page;
|
||||
struct pag* win_buffer;
|
||||
struct jrd_exp* win_expanded_buffer;
|
||||
class bdb* win_bdb;
|
||||
class Buffer_desc* win_bdb;
|
||||
SSHORT win_scans;
|
||||
USHORT win_flags;
|
||||
explicit win(SLONG wp) : win_page(wp), win_flags(0) {}
|
||||
@ -941,7 +942,7 @@ struct win_for_array: public win
|
||||
|
||||
/* Thread specific database block */
|
||||
|
||||
typedef struct tdbb
|
||||
struct thread_db
|
||||
{
|
||||
struct thdd tdbb_thd_data;
|
||||
Database* tdbb_database;
|
||||
@ -961,7 +962,7 @@ typedef struct tdbb
|
||||
#if defined(UNIX) && defined(SUPERSERVER)
|
||||
sigjmp_buf tdbb_sigsetjmp;
|
||||
#endif
|
||||
} *TDBB;
|
||||
};
|
||||
|
||||
#define TDBB_sweeper 1 /* Thread sweeper or garbage collector */
|
||||
#define TDBB_no_cache_unwind 2 /* Don't unwind page buffer cache */
|
||||
@ -985,20 +986,20 @@ struct ihndl
|
||||
#endif
|
||||
|
||||
#ifdef V4_THREADING
|
||||
#define PLATFORM_GET_THREAD_DATA ((TDBB) THD_get_specific())
|
||||
#define PLATFORM_GET_THREAD_DATA ((thread_db*) THD_get_specific())
|
||||
#endif
|
||||
|
||||
/* RITTER - changed HP10 to HPUX in the expression below */
|
||||
#ifdef MULTI_THREAD
|
||||
#if (defined SOLARIS_MT || defined WIN_NT || \
|
||||
defined HPUX || defined LINUX || defined DARWIN || defined FREEBSD )
|
||||
#define PLATFORM_GET_THREAD_DATA ((TDBB) THD_get_specific())
|
||||
#define PLATFORM_GET_THREAD_DATA ((thread_db*) THD_get_specific())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PLATFORM_GET_THREAD_DATA
|
||||
|
||||
extern TDBB gdbb;
|
||||
extern thread_db* gdbb;
|
||||
|
||||
#define PLATFORM_GET_THREAD_DATA (gdbb)
|
||||
#endif
|
||||
@ -1010,7 +1011,7 @@ extern TDBB gdbb;
|
||||
*
|
||||
* This allows for NULL thread data (which might be an error by itself)
|
||||
* If there is thread data,
|
||||
* AND it is tagged as being a TDBB.
|
||||
* AND it is tagged as being a thread_db.
|
||||
* AND it has a non-NULL tdbb_database field,
|
||||
* THEN we validate that the structure there is a database block.
|
||||
* Otherwise, we return what we got.
|
||||
@ -1020,8 +1021,8 @@ extern TDBB gdbb;
|
||||
#ifdef DEV_BUILD
|
||||
#define GET_THREAD_DATA (((PLATFORM_GET_THREAD_DATA) && \
|
||||
(((THDD)(PLATFORM_GET_THREAD_DATA))->thdd_type == THDD_TYPE_TDBB) && \
|
||||
(((TDBB)(PLATFORM_GET_THREAD_DATA))->tdbb_database)) \
|
||||
? ((MemoryPool::blk_type(((TDBB)(PLATFORM_GET_THREAD_DATA))->tdbb_database) == type_dbb) \
|
||||
(((thread_db*)(PLATFORM_GET_THREAD_DATA))->tdbb_database)) \
|
||||
? ((MemoryPool::blk_type(((thread_db*)(PLATFORM_GET_THREAD_DATA))->tdbb_database) == type_dbb) \
|
||||
? (PLATFORM_GET_THREAD_DATA) \
|
||||
: (BUGCHECK (147), (PLATFORM_GET_THREAD_DATA))) \
|
||||
: (PLATFORM_GET_THREAD_DATA))
|
||||
@ -1036,10 +1037,10 @@ extern TDBB gdbb;
|
||||
#define CHECK_DBB(dbb) /* nothing */
|
||||
#endif
|
||||
|
||||
#define GET_DBB (((TDBB) (GET_THREAD_DATA))->tdbb_database)
|
||||
#define GET_DBB (((thread_db*) (GET_THREAD_DATA))->tdbb_database)
|
||||
|
||||
/*-------------------------------------------------------------------------*
|
||||
* macros used to set tdbb and dbb pointers when there are not set already *
|
||||
* macros used to set thread_db and Database pointers when there are not set already *
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
#define SET_TDBB(tdbb) if ((tdbb) == NULL) { (tdbb) = GET_THREAD_DATA; }; CHECK_TDBB (tdbb)
|
||||
|
@ -144,6 +144,8 @@ ISC_STATUS jrd8_transact_request(ISC_STATUS*, att**,
|
||||
ISC_STATUS jrd8_unwind_request(ISC_STATUS *, jrd_req**, SSHORT);
|
||||
void jrd_vtof(const char*, char*, SSHORT);
|
||||
|
||||
// CVC: It looks to me that these JRD_ functions should be outside the extern "C" directive.
|
||||
|
||||
#ifdef SERVER_SHUTDOWN
|
||||
/* Defines for paramater 3 of JRD_num_attachments */
|
||||
#define JRD_info_drivemask 1
|
||||
@ -157,9 +159,9 @@ void JRD_set_cache_default(ULONG *);
|
||||
void JRD_blocked(att *, struct btb **);
|
||||
void JRD_mutex_lock(struct mutx_t *);
|
||||
void JRD_mutex_unlock(struct mutx_t *);
|
||||
BOOLEAN JRD_reschedule(struct tdbb*, SLONG, bool);
|
||||
bool JRD_reschedule(struct thread_db*, SLONG, bool);
|
||||
void JRD_restore_context(void);
|
||||
void JRD_set_context(struct tdbb *);
|
||||
void JRD_set_context(struct thread_db*);
|
||||
void JRD_unblock(struct btb **);
|
||||
void JRD_wlck_lock(struct mutx_t *);
|
||||
void JRD_wlck_unlock(struct mutx_t *);
|
||||
@ -170,7 +172,7 @@ USHORT JRD_getdir(TEXT*, USHORT);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_PROCS
|
||||
void JRD_print_procedure_info(TDBB, const char*);
|
||||
void JRD_print_procedure_info(thread_db*, const char*);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -65,7 +65,7 @@ static void bug_lck(TEXT*);
|
||||
static void check_lock(lck*, USHORT);
|
||||
#endif
|
||||
static bool compatible(lck*, lck*, USHORT);
|
||||
static void enqueue(TDBB, lck*, USHORT, SSHORT);
|
||||
static void enqueue(thread_db*, lck*, USHORT, SSHORT);
|
||||
static int external_ast(void*);
|
||||
#ifdef MULTI_THREAD
|
||||
static lck* find_block(lck*, USHORT);
|
||||
@ -77,9 +77,9 @@ static void hash_insert_lock(lck*);
|
||||
static bool hash_remove_lock(lck*, lck**);
|
||||
static void internal_ast(lck*);
|
||||
static bool internal_compatible(lck*, lck*, USHORT);
|
||||
static void internal_dequeue(TDBB, lck*);
|
||||
static USHORT internal_downgrade(TDBB, lck*);
|
||||
static bool internal_enqueue(TDBB, lck*, USHORT, SSHORT, bool);
|
||||
static void internal_dequeue(thread_db*, lck*);
|
||||
static USHORT internal_downgrade(thread_db*, lck*);
|
||||
static bool internal_enqueue(thread_db*, lck*, USHORT, SSHORT, bool);
|
||||
|
||||
|
||||
/* globals and macros */
|
||||
@ -137,7 +137,7 @@ static const UCHAR compatibility[] = {
|
||||
#define COMPATIBLE(st1, st2) compatibility [st1 * LCK_max + st2]
|
||||
#define LOCK_HASH_SIZE 19
|
||||
|
||||
inline void ENQUEUE(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
inline void ENQUEUE(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
{
|
||||
if (lock->lck_compatible)
|
||||
internal_enqueue (tdbb, lock, level, wait, false);
|
||||
@ -145,14 +145,14 @@ inline void ENQUEUE(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
enqueue (tdbb, lock, level, wait);
|
||||
}
|
||||
|
||||
inline bool CONVERT(TDBB tdbb, lck* lock, USHORT level, SSHORT wait, ISC_STATUS* status)
|
||||
inline bool CONVERT(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait, ISC_STATUS* status)
|
||||
{
|
||||
return (lock->lck_compatible) ?
|
||||
internal_enqueue (tdbb, lock, level, wait, true) :
|
||||
LOCK_convert (lock->lck_id, level, wait, lock->lck_ast, lock->lck_object, status);
|
||||
}
|
||||
|
||||
inline void DEQUEUE(TDBB tdbb, lck* lock)
|
||||
inline void DEQUEUE(thread_db* tdbb, lck* lock)
|
||||
{
|
||||
if (lock->lck_compatible)
|
||||
internal_dequeue (tdbb, lock);
|
||||
@ -160,7 +160,7 @@ inline void DEQUEUE(TDBB tdbb, lck* lock)
|
||||
LOCK_deq (lock->lck_id);
|
||||
}
|
||||
|
||||
inline USHORT DOWNGRADE(TDBB tdbb, lck* lock, ISC_STATUS* status)
|
||||
inline USHORT DOWNGRADE(thread_db* tdbb, lck* lock, ISC_STATUS* status)
|
||||
{
|
||||
return (lock->lck_compatible) ?
|
||||
internal_downgrade (tdbb, lock) :
|
||||
@ -211,7 +211,7 @@ void LCK_ast_enable() {
|
||||
LOCK_ast_enable();
|
||||
}
|
||||
|
||||
void LCK_assert(TDBB tdbb, lck* lock)
|
||||
void LCK_assert(thread_db* tdbb, lck* lock)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -239,7 +239,7 @@ void LCK_assert(TDBB tdbb, lck* lock)
|
||||
}
|
||||
|
||||
|
||||
bool LCK_convert(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
bool LCK_convert(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -281,7 +281,7 @@ bool LCK_convert(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
|
||||
|
||||
#ifdef MULTI_THREAD
|
||||
int LCK_convert_non_blocking(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
int LCK_convert_non_blocking(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -348,7 +348,7 @@ int LCK_convert_non_blocking(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
|
||||
|
||||
#else
|
||||
int LCK_convert_non_blocking(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
int LCK_convert_non_blocking(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -370,7 +370,7 @@ int LCK_convert_non_blocking(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
#endif
|
||||
|
||||
|
||||
int LCK_convert_opt(TDBB tdbb, lck* lock, USHORT level)
|
||||
int LCK_convert_opt(thread_db* tdbb, lck* lock, USHORT level)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -399,7 +399,7 @@ int LCK_convert_opt(TDBB tdbb, lck* lock, USHORT level)
|
||||
|
||||
|
||||
#ifndef VMS
|
||||
int LCK_downgrade(TDBB tdbb, lck* lock)
|
||||
int LCK_downgrade(thread_db* tdbb, lck* lock)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -433,7 +433,7 @@ int LCK_downgrade(TDBB tdbb, lck* lock)
|
||||
#endif
|
||||
|
||||
|
||||
void LCK_fini(TDBB tdbb, enum lck_owner_t owner_type)
|
||||
void LCK_fini(thread_db* tdbb, enum lck_owner_t owner_type)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -473,7 +473,7 @@ void LCK_fini(TDBB tdbb, enum lck_owner_t owner_type)
|
||||
}
|
||||
|
||||
|
||||
SLONG LCK_get_owner_handle(TDBB tdbb, enum lck_t lock_type)
|
||||
SLONG LCK_get_owner_handle(thread_db* tdbb, enum lck_t lock_type)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -522,7 +522,7 @@ SLONG LCK_get_owner_handle(TDBB tdbb, enum lck_t lock_type)
|
||||
}
|
||||
|
||||
|
||||
void LCK_init(TDBB tdbb, enum lck_owner_t owner_type)
|
||||
void LCK_init(thread_db* tdbb, enum lck_owner_t owner_type)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -572,7 +572,7 @@ void LCK_init(TDBB tdbb, enum lck_owner_t owner_type)
|
||||
}
|
||||
|
||||
|
||||
int LCK_lock(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
int LCK_lock(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -618,7 +618,7 @@ int LCK_lock(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
}
|
||||
|
||||
|
||||
int LCK_lock_non_blocking(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
int LCK_lock_non_blocking(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -723,7 +723,7 @@ int LCK_lock_non_blocking(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
}
|
||||
|
||||
|
||||
int LCK_lock_opt(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
int LCK_lock_opt(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -806,7 +806,7 @@ SLONG LCK_read_data(lck* lock)
|
||||
}
|
||||
|
||||
|
||||
void LCK_release(TDBB tdbb, lck* lock)
|
||||
void LCK_release(thread_db* tdbb, lck* lock)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -999,7 +999,7 @@ static bool compatible(lck* lock1, lck* lock2, USHORT level2)
|
||||
}
|
||||
|
||||
|
||||
static void enqueue(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
static void enqueue(thread_db* tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1019,7 +1019,7 @@ static void enqueue(TDBB tdbb, lck* lock, USHORT level, SSHORT wait)
|
||||
lock->lck_id = LOCK_enq(lock->lck_id,
|
||||
parent ? parent->lck_id : 0,
|
||||
lock->lck_type,
|
||||
(UCHAR *) & lock->lck_key,
|
||||
(const UCHAR*) & lock->lck_key,
|
||||
lock->lck_length,
|
||||
level,
|
||||
lock->lck_ast,
|
||||
@ -1414,7 +1414,7 @@ static bool internal_compatible(lck* match, lck* lock, USHORT level)
|
||||
}
|
||||
|
||||
|
||||
static void internal_dequeue(TDBB tdbb, lck* lock)
|
||||
static void internal_dequeue(thread_db* tdbb, lck* lock)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1449,7 +1449,7 @@ static void internal_dequeue(TDBB tdbb, lck* lock)
|
||||
}
|
||||
|
||||
|
||||
static USHORT internal_downgrade(TDBB tdbb, lck* first)
|
||||
static USHORT internal_downgrade(thread_db* tdbb, lck* first)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1496,7 +1496,7 @@ static USHORT internal_downgrade(TDBB tdbb, lck* first)
|
||||
|
||||
|
||||
static bool internal_enqueue(
|
||||
TDBB tdbb,
|
||||
thread_db* tdbb,
|
||||
lck* lock,
|
||||
USHORT level,
|
||||
SSHORT wait, bool convert_flg)
|
||||
@ -1581,7 +1581,7 @@ static bool internal_enqueue(
|
||||
lock->lck_id = LOCK_enq(lock->lck_id,
|
||||
lock->lck_parent ? lock->lck_parent->lck_id : 0,
|
||||
lock->lck_type,
|
||||
(UCHAR *) & lock->lck_key,
|
||||
(const UCHAR*) & lock->lck_key,
|
||||
lock->lck_length,
|
||||
level,
|
||||
external_ast,
|
||||
|
@ -26,20 +26,20 @@
|
||||
|
||||
#include "../jrd/lck.h"
|
||||
|
||||
void LCK_assert(TDBB, lck*);
|
||||
bool LCK_convert(TDBB, lck*, USHORT, SSHORT);
|
||||
int LCK_convert_non_blocking(TDBB, lck*, USHORT, SSHORT);
|
||||
int LCK_convert_opt(TDBB, lck*, USHORT);
|
||||
int LCK_downgrade(TDBB, lck*);
|
||||
void LCK_fini(TDBB, enum lck_owner_t);
|
||||
SLONG LCK_get_owner_handle(TDBB, enum lck_t);
|
||||
void LCK_init(TDBB, enum lck_owner_t);
|
||||
int LCK_lock(TDBB, lck*, USHORT, SSHORT);
|
||||
int LCK_lock_non_blocking(TDBB, lck*, USHORT, SSHORT);
|
||||
int LCK_lock_opt(TDBB, lck*, USHORT, SSHORT);
|
||||
void LCK_assert(thread_db*, lck*);
|
||||
bool LCK_convert(thread_db*, lck*, USHORT, SSHORT);
|
||||
int LCK_convert_non_blocking(thread_db*, lck*, USHORT, SSHORT);
|
||||
int LCK_convert_opt(thread_db*, lck*, USHORT);
|
||||
int LCK_downgrade(thread_db*, lck*);
|
||||
void LCK_fini(thread_db*, enum lck_owner_t);
|
||||
SLONG LCK_get_owner_handle(thread_db*, enum lck_t);
|
||||
void LCK_init(thread_db*, enum lck_owner_t);
|
||||
int LCK_lock(thread_db*, lck*, USHORT, SSHORT);
|
||||
int LCK_lock_non_blocking(thread_db*, lck*, USHORT, SSHORT);
|
||||
int LCK_lock_opt(thread_db*, lck*, USHORT, SSHORT);
|
||||
SLONG LCK_query_data(lck*, enum lck_t, USHORT);
|
||||
SLONG LCK_read_data(lck*);
|
||||
void LCK_release(TDBB, lck*);
|
||||
void LCK_release(thread_db*, lck*);
|
||||
void LCK_re_post(lck*);
|
||||
void LCK_write_data(lck*, SLONG);
|
||||
void LCK_ast_inhibit();
|
||||
|
@ -303,7 +303,7 @@ void LOG_disable(void)
|
||||
}
|
||||
|
||||
|
||||
void LOG_enable(TEXT * log_file_name, USHORT l_length)
|
||||
void LOG_enable(const TEXT* log_file_name, USHORT l_length)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -365,7 +365,7 @@ void LOG_fini(void)
|
||||
}
|
||||
}
|
||||
|
||||
void LOG_init(TEXT * name, USHORT length)
|
||||
void LOG_init(const TEXT* name, USHORT length)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user