diff --git a/test/adapters/mysql_test.rb b/test/adapters/mysql_test.rb index bded20b0c..5c288344e 100644 --- a/test/adapters/mysql_test.rb +++ b/test/adapters/mysql_test.rb @@ -92,6 +92,10 @@ def test_binary run_statement "SELECT UNHEX('F6'), 1", format: "html" end + def test_binary_output + assert_result [{"hello" => "0xF6"}], "SELECT UNHEX('F6') AS hello" + end + private def prepared_statements? diff --git a/test/adapters/postgresql_test.rb b/test/adapters/postgresql_test.rb index 6828ce58b..de80b2edc 100644 --- a/test/adapters/postgresql_test.rb +++ b/test/adapters/postgresql_test.rb @@ -67,4 +67,8 @@ def test_bad_position_after def test_quoted assert_error "could not determine data type of parameter $1", "SELECT '{var}' AS hello", var: "world" end + + def test_binary_output + assert_result [{"bytea" => "\\x68656c6c6f"}], "SELECT 'hello'::bytea" + end end