From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: imeevma@tarantool.org, tsafin@tarantool.org,
tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 7/7] sql: use type instead of value in type mismatch error
Date: Sun, 14 Jun 2020 19:03:36 +0200 [thread overview]
Message-ID: <71ed2250-9f9a-040c-debf-064d6bb4e82a@tarantool.org> (raw)
In-Reply-To: <338034a2577e902a1295db12650fee26a8bcdbf2.1591878044.git.imeevma@gmail.com>
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.
next prev parent reply other threads:[~2020-06-14 17:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-11 12:54 [Tarantool-patches] [PATCH v2 0/7] Remove implicit cast imeevma
2020-06-11 12:54 ` [Tarantool-patches] [PATCH v2 1/7] sql: remove implicit cast for assignment imeevma
2020-06-11 12:54 ` [Tarantool-patches] [PATCH v2 2/7] sql: remove mem_apply_type() from OP_MakeRecord imeevma
2020-06-11 12:54 ` [Tarantool-patches] [PATCH v2 3/7] sql: replace ApplyType by CheckType for IN operator imeevma
2020-06-11 12:54 ` [Tarantool-patches] [PATCH v2 4/7] sql: remove mem_apply_type() from OP_MustBeInt imeevma
2020-06-11 12:54 ` [Tarantool-patches] [PATCH v2 5/7] sql: remove implicit cast from string for comparison imeevma
2020-06-11 12:54 ` [Tarantool-patches] [PATCH v2 6/7] sql: remove OP_ApplyType imeevma
2020-06-11 12:54 ` [Tarantool-patches] [PATCH v2 7/7] sql: use type instead of value in type mismatch error imeevma
2020-06-14 17:03 ` Vladislav Shpilevoy [this message]
2020-06-17 12:36 [Tarantool-patches] [PATCH v2 0/7] Remove implicit cast imeevma
2020-06-17 12:36 ` [Tarantool-patches] [PATCH v2 7/7] sql: use type instead of value in type mismatch error imeevma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=71ed2250-9f9a-040c-debf-064d6bb4e82a@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=imeevma@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=tsafin@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v2 7/7] sql: use type instead of value in type mismatch error' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox