Skip to content

Commit

Permalink
[CBRD-24505] fix assert for a migration tool to 11.2 (#3820)
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondykk9 authored Oct 12, 2022
1 parent ade8e1c commit 1787a11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/base/object_representation.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ OR_PUT_DOUBLE (char *ptr, double val)
#define OR_BOUND_BIT_FLAG 0x80000000

#define BIG_VAR_OFFSET_SIZE OR_INT_SIZE /* 4byte */
#define SHORT_VAR_OFFSET_SIZE OR_SHORT_SIZE /* 2byte */

/* OBJECT HEADER ACCESS MACROS */

Expand Down
7 changes: 5 additions & 2 deletions src/storage/catalog_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -3249,6 +3249,7 @@ catcls_get_or_value_from_buffer (THREAD_ENTRY * thread_p, OR_BUF * buf_p, OR_VAL
int i, pad, size, rc;
int error = NO_ERROR;
char mvcc_flags;
int offset_size;

fixed_p = repr_p->fixed;
n_fixed = repr_p->n_fixed;
Expand All @@ -3258,8 +3259,10 @@ catcls_get_or_value_from_buffer (THREAD_ENTRY * thread_p, OR_BUF * buf_p, OR_VAL
attrs = value_p->sub.value;
n_attrs = n_fixed + n_variable;

offset_size = OR_GET_OFFSET_SIZE (buf_p->ptr);

/* header */
assert (OR_GET_OFFSET_SIZE (buf_p->ptr) == BIG_VAR_OFFSET_SIZE);
assert (offset_size == BIG_VAR_OFFSET_SIZE || offset_size == SHORT_VAR_OFFSET_SIZE);

repr_id_bits = or_mvcc_get_repid_and_flags (buf_p, &rc);
/* get bound_bits_flag and skip other MVCC header fields */
Expand Down Expand Up @@ -3299,7 +3302,7 @@ catcls_get_or_value_from_buffer (THREAD_ENTRY * thread_p, OR_BUF * buf_p, OR_VAL
}

/* get the offsets relative to the end of the header (beginning of variable table) */
vars = or_get_var_table (buf_p, n_variable, catcls_unpack_allocator);
vars = or_get_var_table_internal (buf_p, n_variable, catcls_unpack_allocator, offset_size);
if (vars == NULL)
{
error = ER_OUT_OF_VIRTUAL_MEMORY;
Expand Down

0 comments on commit 1787a11

Please sign in to comment.