logstash-plugins / logstash-integration-jdbc

Logstash Integration Plugin for JDBC, including Logstash Input and Filter Plugins
Apache License 2.0
53 stars 55 forks source link

fix: use `Array#<<` to append an element to an array #165

Closed yaauie closed 6 months ago

yaauie commented 6 months ago

Ruby's Array#concat needs an Array argument; appending a single element can be done with Array#<<.

Fixes exception that could occur repeatedly when the upstream loader is not currently connected:

TypeError, original message: no 
implicit conversion of String into Array", :backtrace=>["org/jruby/RubyArray.java:1670:in `concat'", 
"/usr/share/logstash/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-
5.4.1/lib/logstash/filters/jdbc/read_only_database.rb:15:in `count'",