[TD-6616]<fix>:check the right side of match to be a node value of binary type
This commit is contained in:
parent
13d8bb8348
commit
f79bcf1d5f
|
@ -4531,6 +4531,10 @@ static int32_t validateMatchExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_
|
||||||
return invalidOperationMsg(msgBuf, msg2);
|
return invalidOperationMsg(msgBuf, msg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(pRight->type == SQL_NODE_VALUE && pRight->value.nType == TSDB_DATA_TYPE_BINARY)) {
|
||||||
|
return invalidOperationMsg(msgBuf, msg3);
|
||||||
|
}
|
||||||
|
|
||||||
int errCode = 0;
|
int errCode = 0;
|
||||||
regex_t regex;
|
regex_t regex;
|
||||||
char regErrBuf[256] = {0};
|
char regErrBuf[256] = {0};
|
||||||
|
|
|
@ -79,6 +79,9 @@ if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
sql_error select c1b from $st_name where c1b match e;
|
||||||
|
sql_error select c1b from $st_name where c1b nmatch e;
|
||||||
|
|
||||||
sql create table wrong_type(ts timestamp, c0 tinyint, c1 smallint, c2 int, c3 bigint, c4 float, c5 double, c6 bool, c7 nchar(20)) tags(t0 tinyint, t1 smallint, t2 int, t3 bigint, t4 float, t5 double, t6 bool, t7 nchar(10))
|
sql create table wrong_type(ts timestamp, c0 tinyint, c1 smallint, c2 int, c3 bigint, c4 float, c5 double, c6 bool, c7 nchar(20)) tags(t0 tinyint, t1 smallint, t2 int, t3 bigint, t4 float, t5 double, t6 bool, t7 nchar(10))
|
||||||
sql insert into wrong_type_1 using wrong_type tags(1, 2, 3, 4, 5, 6, true, 'notsupport') values(now, 1, 2, 3, 4, 5, 6, false, 'notsupport')
|
sql insert into wrong_type_1 using wrong_type tags(1, 2, 3, 4, 5, 6, true, 'notsupport') values(now, 1, 2, 3, 4, 5, 6, false, 'notsupport')
|
||||||
sql_error select * from wrong_type where ts match '.*'
|
sql_error select * from wrong_type where ts match '.*'
|
||||||
|
|
Loading…
Reference in New Issue