-
Notifications
You must be signed in to change notification settings - Fork 465
Incorrect behavior of temporal types as sql variant types. #449
Copy link
Copy link
Closed
Description
Driver version or jar name
6.3.0.jre8-preview
SQL Server version
Microsoft SQL Server vNext (CTP2.0) - 14.0.500.272 (X64)
Client operating system
Ubuntu 16.04.2 LTS
Java/JVM version
openjdk version "1.8.0_131"
Problem description
- Null value is returned if you cast a value of time to sql variant.
- Value of String class is return if you cast a value of datetimeoffset to sql variant.
Repro code
//issue #1
ResultSet resultSet = statement.executeQuery("select cast(cast('2017-08-16 17:31:09.995 +07:00' as datetimeoffset) as sql_variant)");
resultSet.next();
if (resultSet.getObject(1) == null) {
throw new IllegalStateException("value must not be null");
}
//issue #2
ResultSet resultSet = statement.executeQuery("select cast(cast('17:31:09.995' as time(3)) as sql_variant)");
resultSet.next();
Object object = resultSet.getObject(1);
if (object.getClass() != java.sql.Time.class) {
throw new IllegalStateException("value must be of java.sql.Time class");
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels