wrong error message in DBDuplicateEntry exception

Bug #1182062 reported by Viktor Serhieiev
This bug report is a duplicate of:  Bug #1182054: wrong unique constraint names. Edit Remove
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
oslo-incubator
In Progress
Medium
Viktor Serhieiev

Bug Description

We found that current constraint name convention allows us create
constraints with duplicate names. It happens if we will add constraints
in different tables with same column names (for example, `name`,
`deleted`). In this case we can not create new constraint due to mysql
limitation (it requires unique constraint name for database)
To solve this issue unique constraint name convention was changed
from "uniq_c1_x_c2_x_c3" to "uniq_t$c1$c2$c3" where `t` it is table name
and columns `c1`, `c2`, `c3` are in UniqueConstraint.

Also we need change `_raise_if_duplicate_entry_error()` function respectively to get in error message only column names instead of table name and column names.

Tags: db
Changed in oslo:
assignee: nobody → Victor Sergeyev (vsergeyev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/29888

Changed in oslo:
status: New → In Progress
Changed in oslo:
assignee: Victor Sergeyev (vsergeyev) → nobody
assignee: nobody → Victor Sergeyev (vsergeyev)
description: updated
Mark McLoughlin (markmc)
Changed in oslo:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.