6.0.0-alpha12
6/6/25

[#9049] Constraint violation in imp_sentmail
Summary Constraint violation in imp_sentmail
Queue IMP
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners Horde Developers (at) , slusarz (at) horde (dot) org
Requester jan (at) horde (dot) org
Created 05/20/2010 (5496 days ago)
Due
Updated 05/26/2010 (5490 days ago)
Assigned 05/20/2010 (5496 days ago)
Resolved 05/26/2010 (5490 days ago)
Milestone
Patch No

History
05/26/2010 04:15:10 AM Michael Slusarz Comment #5
State ⇒ Resolved
Reply to this comment
This should have been fixed with the recent db migration changes to 
imp.  Need to figure out some things re: migration usage, but the 
topic of this ticket has been resolved.
05/20/2010 06:36:18 PM Michael Slusarz Comment #4 Reply to this comment
It probably wasn't using auto_increment because PEAR Db basically 
presumed the use of separate sequence tables; Horde_Db presumes that 
you use the database's built-in sequencing.
Hmmm... unfortunately it doesn't look like Horde_Db supports altering 
an existing table to include an auto_increment column.  Or am I 
missing something?
05/20/2010 05:26:04 PM Chuck Hagenbuch Comment #3 Reply to this comment
It probably wasn't using auto_increment because PEAR Db basically 
presumed the use of separate sequence tables; Horde_Db presumes that 
you use the database's built-in sequencing.
05/20/2010 05:12:57 PM Michael Slusarz Comment #2
State ⇒ Feedback
Assigned to Horde DevelopersHorde Developers
Reply to this comment
The issue is that Horde_Db_Adapter_Base does not have a nextId() 
function like PEAR DB.

A related question: why is the imp_sentmail table not using 
AUTO_INCREMENT for that key?
05/20/2010 08:40:30 AM Jan Schneider Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Constraint violation in imp_sentmail
Queue ⇒ IMP
Assigned to Michael Slusarz
Milestone ⇒
Patch ⇒ No
State ⇒ Assigned
Reply to this comment
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 
'0' for key 1

[Zeile 496 von 
/home/jan/sapo/horde/framework/Db/lib/Horde/Db/Adapter/Base.php]
Details:
The full error message is logged in Horde's log file, and is shown 
below only to administrators. Non-administrative users will not see 
error details.

Horde_Db_Exception Object
(
     [message:protected] => SQLSTATE[23000]: Integrity constraint 
violation: 1062 Duplicate entry '0' for key 1
     [string:Exception:private] =>
     [code:protected] => 23000
     [file:protected] => 
/home/jan/sapo/horde/framework/Db/lib/Horde/Db/Adapter/Base.php
     [line:protected] => 496
     [trace:Exception:private] => Array
         (
             [0] => Array
                 (
                     [file] => 
/home/jan/sapo/horde/framework/Db/lib/Horde/Db/Adapter/Base.php
                     [line] => 527
                     [function] => execute
                     [class] => Horde_Db_Adapter_Base
                     [type] => ->
                     [args] => Array
                         (
                             [0] => INSERT INTO imp_sentmail 
(sentmail_who, sentmail_ts, sentmail_messageid, sentmail_action, 
sentmail_recipient, sentmail_success) VALUES (?, ?, ?, ?, ?, ?)
                             [1] => Array
                                 (
                                     [0] => jan
                                     [1] => 1274344637
                                     [2] => 
<20100520103717.Horde.ey9kh8ss6o00owo80owkk8o8@php5.wg.de>
                                     [3] => 1
                                     [4] => xxx@co.sapo.pt
                                     [5] => 1
                                 )

                             [2] =>
                         )

                 )

             [1] => Array
                 (
                     [file] => /home/jan/sapo/horde/imp/lib/Sentmail/Sql.php
                     [line] => 78
                     [function] => insert
                     [class] => Horde_Db_Adapter_Base
                     [type] => ->
                     [args] => Array
                         (
                             [0] => INSERT INTO imp_sentmail 
(sentmail_who, sentmail_ts, sentmail_messageid, sentmail_action, 
sentmail_recipient, sentmail_success) VALUES (?, ?, ?, ?, ?, ?)
                             [1] => Array
                                 (
                                     [0] => jan
                                     [1] => 1274344637
                                     [2] => 
<20100520103717.Horde.ey9kh8ss6o00owo80owkk8o8@php5.wg.de>
                                     [3] => 1
                                     [4] => xxx@co.sapo.pt
                                     [5] => 1
                                 )

                         )

                 )

             [2] => Array
                 (
                     [file] => /home/jan/sapo/horde/imp/lib/Sentmail/Driver.php
                     [line] => 53
                     [function] => _log
                     [class] => IMP_Sentmail_Sql
                     [type] => ->
                     [args] => Array
                         (
                             [0] => 1
                             [1] => 
<20100520103717.Horde.ey9kh8ss6o00owo80owkk8o8@php5.wg.de>
                             [2] => xxx@co.sapo.pt
                             [3] => 1
                         )

                 )

             [3] => Array
                 (
                     [file] => /home/jan/sapo/horde/imp/lib/Compose.php
                     [line] => 593
                     [function] => log
                     [class] => IMP_Sentmail_Driver
                     [type] => ->
                     [args] => Array
                         (
                             [0] => 1
                             [1] => 
<20100520103717.Horde.ey9kh8ss6o00owo80owkk8o8@php5.wg.de>
                             [2] => Array
                                 (
                                     [0] => João Machado <xxx@co.sapo.pt>
                                     [1] => Carlos Pires <xxx@sapo.pt>
                                     [2] => João Machado <xxx@telecom.pt>
                                     [3] => João Paulo Alberto Martins 
Carvalho <xxx@co.sapo.pt>
                                     [4] => Joana Torrado Mendes 
<xxx@telecom.pt>
                                 )

                             [3] => 1
                         )

                 )


Saved Queries