my $db = $pg->db;my $dbh = $db->dbh;say $dbh->{'pg_socket'}; #returns file no.say $dbh->func('getfd'); #deprecated but still returns the same file no.say Dumper tied %$dbh;my $pubsub = Mojo::Pg::PubSub->new(pg => $pg, dbh => $dbh);$pubsub->listen(foo => sub {});
Expected behavior
Should open $dbh->{'pg_socket'} as a handle in Database.pm
Here's the code it's trying to run in Database.pm
open $self->{handle}, '<&', $dbh->{pg_socket} or die "Can't dup: $!"; #line 148
Actual behavior
Can't dup: Bad file descriptor at C:/Strawberry/perl/site/lib/Mojo/Pg/Database.pm line 148.
Use of uninitialized value in delete at C:/Strawberry/perl/site/lib/Mojo/Reactor/Poll.pm line 91.
Steps to reproduce the behavior
use Mojo::Pg;
use Data::Dumper;
use feature 'say';
use warnings;
use strict;
my $pg = Mojo::Pg->new('postgresql://<user>:<pass>@<host>/<db>');
$pg = $pg->options({AutoCommit => 1, RaiseError => 1});
my $db = $pg->db;
my $dbh = $db->dbh;
say $dbh->{'pg_socket'}; #returns file no.
say $dbh->func('getfd'); #deprecated but still returns the same file no.
say Dumper tied %$dbh;
my $pubsub = Mojo::Pg::PubSub->new(pg => $pg, dbh => $dbh);
$pubsub->listen(foo => sub {});
Expected behavior
Should open $dbh->{'pg_socket'} as a handle in Database.pm
Here's the code it's trying to run in Database.pm
open $self->{handle}, '<&', $dbh->{pg_socket} or die "Can't dup: $!";
#line 148Actual behavior
Can't dup: Bad file descriptor at C:/Strawberry/perl/site/lib/Mojo/Pg/Database.pm line 148. Use of uninitialized value in delete at C:/Strawberry/perl/site/lib/Mojo/Reactor/Poll.pm line 91.
Works on Linux though.