Skip to content

Commit

Permalink
Do not use fractional seconds for time values in jdbc/sqlanywhere ada…
Browse files Browse the repository at this point in the history
…pter

The JDBC SQLAnywhere driver apparently ignores the fractional
seconds on retrieval, so for consistency, do not use fractional
seconds when literalizing SQLTime values.
  • Loading branch information
jeremyevans committed Dec 6, 2023
1 parent a46294b commit 0173188
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/sequel/adapters/jdbc/sqlanywhere.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ class Dataset < JDBC::Dataset

private

# JDBC SQLAnywhere driver does not appear to handle fractional
# times correctly.
def default_time_format
"'%H:%M:%S'"
end

# Set to zero to work around JDBC SQLAnywhere driver bug.
def sqltime_precision
0
end

SMALLINT_TYPE = Java::JavaSQL::Types::SMALLINT
BOOLEAN_METHOD = Object.new
def BOOLEAN_METHOD.call(r, i)
Expand Down

0 comments on commit 0173188

Please sign in to comment.