Merge pull request #28938 from kamipo/deprecate_supports_statement_cache
Deprecate `supports_statement_cache?`
This commit is contained in:
commit
00f1f95569
@ -1,3 +1,7 @@
|
||||
* Deprecate `supports_statement_cache?`.
|
||||
|
||||
*Ryuta Kamizono*
|
||||
|
||||
* Quote database name in `db:create` grant statement (when database user does not have access to create the database).
|
||||
|
||||
*Rune Philosof*
|
||||
|
@ -137,9 +137,10 @@ def delete(arel, name = nil, binds = [])
|
||||
|
||||
# Returns +true+ when the connection adapter supports prepared statement
|
||||
# caching, otherwise returns +false+
|
||||
def supports_statement_cache?
|
||||
false
|
||||
def supports_statement_cache? # :nodoc:
|
||||
true
|
||||
end
|
||||
deprecate :supports_statement_cache?
|
||||
|
||||
# Runs the given block in a database transaction, and returns the result
|
||||
# of the block.
|
||||
|
@ -76,12 +76,6 @@ def supports_bulk_alter? #:nodoc:
|
||||
true
|
||||
end
|
||||
|
||||
# Returns true, since this connection adapter supports prepared statement
|
||||
# caching.
|
||||
def supports_statement_cache?
|
||||
true
|
||||
end
|
||||
|
||||
def supports_index_sort_order?
|
||||
!mariadb? && version >= "8.0.1"
|
||||
end
|
||||
|
@ -121,12 +121,6 @@ class PostgreSQLAdapter < AbstractAdapter
|
||||
include PostgreSQL::DatabaseStatements
|
||||
include PostgreSQL::ColumnDumper
|
||||
|
||||
# Returns true, since this connection adapter supports prepared statement
|
||||
# caching.
|
||||
def supports_statement_cache?
|
||||
true
|
||||
end
|
||||
|
||||
def supports_index_sort_order?
|
||||
true
|
||||
end
|
||||
|
@ -105,12 +105,6 @@ def supports_partial_index?
|
||||
sqlite_version >= "3.8.0"
|
||||
end
|
||||
|
||||
# Returns true, since this connection adapter supports prepared statement
|
||||
# caching.
|
||||
def supports_statement_cache?
|
||||
true
|
||||
end
|
||||
|
||||
def requires_reloading?
|
||||
true
|
||||
end
|
||||
|
@ -3,8 +3,7 @@
|
||||
require "models/author"
|
||||
require "models/post"
|
||||
|
||||
if ActiveRecord::Base.connection.supports_statement_cache? &&
|
||||
ActiveRecord::Base.connection.prepared_statements
|
||||
if ActiveRecord::Base.connection.prepared_statements
|
||||
module ActiveRecord
|
||||
class BindParameterTest < ActiveRecord::TestCase
|
||||
fixtures :topics, :authors, :author_addresses, :posts
|
||||
@ -66,6 +65,10 @@ def test_logs_legacy_binds_after_type_cast
|
||||
assert_logs_binds(binds)
|
||||
end
|
||||
|
||||
def test_deprecate_supports_statement_cache
|
||||
assert_deprecated { ActiveRecord::Base.connection.supports_statement_cache? }
|
||||
end
|
||||
|
||||
private
|
||||
def assert_logs_binds(binds)
|
||||
payload = {
|
||||
|
Loading…
Reference in New Issue
Block a user