alter: restrict space format altering
Disallow changing field type of space format fields to an incompatible type. For example, forbid changing a type from integer to string, but allow to change from integer to number. If an user adds new fields, then validate existing tuples to be compatible with a new format. Check works in O(N) time and for big spaces can be realy long. But it can be skipped, if conditions below are ok: 1. if space format field count < old tuple format field count. Then field count of all tuples >= new format field count; 2. new fields are indexed or have type ANY. If a field is already indexed, then its type is already validated. If a field has type ANY, then any value is ok. Closes #2800
Showing
- src/box/alter.cc 52 additions, 26 deletionssrc/box/alter.cc
- src/box/engine.h 0 additions, 1 deletionsrc/box/engine.h
- src/box/field_def.c 25 additions, 0 deletionssrc/box/field_def.c
- src/box/field_def.h 4 additions, 0 deletionssrc/box/field_def.h
- src/box/memtx_space.cc 26 additions, 0 deletionssrc/box/memtx_space.cc
- src/box/space.cc 47 additions, 0 deletionssrc/box/space.cc
- src/box/space.h 31 additions, 0 deletionssrc/box/space.h
- src/box/sysview_engine.cc 7 additions, 0 deletionssrc/box/sysview_engine.cc
- src/box/vinyl.c 19 additions, 0 deletionssrc/box/vinyl.c
- src/box/vinyl.h 12 additions, 0 deletionssrc/box/vinyl.h
- src/box/vinyl_space.cc 9 additions, 0 deletionssrc/box/vinyl_space.cc
- test/box/alter.result 350 additions, 0 deletionstest/box/alter.result
- test/box/alter.test.lua 160 additions, 0 deletionstest/box/alter.test.lua
Loading
Please register or sign in to comment