Skip to content

Commit 5b9af0e

Browse files
author
Artyom Abakumov
committed
Check dsc_length via type_lengths array
1 parent 4f62040 commit 5b9af0e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/common/dsc.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,6 @@ typedef struct dsc
228228
return dsc_dtype == dtype_unknown;
229229
}
230230

231-
bool hasDynamicLength() const
232-
{
233-
return isText(); // TODO: add isJson();
234-
}
235-
236231
SSHORT getBlobSubType() const
237232
{
238233
if (isBlob())

src/jrd/val.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "../jrd/MetaName.h"
3636
#include "../jrd/RecordNumber.h"
3737
#include "../common/dsc.h"
38+
#include "../jrd/align.h"
3839

3940
#define FLAG_BYTES(n) (((n + BITS_PER_LONG) & ~((ULONG)BITS_PER_LONG - 1)) >> 3)
4041

@@ -247,7 +248,7 @@ inline VaryingString* impure_value::getString(MemoryPool& pool, const USHORT len
247248

248249
inline void impure_value::makeImpureDscAddress(MemoryPool& pool)
249250
{
250-
if (vlu_desc.hasDynamicLength())
251+
if (type_lengths[vlu_desc.dsc_dtype] == 0)
251252
{
252253
// If the data type is any of the string types, allocate space to hold value.
253254
allocateTextImpureDscAddress(pool);

0 commit comments

Comments
 (0)