From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CD26C2452F for ; Sun, 28 Jul 2019 19:56:23 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dzBlgRvpHHBz for ; Sun, 28 Jul 2019 19:56:23 -0400 (EDT) Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8F8DE2452B for ; Sun, 28 Jul 2019 19:56:23 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [tarantool-patches] Re: [PATCH 3/5] sql: use 'varbinary' as a name of type instead of 'blob' From: "n.pettik" In-Reply-To: <2e655514-0fec-8baf-20a8-d49e5586b047@tarantool.org> Date: Mon, 29 Jul 2019 02:56:21 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <2e655514-0fec-8baf-20a8-d49e5586b047@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Vladislav Shpilevoy > On 26 Jul 2019, at 01:03, Vladislav Shpilevoy = wrote: >=20 > On 24/07/2019 13:42, Nikita Pettik wrote: >> We are going to introduce new column type 'VARBINARY', which allows = to >> store values with MP_BIN msgpack format. On the other hand, now it is = also >> possible to meet this type: all literals in form of x'...' are >> supposed to be inserted into SCALAR column type exactly with MP_BIN >> encoding. Prior to this moment type of such values (encoded as = MP_BIN) >> was called 'blob'. Thus, let's fix all visible to user messages using >> 'varbinary' name of type instead of 'blob'. >> --- >> src/box/lua/lua_sql.c | 2 +- >> src/box/sql/func.c | 4 ++-- >> src/box/sql/vdbe.c | 4 ++-- >> src/box/sql/vdbeapi.c | 4 ++-- >> test/sql-tap/cast.test.lua | 4 ++-- >> test/sql-tap/func.test.lua | 2 +- >> test/sql-tap/lua_sql.test.lua | 4 ++-- >> test/sql-tap/position.test.lua | 16 ++++++++-------- >> test/sql/types.result | 24 ++++++++++++------------ >> 9 files changed, 32 insertions(+), 32 deletions(-) >=20 > More mentionings of blob in messages visible to user. >=20 > func.c :540, :1185, :1254, :1753 > vdbeapi.c:283, :382, :1061 > vdbemem.c:996, :1022 > vdbeaux.c:1192 All these usages are in form of: "string or blob is too big=E2=80=9D I think that blob is a good name for entity of varbinary type. Another possible names are =E2=80=9Cbinary sequence=E2=80=9D, =E2=80=9Cbinary data=E2=80=9D or =E2=80=9Cbinary string=E2=80=9D. The = latter variant is used in the ANSI specification. Now I=E2=80=99ve changed to =E2=80=9Cbinary = string=E2=80=9D, but if you can suggest better name, let=E2=80=99s discuss it. Diff: diff --git a/src/box/sql/func.c b/src/box/sql/func.c index 4ec591eee..1a5671187 100644 --- a/src/box/sql/func.c +++ b/src/box/sql/func.c @@ -1182,7 +1182,8 @@ zeroblobFunc(sql_context * context, int argc, = sql_value ** argv) if (n < 0) n =3D 0; if (sql_result_zeroblob64(context, n) !=3D 0) { - diag_set(ClientError, ER_SQL_EXECUTE, "string or blob = too big"); + diag_set(ClientError, ER_SQL_EXECUTE, "string or binary = string"\ + "is too big"); context->is_aborted =3D true; } } @@ -1251,7 +1252,7 @@ replaceFunc(sql_context * context, int argc, = sql_value ** argv) testcase(nOut - 2 =3D=3D = db->aLimit[SQL_LIMIT_LENGTH]); if (nOut - 1 > db->aLimit[SQL_LIMIT_LENGTH]) { diag_set(ClientError, ER_SQL_EXECUTE, = "string "\ - "or blob too big"); + "or binary string is too big"); context->is_aborted =3D true; sql_free(zOut); return; @@ -1750,8 +1751,8 @@ groupConcatFinalize(sql_context * context) pAccum =3D sql_aggregate_context(context, 0); if (pAccum) { if (pAccum->accError =3D=3D STRACCUM_TOOBIG) { - diag_set(ClientError, ER_SQL_EXECUTE, "string or = blob "\ - "too big"); + diag_set(ClientError, ER_SQL_EXECUTE, "string or = binary"\ + "string is too big"); context->is_aborted =3D true; } else if (pAccum->accError =3D=3D STRACCUM_NOMEM) { context->is_aborted =3D true; diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c index 3bda7d145..217a9f22d 100644 --- a/src/box/sql/vdbeapi.c +++ b/src/box/sql/vdbeapi.c @@ -280,8 +280,8 @@ invokeValueDestructor(const void *p, /* Value = to destroy */ xDel((void *)p); } if (pCtx) { - diag_set(ClientError, ER_SQL_EXECUTE, "string or blob is = too "\ - "big"); + diag_set(ClientError, ER_SQL_EXECUTE, "string or binary = string"\ + "is too big"); pCtx->is_aborted =3D true; } return -1; @@ -379,8 +379,8 @@ sql_result_zeroblob64(sql_context * pCtx, u64 n) { Mem *pOut =3D pCtx->pOut; if (n > (u64) pOut->db->aLimit[SQL_LIMIT_LENGTH]) { - diag_set(ClientError, ER_SQL_EXECUTE, "string or blob is = too "\ - "big"); + diag_set(ClientError, ER_SQL_EXECUTE, "string or binary = string"\ + "is too big"); return -1; } sqlVdbeMemSetZeroBlob(pCtx->pOut, (int)n); @@ -1058,8 +1058,8 @@ sql_bind_zeroblob64(sql_stmt * pStmt, int i, = sql_uint64 n) { Vdbe *p =3D (Vdbe *) pStmt; if (n > (u64) p->db->aLimit[SQL_LIMIT_LENGTH]) { - diag_set(ClientError, ER_SQL_EXECUTE, "string or blob is = too "\ - "big"); + diag_set(ClientError, ER_SQL_EXECUTE, "string or binary = string"\ + "is too big"); return -1; } assert((n & 0x7FFFFFFF) =3D=3D n); diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c index baeeb4624..de50860bb 100644 --- a/src/box/sql/vdbeaux.c +++ b/src/box/sql/vdbeaux.c @@ -1189,7 +1189,7 @@ displayP4(Op * pOp, char *zTemp, int nTemp) zP4 =3D "NULL"; } else { assert(pMem->flags & MEM_Blob); - zP4 =3D "(blob)"; + zP4 =3D "(binary string)"; } break; } diff --git a/src/box/sql/vdbemem.c b/src/box/sql/vdbemem.c index d85148bc3..274f80a18 100644 --- a/src/box/sql/vdbemem.c +++ b/src/box/sql/vdbemem.c @@ -993,8 +993,8 @@ sqlVdbeMemSetStr(Mem * pMem, /* Memory cell = to set to string value */ nAlloc +=3D 1; //SQL_UTF8 } if (nByte > iLimit) { - diag_set(ClientError, ER_SQL_EXECUTE, "string or = blob "\ - "is too big"); + diag_set(ClientError, ER_SQL_EXECUTE, "string or = binary"\ + "string is too big"); return -1; } testcase(nAlloc =3D=3D 0); @@ -1019,8 +1019,8 @@ sqlVdbeMemSetStr(Mem * pMem, /* Memory cell = to set to string value */ pMem->flags =3D flags; =20 if (nByte > iLimit) { - diag_set(ClientError, ER_SQL_EXECUTE, "string or blob is = too "\ - "big"); + diag_set(ClientError, ER_SQL_EXECUTE, "string or binary = string"\ + "is too big"); return -1; }