Opened 12 years ago

Closed 12 years ago

#356 closed defect (fixed)

$isPg undefined in send-quarantine-digests.pl

Reported by: dmorton Owned by: rjl
Priority: normal Milestone: 1.0.2
Component: Perl scripts Version: 1.0.1
Severity: blocker Keywords:
Cc:

Description

looks like a line got removed from send-quarantine-digests.pl in [977] that is critical:

my $isPg = $dsn =~ /^dbi:Pg/; 

Change History (8)

comment:1 Changed 12 years ago by dmorton

Addition from Marc Fournier:

needs to be

my $isPg = $dsn =~ /^dbi:Pg/i;

I believe ... I have mine set as DBI:Pg ...

but, then the next error:

wm# /var/amavis/maia/scripts/send-quarantine-digests.pl
DBD::Pg::st execute failed: ERROR:  syntax error at or near "$3" at character 109
2006-07-23 22:24:31 Maia: [send-quarantine-digests] FATAL ERROR: Couldn't execute query: ERROR:  syntax error at or near "$3" at character 109 

comment:2 Changed 12 years ago by rjl

Use the get_db_type() subroutine used in many of the other Maia scripts, which queries the DBI driver name directly, rather than trying to fish it out of the DSN string:

# Determine the database type: "mysql" or "pg"
sub get_db_type($) {
   my($dbh) = @_;

   return $dbh->{Driver}->{Name};
}

comment:3 Changed 12 years ago by dmorton

  • Resolution set to fixed
  • Status changed from new to closed

used get_db_type, [1089]

comment:4 Changed 12 years ago by dmorton

  • Resolution fixed deleted
  • Status changed from closed to reopened

I have a report that it should check for "Pg" not "pg", and then not sure about the second half of that error...

comment:5 Changed 12 years ago by dmorton

well, duh, the original error was about the case sensitivity.

Still trying to track down the $3 error, which seems to be in the confirm token generation query.

comment:6 Changed 12 years ago by dmorton

postgresql doesnt like the INTERVAL ? DAYS part... it need to be INTERVAL ? and the days added to the variable passed in... or else some other date arithmetic needs to be done.

comment:7 Changed 12 years ago by dmorton

I think we got this sorted out in [1112] and [1113]. Thanks to riogeed on IRC for testing. We settled on the date arithmetic in order to keep the parameter constant.

comment:8 Changed 12 years ago by dmorton

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.