[CONJ-280] Wrong data returned Created: 2016-04-15  Updated: 2017-10-03

Status: Open
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.4.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ralf Wiebicke Assignee: Diego Dupin
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Linux, OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-1~deb7u1)


Attachments: Java Source File DateDstTest.java     Text File test-log.txt    
Issue Links:
Relates
relates to MDEV-10285 Summer Time Timezone and Timestamps c... Open
Sprint: Sprint connector/j 2.1.0

 Description   

Testcase attached.

I do write a date 2007-04-26 to the database. When getting it back, it becomes 2007-04-25 - one day before.

The problem occurs only, if the data is fetched via a function, such as "SELECT LEAST(a,b) FROM tab". There is no problem with "SELECT a FROM tab".

The problem occurs only, if the database server process did experience a daylight saving switch. So for instance the server was started on Jan 29 2016, and my test runs on Apr 15 2016. On startup the server sees time zone CET (Central European Time), but the test runs in CEST (Central European Summer Time). Then a "show variables like 'system_time_zone'" returns CET, although Apr 14 is already CEST.

Restarting the server causes system_time_zone to become CEST, and the problem described here disappeares.

The test case attached does not use prepared statements, but I did experience the problem with prepared statements as well.

The problem does not occur when using MySQL JDBC Driver instead of MariaDB connector/J.


Generated at Thu Feb 08 03:14:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.