alter: drop field_no from ER_WRONG_XXX_OPTIONS errors
opts_decode takes errcode and field_no, which is passed to diag_set, so all code paths that use opts_decode must set a field_no in an error message. This is stupid, because often there's no reasonable field_no to report. As a result, for ER_WRONG_INDEX_OPTIONS, ER_WRONG_SPACE_OPTIONS, and ER_WRONG_COLLATION we use either 0 or field_no of the field in a system space, which means nothing to users. When there's an error in index parts we pass the index part no for field_no ("(field X)" where X is an index part number), which is confusing. The only error for which field_no makes sense is ER_WRONG_SPACE_FORMAT, but it doesn't justify passing around field_no for other errors and complicating common code paths. Let's drop the field_no everywhere for simplicity - the user can pin-point the erroneous field without it by inspecting fields/parts. NO_DOC=minor change in error message NO_CHANGELOG=minor change in error message
Showing
- src/box/alter.cc 12 additions, 21 deletionssrc/box/alter.cc
- src/box/errcode.h 4 additions, 4 deletionssrc/box/errcode.h
- src/box/field_def.c 8 additions, 12 deletionssrc/box/field_def.c
- src/box/key_def.c 6 additions, 15 deletionssrc/box/key_def.c
- src/box/opt_def.c 10 additions, 12 deletionssrc/box/opt_def.c
- src/box/opt_def.h 4 additions, 8 deletionssrc/box/opt_def.h
- src/box/space_def.c 8 additions, 15 deletionssrc/box/space_def.c
- src/box/tuple_constraint_def.c 22 additions, 25 deletionssrc/box/tuple_constraint_def.c
- src/box/tuple_constraint_def.h 4 additions, 6 deletionssrc/box/tuple_constraint_def.h
- src/box/tuple_format.c 1 addition, 1 deletionsrc/box/tuple_format.c
- test/box-tap/key_def.test.lua 5 additions, 6 deletionstest/box-tap/key_def.test.lua
- test/box/alter.result 1 addition, 1 deletiontest/box/alter.result
- test/box/ddl_collation.result 5 additions, 5 deletionstest/box/ddl_collation.result
- test/box/ddl_collation_wrong_id.result 1 addition, 1 deletiontest/box/ddl_collation_wrong_id.result
- test/box/misc.result 11 additions, 11 deletionstest/box/misc.result
- test/box/rtree_misc.result 4 additions, 4 deletionstest/box/rtree_misc.result
- test/engine/func_index.result 8 additions, 8 deletionstest/engine/func_index.result
- test/engine/json.result 2 additions, 2 deletionstest/engine/json.result
- test/engine/multikey.result 4 additions, 4 deletionstest/engine/multikey.result
- test/engine/null.result 15 additions, 15 deletionstest/engine/null.result
Loading
Please register or sign in to comment