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 AD7A627452 for ; Thu, 19 Jul 2018 06:17:06 -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 RV7LQx3y0SMA for ; Thu, 19 Jul 2018 06:17:06 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 5E98622E92 for ; Thu, 19 Jul 2018 06:17:06 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v1 3/3] sql: get rid of Column structure References: <72990d0ecbba60f0551c254eb33a3282b645cd5d.1531932662.git.kshcherbatov@tarantool.org> <4A0B514A-C0DA-406F-BD14-B1F11D4357EF@tarantool.org> <73ba298b-8546-6a67-1b6e-87d2b55a9d8a@tarantool.org> From: Kirill Shcherbatov Message-ID: Date: Thu, 19 Jul 2018 13:17:03 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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, Vladislav Shpilevoy , Nikita Pettik > Now you have changed the behavior. Before this fix the collation was > assigned once. Now it is assigned every time. hi! Thank you for lookup. You right: columns could have default collation that could be overwritten with specified one. I've returned old semantics. CREATE TABLE t3(x TEXT PRIMARY KEY COLLATE "unicode_ci"); SELECT b FROM t4 UNION SELECT b FROM v4 ORDER BY 1 COLLATE text; - bool unused; - uint32_t id; - struct coll *coll = sql_expr_coll(pParse, p, &unused, &id); - if (coll != NULL && pCol->coll == NULL) { - pCol->coll = coll; - pTab->def->fields[i].coll_id = id; - } + bool is_found; + uint32_t coll_id; + if (pTab->def->fields[i].coll_id == COLL_NONE && + sql_expr_coll(pParse, p, &is_found, &coll_id) && is_found) + pTab->def->fields[i].coll_id = coll_id;