From 429149a8f4f81c389bf9d96256e271c7b593237d Mon Sep 17 00:00:00 2001 From: Zhao Junwang Date: Wed, 10 Feb 2021 09:53:00 +0800 Subject: [PATCH] fix IB_VEC_OFFSET 's wrong parameter This is not a bug since the four places using this MACRO has a `vec` local variable in the calling scope, but this may be some problem when there is a `vec` vector and a `vec2` vector, because IB_VEC_OFFSET(vec2, i) will give the offset of `vec`, thus I think this is a potential bug that we should address. --- storage/innobase/include/ut0vec.ic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/include/ut0vec.ic b/storage/innobase/include/ut0vec.ic index 7f5173d95bb..68990453fa3 100644 --- a/storage/innobase/include/ut0vec.ic +++ b/storage/innobase/include/ut0vec.ic @@ -32,7 +32,7 @@ this program; if not, write to the Free Software Foundation, Inc., #include "ut0new.h" -#define IB_VEC_OFFSET(v, i) (vec->sizeof_value * i) +#define IB_VEC_OFFSET(vec, i) (vec->sizeof_value * i) /******************************************************************** The default ib_vector_t heap malloc. Uses mem_heap_alloc(). */