Skip to content

Commit

Permalink
Merge pull request #361 from bmax/issue#360
Browse files Browse the repository at this point in the history
Fix jdbc_paging_enabled config flag not being passed through
  • Loading branch information
robbavey authored Nov 22, 2019
2 parents 23e6e3b + 3e34643 commit 48ba108
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/logstash/plugin_mixins/jdbc/jdbc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def execute_statement
begin
sql_last_value = @use_column_value ? @value_tracker.value : Time.now.utc
@tracking_column_warning_sent = false
@statement_handler.perform_query(@database, @value_tracker.value) do |row|
@statement_handler.perform_query(@database, @value_tracker.value, @jdbc_paging_enabled, @jdbc_page_size) do |row|
sql_last_value = get_column_value(row) if @use_column_value
yield extract_values_from(row)
end
Expand Down
8 changes: 4 additions & 4 deletions lib/logstash/plugin_mixins/jdbc/statement_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class NormalStatementHandler < StatementHandler
# @param db [Sequel::Database]
# @param sql_last_value [Integet|DateTime|Time]
# @yieldparam row [Hash{Symbol=>Object}]
def perform_query(db, sql_last_value)
def perform_query(db, sql_last_value, jdbc_paging_enabled, jdbc_page_size)
query = build_query(db, sql_last_value)
if @jdbc_paging_enabled
query.each_page(@jdbc_page_size) do |paged_dataset|
if jdbc_paging_enabled
query.each_page(jdbc_page_size) do |paged_dataset|
paged_dataset.each do |row|
yield row
end
Expand Down Expand Up @@ -74,7 +74,7 @@ class PreparedStatementHandler < StatementHandler
# @param db [Sequel::Database]
# @param sql_last_value [Integet|DateTime|Time]
# @yieldparam row [Hash{Symbol=>Object}]
def perform_query(db, sql_last_value)
def perform_query(db, sql_last_value, jdbc_paging_enabled, jdbc_page_size)
query = build_query(db, sql_last_value)
query.each do |row|
yield row
Expand Down

0 comments on commit 48ba108

Please sign in to comment.