MS SQL Server returns two rows for a unique key
Fix versions
Priority
Description
Related
Activity
Show:
Resolved
Details
Details
Assignee
Adrien Ragot
Adrien RagotReporter
Adrien Ragot
Adrien RagotSprint
None
Story Points
2
Release date
Apr 10, 2023
Requirement Yogi
Linked requirements
Requirement Yogi
Linked requirements
Created March 29, 2023 at 9:02 AM
Updated last week
Resolved April 10, 2023 at 11:08 AM
A customer has a problem with inserting a certain type of requirements,
and this is because this customer has two keys,
TEST-1000
and??TEST-1000
(?
representing an unknown character, possibly an emoji), and MS SQL Server returns both when running the query"KEY" IN ('TEST-1000')
.How we’ve resolved it
Upon installing RY 3.4.20, the administrator will be notified if they go to the Requirement Yogi administration that something is not right, and will be encouraged to go to the Requirement Yogi administration in Confluence → Upgrade Tasks → V70 → Details.
Technically
When installing RY 3.4.20, an upgrade task runs and diagnoses colliding keys (according to the customer’s DBMS).
If one is found, then a message is displayed in the administration, telling the administrator to go to the Upgrade Tasks → V70 → Details,
On that screen, the administrator must check the keys which need to be merged, and click “Fix”.
It is not possible to ignore this required action. So why don’t we automatically fix the keys? Because it merges data, therefore it must be approved by the customer, in case the various keys were actually due to differences. In this situation, the customer must fix their database so that
key = ?
returns only 1 key at a time.Fix in bulk: The “Fix” button also works for an entire page of 100. If this is not enough, then please copy-as-curl (right-click → Inspect → Find the query → copy as curl → paste it in the command line) and change the ‘limit’ parameter.
This kind of issue should not occur during normal operations, since the software checks for the presence of the key before inserting it into the database.