This commit is contained in:
Lukas Eder 2024-02-15 10:44:31 +01:00
parent 716865d040
commit 2b259a3e67

View File

@ -4797,14 +4797,22 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
@Override
final Time get0(BindingGetResultSetContext<U> ctx) throws SQLException {
// SQLite's type affinity needs special care...
if (ctx.family() == SQLDialect.SQLITE) {
String time = ctx.resultSet().getString(ctx.index());
return time == null ? null : new Time(parse(Time.class, time));
}
switch (ctx.family()) {
else {
return ctx.resultSet().getTime(ctx.index());
// ResultSet.getTime() isn't implemented correctly, see: https://github.com/duckdb/duckdb/issues/10682
case DUCKDB: {
String time = ctx.resultSet().getString(ctx.index());
return time == null ? null : Convert.convert(time, Time.class);
}
// SQLite's type affinity needs special care...
case SQLITE: {
String time = ctx.resultSet().getString(ctx.index());
return time == null ? null : new Time(parse(Time.class, time));
}
default:
return ctx.resultSet().getTime(ctx.index());
}
}