DBD-MariaDB
view release on metacpan or search on metacpan
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
my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 0 });
plan tests => 21;
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
use vars qw($got_warning $test_dsn $test_user $test_password);
my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 0, AutoCommit => 0 });
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.600 second using v1.01-cache-2.11-cpan-65fba6d93b7 )