instance method collect_warnings

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

collect_warnings(_initial_result)

No documentation comment.

Parameters

_initial_result req
Source
# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 888
        def collect_warnings(_initial_result)
          return [] if ActiveRecord.db_warnings_action.nil? || @raw_connection.warning_count == 0

          warning_count = @raw_connection.warning_count
          result = @raw_connection.query("SHOW WARNINGS")
          result = [
            ["Warning", nil, "Query had warning_count=#{warning_count} but `SHOW WARNINGS` did not return the warnings. Check MySQL logs or database configuration."],
          ] if result.count == 0

          result.map do |level, code, message|
            SQLWarning.new(message, code, level, nil, @pool)
          end
        end

Defined in activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb line 888 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close