mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
disallow null characters in custom alphabet
This commit is contained in:
parent
4eb55d17b3
commit
03a7f7c4bd
@ -23,6 +23,7 @@ namespace ErrorCodes
|
||||
{
|
||||
extern const int ILLEGAL_COLUMN;
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
extern const int INVALID_ALPHABET;
|
||||
extern const int TOO_MANY_ARGUMENTS_FOR_FUNCTION;
|
||||
extern const int TOO_FEW_ARGUMENTS_FOR_FUNCTION;
|
||||
}
|
||||
@ -114,7 +115,11 @@ public:
|
||||
{
|
||||
const auto & alphabetcolumn = arguments[3].column;
|
||||
if (auto alpha_col = checkAndGetColumnConst<ColumnString>(alphabetcolumn.get()))
|
||||
{
|
||||
alphabet = alpha_col->getValue<String>();
|
||||
if (alphabet.find("\0") != std::string::npos)
|
||||
throw Exception(ErrorCodes::INVALID_ALPHABET, "Custom alphabet must not contain null character");
|
||||
}
|
||||
}
|
||||
else
|
||||
alphabet.assign(DEFAULT_ALPHABET);
|
||||
|
Loading…
Reference in New Issue
Block a user