[Tarantool-patches] [PATCH v2 2/4] sql: properly show values in type mismatch error
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu Jul 8 01:09:57 MSK 2021
Thanks for the patch!
> diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
> index 630f1a135..728d3c9a7 100644
> --- a/src/box/sql/mem.c
> +++ b/src/box/sql/mem.c
> @@ -80,9 +80,11 @@ mem_str(const struct Mem *mem)
> if (mem->n > STR_VALUE_MAX_LEN) {
> memcpy(buf, mem->z, STR_VALUE_MAX_LEN);
> buf[STR_VALUE_MAX_LEN] = '\0';
> - return tt_sprintf("%s...", buf);
> + return tt_sprintf("'%s...", buf);
Why didn't you put a second ' after ...? The error message
does not end here. There are more words after this string usually.
The same below.
> @@ -102,7 +115,8 @@ mem_str(const struct Mem *mem)
> return tt_sprintf("%s...", buf);
> }
> case MEM_TYPE_UUID:
> - return tt_uuid_str(&mem->u.uuid);
> + tt_uuid_to_string(&mem->u.uuid, buf);
> + return tt_sprintf("'%s'", buf);
> case MEM_TYPE_BOOL:
> return mem->u.b ? "TRUE" : "FALSE";
> default:
More information about the Tarantool-patches
mailing list