You've already forked mariadb-columnstore-engine
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:
@ -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)
|
||||
|
||||
|
@ -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
5153
utils/pcre2/jpcre2.hpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user