sql: fix result type of min() and max() functions
Prior to this, the patch functions MIN(), MAX(), LEAST() and GREATEST() showed SCALAR as result types in metadata. However, in reality, the type of the result could be any scalar type. After this patch, the type of the result will always be the same as the type in the metadata. Also, for MIN() and MAX() functions, the type of the result will be the same as the type of the argument. For the LEAST() and GREATEST() functions, the result type will be the same as the type of the arguments if all arguments are of the same type, or it will be NUMBER if all arguments are of numeric types, or it will be SCALAR. Part of #6105
Showing
- src/box/sql/func.c 55 additions, 4 deletionssrc/box/sql/func.c
- test/sql-tap/built-in-functions.test.lua 48 additions, 1 deletiontest/sql-tap/built-in-functions.test.lua
- test/sql-tap/minmax2.test.lua 2 additions, 1 deletiontest/sql-tap/minmax2.test.lua
- test/sql-tap/select3.test.lua 1 addition, 1 deletiontest/sql-tap/select3.test.lua
- test/sql/iproto.result 2 additions, 2 deletionstest/sql/iproto.result
- test/sql/max-on-index.result 3 additions, 3 deletionstest/sql/max-on-index.result
- test/sql/prepared.result 2 additions, 2 deletionstest/sql/prepared.result
- test/sql/types.result 9 additions, 9 deletionstest/sql/types.result
Loading
Please register or sign in to comment