mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Trim exit string before checking. #2510
This commit is contained in:
parent
c8bdc1e8ba
commit
27c6df7e20
@ -731,7 +731,7 @@ private:
|
||||
|
||||
bool processSingleQuery(const String & line, ASTPtr parsed_query_ = nullptr)
|
||||
{
|
||||
if (exit_strings.end() != exit_strings.find(line))
|
||||
if (exit_strings.end() != exit_strings.find(trim(line, [](char c){ return isWhitespaceASCII(c) || c == ';'; })))
|
||||
return false;
|
||||
|
||||
resetOutput();
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "StringUtils.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
namespace detail
|
||||
{
|
||||
@ -14,3 +15,10 @@ bool endsWith(const std::string & s, const char * suffix, size_t suffix_size)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string trim(const std::string & str, const std::function<bool(char)> & predicate)
|
||||
{
|
||||
std::string trimmed = str;
|
||||
boost::trim_if(trimmed, predicate);
|
||||
return trimmed;
|
||||
}
|
||||
|
@ -133,3 +133,4 @@ inline bool equalsCaseInsensitive(char a, char b)
|
||||
return a == b || (isAlphaASCII(a) && alternateCaseIfAlphaASCII(a) == b);
|
||||
}
|
||||
|
||||
std::string trim(const std::string & str, const std::function<bool(char)> & predicate);
|
||||
|
Loading…
Reference in New Issue
Block a user