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:
@ -67,7 +67,7 @@ extern boost::condition_variable cond;
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const std::string myname = "DMLProc";
|
[[maybe_unused]] const std::string myname = "DMLProc";
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace dmlprocessor
|
namespace dmlprocessor
|
||||||
|
@ -150,7 +150,7 @@ add_library(funcexp SHARED ${funcexp_LIB_SRCS})
|
|||||||
|
|
||||||
add_dependencies(funcexp loggingcpp)
|
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)
|
install(TARGETS funcexp DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine)
|
||||||
|
|
||||||
|
@ -25,12 +25,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#ifdef __linux__
|
#include "utils/pcre2/jpcre2.hpp"
|
||||||
#include <regex.h>
|
|
||||||
#else
|
|
||||||
#include <regex>
|
|
||||||
using namespace boost;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "functor_bool.h"
|
#include "functor_bool.h"
|
||||||
#include "functioncolumn.h"
|
#include "functioncolumn.h"
|
||||||
@ -50,7 +45,7 @@ namespace
|
|||||||
inline bool getBool(rowgroup::Row& row, funcexp::FunctionParm& pm, bool& isNull,
|
inline bool getBool(rowgroup::Row& row, funcexp::FunctionParm& pm, bool& isNull,
|
||||||
CalpontSystemCatalog::ColType& ct, long timeZone)
|
CalpontSystemCatalog::ColType& ct, long timeZone)
|
||||||
{
|
{
|
||||||
string expr;
|
string expr ;
|
||||||
string pattern;
|
string pattern;
|
||||||
|
|
||||||
switch (pm[0]->data()->resultType().colDataType)
|
switch (pm[0]->data()->resultType().colDataType)
|
||||||
@ -212,25 +207,9 @@ inline bool getBool(rowgroup::Row& row, funcexp::FunctionParm& pm, bool& isNull,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __linux__
|
jpcre2::select<char>::Regex re(pattern);
|
||||||
regex_t re;
|
return re.match(expr);
|
||||||
|
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace funcexp
|
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