Fix TrimLayer so that TRIM-ing an empty string no longer throws an exception

This commit is contained in:
Peter Nguyen 2024-08-18 10:14:20 -06:00
parent 343f1e7e70
commit fc96f54e10

View File

@ -1667,6 +1667,11 @@ public:
if (!mergeElement())
return false;
/// Skip replaceRegex if trying to TRIM an empty string to avoid exception
if (char_override && elements[0]->getID() == "Literal_''") {
char_override = false;
}
to_remove = makeASTFunction("regexpQuoteMeta", elements[0]);
elements.clear();
state = 2;