[tarantool-patches] Re: [PATCH v1 12/21] sql: remove SQL_TOOBIG errcode

n.pettik korablev at tarantool.org
Sat May 25 19:11:00 MSK 2019


> diff --git a/src/box/bind.c b/src/box/bind.c
> index 90d56d6..754f6c7 100644
> --- a/src/box/bind.c
> +++ b/src/box/bind.c
> @@ -207,16 +207,7 @@ sql_bind_column(struct sql_stmt *stmt, const struct sql_bind *p,
> 	}
> 	if (rc == 0)
> 		return 0;
> -
> -	switch (rc) {
> -	case SQL_NOMEM:
> -		diag_set(OutOfMemory, p->bytes, "vdbe", "bind value");
> -		break;
> -	case SQL_TOOBIG:
> -	default:
> -		diag_set(ClientError, ER_SQL_BIND_VALUE, sql_bind_name(p),
> -			 mp_type_strs[p->type]);
> -		break;
> -	}
> +	diag_set(ClientError, ER_SQL_BIND_VALUE, sql_bind_name(p),
> +		 mp_type_strs[p->type]);

I guess this refactoring is incorrect a bit. Here you always set
ER_SQL_BIND_VALUE. However, sqlVdbeMemSetStr() and
sql_bind_zeroblob64() already set ER_SQL_EXECUTE error
in case “string or blob is too big”. Probably, this case is not
covered by tests. Please, come up with test case on this condition.





More information about the Tarantool-patches mailing list