From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id C5B4C70358; Wed, 15 Sep 2021 00:53:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C5B4C70358 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1631656431; bh=eWLKa5/uZYXNsp0FgQ41ZjQBDfVsG88mPa0Ua0elQAg=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=CaWkqvZt+WNLSQ4weYcYA1hAI/M08LQzvfGfdbceeRLG1eoJgItb5dBtYSZQbpZ8S pm5ecFq8iHsRfh77Kr/9Yf9bppKFUuyZiyCsq5lMHttUCmCfGlJZdlwL4gNLFLrCpI KAyC5afx3hmY/xrLbW8pzXDLVngqidH3DhQTs0gc= Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E0BAB70358 for ; Wed, 15 Sep 2021 00:53:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E0BAB70358 Received: by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1mQGNB-0001AM-6F; Wed, 15 Sep 2021 00:53:49 +0300 To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: <5b50cb62e4b786ecb420ee2de5ee4d8f8c59b5d5.1631291287.git.tsafin@tarantool.org> Message-ID: Date: Wed, 15 Sep 2021 00:53:41 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <5b50cb62e4b786ecb420ee2de5ee4d8f8c59b5d5.1631291287.git.tsafin@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91AE02D33A9C88A2FECE56E2A292C9F7D3C69CC5C84EEB3A800894C459B0CD1B953DAC1E8A0214F1D64AAD99942D19C53B1FBEFDBD6FEC8F4479AC59D1825621F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78CB87876C5D626D4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063764345650F0BBEB0B8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D88F893D02ED79F47C1E79F1DE6F41FAD2117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC6A03BDC6CE4C620F3AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F7900637D6F850AEB95125CFD81D268191BDAD3D698AB9A7B718F8C4D1B931868CE1C5781A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F83C798A30B85E16BCE5475246E174218B5C8C57E37DE458BEDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79D2AE6C3BEB5DE9A26887DACE6AADA3D99 X-C1DE0DAB: 0D63561A33F958A5750EDB5DAF0AEE67F0410BA5F94FD1BBEED2DC431BD5F485D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D75CEA0D7A80616EB7C5E6CE9F2EFD6F944B805D7F42AD298A0FB62A243F67A264AB32A6031B2C121D7E09C32AA3244CEAEAFBB51EA594AD9805E4EC81DD7B5135DA7DC5AF9B58C0729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj2yA91e2A1g0tryEEuOiNcQ== X-Mailru-Sender: B5B6A6EBBD94DAD8CDC8197FB00801286AB7E57616195C87D2951E12880A2B4E2FC79D37E3987A0F1EC9E4A2C82A33BC8C24925A86E657CE0C70AEE3C9A96FBAB3D7EE8ED63280BE112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/n] build, lua: built-in module datetime X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Safin Timur via Tarantool-patches Reply-To: Safin Timur Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On 10.09.2021 20:50, Timur Safin wrote: ... > + local ts = obj.timestamp > + if ts ~= nil then > + local sec_int, fraction > + sec_int, fraction = math_modf(ts) > + -- if there is one of nsec, usec, msec provided > + -- then ignore fraction in timestamp > + -- otherwise - use nsec, usec, or msec > + if count_usec == 0 then > + nsec = fraction * 1e9 > + end > + > + self.secs = sec_int > + self.nsec = nsec > + > + return self > + end > + Discovered the harder way (via hitting runtime exception) that I've not renamed .secs access here to .epoch field access. ------------------------------------------------------------- diff --git a/src/lua/datetime.lua b/src/lua/datetime.lua index 4c6471bed..540a5a940 100644 --- a/src/lua/datetime.lua +++ b/src/lua/datetime.lua @@ -664,7 +664,7 @@ local function datetime_set(self, obj) nsec = fraction * 1e9 end - self.secs = sec_int + self.epoch = sec_int self.nsec = nsec return self ------------------------------------------------------------- This is an indication that I've not tested date:set{timestamp = N} access thouroughly, and more tests cases needed. Will update 1st commit to branch tsafin/gh-5941-datetime-take2-wip soon with the corrected code and more tests. Timur