-
I'm not sure what we can do here. We already tried to resolve this issue and if incoming data value transformed to MySQL database server timezone results in value lower that 1970-01-01 this error is triggered. As Tigase XMPP Server is not aware of MySQL server timezone, this is hard to protect against.
The only solution I could suggest would be (for MySQL) just assume that everything below arbitrary selected date value will be replaced with ie. 1970-01-02T00:00:00 just to get rid of this issue.
-
Maybe the "final" solution would be to get rid of
TIMESTAMP
type and replace it withDATETIME
? There is one more reason to do so -TIMESTAMP
is only valid for dates in range1970-01-01
to2038-01-19 03:14:04.499999
, in the next 14 years it will not be usable (unless the MySQL implementation will change). -
I'm not sure what we can do here. We already tried to resolve this issue and if incoming data value transformed to MySQL database server timezone results in value lower that 1970-01-01 this error is triggered. As Tigase XMPP Server is not aware of MySQL server timezone, this is hard to protect against.
Shouldn't we be using UTC? Thus making timezones irrelevant here? Unless we don't enforce timezones correctly (on MySQL server nor on the connection level)?
Maybe the "final" solution would be to get rid of
TIMESTAMP
type and replace it withDATETIME
? There is one more reason to do so -TIMESTAMP
is only valid for dates in range1970-01-01
to2038-01-19 03:14:04.499999
, in the next 14 years it will not be usable (unless the MySQL implementation will change).IMHO using
DATETIME
seems the most reasonable here, though it's twice the size... -
Shouldn't we be using UTC? Thus making timezones irrelevant here? Unless we don't enforce timezones correctly (on MySQL server nor on the connection level)?
We specify timestamp with server time and JDBC driver passes that to MySQL but it converts data to its own value matching MySQL server time zone AFAIR.
IMHO using DATETIME seems the most reasonable here, though it's twice the size...
We have some protections for MySQL in MAM, but it also fails and I'm not sure why...
if (data_repo.getDatabaseType() == DataRepository.dbTypes.mysql && crit.getStart().getTime() <= 0) { stmt.setObject(i++, null); } else { data_repo.setTimestamp(stmt, i++, convertToTimestamp(crit.getStart())); }
Type |
Bug
|
Priority |
If you are bored
|
Assignee | |
Version |
tigase-server-8.5.0
|
Sprints |
n/a
|
Customer |
n/a
|
-
tigase-server-8.5.0 Open