View Issue Details

IDProjectCategoryView StatusLast Update
0011892mantisbtemailpublic2012-07-13 06:29
Reporteragronholm Assigned Todregad  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version1.2.1 
Summary0011892: Email notifications fail on PostgreSQL
Description

The email queue API uses the wrong sequence name on line 103 of core/email_queue_api.php. As a result, it tries to get the current value of a nonexistent sequence 'mantis_email_table_email_id_seq'.
This can be fixed by changing 'email_id' to 'id' on that line.

Steps To Reproduce

Change the status of a bug so it triggers an email notification to interested parties.

Tagspatch

Activities

jreese

jreese

2010-05-06 08:34

reporter   ~0025424

Assigning to David since he uses pgsql.

dhx

dhx

2010-11-19 09:08

reporter   ~0027420

Last edited: 2010-11-19 09:09

mantis_email_table does actually have an "email_id" column so the correct solution is not to use db_insert_id( $t_email_table, 'id' );

The SQL executed when PGSQL is in use is:
$query = "SELECT currval('" . $ptable . "" . $p_field . "_seq')";

Where $p_table and $p_field are the two arguments to the db_insert_id function.

I can't see why there would be a problem with the code.

Are you able to reproduce this issue with a fresh MantisBT database (just installed) using MantisBT 1.2.3?

agronholm

agronholm

2010-11-19 09:32

reporter   ~0027422

The table does have an email_id column, that was never in question. The database, however, does NOT have the corresponding sequence ("mantis_email_table_email_id_seq"), which is why it fails.

However, it seems that the latest version creates the database properly (with the aforementioned sequence name), so it could be a migration problem.

agronholm

agronholm

2010-11-19 09:34

reporter   ~0027423

By the way, why does the installer require me to specify a host name? I want to use the database via the UNIX domain socket.

dregad

dregad

2012-07-03 08:51

developer   ~0032230

As mentioned by agronholm in 0011892:0027422, the installer does create the sequence properly in latest version, so I'm resolving this as unable to reproduce.