feat:[TD-32642] add timezone for connection support

This commit is contained in:
wangmm0220 2024-11-29 01:34:20 +08:00
parent 8c05378ca1
commit 8629a63c6b
2 changed files with 6 additions and 4 deletions

View File

@ -192,7 +192,6 @@ char *tz_test[] = {
"2023-09-16 17:00:00+:",
"2023-09-16 17:00:00+8f:",
"2023-09-16 17:00:00+080:",
"2023-09-16 17:00:00+080",
"2023-09-16 17:00:00+a",
"2023-09-16 17:00:00+09:",
"2023-09-16 17:00:00+09:a",

View File

@ -163,6 +163,8 @@ int32_t parseTimezone(char* str, int64_t* tzOffset) {
PARSE(&str[i], hourSize, hour);
i += hourSize + 1;
size_t minSize = strlen(&str[i]);
PARSE(&str[i], minSize, minute);
} else {
size_t hourSize = strlen(&str[i]);
if (hourSize > 2){
@ -170,14 +172,15 @@ int32_t parseTimezone(char* str, int64_t* tzOffset) {
}
PARSE(&str[i], hourSize, hour)
i += hourSize;
size_t minSize = strlen(&str[i]);
if (minSize > 0){
PARSE(&str[i], minSize, minute);
}
}
if (hour > 13 || hour < 0) {
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);
}