From 2cbf57c053541b53d216a284a832838e3d5a77f3 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 3 May 2017 22:32:27 +0100 Subject: [PATCH] MCOL-698 Fix joiner for TEXT columns Joiner was thinking TEXT was INT --- utils/joiner/tuplejoiner.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/utils/joiner/tuplejoiner.cpp b/utils/joiner/tuplejoiner.cpp index 23b23fcf9..bfa6535fc 100644 --- a/utils/joiner/tuplejoiner.cpp +++ b/utils/joiner/tuplejoiner.cpp @@ -109,7 +109,9 @@ TupleJoiner::TupleJoiner( for (uint32_t i = keyLength = 0; i < smallKeyColumns.size(); i++) { if (smallRG.getColTypes()[smallKeyColumns[i]] == CalpontSystemCatalog::CHAR || - smallRG.getColTypes()[smallKeyColumns[i]] == CalpontSystemCatalog::VARCHAR) + smallRG.getColTypes()[smallKeyColumns[i]] == CalpontSystemCatalog::VARCHAR + || + smallRG.getColTypes()[smallKeyColumns[i]] == CalpontSystemCatalog::TEXT) keyLength += smallRG.getColumnWidth(smallKeyColumns[i]) + 1; // +1 null char else keyLength += 8; @@ -611,7 +613,9 @@ TypelessData makeTypelessKey(const Row &r, const vector &keyCols, ret.data = (uint8_t *) fa->allocate(); for (i = 0; i < keyCols.size(); i++) { type = r.getColTypes()[keyCols[i]]; - if (type == CalpontSystemCatalog::VARCHAR || type == CalpontSystemCatalog::CHAR) { + if (type == CalpontSystemCatalog::VARCHAR || + type == CalpontSystemCatalog::CHAR || + type == CalpontSystemCatalog::TEXT) { // this is a string, copy a normalized version const uint8_t *str = r.getStringPointer(keyCols[i]); uint32_t width = r.getStringLength(keyCols[i]); @@ -664,7 +668,9 @@ TypelessData makeTypelessKey(const Row &r, const vector &keyCols, Pool ret.data = (uint8_t *) fa->allocate(keylen); for (i = 0; i < keyCols.size(); i++) { type = r.getColTypes()[keyCols[i]]; - if (type == CalpontSystemCatalog::VARCHAR || type == CalpontSystemCatalog::CHAR) { + if (type == CalpontSystemCatalog::VARCHAR || + type == CalpontSystemCatalog::CHAR || + type == CalpontSystemCatalog::TEXT) { // this is a string, copy a normalized version const uint8_t *str = r.getStringPointer(keyCols[i]); uint32_t width = r.getStringLength(keyCols[i]); @@ -698,7 +704,9 @@ uint64_t getHashOfTypelessKey(const Row &r, const vector &keyCols, uin for (i = 0; i < keyCols.size(); i++) { type = r.getColTypes()[keyCols[i]]; - if (type == CalpontSystemCatalog::VARCHAR || type == CalpontSystemCatalog::CHAR) { + if (type == CalpontSystemCatalog::VARCHAR || + type == CalpontSystemCatalog::CHAR || + type == CalpontSystemCatalog::TEXT) { // this is a string, copy a normalized version const uint8_t *str = r.getStringPointer(keyCols[i]); uint32_t len = r.getStringLength(keyCols[i]);