DBD-Illustra
view release on metacpan or search on metacpan
t/10dsnlist.t view on Meta::CPAN
if ($mdriver ne '') {
last;
}
}
if ($mdriver eq 'pNET' || $mdriver eq 'ODBC') {
print "1..0\n";
exit 0;
}
if ($verbose) { print "Driver is $mdriver\n"; }
sub ServerError() {
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
#
t/20createdrop.t view on Meta::CPAN
my $file;
foreach $file ("lib.pl", "t/lib.pl") {
do $file; if ($@) { print STDERR "Error while executing lib.pl: $@\n";
exit 10;
}
if ($mdriver ne '') {
last;
}
}
sub ServerError() {
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
#
t/30insertfetch.t view on Meta::CPAN
$mdriver = "";
foreach $file ("lib.pl", "t/lib.pl") {
do $file; if ($@) { print STDERR "Error while executing lib.pl: $@\n";
exit 10;
}
if ($mdriver ne '') {
last;
}
}
sub ServerError() {
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
#
t/40bindparam.t view on Meta::CPAN
$mdriver = "";
foreach $file ("lib.pl", "t/lib.pl") {
do $file; if ($@) { print STDERR "Error while executing lib.pl: $@\n";
exit 10;
}
if ($mdriver ne '') {
last;
}
}
sub ServerError() {
my $err = $DBI::errstr; # Hate -w ...
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
t/40blobs.t view on Meta::CPAN
if ($mdriver ne '') {
last;
}
}
if ($dbdriver eq 'Illustra'){
# XXX No direct blob support yet
print "1..0\n";
exit 0;
}
sub ServerError() {
my $err = $DBI::errstr; # Hate -w ...
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
sub ShowBlob($) {
my ($blob) = @_;
for($i = 0; $i < 8; $i++) {
if (defined($blob) && length($blob) > $i) {
$b = substr($blob, $i*32);
} else {
$b = "";
}
printf("%08lx %s\n", $i*32, unpack("H64", $b));
}
}
t/40listfields.t view on Meta::CPAN
last;
}
}
@table_def = (
["id", "INTEGER", 4, $COL_KEY],
["name", "CHAR", 64, $COL_NULLABLE]
);
sub ServerError() {
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
#
t/40nulls.t view on Meta::CPAN
$mdriver = "";
foreach $file ("lib.pl", "t/lib.pl") {
do $file; if ($@) { print STDERR "Error while executing lib.pl: $@\n";
exit 10;
}
if ($mdriver ne '') {
last;
}
}
sub ServerError() {
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
#
t/40numrows.t view on Meta::CPAN
$mdriver = "";
foreach $file ("lib.pl", "t/lib.pl") {
do $file; if ($@) { print STDERR "Error while executing lib.pl: $@\n";
exit 10;
}
if ($mdriver ne '') {
last;
}
}
sub ServerError() {
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
#
t/50chopblanks.t view on Meta::CPAN
foreach $file ("lib.pl", "t/lib.pl") {
do $file; if ($@) { print STDERR "Error while executing lib.pl: $@\n";
exit 10;
}
if ($mdriver ne '') {
last;
}
}
}
sub ServerError() {
print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
"\tEither your server is not up and running or you have no\n",
"\tpermissions for acessing the DSN $test_dsn.\n",
"\tThis test requires a running server and write permissions.\n",
"\tPlease make sure your server is running and you have\n",
"\tpermissions, then retry.\n");
exit 10;
}
#
t/50commit.t view on Meta::CPAN
if ($mdriver ne '') {
last;
}
}
if ($mdriver eq 'whatever') {
print "1..0\n";
exit 0;
}
sub NumRows($$$) {
my($dbh, $table, $num) = @_;
my($sth, $got);
if (!($sth = $dbh->prepare("SELECT * FROM $table"))) {
return "Failed to prepare: err " . $dbh->err . ", errstr "
. $dbh->errstr;
}
if (!$sth->execute) {
return "Failed to execute: err " . $dbh->err . ", errstr "
. $dbh->errstr;
t/Illustra.dbtest view on Meta::CPAN
}
$def = sprintf("CREATE TABLE %s (%s%s)", $tablename,
join(", ", @colDefs), $keyDef);
}
#
# This function generates a list of tables associated to a
# given DSN.
#
sub ListTables($) {
my($dbh, $dsn, $user, $password) = @_;
my($ndbh, $cu, @tables);
if (!ref($dbh)) { # Called by DBD::pNET, need to connect
$dsn .= ":hostname=" . $dbh;
if (!($ndbh = DBI->connect($dsn, $user, $password))) {
die "Cannot connect to server at $.";
}
$dbh = $ndbh;
}
t/Illustra.dbtest view on Meta::CPAN
# host.
sub HostDsn ($$) {
my($hostname, $dsn) = @_;
die "HostDsn not implemented";
}
#
# Return a string for checking, whether a given column is NULL.
#
sub IsNull($) {
my($var) = @_;
"$var IS NULL";
}
#
# Return TRUE, if database supports transactions
#
sub HaveTransactions () {
$Mysql::db_errstr = '';
$errstrRef = \$Mysql::db_errstr;
} else {
$class = 'Msql';
eval "use $class";
$Msql::db_errstr = '';
$errstrRef = \$Msql::db_errstr;
}
sub ServerError() {
$$errstrRef ||= "";
my $onhost = $host ? " (on $host)" : "";
print STDERR ("Cannot connect: $$errstrRef\n",
"\tIt looks as if your server$onhost is not up and running.\n",
"\tThis test requires a running server.\n",
"\tPlease make sure your server is running and retry.\n");
exit 10;
}
sub DatabaseError() {
print STDERR ("Cannot select database 'test': $$errstrRef.\n",
"Please make sure that a database \"test\" exists\n",
"and that you have permission to read and write on it.\n");
exit 10;
}
# For the error messages we're going to produce within this script we
# write a subroutine, so the typical error message will always look
# more or less similar:
( run in 1.406 second using v1.01-cache-2.11-cpan-65fba6d93b7 )