From dcacbbd3a92dad74c27669c7073e2d9db16dfd57 Mon Sep 17 00:00:00 2001 From: Leonid Fedorov <79837786+mariadb-LeonidFedorov@users.noreply.github.com> Date: Wed, 18 Aug 2021 19:48:48 +0300 Subject: [PATCH] Wrong power of 2 in esimator` (#2088) --- dbcon/joblist/rowestimator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbcon/joblist/rowestimator.cpp b/dbcon/joblist/rowestimator.cpp index 9879aa932..873a1ad49 100644 --- a/dbcon/joblist/rowestimator.cpp +++ b/dbcon/joblist/rowestimator.cpp @@ -159,16 +159,16 @@ uint32_t RowEstimator::estimateDistinctValues(const execplan::CalpontSystemCatal // Return limit/2 for integers where limit is number of possible values. case CalpontSystemCatalog::TINYINT: - return (2 ^ 8) / 2; + return (1 << 8) / 2; case CalpontSystemCatalog::UTINYINT: - return (2 ^ 8); + return (1 << 8); case CalpontSystemCatalog::SMALLINT: - return (2 ^ 16) / 2; + return (1 << 16) / 2; case CalpontSystemCatalog::USMALLINT: - return (2 ^ 16); + return (1 << 16); // Next group all have range greater than 8M (# of rows in an extent), use 8M/2 as the estimate. case CalpontSystemCatalog::MEDINT: