Adding Initialization Sequence for the JDBC connection.
Summary of Changes
Session Timezone: The PR sets the session time zone to UTC by default to retrieve timestamp in UTC. This is asper the contract exposed by the Reader to always output timestamp in UTC (irrespective of the source settings).The most idomatic way to achieve this via jdbc would be to pass a Calendar object initialized to UTC to java.sql.ResultSet.getTimestamp(String, Calendar) api (which is what we do in MysqlJdbcValueMappings), but due to bugs like Bug#95644 , Bug#96276, Bug#93444, etc. in the older drivers, we are also setting the session timezone to UTC.
Testing
This change has been tested on an end to end migration setup where MySQL server was in IST timezone and the timestamp was migrated to spanner by verifying that the migrated timestamp obtained from Spanner was as per the correct timezone offsets applied.
Adding Initialization Sequence for the JDBC connection.
Summary of Changes
Session Timezone: The PR sets the session time zone to UTC by default to retrieve timestamp in UTC. This is asper the contract exposed by the Reader to always output timestamp in UTC (irrespective of the source settings).The most idomatic way to achieve this via jdbc would be to pass a Calendar object initialized to UTC to java.sql.ResultSet.getTimestamp(String, Calendar) api (which is what we do in MysqlJdbcValueMappings), but due to bugs like Bug#95644 , Bug#96276, Bug#93444, etc. in the older drivers, we are also setting the session timezone to UTC.
Testing
This change has been tested on an end to end migration setup where MySQL server was in IST timezone and the timestamp was migrated to spanner by verifying that the migrated timestamp obtained from Spanner was as per the correct timezone offsets applied.