You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
tests and review fixes
This commit is contained in:
@ -125,13 +125,13 @@ local testRun(platform) =
|
|||||||
|
|
||||||
local testPreparation(platform) =
|
local testPreparation(platform) =
|
||||||
local platform_map = {
|
local platform_map = {
|
||||||
'centos:7': 'yum -y install epel-release && yum install -y git cppunit-devel cmake3 boost-devel snappy-devel',
|
'centos:7': 'yum -y install epel-release && yum install -y git cppunit-devel cmake3 boost-devel snappy-devel pcre2-devel',
|
||||||
'rockylinux:8': rockylinux8_build_deps + ' && dnf install -y git lz4 cppunit-devel cmake3 boost-devel snappy-devel',
|
'rockylinux:8': rockylinux8_build_deps + ' && dnf install -y git lz4 cppunit-devel cmake3 boost-devel snappy-devel pcre2-devel',
|
||||||
'rockylinux:9': rockylinux9_build_deps + ' && dnf install -y git lz4 cppunit-devel cmake3 boost-devel snappy-devel',
|
'rockylinux:9': rockylinux9_build_deps + ' && dnf install -y git lz4 cppunit-devel cmake3 boost-devel snappy-devel pcre2-devel',
|
||||||
'debian:11': 'apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake',
|
'debian:11': 'apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake libpcre2-dev',
|
||||||
'debian:12': 'apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake',
|
'debian:12': 'apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake libpcre2-dev',
|
||||||
'ubuntu:20.04': 'apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake',
|
'ubuntu:20.04': 'apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake libpcre2-dev',
|
||||||
'ubuntu:22.04': 'apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake',
|
'ubuntu:22.04': 'apt update && apt install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake libpcre2-dev',
|
||||||
};
|
};
|
||||||
platform_map[platform];
|
platform_map[platform];
|
||||||
|
|
||||||
|
@ -412,6 +412,11 @@ t1_TEXT REGEXP_REPLACE(t1_TEXT, 'o?o', 'KittyCat')
|
|||||||
ooooo KittyCatKittyCatKittyCat
|
ooooo KittyCatKittyCatKittyCat
|
||||||
ppppp ppppp
|
ppppp ppppp
|
||||||
qqqqq qqqqq
|
qqqqq qqqqq
|
||||||
|
SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, 'q', 'KittyCat') FROM t1 ORDER BY 1;
|
||||||
|
t1_TEXT REGEXP_REPLACE(t1_TEXT, 'q', 'KittyCat')
|
||||||
|
ooooo ooooo
|
||||||
|
ppppp ppppp
|
||||||
|
qqqqq KittyCatKittyCatKittyCatKittyCatKittyCat
|
||||||
SELECT t1_DATE, t1_DATE REGEXP '(1997)+' FROM t1 ORDER BY 1;
|
SELECT t1_DATE, t1_DATE REGEXP '(1997)+' FROM t1 ORDER BY 1;
|
||||||
t1_DATE t1_DATE REGEXP '(1997)+'
|
t1_DATE t1_DATE REGEXP '(1997)+'
|
||||||
1997-12-12 1
|
1997-12-12 1
|
||||||
|
@ -13,5 +13,8 @@ INSERT INTO t1 VALUES(103, 1234.5699, repeat('o', 5), '1997-12-12', '22:12:02');
|
|||||||
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
||||||
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
||||||
SELECT t1_TEXT, REGEXP_INSTR(t1_TEXT, 'o') FROM t1 ORDER BY 1;
|
SELECT t1_TEXT, REGEXP_INSTR(t1_TEXT, 'o') FROM t1 ORDER BY 1;
|
||||||
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'regexp_instr' isn't supported.
|
t1_TEXT REGEXP_INSTR(t1_TEXT, 'o')
|
||||||
|
ooooo 1
|
||||||
|
ppppp 0
|
||||||
|
qqqqq 0
|
||||||
DROP DATABASE mcs244_db;
|
DROP DATABASE mcs244_db;
|
||||||
|
@ -13,5 +13,8 @@ INSERT INTO t1 VALUES(103, 1234.5699, repeat('o', 5), '1997-12-12', '22:12:02');
|
|||||||
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
||||||
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
||||||
SELECT REGEXP_REPLACE(t1_TEXT, 'o', 'X') FROM t1 ORDER BY 1;
|
SELECT REGEXP_REPLACE(t1_TEXT, 'o', 'X') FROM t1 ORDER BY 1;
|
||||||
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'regexp_replace' isn't supported.
|
REGEXP_REPLACE(t1_TEXT, 'o', 'X')
|
||||||
|
ppppp
|
||||||
|
qqqqq
|
||||||
|
XXXXX
|
||||||
DROP DATABASE mcs245_db;
|
DROP DATABASE mcs245_db;
|
||||||
|
@ -13,5 +13,8 @@ INSERT INTO t1 VALUES(103, 1234.5699, repeat('o', 5), '1997-12-12', '22:12:02');
|
|||||||
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
||||||
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
||||||
SELECT REGEXP_SUBSTR(t1_TEXT, '[a-z]+') FROM t1 ORDER BY 1;
|
SELECT REGEXP_SUBSTR(t1_TEXT, '[a-z]+') FROM t1 ORDER BY 1;
|
||||||
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'regexp_substr' isn't supported.
|
REGEXP_SUBSTR(t1_TEXT, '[a-z]+')
|
||||||
|
ooooo
|
||||||
|
ppppp
|
||||||
|
qqqqq
|
||||||
DROP DATABASE mcs246_db;
|
DROP DATABASE mcs246_db;
|
||||||
|
@ -115,7 +115,7 @@ SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, '(qqqqq)+', 'KittyCat') FROM t1 ORDER BY
|
|||||||
SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, 'p*', 'KittyCat') FROM t1 ORDER BY 1;
|
SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, 'p*', 'KittyCat') FROM t1 ORDER BY 1;
|
||||||
SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, 'qq+q', 'KittyCat') FROM t1 ORDER BY 1;
|
SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, 'qq+q', 'KittyCat') FROM t1 ORDER BY 1;
|
||||||
SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, 'o?o', 'KittyCat') FROM t1 ORDER BY 1;
|
SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, 'o?o', 'KittyCat') FROM t1 ORDER BY 1;
|
||||||
|
SELECT t1_TEXT, REGEXP_REPLACE(t1_TEXT, 'q', 'KittyCat') FROM t1 ORDER BY 1;
|
||||||
|
|
||||||
SELECT t1_DATE, t1_DATE REGEXP '(1997)+' FROM t1 ORDER BY 1;
|
SELECT t1_DATE, t1_DATE REGEXP '(1997)+' FROM t1 ORDER BY 1;
|
||||||
SELECT t1_DATE, t1_DATE REGEXP '01$' FROM t1 ORDER BY 1;
|
SELECT t1_DATE, t1_DATE REGEXP '01$' FROM t1 ORDER BY 1;
|
||||||
|
@ -23,7 +23,6 @@ INSERT INTO t1 VALUES(103, 1234.5699, repeat('o', 5), '1997-12-12', '22:12:02');
|
|||||||
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
||||||
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
||||||
|
|
||||||
--error ER_CHECK_NOT_IMPLEMENTED
|
|
||||||
SELECT t1_TEXT, REGEXP_INSTR(t1_TEXT, 'o') FROM t1 ORDER BY 1;
|
SELECT t1_TEXT, REGEXP_INSTR(t1_TEXT, 'o') FROM t1 ORDER BY 1;
|
||||||
|
|
||||||
# Clean UP
|
# Clean UP
|
||||||
|
@ -23,7 +23,6 @@ INSERT INTO t1 VALUES(103, 1234.5699, repeat('o', 5), '1997-12-12', '22:12:02');
|
|||||||
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
||||||
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
||||||
|
|
||||||
--error ER_CHECK_NOT_IMPLEMENTED
|
|
||||||
SELECT REGEXP_REPLACE(t1_TEXT, 'o', 'X') FROM t1 ORDER BY 1;
|
SELECT REGEXP_REPLACE(t1_TEXT, 'o', 'X') FROM t1 ORDER BY 1;
|
||||||
|
|
||||||
# Clean UP
|
# Clean UP
|
||||||
|
@ -23,7 +23,6 @@ INSERT INTO t1 VALUES(103, 1234.5699, repeat('o', 5), '1997-12-12', '22:12:02');
|
|||||||
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
INSERT INTO t1 VALUES(-7299, 111.99, repeat('p', 5), '2001-1-1', '23:59:59');
|
||||||
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
INSERT INTO t1 VALUES(9913, 98765.4321, repeat('q', 5), '09-12-11', '01:08:59');
|
||||||
|
|
||||||
--error ER_CHECK_NOT_IMPLEMENTED
|
|
||||||
SELECT REGEXP_SUBSTR(t1_TEXT, '[a-z]+') FROM t1 ORDER BY 1;
|
SELECT REGEXP_SUBSTR(t1_TEXT, '[a-z]+') FROM t1 ORDER BY 1;
|
||||||
|
|
||||||
# Clean UP
|
# Clean UP
|
||||||
|
@ -259,10 +259,11 @@ std::string Func_regexp_replace::getStrVal(rowgroup::Row& row, FunctionParm& fp,
|
|||||||
execplan::CalpontSystemCatalog::ColType& ct)
|
execplan::CalpontSystemCatalog::ColType& ct)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
RegExpParams param = getEpressionAndPattern(row, fp, isNull, ct, ct.getTimeZone());
|
||||||
|
|
||||||
if (isNull)
|
if (isNull)
|
||||||
return std::string{};
|
return std::string{};
|
||||||
|
|
||||||
RegExpParams param = getEpressionAndPattern(row, fp, isNull, ct, ct.getTimeZone());
|
|
||||||
const auto& replace_with = fp[2]->data()->getStrVal(row, isNull);
|
const auto& replace_with = fp[2]->data()->getStrVal(row, isNull);
|
||||||
|
|
||||||
if (replace_with.isNull())
|
if (replace_with.isNull())
|
||||||
@ -280,11 +281,11 @@ std::string Func_regexp_substr::getStrVal(rowgroup::Row& row, FunctionParm& fp,
|
|||||||
execplan::CalpontSystemCatalog::ColType& ct)
|
execplan::CalpontSystemCatalog::ColType& ct)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
RegExpParams param = getEpressionAndPattern(row, fp, isNull, ct, ct.getTimeZone());
|
||||||
|
|
||||||
if (isNull)
|
if (isNull)
|
||||||
return std::string{};
|
return std::string{};
|
||||||
|
|
||||||
RegExpParams param = getEpressionAndPattern(row, fp, isNull, ct, ct.getTimeZone());
|
|
||||||
|
|
||||||
jp::Regex re(param.pattern);
|
jp::Regex re(param.pattern);
|
||||||
jp::RegexMatch rm(&re);
|
jp::RegexMatch rm(&re);
|
||||||
jp::VecNum vec_num;
|
jp::VecNum vec_num;
|
||||||
@ -305,11 +306,11 @@ std::string Func_regexp_instr::getStrVal(rowgroup::Row& row, FunctionParm& fp, b
|
|||||||
execplan::CalpontSystemCatalog::ColType& ct)
|
execplan::CalpontSystemCatalog::ColType& ct)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
RegExpParams param = getEpressionAndPattern(row, fp, isNull, ct, ct.getTimeZone());
|
||||||
|
|
||||||
if (isNull)
|
if (isNull)
|
||||||
return std::string{};
|
return std::string{};
|
||||||
|
|
||||||
RegExpParams param = getEpressionAndPattern(row, fp, isNull, ct, ct.getTimeZone());
|
|
||||||
|
|
||||||
jp::Regex re(param.pattern);
|
jp::Regex re(param.pattern);
|
||||||
jp::RegexMatch rm(&re);
|
jp::RegexMatch rm(&re);
|
||||||
jpcre2::VecOff vec_soff;
|
jpcre2::VecOff vec_soff;
|
||||||
@ -328,11 +329,11 @@ std::string Func_regexp_instr::getStrVal(rowgroup::Row& row, FunctionParm& fp, b
|
|||||||
bool Func_regexp::getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
bool Func_regexp::getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||||
CalpontSystemCatalog::ColType& ct)
|
CalpontSystemCatalog::ColType& ct)
|
||||||
{
|
{
|
||||||
|
RegExpParams param = getEpressionAndPattern(row, fp, isNull, ct, ct.getTimeZone());
|
||||||
|
|
||||||
if (isNull)
|
if (isNull)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RegExpParams param = getEpressionAndPattern(row, fp, isNull, ct, ct.getTimeZone());
|
|
||||||
|
|
||||||
jp::Regex re(param.pattern);
|
jp::Regex re(param.pattern);
|
||||||
return re.match(param.expression);
|
return re.match(param.expression);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user