From 61b02598d7ce1cc787d6d872411ba237c1c06347 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Mon, 23 Sep 2019 02:02:03 +0300 Subject: [PATCH] Update repeat.cpp --- dbms/src/Functions/repeat.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dbms/src/Functions/repeat.cpp b/dbms/src/Functions/repeat.cpp index 81e780fb53b..741af698452 100644 --- a/dbms/src/Functions/repeat.cpp +++ b/dbms/src/Functions/repeat.cpp @@ -178,16 +178,18 @@ public: Impl::vectorConst(copy_str, repeat_time, col_res->getChars(), col_res->getOffsets()); block.getByPosition(result).column = std::move(col_res); } - else if (!castType(block.getByPosition(arguments[1]).type.get(), [&](const auto & type) + else if (!castType(block.getByPosition(arguments[1]).type.get(), [&](const auto & type) + { + using DataType = std::decay_t; + using T0 = typename DataType::FieldType; + const ColumnVector * colnum = checkAndGetColumn>(numcolumn.get()); + auto col_res = ColumnString::create(); + Impl::vectorNonConstInteger(copy_str, col_res->getChars(), col_res->getOffsets(), colnum->getData()); + block.getByPosition(result).column = std::move(col_res); + return 0; + })) { - using DataType = std::decay_t; - using T0 = typename DataType::FieldType; - const ColumnVector * colnum = checkAndGetColumn>(numcolumn.get()); - auto col_res = ColumnString::create(); - Impl::vectorNonConstInteger(copy_str, col_res->getChars(), col_res->getOffsets(), colnum->getData()); - block.getByPosition(result).column = std::move(col_res); - return 0; - })); + } else throw Exception( "Illegal column " + block.getByPosition(arguments[1]).column->getName() + " of argument of function " + getName(),