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 7AB3B6DB00; Sat, 21 Aug 2021 09:48:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7AB3B6DB00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629528516; bh=gJbKrAjCRajzi+CgCqt8xZRH/hpt7ve5SPZAmU685QM=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=AHBZ/Cu7FUcwd3OL/bbi0/bZDvxqqk5/BKUyyrqd3VTs7N2RhazxChT17BAl0Y+jH Yy6J29s5wN7XlrE4zUAZbZ/vqf0MSguEtdr3shU/T3JBBPctW1hwV39kXA3Z9QboL/ SAtZ+ZEqrssXUtvLqFx5I3jVbV1zx8OVwqTwNUsE= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 6704A6DB00 for ; Thu, 19 Aug 2021 17:47:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6704A6DB00 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mGjKX-00085W-8g; Thu, 19 Aug 2021 17:47:41 +0300 Date: Thu, 19 Aug 2021 17:47:39 +0300 To: Safin Timur Message-ID: References: <1e9be2a14c934c0597c519a3cb72f30e2ce9e76a.1629341071.git.tsafin@tarantool.org> <1629371897.227277377@f106.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-618D5548: 5FEE1E42414EDE0AEA2C218F635C109D81B4C380E13AE3BDD15E3534DD24E6EE X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9F9A2272A1D086A28553D1D5C4B4124EF182A05F53808504050670BE44DA7EEBB661EFA5A874042DFFB8FEC801AABAC68FADF6C21B4D7AA75 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE712EB008F780777E9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375E347E1311495C1B8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D820146FA0F39BE1737D5514DFE70CFC506F9789CCF6C18C3F8528715B7D10C86878DA827A17800CE7FA587F4160EEFA029FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B2EE5AD8F952D28FBA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C46CC729E650C927943847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5A9A7DF34B11796D1C70364B573B57FA82987E1FE40730655D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75601EFBC916B793DF410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D9DC20663B80603F08E11900DB502F7259AEEFEB82DDFBB7F2EF4EE6B011F92C3BE432A1256BB0751D7E09C32AA3244C1D3B5F64FB181F6F208034B88C6B343A7C0C08F7987826B98D5DD81C2BAB7D1D X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojGSxK+6r6oBGRiWtzC5FdFA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D533BA7CEBF1D52AF0D6733159D9CF257538ECAC369CE044476863AE46C6229963AE5922765F965CD4A8E3A94D815DAADEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok X-Mailman-Approved-At: Sat, 21 Aug 2021 09:48:35 +0300 Subject: Re: [Tarantool-patches] [PATCH v6 3/5] box, datetime: datetime comparison for indices 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: "Dmitry E. Oboukhov via Tarantool-patches" Reply-To: "Dmitry E. Oboukhov" Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" > > The code looks like as broken. > > Not exactly :) > > .new{} is constructor which is not expecting string at the moment. .parse() > expect strings, or defaul __call handler for the module, which is > dispatching between parsing, if passed string, and, direct calling > constructor, if there are no arguments passed or they are object. If .new and .__call are different, .new have to throw an exception instead creating object with zero in its timestamp. I think it would be nice to drop '__call' method and patch 'new' for work with strings (mainstream) and tables (rare cases) > diff --git a/src/lib/core/datetime.c b/src/lib/core/datetime.c > index ebc05e29c..6e2a76da5 100644 > --- a/src/lib/core/datetime.c > +++ b/src/lib/core/datetime.c > @@ -93,20 +93,17 @@ datetime_to_string(const struct datetime *date, char I can't apply the patch: > patching file src/lib/core/datetime.c > patch: **** malformed patch at line 4: *buf, int len) I think it isn't between previous and current versions. > ------------------------------------------------ > > 2. also the other databases try to avoid to use «Z» symbol in > > datetime-format, so I thing we should use «+00:00» instead «Z» > > I don't care which way to output UTC, but here I need more examples (which > vendor, how and when outputs timezone)... > > Like - here is DATE WITH TIMEZONE column, and here is DATE WITHOUT TIMEZONE. > And here TIMESTAMP WITHOUT TIMEZONE, and with UTC, and we see... Example Postgresql unera=> SET TIME ZONE 'ZULU'; SET unera=> select '2021-08-19 17:36:14+0300'::TIMESTAMPTZ(0); timestamptz ------------------------ 2021-08-19 14:36:14+00 (1 строка) unera=> select '2021-08-19 17:36:14Z'::TIMESTAMPTZ(0); timestamptz ------------------------ 2021-08-19 17:36:14+00 (1 строка) Even if you set current timezone to 'Z' it prints zone as number. So user can sort these strings as strings and sort will be correct. > > > > > Yesterday we approved the following API: > > T:add{year=XXX, month=YYY, ...} > > T:sub{year=XXX, month=YYY, ...} > > T:set{year=XXX, …, tz=’+03:00’} > > T:strftime(‘%F %D %z’) > > I want to see a test set for the API. > > FWIW, :add{}/:sub{}/:strftime{} are there, but not :set() as unimplemented > yet. Ok, I think we need to have test for each method. > > Datetime object must have methods to return integer and float timestamp: > > T:epoch() > > T:timestamp() > > epoch() is integer, and timestamp() is double, correct? ok -- . ''`. Dmitry E. Oboukhov : :’ : `. `~’ work: `- 71ED ACFC 6801 0DD9 1AD1 9B86 8D1F 969A 08EE A756