1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

initital pcre2

This commit is contained in:
Leonid Fedorov
2024-03-05 10:21:03 +00:00
parent c01e1f4ed8
commit fe0299d42c
4 changed files with 5159 additions and 27 deletions

View File

@ -150,7 +150,7 @@ add_library(funcexp SHARED ${funcexp_LIB_SRCS})
add_dependencies(funcexp loggingcpp)
target_link_libraries(funcexp ${NETSNMP_LIBRARIES} pron)
target_link_libraries(funcexp ${NETSNMP_LIBRARIES} pron pcre2-8)
install(TARGETS funcexp DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine)

View File

@ -25,12 +25,7 @@
#include <string>
using namespace std;
#ifdef __linux__
#include <regex.h>
#else
#include <regex>
using namespace boost;
#endif
#include "utils/pcre2/jpcre2.hpp"
#include "functor_bool.h"
#include "functioncolumn.h"
@ -50,7 +45,7 @@ namespace
inline bool getBool(rowgroup::Row& row, funcexp::FunctionParm& pm, bool& isNull,
CalpontSystemCatalog::ColType& ct, long timeZone)
{
string expr;
string expr ;
string pattern;
switch (pm[0]->data()->resultType().colDataType)
@ -212,25 +207,9 @@ inline bool getBool(rowgroup::Row& row, funcexp::FunctionParm& pm, bool& isNull,
}
}
#ifdef __linux__
regex_t re;
regcomp(&re, pattern.c_str(), REG_EXTENDED | REG_NOSUB);
int res = regexec(&re, expr.c_str(), 0, NULL, 0);
regfree(&re);
if (res == 0)
return true;
else
return false;
#else
std::regex pat(pattern.c_str());
return std::regex_search(expr.c_str(), pat);
#endif
jpcre2::select<char>::Regex re(pattern);
return re.match(expr);
}
} // namespace
namespace funcexp

5153
utils/pcre2/jpcre2.hpp Normal file

File diff suppressed because it is too large Load Diff