From: "n.pettik" <korablev@tarantool.org> To: tarantool-patches@freelists.org Cc: Imeev Mergen <imeevma@tarantool.org>, Konstantin Osipov <kostja@tarantool.org> Subject: [tarantool-patches] Re: [PATCH v2 2/2] sql: fix error in case ARRAY/MAP converted to SCALAR Date: Thu, 25 Jul 2019 02:30:12 +0300 [thread overview] Message-ID: <87724483-B69D-4913-A17F-0754D9C53653@tarantool.org> (raw) In-Reply-To: <20190724223706.GD13150@atlas> > On 25 Jul 2019, at 01:37, Konstantin Osipov <kostja@tarantool.org> wrote: > > * n.pettik <korablev@tarantool.org> [19/07/24 17:03]: >>> assert(memIsValid(pIn1)); >>> if (mem_apply_type(pIn1, type) != 0) { >>> - diag_set(ClientError, ER_SQL_TYPE_MISMATCH, >>> - sql_value_text(pIn1), >>> + const char *value; >>> + if ((pIn1->flags & MEM_Subtype) != 0 && >>> + pIn1->subtype == SQL_SUBTYPE_MSGPACK) { >>> + if (mp_typeof(*pIn1->z) == MP_MAP) >>> + value = "map"; >>> + else >>> + value = "array"; >>> + } else { >>> + value = (const char *)sql_value_text(pIn1); >> >> >> Why not simply patch sql_value_text() to make it convert >> map/array to string representation? I’m afraid this is >> unlikely to be the only place where such error may occur. > > Perhaps I am missing the context, but because we don't want to > implicitly convert these values to text in SQL? It’s not about implicit conversion, it’s only about text representation (like mp_fprint()). > Soon we will be able to work with these values in SQL queries, It’s extremely doubtful statement. > so we simply need > to make sure we can pass them around expression trees for now? Actually, we can’t now. > > -- > Konstantin Osipov, Moscow, Russia >
next prev parent reply other threads:[~2019-07-24 23:30 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-07-24 8:11 [tarantool-patches] [PATCH v2 0/2] sql: add ARRAY, MAP and ANY types to mem_apply_type() imeevma 2019-07-24 8:12 ` [tarantool-patches] [PATCH v2 1/2] " imeevma 2019-07-24 8:12 ` [tarantool-patches] [PATCH v2 2/2] sql: fix error in case ARRAY/MAP converted to SCALAR imeevma 2019-07-24 12:24 ` [tarantool-patches] " n.pettik 2019-07-24 22:37 ` Konstantin Osipov 2019-07-24 23:30 ` n.pettik [this message] 2019-07-27 10:16 ` Mergen Imeev 2019-08-07 18:25 ` n.pettik 2019-08-28 13:30 ` Mergen Imeev 2019-08-29 12:19 ` Nikita Pettik 2019-09-02 13:53 ` Mergen Imeev 2019-09-10 13:54 ` korablev 2019-09-11 8:13 ` Mergen Imeev 2019-09-11 9:25 ` Nikita Pettik
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=87724483-B69D-4913-A17F-0754D9C53653@tarantool.org \ --to=korablev@tarantool.org \ --cc=imeevma@tarantool.org \ --cc=kostja@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH v2 2/2] sql: fix error in case ARRAY/MAP converted to SCALAR' \ /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