Skip to content
This repository was archived by the owner on Sep 17, 2019. It is now read-only.

Commit 3a64a22

Browse files
committed
Merge pull request #32 from hordijk/patch-1
Fix toString method of LogStash::Timestamp
2 parents b9e5f64 + c4b6276 commit 3a64a22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/logstash/outputs/jdbc.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,12 @@ def unsafe_flush(events, teardown=false)
250250
def add_statement_event_params(statement, event)
251251
@statement[1..-1].each_with_index do |i, idx|
252252
case event[i]
253-
when Time, LogStash::Timestamp
253+
when Time
254254
# Most reliable solution, cross JDBC driver
255255
statement.setString(idx + 1, event[i].iso8601())
256+
when LogStash::Timestamp
257+
# Most reliable solution, cross JDBC driver
258+
statement.setString(idx + 1, event[i].to_iso8601())
256259
when Fixnum, Integer
257260
statement.setInt(idx + 1, event[i])
258261
when Float

0 commit comments

Comments
 (0)