Merge pull request #25220 from taosdata/fix/TS-4421-3.0
enh: integer with duration literal for timestamp
This commit is contained in:
commit
49ca467488
|
@ -747,16 +747,52 @@ insert_query(A) ::= INSERT INTO full_table_name(C) query_or_subquery(B).
|
|||
|
||||
/************************************************ tags_literal *************************************************************/
|
||||
tags_literal(A) ::= NK_INTEGER(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &B, NULL); }
|
||||
tags_literal(A) ::= NK_INTEGER(B) NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_INTEGER(B) NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_INTEGER(C). {
|
||||
SToken t = B;
|
||||
t.n = (C.z + C.n) - B.z;
|
||||
A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_INTEGER NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_INTEGER NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_INTEGER(C). {
|
||||
SToken t = B;
|
||||
t.n = (C.z + C.n) - B.z;
|
||||
A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_INTEGER NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_INTEGER NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_FLOAT(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &B, NULL); }
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_FLOAT(C). {
|
||||
SToken t = B;
|
||||
|
@ -770,29 +806,113 @@ tags_literal(A) ::= NK_MINUS(B) NK_FLOAT(C).
|
|||
}
|
||||
|
||||
tags_literal(A) ::= NK_BIN(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &B, NULL); }
|
||||
tags_literal(A) ::= NK_BIN(B) NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_BIN(B) NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_BIN(C). {
|
||||
SToken t = B;
|
||||
t.n = (C.z + C.n) - B.z;
|
||||
A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_BIN NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_BIN NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_BIN(C). {
|
||||
SToken t = B;
|
||||
t.n = (C.z + C.n) - B.z;
|
||||
A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_BIN NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_BIN NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_HEX(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &B, NULL); }
|
||||
tags_literal(A) ::= NK_HEX(B) NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_HEX(B) NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_HEX(C). {
|
||||
SToken t = B;
|
||||
t.n = (C.z + C.n) - B.z;
|
||||
A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_HEX NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_PLUS(B) NK_HEX NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_HEX(C). {
|
||||
SToken t = B;
|
||||
t.n = (C.z + C.n) - B.z;
|
||||
A = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_HEX NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_MINUS(B) NK_HEX NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
|
||||
tags_literal(A) ::= NK_STRING(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B, NULL); }
|
||||
tags_literal(A) ::= NK_STRING(B) NK_PLUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_STRING(B) NK_MINUS duration_literal(C). {
|
||||
SToken l = B;
|
||||
SToken r = getTokenFromRawExprNode(pCxt, C);
|
||||
l.n = (r.z + r.n) - l.z;
|
||||
A = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, C);
|
||||
}
|
||||
tags_literal(A) ::= NK_BOOL(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &B, NULL); }
|
||||
tags_literal(A) ::= NULL(B). { A = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &B, NULL); }
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -936,6 +936,9 @@ sql_error alter table st_bool_i1 set tag tagname="123abc"
|
|||
sql alter table st_bool_i2 set tag tagname="123"
|
||||
sql_error alter table st_bool_i3 set tag tagname=abc
|
||||
sql_error alter table st_bool_i4 set tag tagname="abc"
|
||||
sql_error alter table st_bool_i4 set tag tagname=now
|
||||
sql_error alter table st_bool_i4 set tag tagname=now()+1d
|
||||
sql_error alter table st_bool_i4 set tag tagname=1+1d
|
||||
sql_error alter table st_bool_i5 set tag tagname=" "
|
||||
sql_error alter table st_bool_i6 set tag tagname=''
|
||||
|
||||
|
|
|
@ -913,6 +913,8 @@ sql_error alter table st_int_e19 set tag tagname=123abc
|
|||
sql_error alter table st_int_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_int_e22 set tag tagname=abc
|
||||
sql_error alter table st_int_e23 set tag tagname="abc"
|
||||
sql_error alter table st_int_e25 set tag tagname=1+1d
|
||||
sql_error alter table st_int_e25 set tag tagname="1"+1d
|
||||
sql_error alter table st_int_e24 set tag tagname=" "
|
||||
sql_error alter table st_int_e25 set tag tagname=''
|
||||
sql alter table st_int_e26_1 set tag tagname='123'
|
||||
|
|
|
@ -132,6 +132,77 @@ sql show tags from st_timestamp_22
|
|||
if $data05 != -1 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_23 using mt_timestamp tags (1+ 1d )
|
||||
sql show tags from st_timestamp_23
|
||||
if $data05 != 86400001 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_24 using mt_timestamp tags (-0 + 1d)
|
||||
sql show tags from st_timestamp_24
|
||||
if $data05 != 86400000 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_25 using mt_timestamp tags ("-0" -1s)
|
||||
sql show tags from st_timestamp_25
|
||||
if $data05 != -1000 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_26 using mt_timestamp tags (0b01 -1a)
|
||||
sql show tags from st_timestamp_26
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_27 using mt_timestamp tags (0b01 -1s)
|
||||
sql show tags from st_timestamp_27
|
||||
if $data05 != -999 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_28 using mt_timestamp tags ("0x01" +1u)
|
||||
sql show tags from st_timestamp_28
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_29 using mt_timestamp tags (0x01 +1b)
|
||||
sql show tags from st_timestamp_29
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_30 using mt_timestamp tags (-0b00 -0a)
|
||||
sql show tags from st_timestamp_30
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_31 using mt_timestamp tags ("-0x00" +1u)
|
||||
sql show tags from st_timestamp_31
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_32 using mt_timestamp tags (-0x00 +1b)
|
||||
sql show tags from st_timestamp_32
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_33 using mt_timestamp tags (now +1b)
|
||||
sql show tags from st_timestamp_33
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_34 using mt_timestamp tags ("now()" +1b)
|
||||
sql show tags from st_timestamp_34
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_35 using mt_timestamp tags (today() +1d)
|
||||
sql show tags from st_timestamp_35
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql create table st_timestamp_36 using mt_timestamp tags ("today()" +1d)
|
||||
sql show tags from st_timestamp_36
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
## case 01: insert values for test column values
|
||||
sql insert into st_timestamp_0 values(now,NULL)
|
||||
|
@ -249,6 +320,76 @@ sql select ts, cast(c as bigint) from st_timestamp_22
|
|||
if $data01 != -1 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_23 values(now,1+ 1d )
|
||||
sql select ts, cast(c as bigint) from st_timestamp_23
|
||||
if $data01 != 86400001 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_24 values(now,-0 + 1d)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_24
|
||||
if $data01 != 86400000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_25 values(now,"-0" -1s)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_25
|
||||
if $data01 != -1000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_26 values(now,0b01 -1a)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_26
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_27 values(now,+0b01 -1s)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_27
|
||||
if $data01 != -999 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_28 values(now,"+0x01" +1u)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_28
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_29 values(now,0x01 +1b)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_29
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_30 values(now,-0b00 -0a)
|
||||
sql show tags from st_timestamp_30
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_31 values(now,"-0x00" +1u)
|
||||
sql show tags from st_timestamp_31
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_32 values (now,-0x00 +1b)
|
||||
sql show tags from st_timestamp_32
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_33 values(now,now +1b)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_33
|
||||
if $data01 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_34 values(now,"now()" +1b)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_34
|
||||
if $data01 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_35 values(now,today() +1d)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_35
|
||||
if $data01 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_36 values(now,"today()" +1d)
|
||||
sql select ts, cast(c as bigint) from st_timestamp_36
|
||||
if $data01 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
## case 02: dynamic create table for test tag values
|
||||
sql insert into st_timestamp_100 using mt_timestamp tags(NULL) values(now, NULL)
|
||||
|
@ -450,6 +591,136 @@ sql select ts, cast(c as bigint) from st_timestamp_1022
|
|||
if $data01 != -1 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1023 using mt_timestamp tags(+1+1d) values(now,+1+ 1d )
|
||||
sql show tags from st_timestamp_1023
|
||||
if $data05 != 86400001 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1023
|
||||
if $data01 != 86400001 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1024 using mt_timestamp tags(-0+1d) values(now,-0 + 1d)
|
||||
sql show tags from st_timestamp_1024
|
||||
if $data05 != 86400000 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1024
|
||||
if $data01 != 86400000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1025 using mt_timestamp tags("-0" -1s) values(now,"-0" -1s)
|
||||
sql show tags from st_timestamp_1025
|
||||
if $data05 != -1000 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1025
|
||||
if $data01 != -1000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1026 using mt_timestamp tags(+0b01-1a) values(now,+0b01 -1a)
|
||||
sql show tags from st_timestamp_1026
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1026
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1027 using mt_timestamp tags(0b01-1s) values(now,0b01 -1s)
|
||||
sql show tags from st_timestamp_1027
|
||||
if $data05 != -999 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1027
|
||||
if $data01 != -999 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1028 using mt_timestamp tags("0x01" + 1u) values(now,"0x01" +1u)
|
||||
sql show tags from st_timestamp_1028
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1028
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1029 using mt_timestamp tags(+0x01 +1b) values(now,+0x01 +1b)
|
||||
sql show tags from st_timestamp_1029
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1029
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1030 using mt_timestamp tags (-0b00 -0a) values(now,-0b00 -0a)
|
||||
sql show tags from st_timestamp_1030
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1030
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1031 using mt_timestamp tags ("-0x00" +1u) values(now,"-0x00" +1u)
|
||||
sql show tags from st_timestamp_1031
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1031
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1032 using mt_timestamp tags (-0x00 +1b) values(now,-0x00 +1b)
|
||||
sql show tags from st_timestamp_1032
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1032
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1033 using mt_timestamp tags(now+1b) values(now,now +1b)
|
||||
sql show tags from st_timestamp_1033
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1033
|
||||
if $data01 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1034 using mt_timestamp tags("now" +1b) values(now,"now()" +1b)
|
||||
sql show tags from st_timestamp_1034
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1034
|
||||
if $data01 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1035 using mt_timestamp tags(today() + 1d) values(now,today() +1d)
|
||||
sql show tags from st_timestamp_1035
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1035
|
||||
if $data01 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_timestamp_1036 using mt_timestamp tags("today" +1d) values(now,"today()" +1d)
|
||||
sql show tags from st_timestamp_1036
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql select ts, cast(c as bigint) from st_timestamp_1036
|
||||
if $data01 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### case 03: alter tag values
|
||||
sql alter table st_timestamp_0 set tag tagname=NULL
|
||||
|
@ -567,12 +838,85 @@ sql show tags from st_timestamp_22
|
|||
if $data05 != -1 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_23 set tag tagname=1+ 1d
|
||||
sql show tags from st_timestamp_23
|
||||
if $data05 != 86400001 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_24 set tag tagname=-0 + 1d
|
||||
sql show tags from st_timestamp_24
|
||||
if $data05 != 86400000 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_25 set tag tagname="-0" -1s
|
||||
sql show tags from st_timestamp_25
|
||||
if $data05 != -1000 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_26 set tag tagname=+0b01 -1a
|
||||
sql show tags from st_timestamp_26
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_27 set tag tagname=0b01 -1s
|
||||
sql show tags from st_timestamp_27
|
||||
if $data05 != -999 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_28 set tag tagname="0x01" +1u
|
||||
sql show tags from st_timestamp_28
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_29 set tag tagname=0x01 +1b
|
||||
sql show tags from st_timestamp_29
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_30 set tag tagname==-0b00 -0a
|
||||
sql show tags from st_timestamp_30
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_31 set tag tagname="-0x00" +1u
|
||||
sql show tags from st_timestamp_31
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_32 set tag tagname=-0x00 +1b
|
||||
sql show tags from st_timestamp_32
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_33 set tag tagname=now +1b
|
||||
sql show tags from st_timestamp_33
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_34 set tag tagname="now()" +1b
|
||||
sql show tags from st_timestamp_34
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_35 set tag tagname=today( ) +1d
|
||||
sql show tags from st_timestamp_35
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
sql alter table st_timestamp_36 set tag tagname="today()" +1d
|
||||
sql show tags from st_timestamp_36
|
||||
if $data05 < 1711883186000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
## case 04: illegal input
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags (123abc)
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags ("123abc")
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags (abc)
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags ("abc")
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags (now()+1d+1s)
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags (1+1y)
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags (0x01+1b+1a)
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags (" ")
|
||||
sql_error create table st_timestamp_e0 using mt_timestamp tags ('')
|
||||
sql_error create table st_timestamp_104 using mt_timestamp tags ("-123.1")
|
||||
|
@ -590,5 +934,7 @@ sql_error create table st_timestamp_115 using mt_timestamp tags (922337203685477
|
|||
sql create table st_timestamp_116 using mt_timestamp tags (-9223372036854775808)
|
||||
sql_error create table st_timestamp_117 using mt_timestamp tags (-9223372036854775809)
|
||||
sql_error insert into st_timestamp_118 using mt_timestamp tags(9223372036854775807) values(9223372036854775807, 9223372036854775807)
|
||||
sql_error insert into st_timestamp_119 using mt_timestamp tags(1+1s-1s) values(now, now)
|
||||
sql_error insert into st_timestamp_120 using mt_timestamp tags(1-1s) values(now, now-1s+1d)
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -299,6 +299,8 @@ sql_error create table st_varbinary_1012 using mt_varbinary tags(tRue)
|
|||
sql_error create table st_varbinary_1013 using mt_varbinary tags(FalsE)
|
||||
sql_error create table st_varbinary_1014 using mt_varbinary tags(noW)
|
||||
sql_error create table st_varbinary_1015 using mt_varbinary tags(toDay)
|
||||
sql_error create table st_varbinary_1016 using mt_varbinary tags(now()+1s)
|
||||
sql_error create table st_varbinary_1017 using mt_varbinary tags(1+1s)
|
||||
sql_error insert into st_varbinary_106 using mt_varbinary tags(+0123) values(now, NULL);
|
||||
sql_error insert into st_varbinary_107 using mt_varbinary tags(-01.23) values(now, NULL);
|
||||
sql_error insert into st_varbinary_108 using mt_varbinary tags(+0x01) values(now, NULL);
|
||||
|
@ -309,6 +311,8 @@ sql_error insert into st_varbinary_1012 using mt_varbinary tags(tRue) values(no
|
|||
sql_error insert into st_varbinary_1013 using mt_varbinary tags(FalsE) values(now, NULL);
|
||||
sql_error insert into st_varbinary_1014 using mt_varbinary tags(noW) values(now, NULL);
|
||||
sql_error insert into st_varbinary_1015 using mt_varbinary tags(toDay) values(now, NULL);
|
||||
sql_error insert into st_varbinary_1016 using mt_varbinary tags(now()+1s) values(now, NULL);
|
||||
sql_error insert into st_varbinary_1017 using mt_varbinary tags(1+1s) values(now, NULL);
|
||||
sql_error insert into st_varbinary_106 using mt_varbinary tags(NULL) values(now(), +0123)
|
||||
sql_error insert into st_varbinary_107 using mt_varbinary tags(NULL) values(now(), -01.23)
|
||||
sql_error insert into st_varbinary_108 using mt_varbinary tags(NULL) values(now(), +0x01)
|
||||
|
@ -319,5 +323,7 @@ sql_error insert into st_varbinary_1012 using mt_varbinary tags(NULL) values(no
|
|||
sql_error insert into st_varbinary_1013 using mt_varbinary tags(NULL) values(now(), FalsE)
|
||||
sql_error insert into st_varbinary_1014 using mt_varbinary tags(NULL) values(now(), noW)
|
||||
sql_error insert into st_varbinary_1015 using mt_varbinary tags(NULL) values(now(), toDay)
|
||||
sql_error insert into st_varbinary_1016 using mt_varbinary tags(NULL) values(now(), now()+1s)
|
||||
sql_error insert into st_varbinary_1017 using mt_varbinary tags(NULL) values(now(), 1+1s)
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -410,6 +410,17 @@ endi
|
|||
|
||||
|
||||
# case 04: illegal input
|
||||
sql_error create table st_varchar_100 using mt_varchar tags(now+1d)
|
||||
sql_error create table st_varchar_101 using mt_varchar tags(toDay+1d)
|
||||
sql_error create table st_varchar_102 using mt_varchar tags(1+1b)
|
||||
sql_error create table st_varchar_103 using mt_varchar tags(0x01+1d)
|
||||
sql_error create table st_varchar_104 using mt_varchar tags(0b01+1s)
|
||||
sql_error insert into st_varchar_1100 using mt_varchar tags('now') values(now(),now+1d)
|
||||
sql_error insert into st_varchar_1101 using mt_varchar tags('now') values(now(),toDay+1d)
|
||||
sql_error insert into st_varchar_1102 using mt_varchar tags('now') values(now(),1+1b)
|
||||
sql_error insert into st_varchar_1103 using mt_varchar tags('now') values(now(),0x01+1d)
|
||||
sql_error insert into st_varchar_1104 using mt_varchar tags('now') values(now(),0b01+1s)
|
||||
sql_error alter table st_varchar_15 set tag tagname=now()+1d
|
||||
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
Loading…
Reference in New Issue