lib/fluent/plugin/in_mysql_appender.rb in fluent-plugin-mysql-appender-0.1.1 vs lib/fluent/plugin/in_mysql_appender.rb in fluent-plugin-mysql-appender-0.1.2
- old
+ new
@@ -64,9 +64,10 @@
select_query = @query + " where #{primary_key} > #{max_id} order by #{primary_key} asc"
end
rows, con = query(select_query, con)
rows.each_with_index do |row, index|
tag = format_tag(@tag, {:event => :insert})
+ row.each {|k, v| row[k] = v.to_s if v.is_a?(Time) || v.is_a?(Date) || v.is_a?(BigDecimal)}
router.emit(tag, Engine.now, row)
rows_count += 1
if index == rows.size - 1
max_id = row[@primary_key]
end