Skip to Content.
Sympa Menu

en - Re: [sympa-users] Sympa 5.3.4, get_which_db and Oracle (FetchHashKeyName,

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Olivier Salaün <address@concealed>
  • To: Michael Redinger <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-users] Sympa 5.3.4, get_which_db and Oracle (FetchHashKeyName,
  • Date: Wed, 13 Feb 2008 16:14:36 +0100

Hi Michael,

Your dirty workaround seems quite appropriate since all Sympa table names and column names are lower cased.
I've applied your patch to both development and 5.3 branches.

Thanks.

Michael Redinger a écrit :
I found a problem with Sympa 5.3.4 and Oracle (and even a dirty workaround
...):

I noted that "my lists" was always empty.
I found that fetchrow_hashref in get_which_db returns the database columns
all upper case - even when the query is lower case.
After fixing this, the "my lists" list looks ok.

Having a look at the code (and doing some debugging), I found that the select
statement in get_which_db looks fine:

$statement = sprintf "SELECT list_subscriber, robot_subscriber,
bounce_subscriber, reception_subscriber, topics_subscriber,
include_sources_subscriber, subscribed_subscriber, included_subscriber
FROM subscriber_table WHERE user_subscriber = %s",$dbh->quote($email);

The rows are then fetched with
while ($l = $sth->fetchrow_hashref) {
...

However, the keys returned are:
LIST_SUBSCRIBER
BOUNCE_SUBSCRIBER
...

The next line therefore obviousely fails:
my ($name, $robot) = ($l->{'list_subscriber'}, $l->{'robot_subscriber'});


I therefore edited SQLSource.pm and added
$dbh->{'FetchHashKeyName'}='NAME_lc';
at line 185 (after the DBI->connect).

After this, everything works fine.

Looking at the DBI documentation,this should be the default - obviousely
it is not.


However, this is a rather ugly solution ...
How should this done correctly (eg. can I add this to db_options)?




Archive powered by MHonArc 2.6.19+.

Top of Page