[ic] Can't setup DBI handleof DBI::st=HASH(0xaff6bb0) to DBD::mysql::st_mem: unknown_mem package

Gert van der Spoel gert at 3edge.com
Wed Apr 6 13:15:11 UTC 2011


> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org [mailto:interchange-users-
> bounces at icdevgroup.org] On Behalf Of Peter
> Sent: woensdag 6 april 2011 15:35
> To: interchange-users at icdevgroup.org
> Subject: Re: [ic] Can't setup DBI handleof DBI::st=HASH(0xaff6bb0) to
> DBD::mysql::st_mem: unknown_mem package
> 
> On 06/04/11 19:36, Gert van der Spoel wrote:
> > In case there is anybody who has a great idea, please don't be shy! :)
> >
> >
> > [rt.icdevgroup.org #346] Can't setup DBI handleof
> DBI::st=HASH(0xaff6bb0) to
> > DBD::mysql::st_mem: unknown_mem package
> >
> > IC: 5.7.6  (but possibly other versions)
> > Perl: 5.12.3
> >
> > When doing something like
> > [xxx-exec bar_link]yyyy[/xxx]
> >
> > The following crash occurs:
> > Can't setup DBI handle of DBI::st=HASH(0xaff6bb0) to DBD::mysql::st_mem:
> > unknown _mem package at
> > /export/opt/perl-5.12.3/lib/site_perl/5.12.3/i686-linux/DBI.pm line
> 1285.
> >
> > This happens in
> > /path/to/interchange/catalog_before.cfg
> >
> > line 70:
> >         my $record =  tag_data($base, 'n/a', $code, { hash => 1 });
> >
> > Currently there are 2 possible workarounds:
> > 1) Downgrade to Perl 5.10
> > 2) set AllowGlobal <catalog>   for the catalog using this code.
> 
> Found another (better) workaround.  In catalog_before.cfg, add:
> Autoload <<EOA
> [perl cat][/perl]
> EOA
> 
> This forces Interchange to load in the cat table ahead of time and then
> the bar_link sub doesn't barf on it.  For some reason interchange isn't
> loading it in otherwise.  I'm wondering if there's a better way to do
> this, though, rather than forcing it to load on every page, and
> hard-coding cat as the table that is expected to be required?

This better workaround needs an additional line:

--- catalog_before.cfg  2010-01-23 20:04:07.000000000 +0100
+++ /opt/interchange/catalog_before.cfg 2011-04-06 15:01:41.000000000 +0200
@@ -58,6 +58,10 @@
 Variable  MV_DEFAULT_SEARCH_FILE  products
 Variable  MV_DEFAULT_SEARCH_TABLE products

+Autoload <<EOA
+  [perl cat][/perl]
+EOA
+
 Sub <<EOR
 sub bar_link {
        my $base = shift || 'cat';
@@ -67,6 +71,7 @@
        my $ref = shift;
        my $code = $ref->[0];

+        $Tag->perl($base);
        my $record =  tag_data($base, 'n/a', $code, { hash => 1 });
        return $ref->[0] unless $record;

Thanks Peter for coming up with this workaround.

NOTE: The issue is a result of a newer version of Safe.pm in Perl 5.12.3
(2.27 versus 2.12 that was around in my Perl 5.10 install). 

By copying Safe.pm from my Perl 5.10 to my Perl 5.12.3 the original
catalog_before.cfg code would work, but as this could no doubt be causing
all kinds of other side-effects, I'd say: "don't try this at home", and just
go with the above workaround for the time being.

CU,

Gert




More information about the interchange-users mailing list