Flowdock
method

exec_without_stmt

Importance_0
v3.2.1 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::MysqlAdapter
exec_without_stmt(sql, name = 'SQL') public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 296
      def exec_without_stmt(sql, name = 'SQL') # :nodoc:
        # Some queries, like SHOW CREATE TABLE don't work through the prepared
        # statement API. For those queries, we need to use this method. :'(
        log(sql, name) do
          result = @connection.query(sql)
          cols = []
          rows = []

          if result
            cols = result.fetch_fields.map { |field| field.name }
            rows = result.to_a
            result.free
          end
          ActiveRecord::Result.new(cols, rows)
        end
      end
Register or log in to add new notes.