[Tarantool-patches] [PATCH v2 2/3] box: make constraint operations transactional

Roman Khabibov roman.habibov at tarantool.org
Tue Dec 24 15:06:27 MSK 2019


Hi!

> And I'm still not sure about memory allocation/deallocation is correct during
> constraint id creation/drop. 

If you mean: “Why do you allocate memory for the name string and copy it, if
the same name is already stored in corresponding index_def/ck_def/fk_def
structure”, I’ll answer you the following. At first, I didn’t use the constraint
name copy and did’t allocate memory for it. I simply put pointer to the original
name stored in corresponding index_def/ck_def/fk_def structure. As a result, I had
broken nodes with thrash instead of payload (name) in the constraint hash table.
It was occurred, because this name was free somewhere before. To avoid such situations,
I decided to copy the constraint name.


More information about the Tarantool-patches mailing list