Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgTY7-0006yy-IS for pgsql-committers@arkaria.postgresql.org; Sun, 26 Mar 2023 16:48:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pgTY4-0000BV-DY for pgsql-committers@arkaria.postgresql.org; Sun, 26 Mar 2023 16:48:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgTY4-0000BL-5v for pgsql-committers@lists.postgresql.org; Sun, 26 Mar 2023 16:48:52 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pgTY1-0004sx-Gs for pgsql-committers@lists.postgresql.org; Sun, 26 Mar 2023 16:48:51 +0000 Received: by mail-ed1-x52d.google.com with SMTP id eg48so26411542edb.13 for ; Sun, 26 Mar 2023 09:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1679849327; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1SKEAHoWgbDSkht+ZW4INCODDv6tFUCo8At6evDpUH0=; b=J0C0K1h3n65Bxnx9D/IGUyYJTbP8M0sEBGqmhDcSrBMbjDyW4xBT1SElMUkSwJz1Y/ UT1uAxNIvYKlOz6F7dMHvF465OGAxxT7pmCG0Wr3kgClP5mylmlvUr89lmIessO/FZoT VJl/wWoTum04WAaGOCayZXvZ9UUoWpgROz5evb9iOl9pKYMSQj6OdQk7/1seGbN5Doyc 5EgGPhGZ7SCPvbdCaXjzKHO0Q9DhFKmPiZaPzilfJC6d9nbnkbAjxk2Vol+hRG254j1Z 70VfKlE5fy2sRg/Zpjr7PGOIJ0jc/s9M/TVXEp+8cSolH9OVVQAimKUFLFUbDRgh7X2u 2IzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679849327; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1SKEAHoWgbDSkht+ZW4INCODDv6tFUCo8At6evDpUH0=; b=kWv/ALwvXDOq6vga9Tb0obdFyJO6dOivUQ9DLd+jYOQXZlyuU8qqvvACNYQvwJ1ZzQ T4ODTpax71iA7YssgDegACAPigcYYXIwhsU444AZF/96hz0eYWnjVwKOy6rGvNT2ygU3 MismIw92xuWz/lg5miqyuUHpbnWG7jl2ErphgYaUaUO6FJ933PqDseJUjcmqMA4gaC3/ xJtZUud5iEdbBBjyg2iYFq4cYGOFGyDYFRdSSAjp7tkl1Y1nbik9laq5mEBJhsqI0w52 cOTq+T5hCsKVmI/UzvFy1Hwb6lEfvDzSEKNPpppNoTNd8JTd0gzCk9acqAfVX1IDf1rL wDAw== X-Gm-Message-State: AAQBX9dpPkw0Tt4jjpzOezuo/lJSmSCvVg3J8dfGh0fdGvh1im/slD4I 5S/agP2pYRKp3hY8Tc2TqX01UdM5cpiuKC1A88QzgNoEyS0qeY3aD0/BgbzQs897MvdSOTlMFHq sYjkzX0KWthWhU2gY8hy7DLfHWN6p0L4ir0tDGMNUL9lfNyK/Y1zow3Du1/mVLLiI/A6c6C91NB edQpd3bh0W+uGU1DRb8zHY+NhethpuxAtaywUq/X5x0UA4hXFJP+EJKPn4WsSbhwVhH3gOa+i83 KSX X-Google-Smtp-Source: AKy350ZZArV2ZmJJ988STXd1Wh0vNjt07kTWm6ZWfmANDvIUDXH3vhv+k5kHTwTaxlWSQcZH71lLjQ== X-Received: by 2002:a50:e619:0:b0:4af:6a7e:9218 with SMTP id y25-20020a50e619000000b004af6a7e9218mr8998546edm.42.1679849327587; Sun, 26 Mar 2023 09:48:47 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-228-162.bb.vodafone.cz. [86.49.228.162]) by smtp.gmail.com with ESMTPSA id x23-20020a50d617000000b004fa268da13esm13868913edi.56.2023.03.26.09.48.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Mar 2023 09:48:46 -0700 (PDT) Message-ID: <200b709d-6b1d-54e6-971d-b9dec75bd8a8@enterprisedb.com> Date: Sun, 26 Mar 2023 18:48:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: pgsql: Fix netmask handling in inet_minmax_multi_ops Content-Language: en-US To: Tomas Vondra , pgsql-committers@lists.postgresql.org References: From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/20/23 10:28, Tomas Vondra wrote: > Fix netmask handling in inet_minmax_multi_ops > > When calculating distance in brin_minmax_multi_distance_inet(), the > netmask was applied incorrectly. This results in (seemingly) incorrect > ordering of values, triggering an assert. > > For builds without asserts this is mostly harmless - we may merge other > ranges, possibly resulting in slightly less efficient index. But it's > still correct and the greedy algorithm doesn't guarantee optimality > anyway. > > Backpatch to 14, where minmax-multi indexes were introduced. > > Reported by Dmitry Dolgov, investigation and fix by me. > > Reported-by: Dmitry Dolgov Correction - the issue was reported by Robins Tharakan, I got confused while writing the commit message. I don't know if this issue is to be mentioned in release notes (considering it mostly affects just assert builds), but if we do we should the correct name. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company