File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2484,6 +2484,25 @@ def test_sqlcommenter_format_value_string_coercible_coerced
2484
2484
end
2485
2485
end
2486
2486
2487
+ # SQL requires double single-quotes.
2488
+ coerce_tests! :test_sqlcommenter_format_allows_string_keys
2489
+ def test_sqlcommenter_format_allows_string_keys_coerced
2490
+ ActiveRecord ::QueryLogs . update_formatter ( :sqlcommenter )
2491
+
2492
+ ActiveRecord ::QueryLogs . tags = [
2493
+ :application ,
2494
+ {
2495
+ "string" => "value" ,
2496
+ tracestate : "congo=t61rcWkgMzE,rojo=00f067aa0ba902b7" ,
2497
+ custom_proc : -> { "Joe's Shack" }
2498
+ } ,
2499
+ ]
2500
+
2501
+ assert_sql ( %r{custom_proc=''Joe%27s%20Shack'',string=''value'',tracestate=''congo%3Dt61rcWkgMzE%2Crojo%3D00f067aa0ba902b7''\* /} ) do
2502
+ Dashboard . first
2503
+ end
2504
+ end
2505
+
2487
2506
# Invalid character encoding causes `ActiveRecord::StatementInvalid` error similar to Postgres.
2488
2507
coerce_tests! :test_invalid_encoding_query
2489
2508
def test_invalid_encoding_query_coerced
You can’t perform that action at this time.
0 commit comments