Skip to content

Business intelligence made simple

Added tests for binary data

Andrew Kane969a40259c84
diff --git a/test/adapters/mysql_test.rb b/test/adapters/mysql_test.rb
index bded20b0..5c288344 100644
--- a/test/adapters/mysql_test.rb
+++ b/test/adapters/mysql_test.rb
@@ -92,6 +92,10 @@ class MysqlTest < ActionDispatch::IntegrationTest
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 6828ce58..de80b2ed 100644
--- a/test/adapters/postgresql_test.rb
+++ b/test/adapters/postgresql_test.rb
@@ -67,4 +67,8 @@ class PostgresqlTest < ActionDispatch::IntegrationTest
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