mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:43:03 +01:00
Introduce UserBlob into backup.
This commit is contained in:
parent
4cd2a5a28b
commit
77649d995c
@ -57,6 +57,7 @@
|
||||
#include "../gpre/prett_proto.h"
|
||||
#endif
|
||||
|
||||
#include "../common/classes/UserBlob.h"
|
||||
#include "../common/classes/MsgPrint.h"
|
||||
|
||||
using MsgFormat::SafeArg;
|
||||
@ -104,14 +105,14 @@ SINT64 get_gen_id(const TEXT *, SSHORT);
|
||||
void get_ranges(burp_fld*);
|
||||
void put_array(burp_fld*, burp_rel*, ISC_QUAD *);
|
||||
void put_asciz(const SCHAR, const TEXT*);
|
||||
void put_blob(burp_fld*, ISC_QUAD *, ULONG);
|
||||
bool put_blr_blob(SCHAR, ISC_QUAD *);
|
||||
void put_blob(burp_fld*, ISC_QUAD&, ULONG);
|
||||
bool put_blr_blob(SCHAR, ISC_QUAD&);
|
||||
void put_data(burp_rel*);
|
||||
void put_index(burp_rel*);
|
||||
int put_message(SCHAR, const TEXT *, ULONG);
|
||||
void put_numeric(SCHAR, SLONG);
|
||||
void put_relation(burp_rel*);
|
||||
bool put_source_blob(SCHAR, SCHAR, ISC_QUAD *);
|
||||
bool put_source_blob(SCHAR, SCHAR, ISC_QUAD&);
|
||||
int put_text(SCHAR, const TEXT *, SSHORT);
|
||||
void set_capabilities(void);
|
||||
void write_character_sets(void);
|
||||
@ -219,19 +220,19 @@ const rfr_tab_t rfr_table[] =
|
||||
{0, 0, 0}
|
||||
};
|
||||
|
||||
const SCHAR blob_items[] =
|
||||
const UCHAR blob_items[] =
|
||||
{
|
||||
isc_info_blob_max_segment,
|
||||
isc_info_blob_num_segments,
|
||||
isc_info_blob_type,
|
||||
isc_info_blob_total_length
|
||||
};
|
||||
const SCHAR blr_items[] =
|
||||
const UCHAR blr_items[] =
|
||||
{
|
||||
isc_info_blob_max_segment,
|
||||
isc_info_blob_total_length
|
||||
};
|
||||
const SCHAR source_items[] =
|
||||
const UCHAR source_items[] =
|
||||
{
|
||||
isc_info_blob_max_segment,
|
||||
isc_info_blob_total_length,
|
||||
@ -460,9 +461,9 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
|
||||
MISC_terminate (X.RDB$SECURITY_CLASS, temp, l, sizeof(temp));
|
||||
BURP_verbose (155, temp);
|
||||
// msg 155 writing security class %s
|
||||
put_blr_blob (att_class_acl, &X.RDB$ACL);
|
||||
put_blr_blob (att_class_acl, X.RDB$ACL);
|
||||
put_source_blob (att_class_description2, att_class_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
put(tdgbl, att_end);
|
||||
END_FOR;
|
||||
ON_ERROR
|
||||
@ -1340,7 +1341,7 @@ void put_asciz( const SCHAR attribute, const TEXT* string)
|
||||
}
|
||||
|
||||
|
||||
void put_blob( burp_fld* field, ISC_QUAD* blob_id, ULONG count)
|
||||
void put_blob( burp_fld* field, ISC_QUAD& blob_id, ULONG count)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1360,14 +1361,14 @@ void put_blob( burp_fld* field, ISC_QUAD* blob_id, ULONG count)
|
||||
|
||||
// If the blob is null, don't store it. It will be restored as null.
|
||||
|
||||
if (!blob_id->gds_quad_high && !blob_id->gds_quad_low)
|
||||
if (UserBlob::blobIsNull(blob_id))
|
||||
return;
|
||||
|
||||
// Open the blob and get it's vital statistics
|
||||
|
||||
FB_API_HANDLE blob = 0;
|
||||
UserBlob blob(status_vector);
|
||||
|
||||
if (isc_open_blob(status_vector, &DB, &gds_trans, &blob, blob_id))
|
||||
if (!blob.open(DB, gds_trans, blob_id))
|
||||
{
|
||||
BURP_print(81, field->fld_name);
|
||||
// msg 81 error accessing blob field %s -- continuing
|
||||
@ -1375,9 +1376,7 @@ void put_blob( burp_fld* field, ISC_QUAD* blob_id, ULONG count)
|
||||
return;
|
||||
}
|
||||
|
||||
if (isc_blob_info(status_vector, &blob, sizeof(blob_items),
|
||||
blob_items, sizeof(blob_info),
|
||||
(char*) blob_info))
|
||||
if (!blob.getInfo(sizeof(blob_items), blob_items, sizeof(blob_info), blob_info))
|
||||
{
|
||||
BURP_error_redirect(status_vector, 20);
|
||||
// msg 20 isc_blob_info failed
|
||||
@ -1450,12 +1449,10 @@ void put_blob( burp_fld* field, ISC_QUAD* blob_id, ULONG count)
|
||||
|
||||
while (segments > 0)
|
||||
{
|
||||
USHORT segment_length;
|
||||
|
||||
ISC_STATUS status =
|
||||
isc_get_segment(status_vector, &blob, &segment_length, max_segment,
|
||||
(char*) buffer);
|
||||
size_t segment_length;
|
||||
blob.getSegment(max_segment, buffer, segment_length);
|
||||
|
||||
const ISC_STATUS status = blob.getCode();
|
||||
// Handle the errors. For stream blob isc_segment is not error here.
|
||||
if (status && (status != isc_segment || blob_type == 0))
|
||||
{
|
||||
@ -1472,7 +1469,7 @@ void put_blob( burp_fld* field, ISC_QUAD* blob_id, ULONG count)
|
||||
--segments;
|
||||
}
|
||||
|
||||
if (isc_close_blob(status_vector, &blob))
|
||||
if (!blob.close())
|
||||
BURP_error_redirect(status_vector, 23);
|
||||
// msg 23 isc_close_blob failed
|
||||
|
||||
@ -1481,7 +1478,7 @@ void put_blob( burp_fld* field, ISC_QUAD* blob_id, ULONG count)
|
||||
}
|
||||
|
||||
|
||||
bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
|
||||
bool put_blr_blob( SCHAR attribute, ISC_QUAD& blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1491,7 +1488,7 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
|
||||
*
|
||||
* Functional description
|
||||
* Write out a blr blob, if present. Otherwise do nothing.
|
||||
* Return true is there was the blob was present, false otherwise.
|
||||
* Return true if the blob was present, false otherwise.
|
||||
*
|
||||
**************************************/
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
@ -1501,22 +1498,20 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
|
||||
|
||||
// If the blob is null, don't store it. It will be restored as null.
|
||||
|
||||
if (!blob_id->gds_quad_high && !blob_id->gds_quad_low)
|
||||
if (UserBlob::blobIsNull(blob_id))
|
||||
return false;
|
||||
|
||||
// Open the blob and get it's vital statistics
|
||||
|
||||
FB_API_HANDLE blob = 0;
|
||||
UserBlob blob(status_vector);
|
||||
|
||||
if (isc_open_blob(status_vector, &DB, &gds_trans, &blob, blob_id))
|
||||
if (!blob.open(DB, gds_trans, blob_id))
|
||||
{
|
||||
BURP_error_redirect(status_vector, 24);
|
||||
// msg 24 isc_open_blob failed
|
||||
}
|
||||
|
||||
if (isc_blob_info(status_vector, &blob, sizeof(blr_items),
|
||||
(SCHAR *) blr_items, sizeof(blob_info),
|
||||
(char*) blob_info))
|
||||
if (!blob.getInfo(sizeof(blr_items), blr_items, sizeof(blob_info), blob_info))
|
||||
{
|
||||
BURP_error_redirect(status_vector, 20);
|
||||
// msg 20 isc_blob_info failed
|
||||
@ -1546,15 +1541,18 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
|
||||
default:
|
||||
BURP_print(79, SafeArg() << int(item));
|
||||
// msg 79 don't understand blob info item %ld
|
||||
if (!blob.close())
|
||||
BURP_error_redirect(status_vector, 23);
|
||||
// msg 23 isc_close_blob failed
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!length)
|
||||
{
|
||||
if (isc_close_blob(status_vector, &blob))
|
||||
if (!blob.close())
|
||||
BURP_error_redirect(status_vector, 23);
|
||||
// msg 23 isc_close_blob failed
|
||||
// msg 23 isc_close_blob failed
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1573,9 +1571,9 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
|
||||
else
|
||||
buffer = BURP_alloc(max_segment);
|
||||
|
||||
USHORT segment_length;
|
||||
while (!isc_get_segment(status_vector, &blob, &segment_length,
|
||||
(USHORT) max_segment, (char*) buffer))
|
||||
// The old code didn't accept isc_segment so we check it.
|
||||
size_t segment_length;
|
||||
while (blob.getSegment(max_segment, buffer, segment_length) && !blob.getCode())
|
||||
{
|
||||
if (segment_length)
|
||||
{
|
||||
@ -1583,11 +1581,11 @@ bool put_blr_blob( SCHAR attribute, ISC_QUAD * blob_id)
|
||||
}
|
||||
}
|
||||
|
||||
if (isc_close_blob(status_vector, &blob))
|
||||
if (!blob.close())
|
||||
{
|
||||
BURP_error_redirect(status_vector, 23);
|
||||
// msg 23 isc_close_blob failed
|
||||
}
|
||||
// msg 23 isc_close_blob failed
|
||||
|
||||
if (buffer != static_buffer)
|
||||
BURP_free(buffer);
|
||||
@ -1898,7 +1896,7 @@ void put_data(burp_rel* relation)
|
||||
!(field->fld_flags & FLD_array))
|
||||
{
|
||||
put_blob(field,
|
||||
(ISC_QUAD*) (buffer + field-> fld_offset),
|
||||
*(ISC_QUAD*) (buffer + field-> fld_offset),
|
||||
records);
|
||||
}
|
||||
}
|
||||
@ -2004,16 +2002,16 @@ void put_index( burp_rel* relation)
|
||||
general_on_error();
|
||||
END_ERROR;
|
||||
|
||||
put_source_blob (att_index_description2, att_index_description, &X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_index_description2, att_index_description, X.RDB$DESCRIPTION);
|
||||
put_numeric (att_index_type, X.RDB$INDEX_TYPE);
|
||||
|
||||
if (!X.RDB$EXPRESSION_SOURCE.NULL)
|
||||
put_source_blob (att_index_expression_source,
|
||||
att_index_expression_source,
|
||||
&X.RDB$EXPRESSION_SOURCE);
|
||||
X.RDB$EXPRESSION_SOURCE);
|
||||
if (!X.RDB$EXPRESSION_BLR.NULL)
|
||||
put_blr_blob (att_index_expression_blr,
|
||||
&X.RDB$EXPRESSION_BLR);
|
||||
X.RDB$EXPRESSION_BLR);
|
||||
if (!X.RDB$FOREIGN_KEY.NULL)
|
||||
PUT_TEXT (att_index_foreign_key, X.RDB$FOREIGN_KEY);
|
||||
put(tdgbl, att_end);
|
||||
@ -2083,7 +2081,7 @@ void put_index( burp_rel* relation)
|
||||
general_on_error();
|
||||
END_ERROR;
|
||||
put_source_blob (att_index_description2, att_index_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
if (tdgbl->BCK_capabilities & BCK_attributes_v3)
|
||||
FOR (REQUEST_HANDLE tdgbl->handles_put_index_req_handle6)
|
||||
I IN RDB$INDICES WITH I.RDB$INDEX_NAME = X.RDB$INDEX_NAME
|
||||
@ -2098,10 +2096,10 @@ void put_index( burp_rel* relation)
|
||||
if (!I.RDB$EXPRESSION_SOURCE.NULL)
|
||||
put_source_blob (att_index_expression_source,
|
||||
att_index_expression_source,
|
||||
&I.RDB$EXPRESSION_SOURCE);
|
||||
I.RDB$EXPRESSION_SOURCE);
|
||||
if (!I.RDB$EXPRESSION_BLR.NULL)
|
||||
put_blr_blob (att_index_expression_blr,
|
||||
&I.RDB$EXPRESSION_BLR);
|
||||
I.RDB$EXPRESSION_BLR);
|
||||
if (!I.RDB$FOREIGN_KEY.NULL)
|
||||
PUT_TEXT (att_index_foreign_key, I.RDB$FOREIGN_KEY);
|
||||
END_FOR;
|
||||
@ -2307,9 +2305,9 @@ void put_relation( burp_rel* relation)
|
||||
if (field->fld_edit_string[0])
|
||||
PUT_TEXT(att_field_edit_string, field->fld_edit_string);
|
||||
put_source_blob(att_field_description2, att_field_description,
|
||||
& field->fld_description);
|
||||
field->fld_description);
|
||||
put_source_blob(att_field_query_header, att_field_query_header,
|
||||
& field->fld_query_header);
|
||||
field->fld_query_header);
|
||||
if (field->fld_security_class[0])
|
||||
PUT_TEXT(att_field_security_class, field->fld_security_class);
|
||||
if (!(field->fld_flags & FLD_position_missing))
|
||||
@ -2329,9 +2327,9 @@ void put_relation( burp_rel* relation)
|
||||
if (field->fld_flags & FLD_collate_flag)
|
||||
put_numeric(att_field_collation_id, field->fld_collation_id);
|
||||
put_blr_blob(att_field_default_value,
|
||||
& field->fld_default_value);
|
||||
field->fld_default_value);
|
||||
put_source_blob(att_field_default_source, att_field_default_source,
|
||||
& field->fld_default_source);
|
||||
field->fld_default_source);
|
||||
if (relation->rel_flags & REL_view)
|
||||
{
|
||||
put_numeric(att_view_context, field->fld_view_context);
|
||||
@ -2390,8 +2388,8 @@ void put_relation( burp_rel* relation)
|
||||
|
||||
|
||||
bool put_source_blob(SCHAR attribute,
|
||||
SCHAR old_attribute,
|
||||
ISC_QUAD* blob_id)
|
||||
SCHAR old_attribute,
|
||||
ISC_QUAD& blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2410,27 +2408,25 @@ bool put_source_blob(SCHAR attribute,
|
||||
|
||||
BurpGlobals* tdgbl = BurpGlobals::getSpecific();
|
||||
|
||||
// If the blob is null, don't store it. It will be restored as null.
|
||||
// If the blob is null, don't store it. It will be restored as null.
|
||||
|
||||
if (!blob_id->gds_quad_high && !blob_id->gds_quad_low)
|
||||
if (UserBlob::blobIsNull(blob_id))
|
||||
return false;
|
||||
|
||||
if (tdgbl->gbl_sw_old_descriptions && attribute != att_field_query_header)
|
||||
return put_blr_blob(old_attribute, blob_id);
|
||||
|
||||
// Open the blob and get it's vital statistics
|
||||
// Open the blob and get it's vital statistics
|
||||
|
||||
FB_API_HANDLE blob = 0;
|
||||
UserBlob blob(status_vector);
|
||||
|
||||
if (isc_open_blob(status_vector, &DB, &gds_trans, &blob, blob_id))
|
||||
if (!blob.open(DB, gds_trans, blob_id))
|
||||
{
|
||||
BURP_error_redirect(status_vector, 24);
|
||||
// msg 24 isc_open_blob failed
|
||||
}
|
||||
|
||||
if (isc_blob_info(status_vector, &blob, sizeof(source_items),
|
||||
(SCHAR *) source_items, sizeof(blob_info),
|
||||
(SCHAR*) blob_info))
|
||||
if (!blob.getInfo(sizeof(source_items), source_items, sizeof(blob_info), blob_info))
|
||||
{
|
||||
BURP_error_redirect(status_vector, 20);
|
||||
// msg 20 isc_blob_info failed
|
||||
@ -2464,13 +2460,18 @@ bool put_source_blob(SCHAR attribute,
|
||||
default:
|
||||
BURP_print(79, SafeArg() << int(item));
|
||||
// msg 79 don't understand blob info item %ld
|
||||
if (!blob.close())
|
||||
{
|
||||
BURP_error_redirect(status_vector, 23);
|
||||
// msg 23 isc_close_blob failed
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!length)
|
||||
{
|
||||
if (isc_close_blob(status_vector, &blob))
|
||||
if (!blob.close())
|
||||
{
|
||||
BURP_error_redirect(status_vector, 23);
|
||||
// msg 23 isc_close_blob failed
|
||||
@ -2478,14 +2479,14 @@ bool put_source_blob(SCHAR attribute,
|
||||
return false;
|
||||
}
|
||||
|
||||
// Rdb sometimes gets the length messed up
|
||||
// Rdb sometimes gets the length messed up
|
||||
|
||||
if (length < max_segment)
|
||||
length = max_segment;
|
||||
|
||||
put_numeric(attribute, length + num_seg);
|
||||
|
||||
// Allocate a buffer large enough for the largest segment and start grinding.
|
||||
// Allocate a buffer large enough for the largest segment and start grinding.
|
||||
|
||||
UCHAR* buffer;
|
||||
if (!max_segment || max_segment <= sizeof(static_buffer))
|
||||
@ -2493,9 +2494,9 @@ bool put_source_blob(SCHAR attribute,
|
||||
else
|
||||
buffer = BURP_alloc(max_segment);
|
||||
|
||||
USHORT segment_length;
|
||||
while (!isc_get_segment(status_vector, &blob, &segment_length,
|
||||
max_segment, (SCHAR*) buffer))
|
||||
// The old code didn't accept isc_segment so we check it.
|
||||
size_t segment_length;
|
||||
while (blob.getSegment(max_segment, buffer, segment_length) && !blob.getCode())
|
||||
{
|
||||
if (segment_length)
|
||||
{
|
||||
@ -2504,7 +2505,7 @@ bool put_source_blob(SCHAR attribute,
|
||||
put(tdgbl, (UCHAR) (NULL));
|
||||
}
|
||||
|
||||
if (isc_close_blob(status_vector, &blob))
|
||||
if (!blob.close())
|
||||
BURP_error_redirect(status_vector, 23);
|
||||
// msg 23 isc_close_blob failed
|
||||
|
||||
@ -2615,7 +2616,7 @@ void write_character_sets(void)
|
||||
put_numeric (att_charset_sysflag, X.RDB$SYSTEM_FLAG);
|
||||
if (!X.RDB$DESCRIPTION.NULL)
|
||||
put_source_blob (att_charset_description, att_charset_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
if (!X.RDB$FUNCTION_NAME.NULL)
|
||||
PUT_TEXT (att_charset_funct, X.RDB$FUNCTION_NAME);
|
||||
put_numeric (att_charset_bytes_char, X.RDB$BYTES_PER_CHARACTER);
|
||||
@ -2692,13 +2693,13 @@ void write_collations(void)
|
||||
if (X.RDB$SYSTEM_FLAG)
|
||||
put_numeric (att_coll_sysflag, X.RDB$SYSTEM_FLAG);
|
||||
if (!X.RDB$DESCRIPTION.NULL)
|
||||
put_source_blob (att_coll_description, att_coll_description, &X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_coll_description, att_coll_description, X.RDB$DESCRIPTION);
|
||||
if (!X.RDB$FUNCTION_NAME.NULL)
|
||||
PUT_TEXT (att_coll_funct, X.RDB$FUNCTION_NAME);
|
||||
if (!X.RDB$BASE_COLLATION_NAME.NULL)
|
||||
PUT_TEXT(att_coll_base_collation_name, X.RDB$BASE_COLLATION_NAME);
|
||||
if (!X.RDB$SPECIFIC_ATTRIBUTES.NULL)
|
||||
put_source_blob (att_coll_specific_attr, att_coll_specific_attr, &X.RDB$SPECIFIC_ATTRIBUTES);
|
||||
put_source_blob (att_coll_specific_attr, att_coll_specific_attr, X.RDB$SPECIFIC_ATTRIBUTES);
|
||||
put(tdgbl, att_end);
|
||||
END_FOR;
|
||||
ON_ERROR
|
||||
@ -2717,7 +2718,7 @@ void write_collations(void)
|
||||
if (X.RDB$SYSTEM_FLAG)
|
||||
put_numeric (att_coll_sysflag, X.RDB$SYSTEM_FLAG);
|
||||
if (!X.RDB$DESCRIPTION.NULL)
|
||||
put_source_blob (att_coll_description, att_coll_description, &X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_coll_description, att_coll_description, X.RDB$DESCRIPTION);
|
||||
if (!X.RDB$FUNCTION_NAME.NULL)
|
||||
PUT_TEXT (att_coll_funct, X.RDB$FUNCTION_NAME);
|
||||
put(tdgbl, att_end);
|
||||
@ -2843,7 +2844,7 @@ void write_database( const TEXT* dbb_file)
|
||||
if (!D.RDB$SECURITY_CLASS.NULL)
|
||||
PUT_TEXT (att_database_security_class, D.RDB$SECURITY_CLASS);
|
||||
put_source_blob (att_database_description2, att_database_description,
|
||||
&D.RDB$DESCRIPTION);
|
||||
D.RDB$DESCRIPTION);
|
||||
if (!D.RDB$CHARACTER_SET_NAME.NULL)
|
||||
PUT_TEXT (att_database_dfl_charset, D.RDB$CHARACTER_SET_NAME);
|
||||
END_FOR;
|
||||
@ -2870,7 +2871,7 @@ void write_database( const TEXT* dbb_file)
|
||||
FOR (REQUEST_HANDLE req_handle2)
|
||||
D IN RDB$DATABASE
|
||||
put_source_blob (att_database_description2, att_database_description,
|
||||
&D.RDB$DESCRIPTION);
|
||||
D.RDB$DESCRIPTION);
|
||||
END_FOR;
|
||||
ON_ERROR
|
||||
general_on_error();
|
||||
@ -2926,7 +2927,7 @@ void write_exceptions(void)
|
||||
// msg 198 writing exception %s
|
||||
PUT_MESSAGE(att_exception_msg, X.RDB$MESSAGE);
|
||||
put_source_blob (att_exception_description2, att_procedure_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
put(tdgbl, att_end);
|
||||
END_FOR;
|
||||
ON_ERROR
|
||||
@ -2997,7 +2998,7 @@ void write_filters(void)
|
||||
MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp));
|
||||
BURP_verbose (145, temp);
|
||||
// msg 145 writing filter %s
|
||||
put_source_blob (att_filter_description2, att_filter_description, &X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_filter_description2, att_filter_description, X.RDB$DESCRIPTION);
|
||||
PUT_TEXT (att_filter_module_name, X.RDB$MODULE_NAME);
|
||||
PUT_TEXT (att_filter_entrypoint, X.RDB$ENTRYPOINT);
|
||||
put_numeric (att_filter_input_sub_type, X.RDB$INPUT_SUB_TYPE);
|
||||
@ -3038,7 +3039,7 @@ void write_functions(void)
|
||||
MISC_terminate (X.RDB$FUNCTION_NAME, temp, l, sizeof(temp));
|
||||
BURP_verbose (147, temp);
|
||||
/* msg 147 writing function %.*s */
|
||||
put_source_blob (att_function_description2, att_function_description, &X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_function_description2, att_function_description, X.RDB$DESCRIPTION);
|
||||
PUT_TEXT (att_function_module_name, X.RDB$MODULE_NAME);
|
||||
PUT_TEXT (att_function_entrypoint, X.RDB$ENTRYPOINT);
|
||||
put_numeric (att_function_return_arg, X.RDB$RETURN_ARGUMENT);
|
||||
@ -3184,7 +3185,7 @@ void write_generators(void)
|
||||
}
|
||||
if (!X.RDB$DESCRIPTION.NULL) {
|
||||
put_source_blob (att_gen_description, att_gen_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
}
|
||||
put(tdgbl, att_end);
|
||||
MISC_terminate (X.RDB$GENERATOR_NAME, temp, l, sizeof(temp));
|
||||
@ -3264,24 +3265,24 @@ void write_global_fields(void)
|
||||
PUT_TEXT (att_field_query_name, X.RDB$QUERY_NAME);
|
||||
if (X.RDB$EDIT_STRING [0] != ' ')
|
||||
PUT_TEXT (att_field_edit_string, X.RDB$EDIT_STRING);
|
||||
put_source_blob (att_field_query_header, att_field_query_header, &X.RDB$QUERY_HEADER);
|
||||
put_source_blob (att_field_query_header, att_field_query_header, X.RDB$QUERY_HEADER);
|
||||
put_numeric (att_field_type, X.RDB$FIELD_TYPE);
|
||||
put_numeric (att_field_length, X.RDB$FIELD_LENGTH);
|
||||
put_numeric (att_field_sub_type, X.RDB$FIELD_SUB_TYPE);
|
||||
put_numeric (att_field_scale, X.RDB$FIELD_SCALE);
|
||||
put_blr_blob (att_field_missing_value, &X.RDB$MISSING_VALUE);
|
||||
put_blr_blob (att_field_default_value, &X.RDB$DEFAULT_VALUE);
|
||||
put_blr_blob (att_field_validation_blr, &X.RDB$VALIDATION_BLR);
|
||||
put_blr_blob (att_field_missing_value, X.RDB$MISSING_VALUE);
|
||||
put_blr_blob (att_field_default_value, X.RDB$DEFAULT_VALUE);
|
||||
put_blr_blob (att_field_validation_blr, X.RDB$VALIDATION_BLR);
|
||||
put_source_blob (att_field_validation_source2, att_field_validation_source,
|
||||
&X.RDB$VALIDATION_SOURCE);
|
||||
put_blr_blob (att_field_computed_blr, &X.RDB$COMPUTED_BLR);
|
||||
X.RDB$VALIDATION_SOURCE);
|
||||
put_blr_blob (att_field_computed_blr, X.RDB$COMPUTED_BLR);
|
||||
put_source_blob (att_field_computed_source2, att_field_computed_source,
|
||||
&X.RDB$COMPUTED_SOURCE);
|
||||
X.RDB$COMPUTED_SOURCE);
|
||||
if (X.RDB$SEGMENT_LENGTH)
|
||||
put_numeric (att_field_segment_length, X.RDB$SEGMENT_LENGTH);
|
||||
if (X.RDB$SYSTEM_FLAG)
|
||||
put_numeric (att_field_system_flag, X.RDB$SYSTEM_FLAG);
|
||||
put_source_blob (att_field_description2, att_field_description, &X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_field_description2, att_field_description, X.RDB$DESCRIPTION);
|
||||
|
||||
if (X.RDB$EXTERNAL_LENGTH)
|
||||
put_numeric (att_field_external_length, X.RDB$EXTERNAL_LENGTH);
|
||||
@ -3297,10 +3298,10 @@ void write_global_fields(void)
|
||||
put_numeric (att_field_character_length, X.RDB$CHARACTER_LENGTH);
|
||||
if (!(X.RDB$DEFAULT_SOURCE.NULL))
|
||||
put_source_blob (att_field_default_source, att_field_default_source,
|
||||
&X.RDB$DEFAULT_SOURCE);
|
||||
X.RDB$DEFAULT_SOURCE);
|
||||
if (!(X.RDB$MISSING_SOURCE.NULL))
|
||||
put_source_blob (att_field_missing_source, att_field_missing_source,
|
||||
&X.RDB$MISSING_SOURCE);
|
||||
X.RDB$MISSING_SOURCE);
|
||||
if (!(X.RDB$CHARACTER_SET_ID.NULL))
|
||||
put_numeric (att_field_character_set, X.RDB$CHARACTER_SET_ID);
|
||||
if (!(X.RDB$COLLATION_ID.NULL))
|
||||
@ -3332,25 +3333,25 @@ void write_global_fields(void)
|
||||
PUT_TEXT (att_field_query_name, X.RDB$QUERY_NAME);
|
||||
if (X.RDB$EDIT_STRING [0] != ' ')
|
||||
PUT_TEXT (att_field_edit_string, X.RDB$EDIT_STRING);
|
||||
put_source_blob (att_field_query_header, att_field_query_header, &X.RDB$QUERY_HEADER);
|
||||
put_source_blob (att_field_query_header, att_field_query_header, X.RDB$QUERY_HEADER);
|
||||
put_numeric (att_field_type, X.RDB$FIELD_TYPE);
|
||||
put_numeric (att_field_length, X.RDB$FIELD_LENGTH);
|
||||
put_numeric (att_field_sub_type, X.RDB$FIELD_SUB_TYPE);
|
||||
put_numeric (att_field_scale, X.RDB$FIELD_SCALE);
|
||||
put_blr_blob (att_field_missing_value, &X.RDB$MISSING_VALUE);
|
||||
put_blr_blob (att_field_default_value, &X.RDB$DEFAULT_VALUE);
|
||||
put_blr_blob (att_field_validation_blr, &X.RDB$VALIDATION_BLR);
|
||||
put_blr_blob (att_field_missing_value, X.RDB$MISSING_VALUE);
|
||||
put_blr_blob (att_field_default_value, X.RDB$DEFAULT_VALUE);
|
||||
put_blr_blob (att_field_validation_blr, X.RDB$VALIDATION_BLR);
|
||||
put_source_blob (att_field_validation_source2, att_field_validation_source,
|
||||
&X.RDB$VALIDATION_SOURCE);
|
||||
put_blr_blob (att_field_computed_blr, &X.RDB$COMPUTED_BLR);
|
||||
X.RDB$VALIDATION_SOURCE);
|
||||
put_blr_blob (att_field_computed_blr, X.RDB$COMPUTED_BLR);
|
||||
put_source_blob (att_field_computed_source2, att_field_computed_source,
|
||||
&X.RDB$COMPUTED_SOURCE);
|
||||
X.RDB$COMPUTED_SOURCE);
|
||||
if (X.RDB$SEGMENT_LENGTH)
|
||||
put_numeric (att_field_segment_length, X.RDB$SEGMENT_LENGTH);
|
||||
if (X.RDB$SYSTEM_FLAG)
|
||||
put_numeric (att_field_system_flag, X.RDB$SYSTEM_FLAG);
|
||||
put_source_blob (att_field_description2, att_field_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
if (tdgbl->BCK_capabilities & BCK_attributes_v3)
|
||||
{
|
||||
FOR (REQUEST_HANDLE req_handle2)
|
||||
@ -3379,10 +3380,10 @@ void write_global_fields(void)
|
||||
put_numeric (att_field_character_length, F.RDB$CHARACTER_LENGTH);
|
||||
if (!(F.RDB$DEFAULT_SOURCE.NULL))
|
||||
put_source_blob (att_field_default_source, att_field_default_source,
|
||||
&F.RDB$DEFAULT_SOURCE);
|
||||
F.RDB$DEFAULT_SOURCE);
|
||||
if (!(F.RDB$MISSING_SOURCE.NULL))
|
||||
put_source_blob (att_field_missing_source, att_field_missing_source,
|
||||
&F.RDB$MISSING_SOURCE);
|
||||
F.RDB$MISSING_SOURCE);
|
||||
if (!(F.RDB$CHARACTER_SET_ID.NULL))
|
||||
put_numeric (att_field_character_set, F.RDB$CHARACTER_SET_ID);
|
||||
if (!(F.RDB$COLLATION_ID.NULL))
|
||||
@ -3449,9 +3450,9 @@ void write_procedures(void)
|
||||
put_numeric (att_procedure_inputs, X.RDB$PROCEDURE_INPUTS);
|
||||
put_numeric (att_procedure_outputs, X.RDB$PROCEDURE_OUTPUTS);
|
||||
put_source_blob (att_procedure_description2, att_procedure_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_procedure_source2, att_procedure_source, &X.RDB$PROCEDURE_SOURCE);
|
||||
put_blr_blob (att_procedure_blr, &X.RDB$PROCEDURE_BLR);
|
||||
X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_procedure_source2, att_procedure_source, X.RDB$PROCEDURE_SOURCE);
|
||||
put_blr_blob (att_procedure_blr, X.RDB$PROCEDURE_BLR);
|
||||
if (!X.RDB$SECURITY_CLASS.NULL)
|
||||
PUT_TEXT (att_procedure_security_class, X.RDB$SECURITY_CLASS);
|
||||
if (!X.RDB$SECURITY_CLASS.NULL)
|
||||
@ -3461,7 +3462,7 @@ void write_procedures(void)
|
||||
if (!X.RDB$VALID_BLR.NULL)
|
||||
put_numeric (att_procedure_valid_blr, X.RDB$VALID_BLR);
|
||||
if (!X.RDB$DEBUG_INFO.NULL)
|
||||
put_blr_blob (att_procedure_debug_info, &X.RDB$DEBUG_INFO);
|
||||
put_blr_blob (att_procedure_debug_info, X.RDB$DEBUG_INFO);
|
||||
put(tdgbl, att_end);
|
||||
COPY(X.RDB$PROCEDURE_NAME, proc);
|
||||
write_procedure_prms (proc);
|
||||
@ -3483,9 +3484,9 @@ void write_procedures(void)
|
||||
put_numeric (att_procedure_inputs, X.RDB$PROCEDURE_INPUTS);
|
||||
put_numeric (att_procedure_outputs, X.RDB$PROCEDURE_OUTPUTS);
|
||||
put_source_blob (att_procedure_description2, att_procedure_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_procedure_source2, att_procedure_source, &X.RDB$PROCEDURE_SOURCE);
|
||||
put_blr_blob (att_procedure_blr, &X.RDB$PROCEDURE_BLR);
|
||||
X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_procedure_source2, att_procedure_source, X.RDB$PROCEDURE_SOURCE);
|
||||
put_blr_blob (att_procedure_blr, X.RDB$PROCEDURE_BLR);
|
||||
if (!X.RDB$SECURITY_CLASS.NULL)
|
||||
PUT_TEXT (att_procedure_security_class, X.RDB$SECURITY_CLASS);
|
||||
if (!X.RDB$SECURITY_CLASS.NULL)
|
||||
@ -3533,10 +3534,10 @@ void write_procedure_prms( GDS_NAME procptr)
|
||||
put_numeric (att_procedureprm_type, X.RDB$PARAMETER_type);
|
||||
PUT_TEXT (att_procedureprm_field_source, X.RDB$FIELD_SOURCE);
|
||||
put_source_blob (att_procedureprm_description2, att_procedureprm_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
put_blr_blob (att_procedureprm_default_value, &X.RDB$DEFAULT_VALUE);
|
||||
X.RDB$DESCRIPTION);
|
||||
put_blr_blob (att_procedureprm_default_value, X.RDB$DEFAULT_VALUE);
|
||||
put_source_blob (att_procedureprm_default_source,
|
||||
att_procedureprm_default_source, &X.RDB$DEFAULT_SOURCE);
|
||||
att_procedureprm_default_source, X.RDB$DEFAULT_SOURCE);
|
||||
if (!X.RDB$COLLATION_ID.NULL)
|
||||
put_numeric (att_procedureprm_collation_id, X.RDB$COLLATION_ID);
|
||||
if (!X.RDB$NULL_FLAG.NULL)
|
||||
@ -3562,7 +3563,7 @@ void write_procedure_prms( GDS_NAME procptr)
|
||||
put_numeric (att_procedureprm_type, X.RDB$PARAMETER_type);
|
||||
PUT_TEXT (att_procedureprm_field_source, X.RDB$FIELD_SOURCE);
|
||||
put_source_blob (att_procedureprm_description2, att_procedureprm_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
put(tdgbl, att_end);
|
||||
END_FOR;
|
||||
ON_ERROR
|
||||
@ -3691,7 +3692,7 @@ void write_relations(void)
|
||||
* RESTORE.EPP makes this assumption in get_relation().
|
||||
*/
|
||||
|
||||
if (put_blr_blob (att_relation_view_blr, &X.RDB$VIEW_BLR))
|
||||
if (put_blr_blob (att_relation_view_blr, X.RDB$VIEW_BLR))
|
||||
flags |= REL_view;
|
||||
if (X.RDB$SYSTEM_FLAG)
|
||||
put_numeric (att_relation_system_flag, X.RDB$SYSTEM_FLAG);
|
||||
@ -3701,12 +3702,12 @@ void write_relations(void)
|
||||
PUT_TEXT (att_relation_security_class, X.RDB$SECURITY_CLASS);
|
||||
|
||||
put_source_blob (att_relation_description2, att_relation_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_relation_view_source2, att_relation_view_source,
|
||||
&X.RDB$VIEW_SOURCE);
|
||||
X.RDB$VIEW_SOURCE);
|
||||
|
||||
put_source_blob (att_relation_ext_description2, att_relation_ext_description,
|
||||
&X.RDB$EXTERNAL_DESCRIPTION);
|
||||
X.RDB$EXTERNAL_DESCRIPTION);
|
||||
PUT_TEXT (att_relation_owner_name, X.RDB$OWNER_NAME);
|
||||
if (!X.RDB$EXTERNAL_FILE.NULL)
|
||||
{
|
||||
@ -3750,7 +3751,7 @@ void write_relations(void)
|
||||
* RESTORE.E makes this assumption in get_relation().
|
||||
*/
|
||||
|
||||
if (put_blr_blob (att_relation_view_blr, &X.RDB$VIEW_BLR))
|
||||
if (put_blr_blob (att_relation_view_blr, X.RDB$VIEW_BLR))
|
||||
flags |= REL_view;
|
||||
if (X.RDB$SYSTEM_FLAG)
|
||||
put_numeric (att_relation_system_flag, X.RDB$SYSTEM_FLAG);
|
||||
@ -3777,15 +3778,15 @@ void write_relations(void)
|
||||
END_ERROR;
|
||||
}
|
||||
put_source_blob (att_relation_description2, att_relation_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_relation_view_source2, att_relation_view_source,
|
||||
&X.RDB$VIEW_SOURCE);
|
||||
X.RDB$VIEW_SOURCE);
|
||||
if (tdgbl->BCK_capabilities & BCK_attributes_v3)
|
||||
{
|
||||
FOR (REQUEST_HANDLE req_handle4)
|
||||
R IN RDB$RELATIONS WITH R.RDB$RELATION_NAME = X.RDB$RELATION_NAME
|
||||
put_source_blob (att_relation_ext_description2, att_relation_ext_description,
|
||||
&R.RDB$EXTERNAL_DESCRIPTION);
|
||||
R.RDB$EXTERNAL_DESCRIPTION);
|
||||
PUT_TEXT(att_relation_owner_name, R.RDB$OWNER_NAME);
|
||||
if (!R.RDB$EXTERNAL_FILE.NULL)
|
||||
{
|
||||
@ -3902,7 +3903,7 @@ void write_sql_roles(void)
|
||||
PUT_TEXT (att_role_owner_name, X.RDB$OWNER_NAME);
|
||||
if (!X.RDB$DESCRIPTION.NULL) {
|
||||
put_source_blob (att_role_description, att_role_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
X.RDB$DESCRIPTION);
|
||||
}
|
||||
put(tdgbl, att_end);
|
||||
MISC_terminate (X.RDB$ROLE_NAME, temp, l, sizeof(temp));
|
||||
@ -3977,9 +3978,9 @@ void write_triggers(void)
|
||||
|
||||
put_numeric (att_trig_sequence, X.RDB$TRIGGER_SEQUENCE);
|
||||
put_numeric (att_trig_type, X.RDB$TRIGGER_TYPE);
|
||||
put_blr_blob (att_trig_blr, &X.RDB$TRIGGER_BLR);
|
||||
put_source_blob (att_trig_source2, att_trig_source, &X.RDB$TRIGGER_SOURCE);
|
||||
put_source_blob (att_trig_description2, att_trig_description, &X.RDB$DESCRIPTION);
|
||||
put_blr_blob (att_trig_blr, X.RDB$TRIGGER_BLR);
|
||||
put_source_blob (att_trig_source2, att_trig_source, X.RDB$TRIGGER_SOURCE);
|
||||
put_source_blob (att_trig_description2, att_trig_description, X.RDB$DESCRIPTION);
|
||||
put_numeric (att_trig_system_flag, X.RDB$SYSTEM_FLAG);
|
||||
put_numeric (att_trig_inactive, X.RDB$TRIGGER_INACTIVE);
|
||||
|
||||
@ -3990,7 +3991,7 @@ void write_triggers(void)
|
||||
put_numeric (att_trig_valid_blr, X.RDB$VALID_BLR);
|
||||
|
||||
if (!X.RDB$DEBUG_INFO.NULL)
|
||||
put_blr_blob (att_trig_debug_info, &X.RDB$DEBUG_INFO);
|
||||
put_blr_blob (att_trig_debug_info, X.RDB$DEBUG_INFO);
|
||||
|
||||
put(tdgbl, att_end);
|
||||
|
||||
@ -4017,9 +4018,9 @@ void write_triggers(void)
|
||||
|
||||
put_numeric (att_trig_sequence, X.RDB$TRIGGER_SEQUENCE);
|
||||
put_numeric (att_trig_type, X.RDB$TRIGGER_TYPE);
|
||||
put_blr_blob (att_trig_blr, &X.RDB$TRIGGER_BLR);
|
||||
put_source_blob (att_trig_source2, att_trig_source, &X.RDB$TRIGGER_SOURCE);
|
||||
put_source_blob (att_trig_description2, att_trig_description, &X.RDB$DESCRIPTION);
|
||||
put_blr_blob (att_trig_blr, X.RDB$TRIGGER_BLR);
|
||||
put_source_blob (att_trig_source2, att_trig_source, X.RDB$TRIGGER_SOURCE);
|
||||
put_source_blob (att_trig_description2, att_trig_description, X.RDB$DESCRIPTION);
|
||||
put_numeric (att_trig_system_flag, X.RDB$SYSTEM_FLAG);
|
||||
put_numeric (att_trig_inactive, X.RDB$TRIGGER_INACTIVE);
|
||||
|
||||
@ -4051,9 +4052,9 @@ void write_triggers(void)
|
||||
|
||||
put_numeric (att_trig_sequence, X.RDB$TRIGGER_SEQUENCE);
|
||||
put_numeric (att_trig_type, X.RDB$TRIGGER_TYPE);
|
||||
put_blr_blob (att_trig_blr, &X.RDB$TRIGGER_BLR);
|
||||
put_source_blob (att_trig_source2, att_trig_source, &X.RDB$TRIGGER_SOURCE);
|
||||
put_source_blob (att_trig_description2, att_trig_description, &X.RDB$DESCRIPTION);
|
||||
put_blr_blob (att_trig_blr, X.RDB$TRIGGER_BLR);
|
||||
put_source_blob (att_trig_source2, att_trig_source, X.RDB$TRIGGER_SOURCE);
|
||||
put_source_blob (att_trig_description2, att_trig_description, X.RDB$DESCRIPTION);
|
||||
put_numeric (att_trig_system_flag, X.RDB$SYSTEM_FLAG);
|
||||
put_numeric (att_trig_inactive, X.RDB$TRIGGER_INACTIVE);
|
||||
|
||||
@ -4150,7 +4151,7 @@ void write_types(void)
|
||||
BURP_verbose (160, SafeArg() << X.RDB$TYPE_NAME << X.RDB$FIELD_NAME);
|
||||
// msg 160 writing type %s for field %s
|
||||
put_numeric (att_type_type, X.RDB$TYPE);
|
||||
put_source_blob (att_type_description2, att_type_description, &X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_type_description2, att_type_description, X.RDB$DESCRIPTION);
|
||||
if (X.RDB$SYSTEM_FLAG)
|
||||
put_numeric (att_type_system_flag, X.RDB$SYSTEM_FLAG);
|
||||
put(tdgbl, att_end);
|
||||
|
Loading…
Reference in New Issue
Block a user