mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
dbms: OLAP compatibility: fixed error with some date-time attributes [#METRIKASUPP-2361].
This commit is contained in:
parent
a70573aeba
commit
ece838895f
@ -76,7 +76,8 @@ struct AttributeDateTimeBase : public IAttributeMetadata
|
||||
tm.tm_year -= 1900;
|
||||
tm.tm_isdst = -1;
|
||||
|
||||
return mktime(&tm);
|
||||
time_t res = mktime(&tm);
|
||||
return res >= 0 ? res : 0;
|
||||
}
|
||||
};
|
||||
|
||||
@ -94,7 +95,8 @@ struct AttributeDateBase : public IAttributeMetadata
|
||||
tm.tm_year -= 1900;
|
||||
tm.tm_isdst = -1;
|
||||
|
||||
return mktime(&tm);
|
||||
time_t res = mktime(&tm);
|
||||
return res >= 0 ? res : 0;
|
||||
}
|
||||
};
|
||||
|
||||
@ -109,7 +111,8 @@ struct AttributeTimeBase : public IAttributeMetadata
|
||||
sscanf(s.c_str(), "%02d:%02d:%02d",
|
||||
&tm.tm_hour, &tm.tm_min, &tm.tm_sec);
|
||||
|
||||
return mktime(&tm);
|
||||
time_t res = mktime(&tm);
|
||||
return res >= 0 ? res : 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user