-
-
Save anonymous/034680eb2eb42654d925be2d717c0a0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/t/results.t b/t/results.t | |
index 8cb450e..6457a49 100644 | |
--- a/t/results.t | |
+++ b/t/results.t | |
@@ -157,6 +157,23 @@ my $results2 = $db->query('select 1 as one'); | |
undef $results1; | |
is_deeply $results2->hashes, [{one => 1}], 'right structure'; | |
+# Binary data | |
+$db->query( | |
+ 'create table if not exists results_test2 ( | |
+ id serial primary key, | |
+ stuff bytea | |
+ )' | |
+); | |
+my $snowman = '☃'; | |
+utf8::encode $snowman; | |
+#my $dbh = $db->dbh; | |
+#my $sth = $dbh->prepare('insert into results_test2 (stuff) values (?)'); | |
+#$sth->bind_param(1, $snowman, {pg_type => DBD::Pg::PG_BYTEA}); | |
+#$sth->execute; | |
+$db->query('insert into results_test2 (stuff) values (?)', $snowman); | |
+utf8::encode $snowman; | |
+is $db->query('select * from results_test2')->hash->{stuff}, $snowman; | |
+ | |
# Clean up once we are done | |
$pg->db->query('drop schema mojo_results_test cascade'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment