[Tarantool-patches] [PATCH v2 7/7] sql: use type instead of value in type mismatch error

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Jun 14 20:03:36 MSK 2020


Thanks for the patch!

> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
> index e22ed98cf..cf0ae8a06 100644
> --- a/src/box/sql/vdbe.c
> +++ b/src/box/sql/vdbe.c
> @@ -1748,12 +1748,12 @@ case OP_Remainder: {           /* same as TK_REM, in1, in2, out3 */
>  	} else {
>  		if (sqlVdbeRealValue(pIn1, &rA) != 0) {
>  			diag_set(ClientError, ER_SQL_TYPE_MISMATCH,
> -				 sql_value_to_diag_str(pIn1), "numeric");
> +				 mem_type_to_str(pIn1), "numeric");

src/box/sql/func.c still contains lots of sql_value_to_diag_str() calls.
I think, sql_value_to_diag_str() should be removed completely.

It is not only inconsistent with other error messages, but is also unsafe,
because that errors may end up in user logs, and may contain sensitive
data such as password hashes.

Please, remove it in this commit, and then send the whole patchset to
Nikita for a second review. The patchset LGTM except the comment above.


More information about the Tarantool-patches mailing list