Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / share / doc / libdbd-mysql-perl / examples / | server ip : 104.21.89.46 your ip : 172.69.59.9 H O M E |
Filename | /usr/share/doc/libdbd-mysql-perl/examples/bug30033pg.pl |
Size | 456 |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 10:10 |
Last modified | 18-Oct-2013 03:23 |
Last accessed | 06-Jul-2025 23:46 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use DBI;
my $dsn = "DBI:Pg:database=postgres;host=localhost";
my $dbh = DBI->connect( $dsn, 'postgres', '', { RaiseError => 1 } )
or die $DBI::errstr;
$dbh->do('CREATE TABLE buggy ( id INT )');
$dbh->do('INSERT INTO buggy (id) VALUES (1)');
my $ref= $dbh->selectrow_arrayref(<<END, {}, 1);
SELECT id
FROM buggy
-- it's a bug!
WHERE id = ?
END
print Dumper $ref;
$dbh->do('DROP TABLE buggy');
use strict;
use warnings;
use Data::Dumper;
use DBI;
my $dsn = "DBI:Pg:database=postgres;host=localhost";
my $dbh = DBI->connect( $dsn, 'postgres', '', { RaiseError => 1 } )
or die $DBI::errstr;
$dbh->do('CREATE TABLE buggy ( id INT )');
$dbh->do('INSERT INTO buggy (id) VALUES (1)');
my $ref= $dbh->selectrow_arrayref(<<END, {}, 1);
SELECT id
FROM buggy
-- it's a bug!
WHERE id = ?
END
print Dumper $ref;
$dbh->do('DROP TABLE buggy');