Skip to content

Commit c7f6a55

Browse files
committed
Turn on prepared statements again.
* Changed bin param integer to start with `@0` so each with index always works. * The `supports_statement_cache?` is still in there for AR's testing reflection now.
1 parent fd020b3 commit c7f6a55

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def initialize(connection, logger, pool, config)
4848
# AbstractAdapter Responsibility
4949
@schema_cache = SQLServer::SchemaCache.new self
5050
@visitor = Arel::Visitors::SQLServer.new self
51+
@prepared_statements = true
5152
# Our Responsibility
5253
@config = config
5354
@connection_options = config

lib/arel/visitors/sqlserver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SQLServer < Arel::Visitors::ToSql
1313
# SQLServer ToSql/Visitor (Overides)
1414

1515
def visit_Arel_Nodes_BindParam o, collector
16-
collector.add_bind(o) { |i| "@#{i}" }
16+
collector.add_bind(o) { |i| "@#{i-1}" }
1717
end
1818

1919
def visit_Arel_Nodes_Offset o, collector

0 commit comments

Comments
 (0)