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 660D22DB9B for ; Thu, 25 Oct 2018 07:00:20 -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 D73k4te3PjDe for ; Thu, 25 Oct 2018 07:00:20 -0400 (EDT) Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (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 9FF9C2DB91 for ; Thu, 25 Oct 2018 07:00:19 -0400 (EDT) From: Nikita Pettik Subject: [tarantool-patches] [PATCH 0/3] Change collation compatibility rules according to ANSI SQL Date: Thu, 25 Oct 2018 14:00:06 +0300 Message-Id: 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: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Nikita Pettik Branch: https://github.com/tarantool/tarantool/tree/np/gh-3185-ban-comparison-with-different-collations Issue: https://github.com/tarantool/tarantool/issues/3185 First two patches are auxiliary and self-explanatory. The third patch adds rules to collation compatibility in order to restrict usage of different collations within one comparison. Originally, SQLite uses doubtful approach: if collations of LHS and RHS can not be used together, then collation of LHS is chosen. Such behaviour quite misleading and results in the fact that swap of LHS and RHS values may change result of operation. We've decided to add restrictions on collations of LHS and RHS to disallow messing different collations as it is stated in ANSI SQL. Nikita Pettik (3): sql: do not add explicit clause Add surrogate ID for BINARY collation sql: change collation compatibility rules src/box/errcode.h | 1 + src/box/key_def.c | 2 +- src/box/key_def.h | 17 ++++++ src/box/lua/space.cc | 2 +- src/box/sql/callback.c | 6 +- src/box/sql/expr.c | 70 +++++++++++++++++------ src/box/sql/fkey.c | 2 - src/box/sql/select.c | 115 ++++++++++++++++++++------------------ src/box/sql/sqliteInt.h | 28 +++++++++- src/box/sql/where.c | 13 ++--- src/box/sql/whereexpr.c | 38 ++++++------- src/box/tuple_format.c | 2 +- test/box/misc.result | 1 + test/sql-tap/e_select1.test.lua | 12 ++-- test/sql-tap/in4.test.lua | 2 +- test/sql-tap/join.test.lua | 2 +- test/sql-tap/tkt3493.test.lua | 4 +- test/sql-tap/transitive1.test.lua | 4 +- test/sql-tap/with1.test.lua | 2 +- test/sql/collation.result | 79 ++++++++++++++++++++++++++ test/sql/collation.test.lua | 30 ++++++++++ 21 files changed, 313 insertions(+), 119 deletions(-) -- 2.15.1