feat:[TD-32642] add timezone for connection support
This commit is contained in:
parent
5ead3c68b1
commit
8c05378ca1
|
@ -163,20 +163,25 @@ int32_t parseTimezone(char* str, int64_t* tzOffset) {
|
||||||
PARSE(&str[i], hourSize, hour);
|
PARSE(&str[i], hourSize, hour);
|
||||||
|
|
||||||
i += hourSize + 1;
|
i += hourSize + 1;
|
||||||
size_t minSize = strlen(&str[i]);
|
|
||||||
PARSE(&str[i], minSize, minute);
|
|
||||||
if (minute > 59 || minute < 0) {
|
|
||||||
TAOS_RETURN(TSDB_CODE_INVALID_PARA);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
size_t hourSize = strlen(&str[i]);
|
size_t hourSize = strlen(&str[i]);
|
||||||
|
if (hourSize > 2){
|
||||||
|
hourSize = 2;
|
||||||
|
}
|
||||||
PARSE(&str[i], hourSize, hour)
|
PARSE(&str[i], hourSize, hour)
|
||||||
|
i += hourSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hour > 13 || hour < 0) {
|
if (hour > 13 || hour < 0) {
|
||||||
TAOS_RETURN(TSDB_CODE_INVALID_PARA);
|
TAOS_RETURN(TSDB_CODE_INVALID_PARA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t minSize = strlen(&str[i]);
|
||||||
|
PARSE(&str[i], minSize, minute);
|
||||||
|
if (minute > 59 || minute < 0) {
|
||||||
|
TAOS_RETURN(TSDB_CODE_INVALID_PARA);
|
||||||
|
}
|
||||||
|
|
||||||
if (str[0] == '+') {
|
if (str[0] == '+') {
|
||||||
*tzOffset = -(hour * 3600 + minute * 60);
|
*tzOffset = -(hour * 3600 + minute * 60);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2259,10 +2259,10 @@ int32_t toISO8601Function(SScalarParam *pInput, int32_t inputNum, SScalarParam *
|
||||||
len += tzLen;
|
len += tzLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
_end:
|
|
||||||
memmove(buf + VARSTR_HEADER_SIZE, buf, len);
|
memmove(buf + VARSTR_HEADER_SIZE, buf, len);
|
||||||
varDataSetLen(buf, len);
|
varDataSetLen(buf, len);
|
||||||
|
|
||||||
|
_end:
|
||||||
SCL_ERR_RET(colDataSetVal(pOutput->columnData, i, buf, false));
|
SCL_ERR_RET(colDataSetVal(pOutput->columnData, i, buf, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue