From 00cd7f40c19ffda5fcd50b1ca9d41b3c511224a2 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Thu, 4 May 2017 15:14:27 +0100 Subject: [PATCH] MCOL-698 Fix joiner for LONGTEXT It turns out not many machines have 32TB of RAM, so lets try not to allocate that much for a LONGTEXT key join... --- utils/joiner/tuplejoiner.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/joiner/tuplejoiner.cpp b/utils/joiner/tuplejoiner.cpp index bfa6535fc..30d97f6be 100644 --- a/utils/joiner/tuplejoiner.cpp +++ b/utils/joiner/tuplejoiner.cpp @@ -112,7 +112,12 @@ TupleJoiner::TupleJoiner( smallRG.getColTypes()[smallKeyColumns[i]] == CalpontSystemCatalog::VARCHAR || smallRG.getColTypes()[smallKeyColumns[i]] == CalpontSystemCatalog::TEXT) + { keyLength += smallRG.getColumnWidth(smallKeyColumns[i]) + 1; // +1 null char + // MCOL-698: if we don't do this LONGTEXT allocates 32TB RAM + if (keyLength > 65536) + keyLength = 65536; + } else keyLength += 8; // Set bSignedUnsignedJoin if one or more join columns are signed to unsigned compares.