lib/fluent/plugin/out_mysql_bulk.rb in fluent-plugin-mysql-2-0.3.7 vs lib/fluent/plugin/out_mysql_bulk.rb in fluent-plugin-mysql-2-0.3.8
- old
+ new
@@ -178,10 +178,10 @@
end
@handler.query("SET SESSION TRANSACTION ISOLATION LEVEL #{transaction_isolation_level}") if @transaction_isolation_level
slice_size = @max_rows_per_insert > 0 ? @max_rows_per_insert : values.length
values.each_slice(slice_size) do |slice|
- sql = "INSERT #{@insert_ignore ? "IGNORE" : ""} INTO #{table} (#{@insert_columns}) VALUES #{values.join(',')}"
+ sql = "INSERT #{@insert_ignore ? "IGNORE" : ""} INTO #{table} (#{@insert_columns}) VALUES #{slice.join(',')}"
sql += @on_duplicate_key_update_sql if @on_duplicate_key_update
@handler.xquery(sql)
end
log.info "bulk insert values size (table: #{@table}) => #{values.size}"