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

Fixed ODS problem with arrays

This commit is contained in:
alexpeshkoff 2005-10-15 13:02:10 +00:00
parent 14b1b8a989
commit 2c9ef9f6d8
2 changed files with 35 additions and 12 deletions

View File

@ -36,6 +36,17 @@
See MET_format() and make_format() in MET.EPP for enlightenment.
*/
struct OdsDesc
{
UCHAR dsc_dtype;
SCHAR dsc_scale;
USHORT dsc_length;
SSHORT dsc_sub_type;
USHORT dsc_flags;
ULONG dsc_offset;
};
typedef struct dsc
{
dsc()
@ -58,19 +69,31 @@ typedef struct dsc
SSHORT& dsc_ttype() { return dsc_sub_type;}
SSHORT dsc_ttype() const { return dsc_sub_type;}
#endif
// this functions were added to have interoperability
// between OdsDesc and DSC
dsc(const OdsDesc& od)
: dsc_dtype(od.dsc_dtype),
dsc_scale(od.dsc_scale),
dsc_length(od.dsc_length),
dsc_sub_type(od.dsc_sub_type),
dsc_flags(od.dsc_flags),
dsc_address(0)
{}
operator OdsDesc()
{
OdsDesc d;
d.dsc_dtype = dsc_dtype;
d.dsc_scale = dsc_scale;
d.dsc_length = dsc_length;
d.dsc_sub_type = dsc_sub_type;
d.dsc_flags = dsc_flags;
d.dsc_offset = 0;
return d;
}
} DSC;
struct OdsDesc
{
UCHAR dsc_dtype;
SCHAR dsc_scale;
USHORT dsc_length;
SSHORT dsc_sub_type;
USHORT dsc_flags;
ULONG dsc_offset;
};
inline SSHORT DSC_GET_CHARSET(const dsc* desc) {
return (desc->dsc_sub_type & 0x00FF);
}

View File

@ -157,7 +157,7 @@ struct internal_array_desc {
SLONG iad_count; /* Total number of elements */
SLONG iad_total_length; /* Total length of array */
struct iad_repeat {
DSC iad_desc; /* Element descriptor */
OdsDesc iad_desc; /* Element descriptor */
SLONG iad_length; /* Length of "vector" element */
SLONG iad_lower; /* Lower bound */
SLONG iad_upper; /* Upper bound */