If the UPDATE set the same values as already in the database - no rows are affected and the db_affected_rows() gives 0. In this case you get this error as a insert is executed for a key that already exists in the database:

user warning: Duplicate entry '4' for key 1 query: INSERT INTO project_release_projects (nid, releases, version_format) VALUES (4, 0, '') in sites\all\modules\project\release\includes\project_edit_releases.inc on line 266.

In cache.inc I have seen this will be catched with "@" on the INSERT.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Status: Active » Needs review
FileSize
1.05 KB

Patch attached

Status: Needs review » Needs work

The last submitted patch, 1394398 Duplicate entry in project_release_projects.patch, failed testing.

hass’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1394398 Duplicate entry in project_release_projects.patch, failed testing.

hass’s picture

Status: Needs work » Needs review
FileSize
3.66 KB

d.o Testbot seems to have issue with spaces in patch files...

As db_affected_rows() is used very often I fixed a few more that may have the same issues.

Status: Needs review » Needs work

The last submitted patch, 1394398_Duplicate_entry_in_project_release_projects_all.patch, failed testing.

hass’s picture

Version: 6.x-1.0-alpha5 » 6.x-1.x-dev
hass’s picture

Status: Needs work » Needs review
hass’s picture

Issue tags: +6.x-1.0 blocker
hass’s picture

Issue summary: View changes

A

  • hass committed 5da9d98 on 6.x-1.x
    Issue #1394398 by hass: Duplicate entry in project_release_projects
    
hass’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.