Skip to content

Commit

Permalink
Replace bytesize
Browse files Browse the repository at this point in the history
  • Loading branch information
borama committed Jun 3, 2024
1 parent e33da56 commit 145ec9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/dump_cleaner/cleaners/mysql_shell_table_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def keep_same_record?(record, table_config:)
end

def warn_on_changed_line_length(orig_line, new_line, id:, record:)
return if orig_line.bytes.length == new_line.bytes.length
return if orig_line.bytesize == new_line.bytesize

warning = "ID: #{id} bytes length changed: #{orig_line.bytes.length} => #{new_line.bytes.length}"
warning = "ID: #{id} bytes length changed: #{orig_line.bytesize} => #{new_line.bytesize}"
orig_line.split("\t").each_with_index do |column, i|
warning << "#{column} -> #{record[i]}" if !record[i] || column.bytes.length != record[i].bytes.length
warning << "#{column} -> #{record[i]}" if !record[i] || column.bytesize != record[i].bytesize
end

Log.warn { warning }
Expand Down

0 comments on commit 145ec9c

Please sign in to comment.