Skip to content

Commit c029406

Browse files
committed
Use backticks around fixed width message in warning not magic quotes
1 parent f21176d commit c029406

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def handle_warnings(sql)
766766
warning_count = @raw_connection.warning_count
767767
result = @raw_connection.query("SHOW WARNINGS")
768768
result = [
769-
["Warning", nil, "Query had warning_count=#{warning_count} but SHOW WARNINGS did not return the warnings. Check MySQL logs or database configuration."],
769+
["Warning", nil, "Query had warning_count=#{warning_count} but `SHOW WARNINGS` did not return the warnings. Check MySQL logs or database configuration."],
770770
] if result.count == 0
771771
result.each do |level, code, message|
772772
warning = SQLWarning.new(message, code, level, sql, @pool)

activerecord/test/cases/adapters/abstract_mysql_adapter/warnings_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def setup
101101
@connection.execute('SELECT "x"')
102102
end
103103

104-
expected = "Query had warning_count=1 but SHOW WARNINGS did not return the warnings. Check MySQL logs or database configuration."
104+
expected = "Query had warning_count=1 but `SHOW WARNINGS` did not return the warnings. Check MySQL logs or database configuration."
105105
assert_equal expected, error.message
106106
end
107107
end

0 commit comments

Comments
 (0)