DBD-mysql
view release on metacpan or search on metacpan
lib/DBD/mysql.pm view on Meta::CPAN
$methods_are_installed++;
}
$drh;
}
sub CLONE {
undef $drh;
}
sub _OdbcParse($$$) {
my($class, $dsn, $hash, $args) = @_;
my($var, $val);
if (!defined($dsn)) {
return;
}
while (length($dsn)) {
if ($dsn =~ /([^:;]*\[.*]|[^:;]*)[:;](.*)/) {
$val = $1;
$dsn = $2;
$val =~ s/\[|]//g; # Remove [] if present, the rest of the code prefers plain IPv6 addresses
t/40blobs.t view on Meta::CPAN
use strict;
use warnings;
use Test::More;
use DBI;
use vars qw($test_dsn $test_user $test_password);
use lib '.', 't';
require 'lib.pl';
sub ShowBlob($) {
my ($blob) = @_;
my $b;
for (my $i = 0; $i < 8; $i++) {
if (defined($blob) && length($blob) > $i) {
$b = substr($blob, $i*32);
}
else {
$b = "";
}
note sprintf("%08lx %s\n", $i*32, unpack("H64", $b));
t/41blobs_prepare.t view on Meta::CPAN
if ($@) {
plan skip_all => "no database connection";
}
plan tests => 25;
my @chars = grep !/[0O1Iil]/, 0..9, 'A'..'Z', 'a'..'z';
my $blob1= join '', map { $chars[rand @chars] } 0 .. 10000;
my $blob2 = '"' x 10000;
sub ShowBlob($) {
my ($blob) = @_;
my $b;
for(my $i = 0; $i < 8; $i++) {
if (defined($blob) && length($blob) > $i) {
$b = substr($blob, $i*32);
}
else {
$b = "";
}
note sprintf("%08lx %s\n", $i*32, unpack("H64", $b));
t/50commit.t view on Meta::CPAN
eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
plan skip_all => "no database connection";
}
sub catch_warning ($) {
$got_warning = 1;
}
sub num_rows($$$) {
my($dbh, $table, $num) = @_;
my($sth, $got);
if (!($sth = $dbh->prepare("SELECT * FROM dbd_mysql_t50commit"))) {
return "Failed to prepare: err " . $dbh->err . ", errstr "
. $dbh->errstr;
}
if (!$sth->execute) {
return "Failed to execute: err " . $dbh->err . ", errstr "
. $dbh->errstr;
( run in 0.607 second using v1.01-cache-2.11-cpan-1f129e94a17 )