mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 10:31:57 +00:00
Merge pull request #11949 from ClickHouse/fix-race-condition-extract-all-groups
Fix race condition in extractAllGroups
This commit is contained in:
commit
b041479d90
@ -126,7 +126,7 @@ struct MatchImpl
|
|||||||
{
|
{
|
||||||
size_t size = offsets.size();
|
size_t size = offsets.size();
|
||||||
|
|
||||||
const auto & regexp = Regexps::get<like, true>(pattern);
|
auto regexp = Regexps::get<like, true>(pattern);
|
||||||
|
|
||||||
std::string required_substring;
|
std::string required_substring;
|
||||||
bool is_trivial;
|
bool is_trivial;
|
||||||
@ -281,7 +281,7 @@ struct MatchImpl
|
|||||||
{
|
{
|
||||||
size_t size = data.size() / n;
|
size_t size = data.size() / n;
|
||||||
|
|
||||||
const auto & regexp = Regexps::get<like, true>(pattern);
|
auto regexp = Regexps::get<like, true>(pattern);
|
||||||
|
|
||||||
std::string required_substring;
|
std::string required_substring;
|
||||||
bool is_trivial;
|
bool is_trivial;
|
||||||
|
@ -82,7 +82,8 @@ public:
|
|||||||
throw Exception("Length of 'needle' argument must be greater than 0.", ErrorCodes::BAD_ARGUMENTS);
|
throw Exception("Length of 'needle' argument must be greater than 0.", ErrorCodes::BAD_ARGUMENTS);
|
||||||
|
|
||||||
using StringPiece = typename Regexps::Regexp::StringPieceType;
|
using StringPiece = typename Regexps::Regexp::StringPieceType;
|
||||||
const auto & regexp = Regexps::get<false, false>(needle)->getRE2();
|
auto holder = Regexps::get<false, false>(needle);
|
||||||
|
const auto & regexp = holder->getRE2();
|
||||||
|
|
||||||
if (!regexp)
|
if (!regexp)
|
||||||
throw Exception("There are no groups in regexp: " + needle, ErrorCodes::BAD_ARGUMENTS);
|
throw Exception("There are no groups in regexp: " + needle, ErrorCodes::BAD_ARGUMENTS);
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
if (needle.empty())
|
if (needle.empty())
|
||||||
throw Exception(getName() + " length of 'needle' argument must be greater than 0.", ErrorCodes::BAD_ARGUMENTS);
|
throw Exception(getName() + " length of 'needle' argument must be greater than 0.", ErrorCodes::BAD_ARGUMENTS);
|
||||||
|
|
||||||
const auto regexp = Regexps::get<false, false>(needle);
|
auto regexp = Regexps::get<false, false>(needle);
|
||||||
const auto & re2 = regexp->getRE2();
|
const auto & re2 = regexp->getRE2();
|
||||||
|
|
||||||
if (!re2)
|
if (!re2)
|
||||||
|
Loading…
Reference in New Issue
Block a user