From: Kirill Shcherbatov <kshcherbatov@tarantool.org> To: tarantool-patches@freelists.org, Konstantin Osipov <kostja.osipov@gmail.com> Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: invalid integer type in arithmetic operations Date: Thu, 25 Apr 2019 14:21:34 +0300 [thread overview] Message-ID: <9fdb5c0e-eb00-cdd1-eaac-179e58f64907@tarantool.org> (raw) In-Reply-To: <20190425111556.GL29257@atlas> > Please do a table. You already have a branching hell, and UNSIGNED > arithmetics is raising questions. In particular, > I disagree that unsigned + unsigned should give you number - it should give you unsigned. It is not so, look (master, ff8462554d33d971e6d6df3c6e8913785e7d9d61): - if (sql_type_is_numeric(lhs) || sql_type_is_numeric(rhs)) - return FIELD_TYPE_NUMBER; + if (sql_type_is_numeric(lhs) || sql_type_is_numeric(rhs)) { + if (lhs == FIELD_TYPE_NUMBER || rhs == FIELD_TYPE_NUMBER) + return FIELD_TYPE_NUMBER; + if (lhs == FIELD_TYPE_INTEGER || rhs == FIELD_TYPE_INTEGER) + return FIELD_TYPE_INTEGER; + assert(lhs == FIELD_TYPE_UNSIGNED || + rhs == FIELD_TYPE_UNSIGNED); + return FIELD_TYPE_UNSIGNED; + }
next prev parent reply other threads:[~2019-04-25 11:21 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-24 15:36 [tarantool-patches] " Kirill Shcherbatov 2019-04-24 19:43 ` [tarantool-patches] " n.pettik 2019-04-25 7:32 ` Kirill Shcherbatov 2019-04-24 19:56 ` Vladislav Shpilevoy 2019-04-24 23:03 ` n.pettik 2019-04-25 10:49 ` Konstantin Osipov 2019-04-25 10:52 ` Konstantin Osipov 2019-04-25 11:07 ` Kirill Shcherbatov 2019-04-25 11:15 ` Konstantin Osipov 2019-04-25 11:21 ` Kirill Shcherbatov [this message] 2019-04-25 10:37 ` Kirill Yukhin
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=9fdb5c0e-eb00-cdd1-eaac-179e58f64907@tarantool.org \ --to=kshcherbatov@tarantool.org \ --cc=kostja.osipov@gmail.com \ --cc=tarantool-patches@freelists.org \ --cc=v.shpilevoy@tarantool.org \ --subject='[tarantool-patches] Re: [PATCH v1 1/1] sql: invalid integer type in arithmetic operations' \ /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