Fri Mar 07 12:23:45 2008: Request 33882 was acted upon.
Transaction: Ticket created by david@davidpashley.com
Queue: DBD-RAM
Subject: Making it work
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: david@davidpashley.com
Status: new
Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=33882 >
Was getting the dreaded "Can't find STORE at DBD::File line 280" or
similar. The attached patch make it work again. I didn't have chance to
work out which bit broke it.
--- /usr/share/perl5/DBD/RAM.pm 2008-03-07 17:18:59.000000000 +0000
+++ RAM.pm 2008-03-07 17:18:57.000000000 +0000
@@ -26,8 +26,6 @@
use vars qw($VERSION $err $errstr $sqlstate $drh $ramdata);
-use base qw(DBD::File);
-
$VERSION = '0.07';
$err = 0; # holds error code for DBI::err
@@ -35,26 +33,26 @@
$sqlstate = ""; # holds SQL state for DBI::state
$drh = undef; # holds driver handle once initialized
-#sub driver {
-# return $drh if $drh; # already created - return same one
-# my($class, $attr) = @_;
-# $class .= "::dr";
-# $drh = DBI::_new_drh($class, {
-# 'Name' => 'RAM',
-# 'Version' => $VERSION,
-# 'Err' => \$DBD::RAM::err,
-# 'Errstr' => \$DBD::RAM::errstr,
-# 'State' => \$DBD::RAM::sqlstate,
-# 'Attribution' => 'DBD::RAM by Jeff Zucker',
-# });
-# return $drh;
-#}
+sub driver {
+ return $drh if $drh; # already created - return same one
+ my($class, $attr) = @_;
+ $class .= "::dr";
+ $drh = DBI::_new_drh($class, {
+ 'Name' => 'RAM',
+ 'Version' => $VERSION,
+ 'Err' => \$DBD::RAM::err,
+ 'Errstr' => \$DBD::RAM::errstr,
+ 'State' => \$DBD::RAM::sqlstate,
+ 'Attribution' => 'DBD::RAM by Jeff Zucker',
+ });
+ return $drh;
+}
package DBD::RAM::dr; # ====== DRIVER ======
$DBD::RAM::dr::imp_data_size = 0;
-use base qw(DBD::File::dr);
+@DBD::RAM::dr::ISA = qw(DBD::File::dr);
sub connect {
my($drh, $dbname, $user, $auth, $attr)= @_;
@@ -90,7 +88,7 @@
$DBD::RAM::db::imp_data_size = 0;
-use base qw(DBD::File::db);
+@DBD::RAM::db::ISA = qw(DBD::File::db);
sub disconnect{ $DBD::RAM::ramdata = {};}
@@ -791,13 +789,13 @@
package DBD::RAM::st; # ====== STATEMENT ======
$DBD::RAM::st::imp_data_size = 0;
-use base qw(DBD::File::st);
+@DBD::RAM::st::ISA = qw(DBD::File::st);
package DBD::RAM::Statement;
#@DBD::RAM::Statement::ISA = qw(SQL::Statement);
-#@DBD::RAM::Statement::ISA = qw(SQL::Statement DBD::File::Statement);
-use base qw(DBD::File::Statement);
+@DBD::RAM::Statement::ISA = qw(SQL::Statement DBD::File::Statement);
+#@DBD::RAM::Statement::ISA = qw(DBD::File::Statement);
sub open_table ($$$$$) {
my($self, $data, $tname, $createMode, $lockMode) = @_;
@@ -864,9 +862,9 @@
package DBD::RAM::Table;
-#@DBD::RAM::Table::ISA = qw(SQL::Eval::Table);
+@DBD::RAM::Table::ISA = qw(SQL::Eval::Table);
#@DBD::RAM::Statement::Table::ISA = qw(SQL::Eval::Table DBD::File::Table);
-use base qw(DBD::File::Table);
+#@DBD::RAM::Statement::Table::ISA = qw(DBD::File::Table);
##################################
# fetch_row()
@@ -1006,7 +1004,7 @@
if $data->{$table_name};
return 1;
}
- return DBD::File::Table::drop( $self );
+ return DBD::File::Table::drop( $self, $data );
}
##################################