mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 08:03:04 +01:00
Removing duplicated definitions between
ibase.h and blob_filter.h ibase.h and constants.h
This commit is contained in:
parent
e8b3036482
commit
2c0ab256cf
@ -63,7 +63,7 @@ void API_ROUTINE isc_blob_default_desc(
|
|||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
|
|
||||||
desc->blob_desc_subtype = BLOB_text;
|
desc->blob_desc_subtype = isc_blob_text;
|
||||||
desc->blob_desc_charset = CS_dynamic;
|
desc->blob_desc_charset = CS_dynamic;
|
||||||
desc->blob_desc_segment_size = 80;
|
desc->blob_desc_segment_size = 80;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
* Contributor(s): ______________________________________.
|
* Contributor(s): ______________________________________.
|
||||||
*
|
*
|
||||||
* $Id: ddl.cpp,v 1.96 2004-04-29 14:51:02 brodsom Exp $
|
* $Id: ddl.cpp,v 1.97 2004-04-29 17:47:09 brodsom Exp $
|
||||||
* 2001.5.20 Claudio Valderrama: Stop null pointer that leads to a crash,
|
* 2001.5.20 Claudio Valderrama: Stop null pointer that leads to a crash,
|
||||||
* caused by incomplete yacc syntax that allows ALTER DOMAIN dom SET;
|
* caused by incomplete yacc syntax that allows ALTER DOMAIN dom SET;
|
||||||
*
|
*
|
||||||
@ -476,11 +476,11 @@ void DDL_resolve_intl_type2(dsql_req* request,
|
|||||||
}
|
}
|
||||||
field->fld_sub_type = blob_sub_type;
|
field->fld_sub_type = blob_sub_type;
|
||||||
}
|
}
|
||||||
if (field->fld_character_set && (field->fld_sub_type == BLOB_untyped))
|
if (field->fld_character_set && (field->fld_sub_type == isc_blob_untyped))
|
||||||
{
|
{
|
||||||
field->fld_sub_type = BLOB_text;
|
field->fld_sub_type = isc_blob_text;
|
||||||
}
|
}
|
||||||
if (field->fld_character_set && (field->fld_sub_type != BLOB_text))
|
if (field->fld_character_set && (field->fld_sub_type != isc_blob_text))
|
||||||
{
|
{
|
||||||
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) -204, isc_arg_gds,
|
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) -204, isc_arg_gds,
|
||||||
isc_dsql_datatype_err, isc_arg_gds,
|
isc_dsql_datatype_err, isc_arg_gds,
|
||||||
@ -492,7 +492,7 @@ void DDL_resolve_intl_type2(dsql_req* request,
|
|||||||
isc_dsql_datatype_err, isc_arg_gds,
|
isc_dsql_datatype_err, isc_arg_gds,
|
||||||
isc_collation_requires_text, 0);
|
isc_collation_requires_text, 0);
|
||||||
}
|
}
|
||||||
if (field->fld_sub_type != BLOB_text) {
|
if (field->fld_sub_type != isc_blob_text) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5460,7 +5460,7 @@ static void put_field( dsql_req* request, dsql_fld* field, bool udf_flag)
|
|||||||
}
|
}
|
||||||
if (!(request->req_dbb->dbb_flags & DBB_v3))
|
if (!(request->req_dbb->dbb_flags & DBB_v3))
|
||||||
{
|
{
|
||||||
if (field->fld_sub_type == BLOB_text) {
|
if (field->fld_sub_type == isc_blob_text) {
|
||||||
request->append_number(isc_dyn_fld_character_set,
|
request->append_number(isc_dyn_fld_character_set,
|
||||||
field->fld_character_set_id);
|
field->fld_character_set_id);
|
||||||
}
|
}
|
||||||
|
@ -88,8 +88,8 @@ DATABASE DB = STATIC "yachts.lnk";
|
|||||||
|
|
||||||
static const UCHAR blr_bpb[] = {
|
static const UCHAR blr_bpb[] = {
|
||||||
isc_bpb_version1,
|
isc_bpb_version1,
|
||||||
isc_bpb_source_type, 1, BLOB_blr,
|
isc_bpb_source_type, 1, isc_blob_blr,
|
||||||
isc_bpb_target_type, 1, BLOB_blr
|
isc_bpb_target_type, 1, isc_blob_blr
|
||||||
};
|
};
|
||||||
|
|
||||||
static void check_array(dsql_req*, const SCHAR*, dsql_fld*);
|
static void check_array(dsql_req*, const SCHAR*, dsql_fld*);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: cmd.cpp,v 1.30 2004-02-02 11:01:26 robocop Exp $
|
// $Id: cmd.cpp,v 1.31 2004-04-29 17:47:43 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -34,7 +34,7 @@
|
|||||||
#include "../jrd/y_ref.h"
|
#include "../jrd/y_ref.h"
|
||||||
#include "../jrd/ibase.h"
|
#include "../jrd/ibase.h"
|
||||||
#include "../jrd/flags.h"
|
#include "../jrd/flags.h"
|
||||||
#include "../jrd/constants.h"
|
//#include "../jrd/constants.h"
|
||||||
#include "../gpre/cmd_proto.h"
|
#include "../gpre/cmd_proto.h"
|
||||||
#include "../gpre/cme_proto.h"
|
#include "../gpre/cme_proto.h"
|
||||||
#include "../gpre/cmp_proto.h"
|
#include "../gpre/cmp_proto.h"
|
||||||
@ -2508,7 +2508,7 @@ static void put_dtype( gpre_req* request, const gpre_fld* field)
|
|||||||
put_numeric(request, isc_dyn_fld_sub_type, field->fld_sub_type);
|
put_numeric(request, isc_dyn_fld_sub_type, field->fld_sub_type);
|
||||||
put_numeric(request, isc_dyn_fld_segment_length,
|
put_numeric(request, isc_dyn_fld_segment_length,
|
||||||
field->fld_seg_length);
|
field->fld_seg_length);
|
||||||
if (field->fld_sub_type == BLOB_text && field->fld_charset_id)
|
if (field->fld_sub_type == isc_blob_text && field->fld_charset_id)
|
||||||
put_numeric(request, isc_dyn_fld_character_set,
|
put_numeric(request, isc_dyn_fld_character_set,
|
||||||
field->fld_charset_id);
|
field->fld_charset_id);
|
||||||
return;
|
return;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
*____________________________________________________________
|
*____________________________________________________________
|
||||||
*
|
*
|
||||||
* $Id: gpre_meta.epp,v 1.38 2004-04-28 22:05:56 brodsom Exp $
|
* $Id: gpre_meta.epp,v 1.39 2004-04-29 17:47:43 brodsom Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -57,8 +57,8 @@ extern DBB isc_databases;
|
|||||||
|
|
||||||
static const UCHAR blr_bpb[] = {
|
static const UCHAR blr_bpb[] = {
|
||||||
isc_bpb_version1,
|
isc_bpb_version1,
|
||||||
isc_bpb_source_type, 1, BLOB_blr,
|
isc_bpb_source_type, 1, isc_blob_blr,
|
||||||
isc_bpb_target_type, 1, BLOB_blr
|
isc_bpb_target_type, 1, isc_blob_blr
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SCROLLABLE_CURSORS
|
#ifdef SCROLLABLE_CURSORS
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
*____________________________________________________________
|
*____________________________________________________________
|
||||||
*
|
*
|
||||||
* $Id: gpre_meta_boot.cpp,v 1.38 2004-02-02 11:01:26 robocop Exp $
|
* $Id: gpre_meta_boot.cpp,v 1.39 2004-04-29 17:47:43 brodsom Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -54,8 +54,8 @@ extern bool sw_cstring;
|
|||||||
extern DBB isc_databases;
|
extern DBB isc_databases;
|
||||||
|
|
||||||
static const UCHAR blr_bpb[] = { isc_bpb_version1,
|
static const UCHAR blr_bpb[] = { isc_bpb_version1,
|
||||||
isc_bpb_source_type, 1, BLOB_blr,
|
isc_bpb_source_type, 1, isc_blob_blr,
|
||||||
isc_bpb_target_type, 1, BLOB_blr
|
isc_bpb_target_type, 1, isc_blob_blr
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SCROLLABLE_CURSORS
|
#ifdef SCROLLABLE_CURSORS
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: jrdmet.cpp,v 1.14 2004-01-28 07:50:27 robocop Exp $
|
// $Id: jrdmet.cpp,v 1.15 2004-04-29 17:47:43 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -104,7 +104,7 @@ void JRDMET_init( DBB db)
|
|||||||
else if (field->fld_dtype == dtype_blob) {
|
else if (field->fld_dtype == dtype_blob) {
|
||||||
field->fld_dtype = dtype_blob;
|
field->fld_dtype = dtype_blob;
|
||||||
field->fld_flags |= FLD_blob;
|
field->fld_flags |= FLD_blob;
|
||||||
if (gfield->gfld_sub_type == BLOB_text)
|
if (gfield->gfld_sub_type == isc_blob_text)
|
||||||
field->fld_charset_id = CS_METADATA;
|
field->fld_charset_id = CS_METADATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
//
|
//
|
||||||
//____________________________________________________________
|
//____________________________________________________________
|
||||||
//
|
//
|
||||||
// $Id: sql.cpp,v 1.41 2004-02-02 11:01:27 robocop Exp $
|
// $Id: sql.cpp,v 1.42 2004-04-29 17:47:42 brodsom Exp $
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
@ -773,10 +773,10 @@ void SQL_par_field_dtype(gpre_req* request,
|
|||||||
PAR_error("CHARACTER SET applies only to character columns");
|
PAR_error("CHARACTER SET applies only to character columns");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field->fld_dtype == dtype_blob && field->fld_sub_type == BLOB_untyped)
|
if (field->fld_dtype == dtype_blob && field->fld_sub_type == isc_blob_untyped)
|
||||||
field->fld_sub_type = BLOB_text;
|
field->fld_sub_type = isc_blob_text;
|
||||||
|
|
||||||
if (field->fld_dtype == dtype_blob && field->fld_sub_type != BLOB_text)
|
if (field->fld_dtype == dtype_blob && field->fld_sub_type != isc_blob_text)
|
||||||
PAR_error("CHARACTER SET applies only to character columns");
|
PAR_error("CHARACTER SET applies only to character columns");
|
||||||
|
|
||||||
if (field->fld_flags & FLD_national)
|
if (field->fld_flags & FLD_national)
|
||||||
@ -802,7 +802,7 @@ void SQL_par_field_dtype(gpre_req* request,
|
|||||||
}
|
}
|
||||||
else if ((field->fld_dtype <= dtype_any_text ||
|
else if ((field->fld_dtype <= dtype_any_text ||
|
||||||
(field->fld_dtype == dtype_blob
|
(field->fld_dtype == dtype_blob
|
||||||
&& field->fld_sub_type == BLOB_text))
|
&& field->fld_sub_type == isc_blob_text))
|
||||||
&& !field->fld_character_set && !field->fld_collate && request
|
&& !field->fld_character_set && !field->fld_collate && request
|
||||||
&& request->req_database
|
&& request->req_database
|
||||||
&& request->req_database->dbb_def_charset)
|
&& request->req_database->dbb_def_charset)
|
||||||
@ -3742,7 +3742,7 @@ static act* act_open_blob( ACT_T act_op, gpre_sym* symbol)
|
|||||||
blob->blb_const_from_type =
|
blob->blb_const_from_type =
|
||||||
PAR_blob_subtype(request->req_database);
|
PAR_blob_subtype(request->req_database);
|
||||||
if (token.tok_keyword == KW_CHAR)
|
if (token.tok_keyword == KW_CHAR)
|
||||||
if (blob->blb_const_from_type == BLOB_text) {
|
if (blob->blb_const_from_type == isc_blob_text) {
|
||||||
blob->blb_from_charset = par_char_set();
|
blob->blb_from_charset = par_char_set();
|
||||||
if (act_op == ACT_blob_open
|
if (act_op == ACT_blob_open
|
||||||
&& blob->blb_from_charset != field->fld_charset_id)
|
&& blob->blb_from_charset != field->fld_charset_id)
|
||||||
@ -3751,7 +3751,7 @@ static act* act_open_blob( ACT_T act_op, gpre_sym* symbol)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
PAR_error("Only text BLOBS can specify CHARACTER SET");
|
PAR_error("Only text BLOBS can specify CHARACTER SET");
|
||||||
else if (blob->blb_const_from_type == BLOB_text)
|
else if (blob->blb_const_from_type == isc_blob_text)
|
||||||
if (act_op == ACT_blob_create)
|
if (act_op == ACT_blob_create)
|
||||||
blob->blb_from_charset = CS_dynamic;
|
blob->blb_from_charset = CS_dynamic;
|
||||||
else
|
else
|
||||||
@ -3759,7 +3759,7 @@ static act* act_open_blob( ACT_T act_op, gpre_sym* symbol)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
blob->blb_const_from_type = field->fld_sub_type;
|
blob->blb_const_from_type = field->fld_sub_type;
|
||||||
if (blob->blb_const_from_type == BLOB_text)
|
if (blob->blb_const_from_type == isc_blob_text)
|
||||||
if (act_op == ACT_blob_create)
|
if (act_op == ACT_blob_create)
|
||||||
blob->blb_from_charset = CS_dynamic;
|
blob->blb_from_charset = CS_dynamic;
|
||||||
else
|
else
|
||||||
@ -3769,7 +3769,7 @@ static act* act_open_blob( ACT_T act_op, gpre_sym* symbol)
|
|||||||
CPR_s_error("TO");
|
CPR_s_error("TO");
|
||||||
blob->blb_const_to_type = PAR_blob_subtype(request->req_database);
|
blob->blb_const_to_type = PAR_blob_subtype(request->req_database);
|
||||||
if (token.tok_keyword == KW_CHAR)
|
if (token.tok_keyword == KW_CHAR)
|
||||||
if (blob->blb_const_to_type == BLOB_text) {
|
if (blob->blb_const_to_type == isc_blob_text) {
|
||||||
blob->blb_to_charset = par_char_set();
|
blob->blb_to_charset = par_char_set();
|
||||||
if (act_op == ACT_blob_create
|
if (act_op == ACT_blob_create
|
||||||
&& blob->blb_to_charset != field->fld_charset_id)
|
&& blob->blb_to_charset != field->fld_charset_id)
|
||||||
@ -3778,7 +3778,7 @@ static act* act_open_blob( ACT_T act_op, gpre_sym* symbol)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
PAR_error("Only text BLOBS can specify CHARACTER SET");
|
PAR_error("Only text BLOBS can specify CHARACTER SET");
|
||||||
else if (blob->blb_const_to_type == BLOB_text)
|
else if (blob->blb_const_to_type == isc_blob_text)
|
||||||
if (act_op == ACT_blob_create)
|
if (act_op == ACT_blob_create)
|
||||||
blob->blb_to_charset = field->fld_charset_id;
|
blob->blb_to_charset = field->fld_charset_id;
|
||||||
else
|
else
|
||||||
@ -3796,11 +3796,11 @@ static act* act_open_blob( ACT_T act_op, gpre_sym* symbol)
|
|||||||
* operations are done using blob_ids, and we cannot determine
|
* operations are done using blob_ids, and we cannot determine
|
||||||
* this information from the blob_id within the engine.
|
* this information from the blob_id within the engine.
|
||||||
*/
|
*/
|
||||||
if (field->fld_sub_type == BLOB_text
|
if (field->fld_sub_type == isc_blob_text
|
||||||
&& (field->fld_charset_id != CS_NONE))
|
&& (field->fld_charset_id != CS_NONE))
|
||||||
{
|
{
|
||||||
blob->blb_const_from_type = BLOB_text;
|
blob->blb_const_from_type = isc_blob_text;
|
||||||
blob->blb_const_to_type = BLOB_text;
|
blob->blb_const_to_type = isc_blob_text;
|
||||||
if (act_op == ACT_blob_create) {
|
if (act_op == ACT_blob_create) {
|
||||||
blob->blb_from_charset = CS_dynamic;
|
blob->blb_from_charset = CS_dynamic;
|
||||||
blob->blb_to_charset = field->fld_charset_id;
|
blob->blb_to_charset = field->fld_charset_id;
|
||||||
|
@ -292,15 +292,15 @@ static const UCHAR db_version_info[] =
|
|||||||
static const UCHAR text_bpb[] =
|
static const UCHAR text_bpb[] =
|
||||||
{
|
{
|
||||||
isc_bpb_version1,
|
isc_bpb_version1,
|
||||||
isc_bpb_source_type, 1, BLOB_text,
|
isc_bpb_source_type, 1, isc_blob_text,
|
||||||
isc_bpb_target_type, 1, BLOB_text
|
isc_bpb_target_type, 1, isc_blob_text
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
static UCHAR predefined_blob_subtype_bpb[] =
|
static UCHAR predefined_blob_subtype_bpb[] =
|
||||||
{
|
{
|
||||||
isc_bpb_version1,
|
isc_bpb_version1,
|
||||||
isc_bpb_source_type, 1, 0,
|
isc_bpb_source_type, 1, 0,
|
||||||
isc_bpb_target_type, 1, BLOB_text
|
isc_bpb_target_type, 1, isc_blob_text
|
||||||
};
|
};
|
||||||
|
|
||||||
// No check on input argument for now.
|
// No check on input argument for now.
|
||||||
@ -6053,7 +6053,7 @@ static processing_state print_item_blob(FILE* fp,
|
|||||||
ISC_BLOB_DESC from_desc;
|
ISC_BLOB_DESC from_desc;
|
||||||
|
|
||||||
const int blob_subtype = var->sqlsubtype;
|
const int blob_subtype = var->sqlsubtype;
|
||||||
if (blob_subtype == BLOB_text) {
|
if (blob_subtype == isc_blob_text) {
|
||||||
/* Lookup the remaining descriptor information for the BLOB field,
|
/* Lookup the remaining descriptor information for the BLOB field,
|
||||||
* most specifically we're interested in the Character Set so
|
* most specifically we're interested in the Character Set so
|
||||||
* we can set up a BPB that requests character set transliteration
|
* we can set up a BPB that requests character set transliteration
|
||||||
@ -6072,7 +6072,7 @@ static processing_state print_item_blob(FILE* fp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (blob_subtype > BLOB_text && blob_subtype < BLOB_max_predefined_subtype)
|
else if (blob_subtype > isc_blob_text && blob_subtype < isc_blob_max_predefined_subtype)
|
||||||
{
|
{
|
||||||
bpb = predefined_blob_subtype_bpb;
|
bpb = predefined_blob_subtype_bpb;
|
||||||
bpb_length = sizeof(predefined_blob_subtype_bpb);
|
bpb_length = sizeof(predefined_blob_subtype_bpb);
|
||||||
@ -6098,7 +6098,7 @@ static processing_state print_item_blob(FILE* fp,
|
|||||||
{
|
{
|
||||||
// Special displays for blr or acl subtypes
|
// Special displays for blr or acl subtypes
|
||||||
|
|
||||||
if (blob_subtype > BLOB_text && blob_subtype < BLOB_max_predefined_subtype)
|
if (blob_subtype > isc_blob_text && blob_subtype < isc_blob_max_predefined_subtype)
|
||||||
{
|
{
|
||||||
buffer[length--] = 0;
|
buffer[length--] = 0;
|
||||||
for (char* b = buffer + length; b >= buffer;) {
|
for (char* b = buffer + length; b >= buffer;) {
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
* Contributor(s): ______________________________________.
|
* Contributor(s): ______________________________________.
|
||||||
* $Id: show.epp,v 1.43 2004-04-28 22:13:45 brodsom Exp $
|
* $Id: show.epp,v 1.44 2004-04-29 17:48:08 brodsom Exp $
|
||||||
* Revision 1.2 2000/11/19 07:02:49 fsg
|
* Revision 1.2 2000/11/19 07:02:49 fsg
|
||||||
* Change in show.e to use CHARACTER_LENGTH instead of FIELD_LENGTH in
|
* Change in show.e to use CHARACTER_LENGTH instead of FIELD_LENGTH in
|
||||||
* SHOW PROCEDURE
|
* SHOW PROCEDURE
|
||||||
@ -239,8 +239,8 @@ static const SCHAR db_items[] = {
|
|||||||
*/
|
*/
|
||||||
static const UCHAR metadata_text_bpb[] = {
|
static const UCHAR metadata_text_bpb[] = {
|
||||||
isc_bpb_version1,
|
isc_bpb_version1,
|
||||||
isc_bpb_source_type, 1, BLOB_text,
|
isc_bpb_source_type, 1, isc_blob_text,
|
||||||
isc_bpb_target_type, 1, BLOB_text,
|
isc_bpb_target_type, 1, isc_blob_text,
|
||||||
isc_bpb_source_interp, 1, CS_METADATA,
|
isc_bpb_source_interp, 1, CS_METADATA,
|
||||||
isc_bpb_target_interp, 1, CS_dynamic
|
isc_bpb_target_interp, 1, CS_dynamic
|
||||||
};
|
};
|
||||||
|
@ -33,12 +33,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
$Id: blb.cpp,v 1.70 2004-04-27 01:45:53 skidder Exp $
|
$Id: blb.cpp,v 1.71 2004-04-29 17:48:39 brodsom Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../jrd/common.h"
|
#include "../jrd/common.h"
|
||||||
|
#include "../jrd/y_ref.h"
|
||||||
|
#include "../jrd/ibase.h"
|
||||||
|
|
||||||
#include "../jrd/jrd.h"
|
#include "../jrd/jrd.h"
|
||||||
#include "../jrd/tra.h"
|
#include "../jrd/tra.h"
|
||||||
#include "../jrd/val.h"
|
#include "../jrd/val.h"
|
||||||
@ -52,7 +55,7 @@ $Id: blb.cpp,v 1.70 2004-04-27 01:45:53 skidder Exp $
|
|||||||
#include "../jrd/sdl.h"
|
#include "../jrd/sdl.h"
|
||||||
#include "../jrd/intl.h"
|
#include "../jrd/intl.h"
|
||||||
#include "../jrd/cch.h"
|
#include "../jrd/cch.h"
|
||||||
#include "../jrd/common.h"
|
//#include "../jrd/common.h"
|
||||||
#include "../jrd/constants.h"
|
#include "../jrd/constants.h"
|
||||||
#include "../jrd/gdsassert.h"
|
#include "../jrd/gdsassert.h"
|
||||||
#include "../jrd/all_proto.h"
|
#include "../jrd/all_proto.h"
|
||||||
@ -227,7 +230,7 @@ blb* BLB_create2(thread_db* tdbb,
|
|||||||
filter = find_filter(tdbb, from, to);
|
filter = find_filter(tdbb, from, to);
|
||||||
filter_required = true;
|
filter_required = true;
|
||||||
}
|
}
|
||||||
else if (to == BLOB_text && (from_charset != to_charset)) {
|
else if (to == isc_blob_text && (from_charset != to_charset)) {
|
||||||
if (from_charset == CS_dynamic)
|
if (from_charset == CS_dynamic)
|
||||||
from_charset = tdbb->tdbb_attachment->att_charset;
|
from_charset = tdbb->tdbb_attachment->att_charset;
|
||||||
if (to_charset == CS_dynamic)
|
if (to_charset == CS_dynamic)
|
||||||
@ -985,7 +988,7 @@ void BLB_move_from_string(thread_db* tdbb, const dsc* from_desc, dsc* to_desc, j
|
|||||||
MOVE_CLEAR(&blob_desc, sizeof(blob_desc));
|
MOVE_CLEAR(&blob_desc, sizeof(blob_desc));
|
||||||
blob = BLB_create(tdbb, tdbb->tdbb_request->req_transaction, &temp_bid);
|
blob = BLB_create(tdbb, tdbb->tdbb_request->req_transaction, &temp_bid);
|
||||||
blob_desc.dsc_length = MOV_get_string_ptr(from_desc, &ttype, &fromstr, 0, 0);
|
blob_desc.dsc_length = MOV_get_string_ptr(from_desc, &ttype, &fromstr, 0, 0);
|
||||||
if (from_desc->dsc_sub_type == BLOB_text)
|
if (from_desc->dsc_sub_type == isc_blob_text)
|
||||||
{
|
{
|
||||||
/* I have doubts on the merits of this charset assignment since BLB_create2
|
/* I have doubts on the merits of this charset assignment since BLB_create2
|
||||||
calculates charset internally and assigns it to fields inside blb struct.
|
calculates charset internally and assigns it to fields inside blb struct.
|
||||||
@ -1073,7 +1076,7 @@ blb* BLB_open2(thread_db* tdbb,
|
|||||||
filter = find_filter(tdbb, from, to);
|
filter = find_filter(tdbb, from, to);
|
||||||
filter_required = true;
|
filter_required = true;
|
||||||
}
|
}
|
||||||
else if (to == BLOB_text && (from_charset != to_charset)) {
|
else if (to == isc_blob_text && (from_charset != to_charset)) {
|
||||||
if (from_charset == CS_dynamic)
|
if (from_charset == CS_dynamic)
|
||||||
from_charset = tdbb->tdbb_attachment->att_charset;
|
from_charset = tdbb->tdbb_attachment->att_charset;
|
||||||
if (to_charset == CS_dynamic)
|
if (to_charset == CS_dynamic)
|
||||||
@ -1693,7 +1696,7 @@ static ISC_STATUS blob_filter( USHORT action,
|
|||||||
blb* blob = 0;
|
blb* blob = 0;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ACTION_open:
|
case isc_blob_filter_open:
|
||||||
blob = BLB_open2(tdbb, transaction, blob_id, 0, 0);
|
blob = BLB_open2(tdbb, transaction, blob_id, 0, 0);
|
||||||
control->source_handle = blob;
|
control->source_handle = blob;
|
||||||
control->ctl_total_length = blob->blb_length;
|
control->ctl_total_length = blob->blb_length;
|
||||||
@ -1701,7 +1704,7 @@ static ISC_STATUS blob_filter( USHORT action,
|
|||||||
control->ctl_number_segments = blob->blb_count;
|
control->ctl_number_segments = blob->blb_count;
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_get_segment:
|
case isc_blob_filter_get_segment:
|
||||||
blob = control->source_handle;
|
blob = control->source_handle;
|
||||||
control->ctl_segment_length =
|
control->ctl_segment_length =
|
||||||
BLB_get_segment(tdbb, blob, control->ctl_buffer,
|
BLB_get_segment(tdbb, blob, control->ctl_buffer,
|
||||||
@ -1714,30 +1717,30 @@ static ISC_STATUS blob_filter( USHORT action,
|
|||||||
}
|
}
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_create:
|
case isc_blob_filter_create:
|
||||||
control->source_handle =
|
control->source_handle =
|
||||||
BLB_create2(tdbb, transaction, blob_id, 0, NULL);
|
BLB_create2(tdbb, transaction, blob_id, 0, NULL);
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_put_segment:
|
case isc_blob_filter_put_segment:
|
||||||
blob = control->source_handle;
|
blob = control->source_handle;
|
||||||
BLB_put_segment(tdbb, blob, control->ctl_buffer,
|
BLB_put_segment(tdbb, blob, control->ctl_buffer,
|
||||||
control->ctl_buffer_length);
|
control->ctl_buffer_length);
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_close:
|
case isc_blob_filter_close:
|
||||||
BLB_close(tdbb, control->source_handle);
|
BLB_close(tdbb, control->source_handle);
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_alloc:
|
case isc_blob_filter_alloc:
|
||||||
// pointer to ISC_STATUS!!!
|
// pointer to ISC_STATUS!!!
|
||||||
return (ISC_STATUS) FB_NEW(*transaction->tra_pool) BlobControl(*transaction->tra_pool);
|
return (ISC_STATUS) FB_NEW(*transaction->tra_pool) BlobControl(*transaction->tra_pool);
|
||||||
|
|
||||||
case ACTION_free:
|
case isc_blob_filter_free:
|
||||||
delete control;
|
delete control;
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_seek:
|
case isc_blob_filter_seek:
|
||||||
return BLB_lseek(control->source_handle, mode, offset);
|
return BLB_lseek(control->source_handle, mode, offset);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -61,7 +61,7 @@ using namespace Jrd;
|
|||||||
|
|
||||||
/* System provided internal filters for filtering internal
|
/* System provided internal filters for filtering internal
|
||||||
* subtypes to text.
|
* subtypes to text.
|
||||||
* (from_type in [0..8], to_type == BLOB_text)
|
* (from_type in [0..8], to_type == isc_blob_text)
|
||||||
*/
|
*/
|
||||||
static const FPTR_BFILTER_CALLBACK filters[] =
|
static const FPTR_BFILTER_CALLBACK filters[] =
|
||||||
{
|
{
|
||||||
@ -112,7 +112,7 @@ ISC_STATUS BLF_close_blob(thread_db* tdbb, BlobControl** filter_handle)
|
|||||||
/* Close this stage of the filter */
|
/* Close this stage of the filter */
|
||||||
|
|
||||||
control->ctl_status = user_status;
|
control->ctl_status = user_status;
|
||||||
(*control->ctl_source) (ACTION_close, control);
|
(*control->ctl_source) (isc_blob_filter_close, control);
|
||||||
|
|
||||||
/* Find the next stage */
|
/* Find the next stage */
|
||||||
|
|
||||||
@ -121,10 +121,10 @@ ISC_STATUS BLF_close_blob(thread_db* tdbb, BlobControl** filter_handle)
|
|||||||
next = NULL;
|
next = NULL;
|
||||||
|
|
||||||
/* Free this stage's control block allocated by calling the
|
/* Free this stage's control block allocated by calling the
|
||||||
final stage with an ACTION_alloc, which is why we call
|
final stage with an isc_blob_filter_alloc, which is why we call
|
||||||
the final stage with ACTION_free here. */
|
the final stage with isc_blob_filter_free here. */
|
||||||
|
|
||||||
(*callback) (ACTION_free, control);
|
(*callback) (isc_blob_filter_free, control);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_CHECK_FOR_EXCEPTIONS(next->ctl_exception_message.c_str())
|
END_CHECK_FOR_EXCEPTIONS(next->ctl_exception_message.c_str())
|
||||||
@ -155,7 +155,7 @@ ISC_STATUS BLF_create_blob(thread_db* tdbb,
|
|||||||
|
|
||||||
return open_blob(tdbb, tra_handle, filter_handle,
|
return open_blob(tdbb, tra_handle, filter_handle,
|
||||||
blob_id, bpb_length, bpb,
|
blob_id, bpb_length, bpb,
|
||||||
callback, ACTION_create,
|
callback, isc_blob_filter_create,
|
||||||
filter);
|
filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ ISC_STATUS BLF_get_segment(thread_db* tdbb,
|
|||||||
user_status[1] = FB_SUCCESS;
|
user_status[1] = FB_SUCCESS;
|
||||||
user_status[2] = isc_arg_end;
|
user_status[2] = isc_arg_end;
|
||||||
|
|
||||||
status = (*control->ctl_source) (ACTION_get_segment, control);
|
status = (*control->ctl_source) (isc_blob_filter_get_segment, control);
|
||||||
|
|
||||||
if (!status || status == isc_segment)
|
if (!status || status == isc_segment)
|
||||||
*length = control->ctl_segment_length;
|
*length = control->ctl_segment_length;
|
||||||
@ -224,7 +224,7 @@ BlobFilter* BLF_lookup_internal_filter(thread_db* tdbb, SSHORT from, SSHORT to)
|
|||||||
|
|
||||||
/* Check for system defined filter */
|
/* Check for system defined filter */
|
||||||
|
|
||||||
if (to == BLOB_text && from >= 0 && from < FB_NELEM(filters)) {
|
if (to == isc_blob_text && from >= 0 && from < FB_NELEM(filters)) {
|
||||||
BlobFilter* result = FB_NEW(*dbb->dbb_permanent) BlobFilter(*dbb->dbb_permanent);
|
BlobFilter* result = FB_NEW(*dbb->dbb_permanent) BlobFilter(*dbb->dbb_permanent);
|
||||||
result->blf_next = NULL;
|
result->blf_next = NULL;
|
||||||
result->blf_from = from;
|
result->blf_from = from;
|
||||||
@ -266,7 +266,7 @@ ISC_STATUS BLF_open_blob(thread_db* tdbb,
|
|||||||
const_cast<bid*>(blob_id),
|
const_cast<bid*>(blob_id),
|
||||||
bpb_length, bpb,
|
bpb_length, bpb,
|
||||||
callback,
|
callback,
|
||||||
ACTION_open, filter);
|
isc_blob_filter_open, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ ISC_STATUS BLF_put_segment(thread_db* tdbb,
|
|||||||
user_status[1] = FB_SUCCESS;
|
user_status[1] = FB_SUCCESS;
|
||||||
user_status[2] = isc_arg_end;
|
user_status[2] = isc_arg_end;
|
||||||
|
|
||||||
status = (*control->ctl_source) (ACTION_put_segment, control);
|
status = (*control->ctl_source) (isc_blob_filter_put_segment, control);
|
||||||
|
|
||||||
if (status != user_status[1]) {
|
if (status != user_status[1]) {
|
||||||
user_status[1] = status;
|
user_status[1] = status;
|
||||||
@ -380,7 +380,7 @@ static ISC_STATUS open_blob(
|
|||||||
temp.ctl_internal[2] = NULL;
|
temp.ctl_internal[2] = NULL;
|
||||||
// CVC: Using ISC_STATUS (SLONG) to return a pointer!!!
|
// CVC: Using ISC_STATUS (SLONG) to return a pointer!!!
|
||||||
// If we change the function signature, we'll change the public API.
|
// If we change the function signature, we'll change the public API.
|
||||||
BlobControl* prior = (BlobControl*) (*callback) (ACTION_alloc, &temp); // ISC_STATUS to pointer!
|
BlobControl* prior = (BlobControl*) (*callback) (isc_blob_filter_alloc, &temp); // ISC_STATUS to pointer!
|
||||||
prior->ctl_source = callback;
|
prior->ctl_source = callback;
|
||||||
prior->ctl_status = user_status;
|
prior->ctl_status = user_status;
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ static ISC_STATUS open_blob(
|
|||||||
return user_status[1];
|
return user_status[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
BlobControl* control = (BlobControl*) (*callback) (ACTION_alloc, &temp); // ISC_STATUS to pointer!
|
BlobControl* control = (BlobControl*) (*callback) (isc_blob_filter_alloc, &temp); // ISC_STATUS to pointer!
|
||||||
control->ctl_source = filter->blf_filter;
|
control->ctl_source = filter->blf_filter;
|
||||||
control->ctl_handle = prior;
|
control->ctl_handle = prior;
|
||||||
control->ctl_status = user_status;
|
control->ctl_status = user_status;
|
||||||
@ -407,8 +407,8 @@ static ISC_STATUS open_blob(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (filter->blf_filter == filter_transliterate_text) {
|
if (filter->blf_filter == filter_transliterate_text) {
|
||||||
fb_assert(to == BLOB_text);
|
fb_assert(to == isc_blob_text);
|
||||||
fb_assert(from == BLOB_text);
|
fb_assert(from == isc_blob_text);
|
||||||
control->ctl_to_sub_type = to_charset;
|
control->ctl_to_sub_type = to_charset;
|
||||||
control->ctl_from_sub_type = from_charset;
|
control->ctl_from_sub_type = from_charset;
|
||||||
}
|
}
|
||||||
|
@ -86,15 +86,18 @@ class BlobFilter : public pool_alloc<type_blf>
|
|||||||
BlobFilter(MemoryPool& p) : blf_exception_message(p) { }
|
BlobFilter(MemoryPool& p) : blf_exception_message(p) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// BRS 29-Apr-2004
|
||||||
const int ACTION_open = 0;
|
// replace those constants with public defined ones isc_blob_filter_
|
||||||
const int ACTION_get_segment = 1;
|
//
|
||||||
const int ACTION_close = 2;
|
// const int ACTION_open = 0;
|
||||||
const int ACTION_create = 3;
|
// const int ACTION_get_segment = 1;
|
||||||
const int ACTION_put_segment = 4;
|
// const int ACTION_close = 2;
|
||||||
const int ACTION_alloc = 5;
|
// const int ACTION_create = 3;
|
||||||
const int ACTION_free = 6;
|
// const int ACTION_put_segment = 4;
|
||||||
const int ACTION_seek = 7;
|
// const int ACTION_alloc = 5;
|
||||||
|
// const int ACTION_free = 6;
|
||||||
|
// const int ACTION_seek = 7;
|
||||||
|
//
|
||||||
|
|
||||||
const static char* EXCEPTION_MESSAGE = "The blob filter: \t\t%s\n"
|
const static char* EXCEPTION_MESSAGE = "The blob filter: \t\t%s\n"
|
||||||
"\treferencing entrypoint: \t%s\n"
|
"\treferencing entrypoint: \t%s\n"
|
||||||
|
@ -34,20 +34,21 @@
|
|||||||
* Subtypes > 0 are InterBase defined
|
* Subtypes > 0 are InterBase defined
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const int BLOB_untyped = 0;
|
// BRS 29-Apr-2004
|
||||||
|
// replace those constants with public defined ones isc_blob_*
|
||||||
/* InterBase defined BLOB subtypes */
|
//
|
||||||
|
//const int BLOB_untyped = 0;
|
||||||
const int BLOB_text = 1;
|
//
|
||||||
const int BLOB_blr = 2;
|
//const int BLOB_text = 1;
|
||||||
const int BLOB_acl = 3;
|
//const int BLOB_blr = 2;
|
||||||
const int BLOB_ranges = 4;
|
//const int BLOB_acl = 3;
|
||||||
const int BLOB_summary = 5;
|
//const int BLOB_ranges = 4;
|
||||||
const int BLOB_format = 6;
|
//const int BLOB_summary = 5;
|
||||||
const int BLOB_tra = 7;
|
//const int BLOB_format = 6;
|
||||||
const int BLOB_extfile = 8;
|
//const int BLOB_tra = 7;
|
||||||
const int BLOB_max_predefined_subtype = 9;
|
//const int BLOB_extfile = 8;
|
||||||
|
//const int BLOB_max_predefined_subtype = 9;
|
||||||
|
//
|
||||||
|
|
||||||
/* Column Limits */
|
/* Column Limits */
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
#include "firebird.h"
|
#include "firebird.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "../jrd/common.h"
|
#include "../jrd/common.h"
|
||||||
|
#include "../jrd/y_ref.h"
|
||||||
|
#include "../jrd/ibase.h"
|
||||||
|
|
||||||
#include "../jrd/jrd.h"
|
#include "../jrd/jrd.h"
|
||||||
#include "../jrd/val.h"
|
#include "../jrd/val.h"
|
||||||
#include "../jrd/quad.h"
|
#include "../jrd/quad.h"
|
||||||
@ -549,11 +552,11 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_ERROR err)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg1->dsc_sub_type == BLOB_text)
|
if (arg1->dsc_sub_type == isc_blob_text)
|
||||||
ttype1 = arg1->dsc_scale; /* Load blob character set */
|
ttype1 = arg1->dsc_scale; /* Load blob character set */
|
||||||
else
|
else
|
||||||
ttype1 = ttype_none;
|
ttype1 = ttype_none;
|
||||||
if (arg2->dsc_sub_type == BLOB_text)
|
if (arg2->dsc_sub_type == isc_blob_text)
|
||||||
ttype2 = arg2->dsc_scale; /* Load blob character set */
|
ttype2 = arg2->dsc_scale; /* Load blob character set */
|
||||||
else
|
else
|
||||||
ttype2 = ttype_none;
|
ttype2 = ttype_none;
|
||||||
@ -572,7 +575,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_ERROR err)
|
|||||||
// Can we have a lightweight, binary comparison?
|
// Can we have a lightweight, binary comparison?
|
||||||
bool both_are_text = false;
|
bool both_are_text = false;
|
||||||
bool bin_cmp =
|
bool bin_cmp =
|
||||||
(arg1->dsc_sub_type != BLOB_text || arg2->dsc_sub_type != BLOB_text);
|
(arg1->dsc_sub_type != isc_blob_text || arg2->dsc_sub_type != isc_blob_text);
|
||||||
if (!bin_cmp)
|
if (!bin_cmp)
|
||||||
{
|
{
|
||||||
both_are_text = true;
|
both_are_text = true;
|
||||||
@ -709,7 +712,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_ERROR err)
|
|||||||
{
|
{
|
||||||
UCHAR buffer1[BUFFER_LARGE];
|
UCHAR buffer1[BUFFER_LARGE];
|
||||||
|
|
||||||
if (arg1->dsc_sub_type == BLOB_text)
|
if (arg1->dsc_sub_type == isc_blob_text)
|
||||||
ttype1 = arg1->dsc_scale; /* Load blob character set */
|
ttype1 = arg1->dsc_scale; /* Load blob character set */
|
||||||
else
|
else
|
||||||
ttype1 = ttype_none;
|
ttype1 = ttype_none;
|
||||||
@ -726,10 +729,10 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_ERROR err)
|
|||||||
|
|
||||||
/* Can we have a lightweight, binary comparison?*/
|
/* Can we have a lightweight, binary comparison?*/
|
||||||
bool bin_cmp =
|
bool bin_cmp =
|
||||||
(arg1->dsc_sub_type != BLOB_text || arg2->dsc_dtype > dtype_varying);
|
(arg1->dsc_sub_type != isc_blob_text || arg2->dsc_dtype > dtype_varying);
|
||||||
if (!bin_cmp)
|
if (!bin_cmp)
|
||||||
{
|
{
|
||||||
if (arg1->dsc_sub_type == BLOB_text)
|
if (arg1->dsc_sub_type == isc_blob_text)
|
||||||
{
|
{
|
||||||
obj1 = INTL_texttype_lookup(tdbb, ttype1, err, NULL);
|
obj1 = INTL_texttype_lookup(tdbb, ttype1, err, NULL);
|
||||||
fb_assert(obj1 != NULL);
|
fb_assert(obj1 != NULL);
|
||||||
|
@ -4413,7 +4413,7 @@ static bool validate_text_type(thread_db* tdbb, ISC_STATUS* status,
|
|||||||
!INTL_defined_type(tdbb, status, tfb->tfb_desc.dsc_ttype))
|
!INTL_defined_type(tdbb, status, tfb->tfb_desc.dsc_ttype))
|
||||||
||
|
||
|
||||||
(tfb->tfb_desc.dsc_dtype == dtype_blob &&
|
(tfb->tfb_desc.dsc_dtype == dtype_blob &&
|
||||||
tfb->tfb_desc.dsc_sub_type == BLOB_text &&
|
tfb->tfb_desc.dsc_sub_type == isc_blob_text &&
|
||||||
!INTL_defined_type(tdbb, status, tfb->tfb_desc.dsc_scale)))
|
!INTL_defined_type(tdbb, status, tfb->tfb_desc.dsc_scale)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -863,7 +863,7 @@ void DSC_make_descriptor(DSC* desc,
|
|||||||
case blr_blob:
|
case blr_blob:
|
||||||
desc->dsc_length = 2 * sizeof(SLONG);
|
desc->dsc_length = 2 * sizeof(SLONG);
|
||||||
desc->dsc_dtype = dtype_blob;
|
desc->dsc_dtype = dtype_blob;
|
||||||
if (sub_type == BLOB_text) {
|
if (sub_type == isc_blob_text) {
|
||||||
fb_assert(charset <= MAX_SCHAR);
|
fb_assert(charset <= MAX_SCHAR);
|
||||||
desc->dsc_scale = (SCHAR) charset;
|
desc->dsc_scale = (SCHAR) charset;
|
||||||
}
|
}
|
||||||
|
@ -372,29 +372,29 @@ inline bool dsc::isBlob() const
|
|||||||
|
|
||||||
inline bool dsc::isBinaryBlob() const
|
inline bool dsc::isBinaryBlob() const
|
||||||
{
|
{
|
||||||
return isBlob() && dsc_sub_type == BLOB_untyped;
|
return isBlob() && dsc_sub_type == isc_blob_untyped;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool dsc::isTextBlob() const
|
inline bool dsc::isTextBlob() const
|
||||||
{
|
{
|
||||||
return isBlob() && dsc_sub_type == BLOB_text;
|
return isBlob() && dsc_sub_type == isc_blob_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool dsc::isMetadataBlob() const
|
inline bool dsc::isMetadataBlob() const
|
||||||
{
|
{
|
||||||
return isBlob()
|
return isBlob()
|
||||||
&& dsc_sub_type >= BLOB_blr
|
&& dsc_sub_type >= isc_blob_blr
|
||||||
&& dsc_sub_type < BLOB_max_predefined_subtype;
|
&& dsc_sub_type < isc_blob_max_predefined_subtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool dsc::isReservedBlob() const
|
inline bool dsc::isReservedBlob() const
|
||||||
{
|
{
|
||||||
return isBlob() && dsc_sub_type >= BLOB_max_predefined_subtype;
|
return isBlob() && dsc_sub_type >= isc_blob_max_predefined_subtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool dsc::isUserDefinedBlob() const
|
inline bool dsc::isUserDefinedBlob() const
|
||||||
{
|
{
|
||||||
return isBlob() && dsc_sub_type < BLOB_untyped;
|
return isBlob() && dsc_sub_type < isc_blob_untyped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
* Contributor(s): ______________________________________.
|
* Contributor(s): ______________________________________.
|
||||||
* $Id: evl.cpp,v 1.79 2004-04-25 02:30:30 skidder Exp $
|
* $Id: evl.cpp,v 1.80 2004-04-29 17:48:39 brodsom Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -64,6 +64,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "../jrd/common.h"
|
#include "../jrd/common.h"
|
||||||
|
#include "../jrd/y_ref.h"
|
||||||
|
#include "../jrd/ibase.h"
|
||||||
|
|
||||||
#include "../jrd/jrd.h"
|
#include "../jrd/jrd.h"
|
||||||
#include "../jrd/val.h"
|
#include "../jrd/val.h"
|
||||||
#include "../jrd/req.h"
|
#include "../jrd/req.h"
|
||||||
@ -4371,7 +4374,7 @@ static bool sleuth(thread_db* tdbb, jrd_nod* node, const dsc* desc1, const dsc*
|
|||||||
|
|
||||||
USHORT ttype;
|
USHORT ttype;
|
||||||
if (desc1->dsc_dtype == dtype_blob) {
|
if (desc1->dsc_dtype == dtype_blob) {
|
||||||
if (desc1->dsc_sub_type == BLOB_text)
|
if (desc1->dsc_sub_type == isc_blob_text)
|
||||||
ttype = desc1->dsc_scale; /* Load blob character set */
|
ttype = desc1->dsc_scale; /* Load blob character set */
|
||||||
else
|
else
|
||||||
ttype = INTL_TTYPE(desc2);
|
ttype = INTL_TTYPE(desc2);
|
||||||
@ -4514,7 +4517,7 @@ static bool string_boolean(thread_db* tdbb, jrd_nod* node, dsc* desc1,
|
|||||||
* but don't transliterate character set if the source blob is binary
|
* but don't transliterate character set if the source blob is binary
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (desc1->dsc_sub_type == BLOB_text) {
|
if (desc1->dsc_sub_type == isc_blob_text) {
|
||||||
type1 = desc1->dsc_scale; /* pick up character set of blob */
|
type1 = desc1->dsc_scale; /* pick up character set of blob */
|
||||||
if (!computed_invariant) {
|
if (!computed_invariant) {
|
||||||
l2 =
|
l2 =
|
||||||
@ -4794,7 +4797,7 @@ static dsc* substring(
|
|||||||
|
|
||||||
USHORT ttype;
|
USHORT ttype;
|
||||||
TextType obj1 = NULL;
|
TextType obj1 = NULL;
|
||||||
if (dtype_blob == value->dsc_dtype && (BLOB_text != value->dsc_sub_type
|
if (dtype_blob == value->dsc_dtype && (isc_blob_text != value->dsc_sub_type
|
||||||
|| (ttype = value->dsc_scale) == ttype_ascii || ttype == ttype_none || ttype == ttype_binary
|
|| (ttype = value->dsc_scale) == ttype_ascii || ttype == ttype_none || ttype == ttype_binary
|
||||||
|| ((obj1 = INTL_texttype_lookup(tdbb, ttype, ERR_post, NULL)) != NULL
|
|| ((obj1 = INTL_texttype_lookup(tdbb, ttype, ERR_post, NULL)) != NULL
|
||||||
&& 1 == obj1.getBytesPerChar())))
|
&& 1 == obj1.getBytesPerChar())))
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
FIELD(fld_context , nam_v_context , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_context , nam_v_context , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_ctx_name , nam_context , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_ctx_name , nam_context , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
FIELD(fld_description , nam_description , dtype_blob , BLOB_SIZE , BLOB_text , 0, NULL)
|
FIELD(fld_description , nam_description , dtype_blob , BLOB_SIZE , isc_blob_text , 0, NULL)
|
||||||
FIELD(fld_edit_string , nam_edit_string , dtype_varying , 127 , 0 , 0, NULL)
|
FIELD(fld_edit_string , nam_edit_string , dtype_varying , 127 , 0 , 0, NULL)
|
||||||
FIELD(fld_f_id , nam_f_id , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_f_id , nam_f_id , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_f_name , nam_f_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_f_name , nam_f_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
@ -45,24 +45,24 @@
|
|||||||
FIELD(fld_p_number , nam_p_number , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
FIELD(fld_p_number , nam_p_number , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
||||||
FIELD(fld_p_sequence , nam_p_sequence , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
FIELD(fld_p_sequence , nam_p_sequence , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
||||||
FIELD(fld_p_type , nam_p_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_p_type , nam_p_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_q_header , nam_q_header , dtype_blob , BLOB_SIZE , BLOB_text , 0, NULL)
|
FIELD(fld_q_header , nam_q_header , dtype_blob , BLOB_SIZE , isc_blob_text , 0, NULL)
|
||||||
FIELD(fld_r_id , nam_r_id , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_r_id , nam_r_id , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_r_name , nam_r_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_r_name , nam_r_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
FIELD(fld_s_count , nam_s_count , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_s_count , nam_s_count , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_s_length , nam_s_length , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_s_length , nam_s_length , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_source , nam_source , dtype_blob , BLOB_SIZE , BLOB_text , 0, NULL)
|
FIELD(fld_source , nam_source , dtype_blob , BLOB_SIZE , isc_blob_text , 0, NULL)
|
||||||
FIELD(fld_sub_type , nam_f_sub_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_sub_type , nam_f_sub_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_v_blr , nam_v_blr , dtype_blob , BLOB_SIZE , BLOB_blr , 0, NULL)
|
FIELD(fld_v_blr , nam_v_blr , dtype_blob , BLOB_SIZE , isc_blob_blr , 0, NULL)
|
||||||
FIELD(fld_validation , nam_vl_blr , dtype_blob , BLOB_SIZE , BLOB_blr , 0, NULL)
|
FIELD(fld_validation , nam_vl_blr , dtype_blob , BLOB_SIZE , isc_blob_blr , 0, NULL)
|
||||||
FIELD(fld_value , nam_value , dtype_blob , BLOB_SIZE , BLOB_blr , 0, NULL)
|
FIELD(fld_value , nam_value , dtype_blob , BLOB_SIZE , isc_blob_blr , 0, NULL)
|
||||||
FIELD(fld_class , nam_class , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_class , nam_class , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
FIELD(fld_acl , nam_acl , dtype_blob , BLOB_SIZE , BLOB_acl , 0, NULL)
|
FIELD(fld_acl , nam_acl , dtype_blob , BLOB_SIZE , isc_blob_acl , 0, NULL)
|
||||||
FIELD(fld_file_name , nam_file_name , dtype_varying , 255 , 0 , 0, NULL)
|
FIELD(fld_file_name , nam_file_name , dtype_varying , 255 , 0 , 0, NULL)
|
||||||
FIELD(fld_file_seq , nam_file_seq , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_file_seq , nam_file_seq , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_file_start , nam_file_start , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
FIELD(fld_file_start , nam_file_start , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
||||||
FIELD(fld_file_length , nam_file_length , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
FIELD(fld_file_length , nam_file_length , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
||||||
FIELD(fld_file_flags , nam_file_flags , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_file_flags , nam_file_flags , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_trigger , nam_trigger , dtype_blob , BLOB_SIZE , BLOB_blr , 0, NULL)
|
FIELD(fld_trigger , nam_trigger , dtype_blob , BLOB_SIZE , isc_blob_blr , 0, NULL)
|
||||||
|
|
||||||
FIELD(fld_trg_name , nam_trg_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_trg_name , nam_trg_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
FIELD(fld_gnr_name , nam_gnr_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_gnr_name , nam_gnr_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
@ -70,23 +70,23 @@
|
|||||||
FIELD(fld_ext_name , nam_ext_name , dtype_text , 31 , 0 , 0, NULL)
|
FIELD(fld_ext_name , nam_ext_name , dtype_text , 31 , 0 , 0, NULL)
|
||||||
FIELD(fld_typ_name , nam_typ_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_typ_name , nam_typ_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
FIELD(fld_dimensions , nam_dimensions , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_dimensions , nam_dimensions , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_runtime , nam_runtime , dtype_blob , BLOB_SIZE , BLOB_summary , 0, NULL)
|
FIELD(fld_runtime , nam_runtime , dtype_blob , BLOB_SIZE , isc_blob_summary , 0, NULL)
|
||||||
FIELD(fld_trg_seq , nam_trg_seq , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_trg_seq , nam_trg_seq , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_gnr_type , nam_gnr_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_gnr_type , nam_gnr_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_trg_type , nam_trg_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_trg_type , nam_trg_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_obj_type , nam_obj_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_obj_type , nam_obj_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_mechanism , nam_mechanism , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_mechanism , nam_mechanism , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_f_descr , nam_desc , dtype_blob , BLOB_SIZE , BLOB_format , 0, NULL)
|
FIELD(fld_f_descr , nam_desc , dtype_blob , BLOB_SIZE , isc_blob_format , 0, NULL)
|
||||||
FIELD(fld_fun_type , nam_fun_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_fun_type , nam_fun_type , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_trans_id , nam_trans_id , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
FIELD(fld_trans_id , nam_trans_id , dtype_long , sizeof(SLONG) , 0 , 0, NULL)
|
||||||
FIELD(fld_trans_state , nam_trans_state , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_trans_state , nam_trans_state , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_time , nam_time , dtype_timestamp, TIMESTAMP_SIZE,0 , 0, NULL)
|
FIELD(fld_time , nam_time , dtype_timestamp, TIMESTAMP_SIZE,0 , 0, NULL)
|
||||||
FIELD(fld_trans_desc , nam_trans_desc , dtype_blob , BLOB_SIZE , BLOB_tra , 0, NULL)
|
FIELD(fld_trans_desc , nam_trans_desc , dtype_blob , BLOB_SIZE , isc_blob_tra , 0, NULL)
|
||||||
FIELD(fld_msg , nam_msg , dtype_varying , 80 , 0 , 0, NULL)
|
FIELD(fld_msg , nam_msg , dtype_varying , 80 , 0 , 0, NULL)
|
||||||
FIELD(fld_msg_num , nam_msg_num , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_msg_num , nam_msg_num , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_user , nam_user , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_user , nam_user , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
FIELD(fld_privilege , nam_privilege , dtype_text , 6 , 0 , 0, NULL)
|
FIELD(fld_privilege , nam_privilege , dtype_text , 6 , 0 , 0, NULL)
|
||||||
FIELD(fld_ext_desc , nam_ext_desc , dtype_blob , BLOB_SIZE , BLOB_extfile , 0, NULL)
|
FIELD(fld_ext_desc , nam_ext_desc , dtype_blob , BLOB_SIZE , isc_blob_extfile , 0, NULL)
|
||||||
FIELD(fld_shad_num , nam_shad_num , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_shad_num , nam_shad_num , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_gen_name , nam_gen_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_gen_name , nam_gen_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
FIELD(fld_gen_id , nam_gen_id , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_gen_id , nam_gen_id , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
@ -100,7 +100,7 @@
|
|||||||
FIELD(fld_match , nam_match , dtype_text , 7 , 0 , 0, dflt_full)
|
FIELD(fld_match , nam_match , dtype_text , 7 , 0 , 0, dflt_full)
|
||||||
FIELD(fld_rule , nam_rule , dtype_text , 11 , 0 , 0, dflt_restrict)
|
FIELD(fld_rule , nam_rule , dtype_text , 11 , 0 , 0, dflt_restrict)
|
||||||
FIELD(fld_file_partitions, nam_file_partitions, dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_file_partitions, nam_file_partitions, dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_prc_blr , nam_prc_blr , dtype_blob , BLOB_SIZE , BLOB_blr , 0, NULL)
|
FIELD(fld_prc_blr , nam_prc_blr , dtype_blob , BLOB_SIZE , isc_blob_blr , 0, NULL)
|
||||||
FIELD(fld_prc_id , nam_prc_id , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_prc_id , nam_prc_id , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_prc_prm , nam_prc_prm , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
FIELD(fld_prc_prm , nam_prc_prm , dtype_short , sizeof(SSHORT), 0 , 0, NULL)
|
||||||
FIELD(fld_prc_name , nam_prc_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
FIELD(fld_prc_name , nam_prc_name , dtype_text , 31 , dsc_text_type_metadata, 0, NULL)
|
||||||
|
@ -136,7 +136,7 @@ ISC_STATUS filter_acl(USHORT action, BlobControl* control)
|
|||||||
* Get next segment from a access control list.
|
* Get next segment from a access control list.
|
||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
if (action != ACTION_open)
|
if (action != isc_blob_filter_open)
|
||||||
return string_filter(action, control);
|
return string_filter(action, control);
|
||||||
|
|
||||||
/* Initialize for retrieval */
|
/* Initialize for retrieval */
|
||||||
@ -151,7 +151,7 @@ ISC_STATUS filter_acl(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
USHORT length;
|
USHORT length;
|
||||||
const ISC_STATUS status =
|
const ISC_STATUS status =
|
||||||
caller(ACTION_get_segment, control, (USHORT) l, temp, &length);
|
caller(isc_blob_filter_get_segment, control, (USHORT) l, temp, &length);
|
||||||
|
|
||||||
TEXT line[256];
|
TEXT line[256];
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ ISC_STATUS filter_blr(USHORT action, BlobControl* control)
|
|||||||
* doesn't complain.
|
* doesn't complain.
|
||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
if (action != ACTION_open)
|
if (action != isc_blob_filter_open)
|
||||||
return string_filter(action, control);
|
return string_filter(action, control);
|
||||||
|
|
||||||
/* Initialize for retrieval */
|
/* Initialize for retrieval */
|
||||||
@ -233,7 +233,7 @@ ISC_STATUS filter_blr(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
USHORT length;
|
USHORT length;
|
||||||
const ISC_STATUS status =
|
const ISC_STATUS status =
|
||||||
caller(ACTION_get_segment, control, (USHORT) l, temp, &length);
|
caller(isc_blob_filter_get_segment, control, (USHORT) l, temp, &length);
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
if ((l > length) && (temp[length - 1] != blr_eoc))
|
if ((l > length) && (temp[length - 1] != blr_eoc))
|
||||||
@ -264,14 +264,14 @@ ISC_STATUS filter_format(USHORT action, BlobControl* control)
|
|||||||
**************************************/
|
**************************************/
|
||||||
/* Unless this is a get segment call, just return success */
|
/* Unless this is a get segment call, just return success */
|
||||||
|
|
||||||
if (action != ACTION_get_segment)
|
if (action != isc_blob_filter_get_segment)
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
/* Loop thru descriptors looking for one with a data type */
|
/* Loop thru descriptors looking for one with a data type */
|
||||||
dsc desc;
|
dsc desc;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
USHORT length;
|
USHORT length;
|
||||||
const ISC_STATUS status = caller(ACTION_get_segment,
|
const ISC_STATUS status = caller(isc_blob_filter_get_segment,
|
||||||
control,
|
control,
|
||||||
sizeof(desc),
|
sizeof(desc),
|
||||||
reinterpret_cast<UCHAR*>(&desc), &length);
|
reinterpret_cast<UCHAR*>(&desc), &length);
|
||||||
@ -327,12 +327,12 @@ ISC_STATUS filter_runtime(USHORT action, BlobControl* control)
|
|||||||
* Get next segment from a relation runtime summary blob.
|
* Get next segment from a relation runtime summary blob.
|
||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
if (action == ACTION_close)
|
if (action == isc_blob_filter_close)
|
||||||
return string_filter(action, control);
|
return string_filter(action, control);
|
||||||
|
|
||||||
/* Unless this is a get segment call, just return success */
|
/* Unless this is a get segment call, just return success */
|
||||||
|
|
||||||
if (action != ACTION_get_segment)
|
if (action != isc_blob_filter_get_segment)
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
/* If there is a string filter active, use it first */
|
/* If there is a string filter active, use it first */
|
||||||
@ -341,7 +341,7 @@ ISC_STATUS filter_runtime(USHORT action, BlobControl* control)
|
|||||||
const ISC_STATUS astatus = string_filter(action, control);
|
const ISC_STATUS astatus = string_filter(action, control);
|
||||||
if (astatus != isc_segstr_eof)
|
if (astatus != isc_segstr_eof)
|
||||||
return astatus;
|
return astatus;
|
||||||
string_filter(ACTION_close, control);
|
string_filter(isc_blob_filter_close, control);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop thru descriptors looking for one with a data type */
|
/* Loop thru descriptors looking for one with a data type */
|
||||||
@ -352,7 +352,7 @@ ISC_STATUS filter_runtime(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
USHORT length;
|
USHORT length;
|
||||||
const ISC_STATUS status =
|
const ISC_STATUS status =
|
||||||
caller(ACTION_get_segment, control, buff_len, buff, &length);
|
caller(isc_blob_filter_get_segment, control, buff_len, buff, &length);
|
||||||
|
|
||||||
if (status == isc_segment)
|
if (status == isc_segment)
|
||||||
return isc_segstr_eof;
|
return isc_segstr_eof;
|
||||||
@ -477,7 +477,7 @@ ISC_STATUS filter_text(USHORT action, BlobControl* control)
|
|||||||
BlobControl* source;
|
BlobControl* source;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ACTION_open:
|
case isc_blob_filter_open:
|
||||||
source = control->ctl_handle;
|
source = control->ctl_handle;
|
||||||
control->ctl_total_length = source->ctl_total_length;
|
control->ctl_total_length = source->ctl_total_length;
|
||||||
control->ctl_max_segment = source->ctl_max_segment;
|
control->ctl_max_segment = source->ctl_max_segment;
|
||||||
@ -486,23 +486,23 @@ ISC_STATUS filter_text(USHORT action, BlobControl* control)
|
|||||||
control->ctl_data[3] = 0;
|
control->ctl_data[3] = 0;
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_close:
|
case isc_blob_filter_close:
|
||||||
if (control->ctl_data[1]) {
|
if (control->ctl_data[1]) {
|
||||||
gds__free((SLONG *) control->ctl_data[1]);
|
gds__free((SLONG *) control->ctl_data[1]);
|
||||||
control->ctl_data[1] = 0;
|
control->ctl_data[1] = 0;
|
||||||
}
|
}
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_get_segment:
|
case isc_blob_filter_get_segment:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTION_put_segment:
|
case isc_blob_filter_put_segment:
|
||||||
case ACTION_create:
|
case isc_blob_filter_create:
|
||||||
case ACTION_seek:
|
case isc_blob_filter_seek:
|
||||||
return isc_uns_ext;
|
return isc_uns_ext;
|
||||||
|
|
||||||
case ACTION_alloc:
|
case isc_blob_filter_alloc:
|
||||||
case ACTION_free:
|
case isc_blob_filter_free:
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -510,7 +510,7 @@ ISC_STATUS filter_text(USHORT action, BlobControl* control)
|
|||||||
return isc_uns_ext;
|
return isc_uns_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drop thru for ACTION_get_segment. */
|
/* Drop thru for isc_blob_filter_get_segment. */
|
||||||
|
|
||||||
const TEXT* left_over = 0;
|
const TEXT* left_over = 0;
|
||||||
USHORT left_length = 0;
|
USHORT left_length = 0;
|
||||||
@ -544,7 +544,7 @@ ISC_STATUS filter_text(USHORT action, BlobControl* control)
|
|||||||
(control->ctl_buffer_length - buffer_used > 0)))
|
(control->ctl_buffer_length - buffer_used > 0)))
|
||||||
{
|
{
|
||||||
USHORT l = control->ctl_buffer_length - buffer_used;
|
USHORT l = control->ctl_buffer_length - buffer_used;
|
||||||
const ISC_STATUS status = caller(ACTION_get_segment, control, l,
|
const ISC_STATUS status = caller(isc_blob_filter_get_segment, control, l,
|
||||||
control->ctl_buffer + buffer_used, &l);
|
control->ctl_buffer + buffer_used, &l);
|
||||||
if (status == isc_segment)
|
if (status == isc_segment)
|
||||||
control->ctl_data[2] = isc_segment;
|
control->ctl_data[2] = isc_segment;
|
||||||
@ -582,7 +582,7 @@ ISC_STATUS filter_text(USHORT action, BlobControl* control)
|
|||||||
if (!control->ctl_data[1]) {
|
if (!control->ctl_data[1]) {
|
||||||
control->ctl_data[1] =
|
control->ctl_data[1] =
|
||||||
(IPTR) gds__alloc((SLONG) control->ctl_buffer_length);
|
(IPTR) gds__alloc((SLONG) control->ctl_buffer_length);
|
||||||
/* FREE: above & ACTION_close in this procedure */
|
/* FREE: above & isc_blob_filter_close in this procedure */
|
||||||
if (!control->ctl_data[1]) /* NOMEM: */
|
if (!control->ctl_data[1]) /* NOMEM: */
|
||||||
return isc_virmemexh;
|
return isc_virmemexh;
|
||||||
control->ctl_data[3] = control->ctl_buffer_length;
|
control->ctl_data[3] = control->ctl_buffer_length;
|
||||||
@ -673,8 +673,8 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
USHORT result_length;
|
USHORT result_length;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ACTION_open:
|
case isc_blob_filter_open:
|
||||||
case ACTION_create:
|
case isc_blob_filter_create:
|
||||||
for (i = 0; i < FB_NELEM(control->ctl_data); i++)
|
for (i = 0; i < FB_NELEM(control->ctl_data); i++)
|
||||||
control->ctl_data[i] = 0;
|
control->ctl_data[i] = 0;
|
||||||
aux = NULL;
|
aux = NULL;
|
||||||
@ -686,7 +686,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
dest_cs = control->ctl_to_sub_type;
|
dest_cs = control->ctl_to_sub_type;
|
||||||
|
|
||||||
aux = (ctlaux*) gds__alloc((SLONG) sizeof(*aux));
|
aux = (ctlaux*) gds__alloc((SLONG) sizeof(*aux));
|
||||||
/* FREE: on ACTION_close in this routine */
|
/* FREE: on isc_blob_filter_close in this routine */
|
||||||
if (!aux) /* NOMEM: */
|
if (!aux) /* NOMEM: */
|
||||||
return isc_virmemexh;
|
return isc_virmemexh;
|
||||||
#ifdef DEBUG_GDS_ALLOC
|
#ifdef DEBUG_GDS_ALLOC
|
||||||
@ -708,7 +708,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
a filter from <source> to <Unicode>.
|
a filter from <source> to <Unicode>.
|
||||||
recursively using the same routine. */
|
recursively using the same routine. */
|
||||||
|
|
||||||
if (action == ACTION_open) {
|
if (action == isc_blob_filter_open) {
|
||||||
aux->ctlaux_obj1 =
|
aux->ctlaux_obj1 =
|
||||||
INTL_convert_lookup(tdbb, dest_cs, CS_UNICODE_UCS2);
|
INTL_convert_lookup(tdbb, dest_cs, CS_UNICODE_UCS2);
|
||||||
}
|
}
|
||||||
@ -728,7 +728,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
// ISC_STATUS to pointer!
|
// ISC_STATUS to pointer!
|
||||||
aux->ctlaux_subfilter =
|
aux->ctlaux_subfilter =
|
||||||
(BlobControl*) caller(ACTION_alloc, control, 0, NULL, NULL);
|
(BlobControl*) caller(isc_blob_filter_alloc, control, 0, NULL, NULL);
|
||||||
|
|
||||||
/* This is freed in BLF_close_filter */
|
/* This is freed in BLF_close_filter */
|
||||||
|
|
||||||
@ -738,7 +738,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
control->ctl_source = filter_transliterate_text;
|
control->ctl_source = filter_transliterate_text;
|
||||||
source = control->ctl_handle;
|
source = control->ctl_handle;
|
||||||
|
|
||||||
if (action == ACTION_open) {
|
if (action == isc_blob_filter_open) {
|
||||||
control->ctl_from_sub_type = CS_UNICODE_UCS2;
|
control->ctl_from_sub_type = CS_UNICODE_UCS2;
|
||||||
aux->ctlaux_subfilter->ctl_to_sub_type = CS_UNICODE_UCS2;
|
aux->ctlaux_subfilter->ctl_to_sub_type = CS_UNICODE_UCS2;
|
||||||
}
|
}
|
||||||
@ -755,7 +755,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == ACTION_open) {
|
if (action == isc_blob_filter_open) {
|
||||||
control->ctl_max_segment =
|
control->ctl_max_segment =
|
||||||
aux->ctlaux_obj1.convert(NULL, 0, NULL,
|
aux->ctlaux_obj1.convert(NULL, 0, NULL,
|
||||||
source->ctl_max_segment, &err_code, &err_position);
|
source->ctl_max_segment, &err_code, &err_position);
|
||||||
@ -779,7 +779,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
MAX(aux->ctlaux_buffer1_len,
|
MAX(aux->ctlaux_buffer1_len,
|
||||||
(80 * aux->ctlaux_expansion_factor) / EXP_SCALE);
|
(80 * aux->ctlaux_expansion_factor) / EXP_SCALE);
|
||||||
}
|
}
|
||||||
else { /* ACTION_create */
|
else { /* isc_blob_filter_create */
|
||||||
/* In a create, the source->ctl_max_segment size isn't set (as
|
/* In a create, the source->ctl_max_segment size isn't set (as
|
||||||
* nothing has been written!). Therefore, take a best guess
|
* nothing has been written!). Therefore, take a best guess
|
||||||
* for an appropriate buffer size, allocate that, and re-allocate
|
* for an appropriate buffer size, allocate that, and re-allocate
|
||||||
@ -804,7 +804,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
aux->ctlaux_buffer1 =
|
aux->ctlaux_buffer1 =
|
||||||
(BYTE *) gds__alloc((SLONG) aux->ctlaux_buffer1_len);
|
(BYTE *) gds__alloc((SLONG) aux->ctlaux_buffer1_len);
|
||||||
/* FREE: on ACTION_close in this procedure */
|
/* FREE: on isc_blob_filter_close in this procedure */
|
||||||
if (!aux->ctlaux_buffer1) /* NOMEM: */
|
if (!aux->ctlaux_buffer1) /* NOMEM: */
|
||||||
return isc_virmemexh;
|
return isc_virmemexh;
|
||||||
|
|
||||||
@ -815,7 +815,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_close:
|
case isc_blob_filter_close:
|
||||||
if (aux && aux->ctlaux_buffer1) {
|
if (aux && aux->ctlaux_buffer1) {
|
||||||
gds__free((SLONG *) aux->ctlaux_buffer1);
|
gds__free((SLONG *) aux->ctlaux_buffer1);
|
||||||
aux->ctlaux_buffer1 = NULL;
|
aux->ctlaux_buffer1 = NULL;
|
||||||
@ -828,11 +828,11 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
}
|
}
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_get_segment:
|
case isc_blob_filter_get_segment:
|
||||||
/* Fall through to handle get_segment below */
|
/* Fall through to handle get_segment below */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTION_put_segment:
|
case isc_blob_filter_put_segment:
|
||||||
/* Now convert from the input buffer into the temporary buffer */
|
/* Now convert from the input buffer into the temporary buffer */
|
||||||
|
|
||||||
/* How much space do we need to convert? */
|
/* How much space do we need to convert? */
|
||||||
@ -845,7 +845,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
gds__free((SLONG *) aux->ctlaux_buffer1);
|
gds__free((SLONG *) aux->ctlaux_buffer1);
|
||||||
aux->ctlaux_buffer1_len = result_length;
|
aux->ctlaux_buffer1_len = result_length;
|
||||||
aux->ctlaux_buffer1 = (BYTE *) gds__alloc((SLONG) result_length);
|
aux->ctlaux_buffer1 = (BYTE *) gds__alloc((SLONG) result_length);
|
||||||
/* FREE: above & ACTION_close in this routine */
|
/* FREE: above & isc_blob_filter_close in this routine */
|
||||||
if (!aux->ctlaux_buffer1) /* NOMEM: */
|
if (!aux->ctlaux_buffer1) /* NOMEM: */
|
||||||
return isc_virmemexh;
|
return isc_virmemexh;
|
||||||
}
|
}
|
||||||
@ -861,7 +861,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
/* hand the text off to the next stage of the filter */
|
/* hand the text off to the next stage of the filter */
|
||||||
|
|
||||||
status = caller(ACTION_put_segment, control, result_length,
|
status = caller(isc_blob_filter_put_segment, control, result_length,
|
||||||
aux->ctlaux_buffer1, NULL);
|
aux->ctlaux_buffer1, NULL);
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
@ -877,11 +877,11 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_seek:
|
case isc_blob_filter_seek:
|
||||||
return isc_uns_ext;
|
return isc_uns_ext;
|
||||||
|
|
||||||
case ACTION_alloc:
|
case isc_blob_filter_alloc:
|
||||||
case ACTION_free:
|
case isc_blob_filter_free:
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -889,7 +889,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
return isc_uns_ext;
|
return isc_uns_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drop thru for ACTION_get_segment. */
|
/* Drop thru for isc_blob_filter_get_segment. */
|
||||||
|
|
||||||
/* Do we already have enough bytes in temp buffer to fill output buffer? */
|
/* Do we already have enough bytes in temp buffer to fill output buffer? */
|
||||||
|
|
||||||
@ -925,7 +925,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
|
|||||||
// into the temporary buffer
|
// into the temporary buffer
|
||||||
|
|
||||||
USHORT bytes_read_from_source = 0;
|
USHORT bytes_read_from_source = 0;
|
||||||
status = caller(ACTION_get_segment,
|
status = caller(isc_blob_filter_get_segment,
|
||||||
control,
|
control,
|
||||||
(USHORT) (aux->ctlaux_buffer1_len - length),
|
(USHORT) (aux->ctlaux_buffer1_len - length),
|
||||||
aux->ctlaux_buffer1 + length,
|
aux->ctlaux_buffer1 + length,
|
||||||
@ -1004,7 +1004,7 @@ ISC_STATUS filter_trans(USHORT action, BlobControl* control)
|
|||||||
* Pretty print a transaction description.
|
* Pretty print a transaction description.
|
||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
if (action != ACTION_open)
|
if (action != isc_blob_filter_open)
|
||||||
return string_filter(action, control);
|
return string_filter(action, control);
|
||||||
|
|
||||||
/* Initialize for retrieval */
|
/* Initialize for retrieval */
|
||||||
@ -1019,7 +1019,7 @@ ISC_STATUS filter_trans(USHORT action, BlobControl* control)
|
|||||||
|
|
||||||
USHORT length;
|
USHORT length;
|
||||||
const ISC_STATUS status =
|
const ISC_STATUS status =
|
||||||
caller(ACTION_get_segment, control, (USHORT) l, temp, &length);
|
caller(isc_blob_filter_get_segment, control, (USHORT) l, temp, &length);
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
TEXT line[256];
|
TEXT line[256];
|
||||||
@ -1092,7 +1092,7 @@ static ISC_STATUS caller(
|
|||||||
source->ctl_buffer = buffer;
|
source->ctl_buffer = buffer;
|
||||||
source->ctl_buffer_length = buffer_length;
|
source->ctl_buffer_length = buffer_length;
|
||||||
|
|
||||||
// Warning: it will be pointer to ISC_STATUS when action == ACTION_alloc.
|
// Warning: it will be pointer to ISC_STATUS when action == isc_blob_filter_alloc.
|
||||||
const ISC_STATUS status = (*source->ctl_source) (action, source);
|
const ISC_STATUS status = (*source->ctl_source) (action, source);
|
||||||
|
|
||||||
if (return_length)
|
if (return_length)
|
||||||
@ -1176,14 +1176,14 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
|
|||||||
USHORT length;
|
USHORT length;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ACTION_close:
|
case isc_blob_filter_close:
|
||||||
while (string = (TMP) control->ctl_data[0]) {
|
while (string = (TMP) control->ctl_data[0]) {
|
||||||
control->ctl_data[0] = (IPTR) string->tmp_next;
|
control->ctl_data[0] = (IPTR) string->tmp_next;
|
||||||
gds__free(string);
|
gds__free(string);
|
||||||
}
|
}
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
case ACTION_get_segment:
|
case isc_blob_filter_get_segment:
|
||||||
if (!(string = (TMP) control->ctl_data[1]))
|
if (!(string = (TMP) control->ctl_data[1]))
|
||||||
return isc_segstr_eof;
|
return isc_segstr_eof;
|
||||||
length = string->tmp_length - control->ctl_data[2];
|
length = string->tmp_length - control->ctl_data[2];
|
||||||
@ -1199,14 +1199,14 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
|
|||||||
control->ctl_segment_length = length;
|
control->ctl_segment_length = length;
|
||||||
return (length <= control->ctl_buffer_length) ? FB_SUCCESS : isc_segment;
|
return (length <= control->ctl_buffer_length) ? FB_SUCCESS : isc_segment;
|
||||||
|
|
||||||
case ACTION_put_segment:
|
case isc_blob_filter_put_segment:
|
||||||
case ACTION_create:
|
case isc_blob_filter_create:
|
||||||
case ACTION_seek:
|
case isc_blob_filter_seek:
|
||||||
case ACTION_open:
|
case isc_blob_filter_open:
|
||||||
return isc_uns_ext;
|
return isc_uns_ext;
|
||||||
|
|
||||||
case ACTION_alloc:
|
case isc_blob_filter_alloc:
|
||||||
case ACTION_free:
|
case isc_blob_filter_free:
|
||||||
return FB_SUCCESS;
|
return FB_SUCCESS;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1230,7 +1230,7 @@ static void string_put(BlobControl* control, const char* line)
|
|||||||
**************************************/
|
**************************************/
|
||||||
const USHORT l = strlen(line);
|
const USHORT l = strlen(line);
|
||||||
TMP string = (TMP) gds__alloc((SLONG) (sizeof(tmp) + l));
|
TMP string = (TMP) gds__alloc((SLONG) (sizeof(tmp) + l));
|
||||||
/* FREE: on ACTION_close in string_filter() */
|
/* FREE: on isc_blob_filter_close in string_filter() */
|
||||||
if (!string) { /* NOMEM: */
|
if (!string) { /* NOMEM: */
|
||||||
fb_assert(FALSE); /* out of memory */
|
fb_assert(FALSE); /* out of memory */
|
||||||
return; /* & No error handling at this level */
|
return; /* & No error handling at this level */
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
$Id: ibase.h,v 1.71 2004-03-30 08:34:14 robocop Exp $
|
$Id: ibase.h,v 1.72 2004-04-29 17:48:39 brodsom Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef JRD_IBASE_H
|
#ifndef JRD_IBASE_H
|
||||||
@ -2374,6 +2374,7 @@ enum info_db_provider
|
|||||||
#define isc_blob_format 6
|
#define isc_blob_format 6
|
||||||
#define isc_blob_tra 7
|
#define isc_blob_tra 7
|
||||||
#define isc_blob_extfile 8
|
#define isc_blob_extfile 8
|
||||||
|
#define isc_blob_max_predefined_subtype 9
|
||||||
|
|
||||||
/* the range 20-30 is reserved for dBASE and Paradox types */
|
/* the range 20-30 is reserved for dBASE and Paradox types */
|
||||||
|
|
||||||
|
@ -1441,7 +1441,7 @@ static void store_global_field(thread_db* tdbb, const gfld* gfield, jrd_req** ha
|
|||||||
X.RDB$SEGMENT_LENGTH.NULL = FALSE;
|
X.RDB$SEGMENT_LENGTH.NULL = FALSE;
|
||||||
X.RDB$FIELD_SUB_TYPE = gfield->gfld_sub_type;
|
X.RDB$FIELD_SUB_TYPE = gfield->gfld_sub_type;
|
||||||
X.RDB$SEGMENT_LENGTH = 80;
|
X.RDB$SEGMENT_LENGTH = 80;
|
||||||
if (gfield->gfld_sub_type == BLOB_text)
|
if (gfield->gfld_sub_type == isc_blob_text)
|
||||||
{
|
{
|
||||||
X.RDB$CHARACTER_SET_ID.NULL = FALSE;
|
X.RDB$CHARACTER_SET_ID.NULL = FALSE;
|
||||||
X.RDB$CHARACTER_SET_ID = CS_METADATA;
|
X.RDB$CHARACTER_SET_ID = CS_METADATA;
|
||||||
|
Loading…
Reference in New Issue
Block a user