[Tarantool-patches] [PATCH v1 6/7] sql: remove implicit cast from OP_MustBeInt
Mergen Imeev
imeevma at tarantool.org
Fri Aug 6 02:47:38 MSK 2021
I dropped this patch since I decided not to drop "precise" functions.
On 28.07.2021 23:51, Mergen Imeev via Tarantool-patches wrote:
> This patch removes implicit casting from STRING to number in
> OP_MustBeInt opcode.
>
> Part of #4470
> ---
> src/box/sql/vdbe.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
> index 81551acf3..89e77baee 100644
> --- a/src/box/sql/vdbe.c
> +++ b/src/box/sql/vdbe.c
> @@ -1435,7 +1435,8 @@ case OP_AddImm: { /* in1 */
> */
> case OP_MustBeInt: { /* jump, in1 */
> pIn1 = &aMem[pOp->p1];
> - if (mem_to_int_precise(pIn1) != 0) {
> + enum field_type type = FIELD_TYPE_INTEGER;
> + if (!mem_is_num(pIn1) || mem_cast_implicit_number(pIn1, type) != 0) {
> if (pOp->p2 != 0)
> goto jump_to_p2;
> diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
More information about the Tarantool-patches
mailing list