Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table columns for line numbers in the source table are defaulting to limit: 4 instead of limit: 8 #191

Open
will3216 opened this issue Sep 16, 2016 · 0 comments

Comments

@will3216
Copy link

will3216 commented Sep 16, 2016

First off, this gem is awesome and a great tool! I am running into an issue when parsing a log file that is 3.5gb though, and when DatabaseInserter.new.source_change([..]) gets called, it hits a database column limitation.

/gems/activerecord-4.2.4/lib/active_record/type/integer.rb:45:in `ensure_in_range': 3461277784 is out of range for ActiveRecord::Type::Integer with limit 4 (RangeError)

Maybe you should explicitly set the limit to 8? It seems as though its trying to store it as a 4byte integer, but should really be stored as an 8 byte integer.

in /request-log-analyzer/lib/request_log_analyzer/database/source.rb

class RequestLogAnalyzer::Database::Source < RequestLogAnalyzer::Database::Base
  def self.create_table!
    unless database.connection.table_exists?(:sources)
      database.connection.create_table(:sources) do |t|
        t.column :filename, :string
        t.column :mtime,    :datetime
        t.column :filesize, :integer, limit: 8
      end
    end
  end
end
@will3216 will3216 changed the title Table columns that reference line numbers are stored as integer instead of bigint Table columns for line numbers in the source table are defaulting to limit: 4 instead of limit: 8 Sep 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant