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 B69202A267 for ; Thu, 28 Mar 2019 02:55:24 -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 G9N472tqzWrG for ; Thu, 28 Mar 2019 02:55:24 -0400 (EDT) Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 00C352A250 for ; Thu, 28 Mar 2019 02:55:23 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: [tarantool-patches] Re: [PATCH] sql: set explicit default collation's strength From: "i.koptelov" In-Reply-To: <085718fe-734f-f141-b914-b21050f6e28c@tarantool.org> Date: Thu, 28 Mar 2019 09:55:21 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190326203456.76617-1-ivan.koptelov@tarantool.org> <8ab84a8f-213e-4bcd-217d-e5f694b70693@tarantool.org> <17D31B00-F24C-48C8-BE9D-CA4D32D35484@tarantool.org> <085718fe-734f-f141-b914-b21050f6e28c@tarantool.org> 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: Vladislav Shpilevoy > On 27 Mar 2019, at 22:32, Vladislav Shpilevoy = wrote: >=20 >=20 >=20 > On 27/03/2019 22:32, Vladislav Shpilevoy wrote: >>=20 >>=20 >> On 27/03/2019 18:01, i.koptelov wrote: >>>=20 >>>=20 >>>> On 27 Mar 2019, at 17:26, Vladislav Shpilevoy = wrote: >>>>=20 >>>> Please, apply the diff below. Be careful because I haven't tested = it. >>>> Fix it, if tests fail, and do not forget to regenerate = boostrap.snap. >>>>=20 >>>> diff --git a/src/box/lua/upgrade.lua b/src/box/lua/upgrade.lua >>>> index a23d0af64..37ab76177 100644 >>>> --- a/src/box/lua/upgrade.lua >>>> +++ b/src/box/lua/upgrade.lua >>>> @@ -638,10 +638,9 @@ end >>>>=20 >>>> local function update_collation_strength_field() >>>> local _collation =3D box.space[box.schema.COLLATION_ID] >>>> - for _, collation in ipairs(_collation:select()) do >>>> - if collation.opts.strength =3D=3D nil and collation.name = ~=3D 'none' and >>>> - collation.name ~=3D 'binary' then >>>> - local new_collation =3D = _collation:get{collation.id}:totable() >>>> + for _, collation in _collation:pairs() do >>>> + if collation.type =3D=3D 'ICU' and collation.opts.strength = =3D=3D nil then >>>> + local new_collation =3D collation:totable() >>>> new_collation[6].strength =3D 'tertiary' >>>> _collation:delete{collation.id} >>>> _collation:insert(new_collation) >>>>=20 >>> Ok, done. Tests are not broken, bootstrap.snap is regenerated. >>>=20 >>=20 >> Looks like it is not done. You ignored last two lines: fix of >> indentation and fix of excess lookup of a tuple which you already >> have from pairs. >>=20 >=20 > Sorry, indentation is ok. Only double lookup still is unfixed. >=20 Sorry, fixed now.=