Closed b2cc closed 2 years ago
Thanks for the info - I think i can see the problem: from the error, it seems like you have a unique key called t_table1_uq_1
, which i would guess is made up of (entry_fk,access_type).
this would mean you had a duplicate entry, i.e. an existing row with the same entry_fk and the same access type together.
imagine you have this data:
+----+--------------------------------------+--------------+---------+-------------------------+
| id | entry_fk | access_type | version | created_at |
+----+--------------------------------------+--------------+---------+-------------------------+
| 1 | 6bcb1d81-18b4-11ed-a540-b42e99e033d5 | ACTION1 | 0 | 2000-01-01 00:00:00.000 |
| 2 | 6bcb1d81-18b4-11ed-a540-b42e99e033d5 | ACTION2 | 0 | 2000-01-01 00:00:00.000 |
+----+--------------------------------------+--------------+---------+-------------------------+
and id=2 is updated to access_type = 'ACTION1'
Additionally we wanted to ask if there is a way to display the actual SQL query that was executed in case of such errors? We tried --verbose, but that didn't do it.
This isn't possible at the moment, but it would be a really good feature request.
Thanks for the quick reply - you're right, I didn't notice this key at first, but in the SHOW CREATE TABLE
it's visible
UNIQUE KEY `t_table1_uq_1` (`entry_fk`,`access_type`),
Guess I need to work around that :)
The other feature would be nice to have, but this issue can be closed I guess. Thanks again and all the best, b2cc
We try to anonymize a table in our database for testing, however we run into unexpected behavior when running pynonymizer.
We run it with a fresh dump from production like this
and we get this error:
The line
ERROR 1062 (23000) at line 1: Duplicate entry '250c4390-6e2c-4ce7-8ae4-bc7b7e1c77ff-ACTION1' for key 't_table1.t_table1_uq_1'
suggests that it is trying to update the fieldentry_fk
with an UUID plus one of the actions defined in the strategy file, but why? What are we doing wrong?Strategyfile, using the faker
word
provider faker.providers.lorem.Provider.wordThe table is structured like this:
A usual entry in the table looks like this:
Additionally we wanted to ask if there is a way to display the actual SQL query that was executed in case of such errors? We tried
--verbose
, but that didn't do it.Thank you in advance for your support, b2cc
EDIT: