From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH v1 2/7] sql: re-introduce NUMBER and SCALAR meta-types Date: Thu, 12 Aug 2021 21:51:01 +0300 [thread overview] Message-ID: <f7de52ca-127c-f752-922b-67146d21b6c5@tarantool.org> (raw) In-Reply-To: <2831e4d4b237ead1e70129010ddd10f9429afe72.1628697448.git.imeevma@gmail.com> Thanks for the patch! > diff --git a/src/box/sql/func.c b/src/box/sql/func.c > index 5ac5c5e56..ebb546a7f 100644 > --- a/src/box/sql/func.c > +++ b/src/box/sql/func.c > @@ -162,6 +162,12 @@ typeofFunc(sql_context * context, int NotUsed, sql_value ** argv) > { > const char *z = 0; > UNUSED_PARAMETER(NotUsed); > + if (argv[0]->type == MEM_TYPE_NULL) > + return mem_set_str0_static(context->pOut, "NULL"); 1. This can be a part of the switch-case a few lines below. > + if ((argv[0]->flags & MEM_Number) != 0) > + return mem_set_str0_static(context->pOut, "number"); > + if ((argv[0]->flags & MEM_Scalar) != 0) > + return mem_set_str0_static(context->pOut, "scalar"); 2. Could you please remind me what was wrong with having type MEM_TYPE_SCALAR and storing the actual type in another field? > switch (argv[0]->type) { > case MEM_TYPE_INT: > case MEM_TYPE_UINT:
next prev parent reply other threads:[~2021-08-12 18:51 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-11 16:01 [Tarantool-patches] [PATCH v1 0/7] Rework SCALAR and NUMBER types in SQL Mergen Imeev via Tarantool-patches 2021-08-11 16:01 ` [Tarantool-patches] [PATCH v1 1/7] sql: remove enum field_type from struct Mem Mergen Imeev via Tarantool-patches 2021-08-11 16:01 ` [Tarantool-patches] [PATCH v1 2/7] sql: re-introduce NUMBER and SCALAR meta-types Mergen Imeev via Tarantool-patches 2021-08-12 18:51 ` Vladislav Shpilevoy via Tarantool-patches [this message] 2021-08-12 22:22 ` Mergen Imeev via Tarantool-patches 2021-08-11 16:01 ` [Tarantool-patches] [PATCH v1 3/7] sql: disallow implicit cast from NUMBER and SCALAR Mergen Imeev via Tarantool-patches 2021-08-11 16:01 ` [Tarantool-patches] [PATCH v1 4/7] sql: disallow arithmetic for " Mergen Imeev via Tarantool-patches 2021-08-11 16:01 ` [Tarantool-patches] [PATCH v1 5/7] sql: disallow bitwise " Mergen Imeev via Tarantool-patches 2021-08-11 16:01 ` [Tarantool-patches] [PATCH v1 6/7] sql: disallow concatination for SCALAR Mergen Imeev via Tarantool-patches 2021-08-11 16:01 ` [Tarantool-patches] [PATCH v1 7/7] sql: fix comparison with SCALAR value Mergen Imeev via Tarantool-patches 2021-08-12 18:50 ` Vladislav Shpilevoy via Tarantool-patches 2021-08-12 22:23 ` Mergen Imeev via Tarantool-patches 2021-08-13 3:12 [Tarantool-patches] [PATCH v1 0/7] Rework SCALAR and NUMBER types in SQL Mergen Imeev via Tarantool-patches 2021-08-13 3:12 ` [Tarantool-patches] [PATCH v1 2/7] sql: re-introduce NUMBER and SCALAR meta-types Mergen Imeev via Tarantool-patches
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=f7de52ca-127c-f752-922b-67146d21b6c5@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=imeevma@tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v1 2/7] sql: re-introduce NUMBER and SCALAR meta-types' \ /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