vinyl: use source tuple format when copying field map
There are two functions in vy_stmt.c that blindly copy tuple field map, vy_stmt_dup() and vy_stmt_replace_from_upsert(). Both these functions take a tuple format to use for the new statement and require this format to be the same as the source tuple format in terms of fields definition, otherwise they'll just crash. The only reason why we did that is that back when these functions were written we used a separate format for UPSERT statements so we needed this extra argument for creating a REPLACE from UPSERT. Now it's not needed, and we can use the source tuple format instead. Moreover, passing the current tuple format to any of those functions is even harmful, because tuple format can be extended by ALTER, in which case these functions will crash if called on a statement created before ALTER. That being said, let's drop the tuple format argument.
Showing
- src/box/tuple_format.c 0 additions, 18 deletionssrc/box/tuple_format.c
- src/box/tuple_format.h 0 additions, 8 deletionssrc/box/tuple_format.h
- src/box/vy_lsm.c 1 addition, 1 deletionsrc/box/vy_lsm.c
- src/box/vy_mem.c 1 addition, 1 deletionsrc/box/vy_mem.c
- src/box/vy_point_lookup.c 1 addition, 2 deletionssrc/box/vy_point_lookup.c
- src/box/vy_stmt.c 5 additions, 13 deletionssrc/box/vy_stmt.c
- src/box/vy_stmt.h 2 additions, 4 deletionssrc/box/vy_stmt.h
- src/box/vy_upsert.c 2 additions, 2 deletionssrc/box/vy_upsert.c
Loading
Please register or sign in to comment