From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 4 Mar 2019 20:53:22 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH v2] sql: Duplicate key error for a non-unique index Message-ID: <20190304175322.bp4hn5g5c65bi4sk@esperanza> References: <20190220100610.29771-1-szudin@tarantool.org> <20190226132625.4bsl5p27m4rgoizi@esperanza> <3e9f77a3-62d7-1619-fc43-7d6d9b300031@tarantool.org> <20190228161945.o3jdmus4tehyoo53@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: Stanislav Zudin Cc: tarantool-patches@freelists.org, Konstantin Osipov List-ID: On Fri, Mar 01, 2019 at 02:46:45PM +0300, Stanislav Zudin wrote: > +/** > + * Check whether the first collation is compatible > + * with the second one. > + * */ > +bool > +coll_is_compatible(const struct coll *first, const struct coll* second); I renamed coll_is_compatible to coll_can_merge (so that it matches key_def_can_merge), because compatibility is typically a symmetric relationship (if a is compatible with b, then b is compatible with a) while this function is asymmetric. I also added some comments explaining the logic behind the decisions made by coll_is_compatible and pushed the patch to 2.1.