fix(query): fix to_iso8601 function append format in "-hh:mm", "-hhmm"
"-hh", "z" when digits exceeds 10 digits
This commit is contained in:
parent
a4ac8b1c03
commit
51c9a6fac7
|
@ -901,12 +901,22 @@ int32_t toISO8601Function(SScalarParam *pInput, int32_t inputNum, SScalarParam *
|
||||||
|
|
||||||
if (hasFraction) {
|
if (hasFraction) {
|
||||||
int32_t fracLen = (int32_t)strlen(fraction) + 1;
|
int32_t fracLen = (int32_t)strlen(fraction) + 1;
|
||||||
char *tzInfo = strchr(buf, '+');
|
|
||||||
if (tzInfo) {
|
char *tzInfo;
|
||||||
|
if (buf[len - 1] == 'z' || buf[len - 1] == 'Z') {
|
||||||
|
tzInfo = &buf[len - 1];
|
||||||
memmove(tzInfo + fracLen, tzInfo, strlen(tzInfo));
|
memmove(tzInfo + fracLen, tzInfo, strlen(tzInfo));
|
||||||
} else {
|
} else {
|
||||||
tzInfo = strchr(buf, '-');
|
tzInfo = strchr(buf, '+');
|
||||||
memmove(tzInfo + fracLen, tzInfo, strlen(tzInfo));
|
if (tzInfo) {
|
||||||
|
memmove(tzInfo + fracLen, tzInfo, strlen(tzInfo));
|
||||||
|
} else {
|
||||||
|
//search '-' backwards
|
||||||
|
tzInfo = strrchr(buf, '-');
|
||||||
|
if (tzInfo) {
|
||||||
|
memmove(tzInfo + fracLen, tzInfo, strlen(tzInfo));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char tmp[32] = {0};
|
char tmp[32] = {0};
|
||||||
|
|
Loading…
Reference in New Issue