MAJOR=7 MINOR=3 DEVNAME=vcs3 :ˆl–äY>””Ëm m@·p-ÜÅ£È ƒp ¹Ça–ß=¿JJj"Tâ‚ Æ�q–”ţ˨use strict; { package DBD::NullP; require DBI; require Carp; our @EXPORT = qw(); # Do NOT @EXPORT anything. our $VERSION = "12.014715"; # $Id: NullP.pm 14714 2011-02-22 17:27:07Z Tim $ # # Copyright (c) 1994-2007 Tim Bunce # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the Perl README file. our $drh = undef; # holds driver handle once initialised sub driver{ return $drh if $drh; my($class, $attr) = @_; $class .= "::dr"; ($drh) = DBI::_new_drh($class, { 'Name' => 'NullP', 'Version' => $VERSION, 'Attribution' => 'DBD Example Null Perl stub by Tim Bunce', }, [ qw'example implementors private data']); $drh; } sub CLONE { undef $drh; } } { package DBD::NullP::dr; # ====== DRIVER ====== our $imp_data_size = 0; use strict; sub connect { # normally overridden, but a handy default my $dbh = shift->SUPER::connect(@_) or return; $dbh->STORE(Active => 1); $dbh; } sub DESTROY { undef } } { package DBD::NullP::db; # ====== DATABASE ====== our $imp_data_size = 0; use strict; use Carp qw(croak); # Added get_info to support tests in 10examp.t sub get_info { my ($dbh, $type) = @_; if ($type == 29) { # identifier quote return '"'; } return; } # Added table_info to support tests in 10examp.t sub table_info { my ($dbh, $catalog, $schema, $table, $type) = @_; my ($outer, $sth) = DBI::_new_sth($dbh, { 'Statement' => 'tables', }); if (defined($type) && $type eq '%' && # special case for tables('','','','%') grep {defined($_) && $_ eq ''} ($catalog, $schema, $table)) { $outer->{dbd_nullp_data} = [[undef, undef, undef, 'TABLE', undef], [undef, undef, undef, 'VIEW', undef], [undef, undef, undef, 'ALIAS', undef]]; } elsif (defined($catalog) && $catalog eq '%' && # special case for tables('%','','') grep {defined($_) && $_ eq ''} ($schema, $table)) { $outer->{dbd_nullp_data} = [['catalog1', undef, undef, undef, undef], ['catalog2', undef, undef, undef, undef]]; } else { $outer->{dbd_nullp_data} = [['catalog', 'schema', 'table1', 'TABLE']]; $outer->{dbd_nullp_data} = [['catalog', 'schema', 'table2', 'TABLE']]; $outer->{dbd_nullp_data} = [['catalog', 'schema', 'table3', 'TABLE']]; } $outer->STORE(NUM_OF_FIELDS => 5); $sth->STORE(Active => 1); return $outer; } sub prepare { my ($dbh, $statement)= @_; my ($outer, $sth) = DBI::_new_sth($dbh, { 'Statement' => $statement, }); return $outer; } sub FETCH { my ($dbh, $attrib) = @_; # In reality this would interrogate the database engine to # either return dynamic values that cannot be precomputed # or fetch and cache attribute values too expensive to prefetch. return $dbh->SUPER::FETCH($attrib); } sub STORE { my ($dbh, $attrib, $value) = @_; # would normally validate and only store known attributes # else pass up to DBI to handle if ($attrib eq 'AutoCommit') { Carp::croak("Can't disable AutoCommit") unless $value; # convert AutoCommit values to magic ones to let DBI # know that the driver has 'handled' the AutoCommit attribute $value = ($value) ? -901 : -900; } elsif ($attrib eq 'nullp_set_err') { # a fake attribute to produce a test case where STORE issues a warning $dbh->set_err($value, $value); } return $dbh->SUPER::STORE($attrib, $value); } sub ping { 1 } sub disconnect { shift->STORE(Active => 0); } } { package DBD::NullP::st; # ====== ST