File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
lib/active_record/connection_adapters/sqlserver Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,20 +8,20 @@ module Explain
8
8
SQLSERVER_STATEMENT_PREFIX = "EXEC sp_executesql "
9
9
SQLSERVER_STATEMENT_REGEXP = /N'(.+)', N'(.+)', (.+)/
10
10
11
- def exec_explain ( queries )
11
+ def exec_explain ( queries , options = [ ] )
12
12
return super unless connection . adapter_name == "SQLServer"
13
13
14
14
unprepared_queries = queries . map do |( sql , binds ) |
15
15
[ unprepare_sqlserver_statement ( sql , binds ) , binds ]
16
16
end
17
- super ( unprepared_queries )
17
+ super ( unprepared_queries , options )
18
18
end
19
19
20
20
private
21
21
22
- # This is somewhat hacky, but it should reliably reformat our prepared sql statment
22
+ # This is somewhat hacky, but it should reliably reformat our prepared sql statement
23
23
# which uses sp_executesql to just the first argument, then unquote it. Likewise our
24
- # `sp_executesql` method should substitude the @n args with the quoted values.
24
+ # `sp_executesql` method should substitute the @n args with the quoted values.
25
25
def unprepare_sqlserver_statement ( sql , binds )
26
26
return sql unless sql . start_with? ( SQLSERVER_STATEMENT_PREFIX )
27
27
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ module Showplan
12
12
OPTION_XML = "SHOWPLAN_XML"
13
13
OPTIONS = [ OPTION_ALL , OPTION_TEXT , OPTION_XML ]
14
14
15
- def explain ( arel , binds = [ ] )
15
+ def explain ( arel , binds = [ ] , options = [ ] )
16
16
sql = to_sql ( arel )
17
17
result = with_showplan_on { sp_executesql ( sql , "EXPLAIN" , binds ) }
18
18
printer = showplan_printer . new ( result )
You can’t perform that action at this time.
0 commit comments