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 765FE21B00 for ; Mon, 22 Apr 2019 14:02:24 -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 4xioRg6BihK9 for ; Mon, 22 Apr 2019 14:02:24 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 D94C9294B5 for ; Mon, 22 Apr 2019 14:02:23 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 3/9] sql: use msgpack types instead of custom ones References: <7d55169718d4bc193a41710da12cfd6a7d4edebc.1555252410.git.korablev@tarantool.org> <374916ec-2e49-643f-eccb-42f9d66e340e@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Mon, 22 Apr 2019 21:02:21 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit 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: "n.pettik" , tarantool-patches@freelists.org Thanks for the fixes! >>> @@ -139,15 +139,15 @@ lengthFunc(sql_context * context, int argc, sql_value ** argv) >>> >>> assert(argc == 1); >>> UNUSED_PARAMETER(argc); >>> - switch (sql_value_type(argv[0])) { >>> - case SQL_BLOB: >>> - case SQL_INTEGER: >>> - case SQL_FLOAT:{ >>> + switch (sql_value_mp_type(argv[0])) { >>> + case MP_BIN: >>> + case MP_INT: >>> + case MP_DOUBLE:{ >> >> 4. Probably you could fix part of this: >> https://github.com/tarantool/tarantool/issues/4159 in scope of >> this commit, alongside. > > THis patch provides straightforward refactoring, I don’t want > to involve here non-trivial changes. Yes, you are right, it is not worth doing here. > diff --git a/src/box/sql/date.c b/src/box/sql/date.c > index 5f5272ea3..1c7a5ad2d 100644 > --- a/src/box/sql/date.c > +++ b/src/box/sql/date.c > @@ -932,12 +932,12 @@ isDate(sql_context * context, int argc, sql_value ** argv, DateTime * p) > { > int i, n; > const unsigned char *z; > - int eType; > + enum mp_type eType; > memset(p, 0, sizeof(*p)); > if (argc == 0) { > return setDateTimeToCurrent(context, p); > } > - if ((eType = sql_value_type(argv[0])) == SQL_FLOAT > + if ((eType = sql_value_type(argv[0])) == MP_DOUBLE > || eType == SQL_INTEGER) { SQL_INTEGER is removed already. Please, replace with MP_INT.