DBD-pNET
view release on metacpan or search on metacpan
t/10dsnlist.t view on Meta::CPAN
192021222324252627282930313233343536373839
if
(
$mdriver
ne
''
) {
last
;
}
}
if
(
$mdriver
eq
'pNET'
) {
"1..0\n"
;
exit
0;
}
if
(
$verbose
) {
"Driver is $mdriver\n"
; }
sub
ServerError() {
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
192021222324252627282930313233343536373839my
$file
;
foreach
$file
(
"lib.pl"
,
"t/lib.pl"
) {
do
$file
;
if
($@) {
STDERR
"Error while executing lib.pl: $@\n"
;
exit
10;
}
if
(
$mdriver
ne
''
) {
last
;
}
}
sub
ServerError() {
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
212223242526272829303132333435363738394041$mdriver
=
""
;
foreach
$file
(
"lib.pl"
,
"t/lib.pl"
) {
do
$file
;
if
($@) {
STDERR
"Error while executing lib.pl: $@\n"
;
exit
10;
}
if
(
$mdriver
ne
''
) {
last
;
}
}
sub
ServerError() {
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
2324252627282930313233343536373839404142$mdriver
=
""
;
foreach
$file
(
"lib.pl"
,
"t/lib.pl"
) {
do
$file
;
if
($@) {
STDERR
"Error while executing lib.pl: $@\n"
;
exit
10;
}
if
(
$mdriver
ne
''
) {
last
;
}
}
sub
ServerError() {
my
$err
=
$DBI::errstr
;
# Hate -w ...
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
272829303132333435363738394041424344454647484950515253545556575859
}
if
(
$mdriver
ne
''
) {
last
;
}
}
if
(
$dbdriver
eq
'mSQL'
||
$dbdriver
eq
'mSQL1'
) {
"1..0\n"
;
exit
0;
}
sub
ServerError() {
my
$err
=
$DBI::errstr
;
# Hate -w ...
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
303132333435363738394041424344454647484950
last
;
}
}
@table_def
= (
[
"id"
,
"INTEGER"
, 4,
$COL_KEY
],
[
"name"
,
"CHAR"
, 64,
$COL_NULLABLE
]
);
sub
ServerError() {
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
232425262728293031323334353637383940414243$mdriver
=
""
;
foreach
$file
(
"lib.pl"
,
"t/lib.pl"
) {
do
$file
;
if
($@) {
STDERR
"Error while executing lib.pl: $@\n"
;
exit
10;
}
if
(
$mdriver
ne
''
) {
last
;
}
}
sub
ServerError() {
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
212223242526272829303132333435363738394041$mdriver
=
""
;
foreach
$file
(
"lib.pl"
,
"t/lib.pl"
) {
do
$file
;
if
($@) {
STDERR
"Error while executing lib.pl: $@\n"
;
exit
10;
}
if
(
$mdriver
ne
''
) {
last
;
}
}
sub
ServerError() {
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
282930313233343536373839404142434445464748
foreach
$file
(
"lib.pl"
,
"t/lib.pl"
) {
do
$file
;
if
($@) {
STDERR
"Error while executing lib.pl: $@\n"
;
exit
10;
}
if
(
$mdriver
ne
''
) {
last
;
}
}
}
sub
ServerError() {
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/Ingres.dbtest view on Meta::CPAN
828384858687888990919293949596979899100101102
}
$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/mSQL.dbtest view on Meta::CPAN
858687888990919293949596979899100101102103
"Table definition: $def\n"
;
}
$def
;
}
#
# This function generates a list of tables associated to a
# given DSN. Highly DBMS specific, EDIT THIS!
#
sub
ListTables($) {
my
(
$dbh
) =
@_
;
my
(
@tables
);
if
(!
defined
(
@tables
=
$dbh
->func(
'_ListTables'
)) ||
$dbh
->errstr) {
return
undef
;
}
@tables
;
}
t/mysql.dbtest view on Meta::CPAN
828384858687888990919293949596979899100101
}
$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
) =
shift
;
my
(
@tables
);
@tables
=
$dbh
->func(
'_ListTables'
);
if
(
$dbh
->errstr) {
die
"Cannot create table list: "
.
$dbh
->errstr;
}
@tables
;
}
( run in 0.356 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )