)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":27909,"name":"Aija Jauntēva","email":"code@clusums.eu","username":"ajya"},"change_message_id":"0fa6048696bee48971d74d8ab300cc82f08fdbb1","unresolved":true,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2021-05-25 10:21:51 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Added handler for mysql 8.0.19 duplicate key error update"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Ic78059b625e73cece355541cb4d89e641abc1103"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"b9f80917_4240fc9d","line":8,"updated":"2021-05-26 10:35:20.000000000","message":"add Closes-Bug reference","commit_id":"fe7fed67f822e471d399df77879c91f84f604752"}],"oslo_db/sqlalchemy/exc_filters.py":[{"author":{"_account_id":27909,"name":"Aija Jauntēva","email":"code@clusums.eu","username":"ajya"},"change_message_id":"0fa6048696bee48971d74d8ab300cc82f08fdbb1","unresolved":true,"context_lines":[{"line_number":112,"context_line":"    \"\"\"Filter for MySQL or Postgresql duplicate key error."},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    note(boris-42): In current versions of DB backends unique constraint"},{"line_number":115,"context_line":"    violation messages follow the structure:"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    postgres:"},{"line_number":118,"context_line":"    1 column - (IntegrityError) duplicate key value violates unique"}],"source_content_type":"text/x-python","patch_set":4,"id":"468384e7_ed25ffc4","line":115,"range":{"start_line":115,"start_character":23,"end_line":115,"end_character":44},"updated":"2021-05-26 10:35:20.000000000","message":"update below regarding mysql","commit_id":"fe7fed67f822e471d399df77879c91f84f604752"},{"author":{"_account_id":27909,"name":"Aija Jauntēva","email":"code@clusums.eu","username":"ajya"},"change_message_id":"0fa6048696bee48971d74d8ab300cc82f08fdbb1","unresolved":true,"context_lines":[{"line_number":145,"context_line":"    if not columns.startswith(uniqbase):"},{"line_number":146,"context_line":"        if engine_name \u003d\u003d \"postgresql\":"},{"line_number":147,"context_line":"            columns \u003d [columns[columns.index(\"_\") + 1:columns.rindex(\"_\")]]"},{"line_number":148,"context_line":"        elif engine_name \u003d\u003d \"mysql\":"},{"line_number":149,"context_line":"            columns \u003d columns.split(\"0\")[1:]"},{"line_number":150,"context_line":"        else:"},{"line_number":151,"context_line":"            columns \u003d [columns]"},{"line_number":152,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"743fe3ad_57c00cd0","line":149,"range":{"start_line":148,"start_character":8,"end_line":149,"end_character":44},"updated":"2021-05-26 10:35:20.000000000","message":"the code must be fixed because it breaks existing tests; as in test for the columns\u003d\u0027b\u0027 fails because it does not start with uniq_ (line 144), but is mysql engine and tries to split it rendering \u0027b\u0027 into \u0027\u0027 (line 149).\n\nOne solution to this can be to make adjustment on line 146\n\n  if not columns.startswith(uniqbase) and \".\" + uniqbase not in columns\n\nso that block is not executed as it is still contains uniq_ prefix.\n\nCould also go with simple version \n\n  uniqbase not in columns\n\nbut this will fail if there is a column named, e.g., myuniq_columnname\n\nIn any case, have to think about the edge cases, because uniq_ can be part of the regular table and column name, and also identifiers can contain dots in mysql. Could add more tests for extreme edge cases, e.g., where table is `my.uniq_tablename` and column `my.uniq_columnname`, though such names containing dots and uniq_ should be near non-existing :)","commit_id":"fe7fed67f822e471d399df77879c91f84f604752"},{"author":{"_account_id":27909,"name":"Aija Jauntēva","email":"code@clusums.eu","username":"ajya"},"change_message_id":"43b81c5073db36819b02651c98a99ca78f57d7de","unresolved":true,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    mysql since 8.0.19:"},{"line_number":124,"context_line":"    1 column - (IntegrityError) (1062, \"Duplicate entry \u0027value_of_c1\u0027 for key"},{"line_number":125,"context_line":"               \u0027table_name.uniq_tbl0c1\u0027\")"},{"line_number":126,"context_line":"    N columns - (IntegrityError) (1062, \"Duplicate entry \u0027values joined"},{"line_number":127,"context_line":"               with -\u0027 for key \u0027table_name.uniq_tbl0c10c20cn\u0027\")"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"25d9f6f6_5ee80441","line":125,"range":{"start_line":125,"start_character":27,"end_line":125,"end_character":38},"updated":"2021-06-03 15:16:24.000000000","message":"to be consistent with other parts of this docstring, it should be `table_name.c1` and below `table_name.name_of_our_constraint`.\n\nAnd probably there is still difference between mysqldb vs mysqlconnector, but then this is getting verbose.","commit_id":"b32961be7d75b6ebf15fcc5f7d7e6b3fb411093e"},{"author":{"_account_id":33244,"name":"kamlesh chauvhan","email":"kamlesh.chauvhan@gmail.com","username":"kamlesh.chauvhan"},"change_message_id":"160041ecb5e1b69d5fd0e21aafb1a752d9d0bd7c","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    mysql since 8.0.19:"},{"line_number":124,"context_line":"    1 column - (IntegrityError) (1062, \"Duplicate entry \u0027value_of_c1\u0027 for key"},{"line_number":125,"context_line":"               \u0027table_name.uniq_tbl0c1\u0027\")"},{"line_number":126,"context_line":"    N columns - (IntegrityError) (1062, \"Duplicate entry \u0027values joined"},{"line_number":127,"context_line":"               with -\u0027 for key \u0027table_name.uniq_tbl0c10c20cn\u0027\")"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9db3f92c_fd785099","line":125,"range":{"start_line":125,"start_character":27,"end_line":125,"end_character":38},"in_reply_to":"25d9f6f6_5ee80441","updated":"2021-06-04 07:16:57.000000000","message":"Thanks for review comment. Incorporated Suggested changes.","commit_id":"b32961be7d75b6ebf15fcc5f7d7e6b3fb411093e"}],"oslo_db/tests/sqlalchemy/test_exc_filters.py":[{"author":{"_account_id":27909,"name":"Aija Jauntēva","email":"code@clusums.eu","username":"ajya"},"change_message_id":"7f18624549cb1aa6ebfcaa6240dd35deaa58c86e","unresolved":true,"context_lines":[{"line_number":816,"context_line":"    def test_mysql_single(self):"},{"line_number":817,"context_line":"        self._run_dupe_constraint_test("},{"line_number":818,"context_line":"            \"mysql\","},{"line_number":819,"context_line":"            \"1062 (23000): Duplicate entry \u00272\u0027 for key \u0027tablename.uniq_tbl0b\u0027\","},{"line_number":820,"context_line":"            expected_columns\u003d[\u0027b\u0027],"},{"line_number":821,"context_line":"            expected_value\u003d\u00272\u0027"},{"line_number":822,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":2,"id":"3b408015_d5fe41e8","line":819,"range":{"start_line":819,"start_character":13,"end_line":819,"end_character":76},"updated":"2021-05-24 11:00:03.000000000","message":"For this test and one below, I\u0027m wondering if this is the way to go.\nBy introducing the fix for 8.0.19+, still need to make sure that it works for older versions. That\u0027s why I would expect:\n\n1) all existing tests are passing without being changed\n2) there is new test case for 8.0.19+ naming convention\n\nthat\u0027s why, rather changing unit test, need to understand what needs to be changed in code so that it works both for old and new syntax.","commit_id":"31d46f8e9565a20b4427bfe010df7913ef9fb298"},{"author":{"_account_id":33244,"name":"kamlesh chauvhan","email":"kamlesh.chauvhan@gmail.com","username":"kamlesh.chauvhan"},"change_message_id":"b390d3416ac7423720df8e674b197bf52e13b4da","unresolved":true,"context_lines":[{"line_number":816,"context_line":"    def test_mysql_single(self):"},{"line_number":817,"context_line":"        self._run_dupe_constraint_test("},{"line_number":818,"context_line":"            \"mysql\","},{"line_number":819,"context_line":"            \"1062 (23000): Duplicate entry \u00272\u0027 for key \u0027tablename.uniq_tbl0b\u0027\","},{"line_number":820,"context_line":"            expected_columns\u003d[\u0027b\u0027],"},{"line_number":821,"context_line":"            expected_value\u003d\u00272\u0027"},{"line_number":822,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":2,"id":"c7954a2a_c71f898e","line":819,"range":{"start_line":819,"start_character":13,"end_line":819,"end_character":76},"in_reply_to":"3b408015_d5fe41e8","updated":"2021-05-25 06:05:39.000000000","message":"This test case is not matching with code which is getting executed with running mysql environment setup. To elaborate ,in current scenario, where for mysql duplicate key error oslo_db/sqlalchemy/exc_filters.py line 151 is getting executed where as in test_mysql_single its hitting line 149 in original code.\n\nChanges in test cases :\n1) Updated older test cases to match with execution scenario.\n2) Added new test cases to have coverage for newer sql version.","commit_id":"31d46f8e9565a20b4427bfe010df7913ef9fb298"},{"author":{"_account_id":27909,"name":"Aija Jauntēva","email":"code@clusums.eu","username":"ajya"},"change_message_id":"0fa6048696bee48971d74d8ab300cc82f08fdbb1","unresolved":true,"context_lines":[{"line_number":813,"context_line":"            expected_value\u003d\u00272, 3\u0027"},{"line_number":814,"context_line":"        )"},{"line_number":815,"context_line":""},{"line_number":816,"context_line":"    def test_mysql_single(self):"},{"line_number":817,"context_line":"        self._run_dupe_constraint_test("},{"line_number":818,"context_line":"            \"mysql\","},{"line_number":819,"context_line":"            \"1062 (23000): Duplicate entry \u00272\u0027 for key \u0027uniq_tbl0b\u0027\","}],"source_content_type":"text/x-python","patch_set":4,"id":"614515bb_7808b157","line":816,"range":{"start_line":816,"start_character":8,"end_line":816,"end_character":25},"updated":"2021-05-26 10:35:20.000000000","message":"this test MUST remain unchanged. It is testing for case for duplicate key error does not contain uniq_. Looking at the docstring for the function and test name itself it seems to be the case when there is single column violating.\n\nEven if this is no longer the case for mysql there still could be older versions that behave the old way and still needs to be supported.\n\nInstead of changing the test case, fix the code so that it works for both old and new ways.","commit_id":"fe7fed67f822e471d399df77879c91f84f604752"},{"author":{"_account_id":27909,"name":"Aija Jauntēva","email":"code@clusums.eu","username":"ajya"},"change_message_id":"0fa6048696bee48971d74d8ab300cc82f08fdbb1","unresolved":true,"context_lines":[{"line_number":829,"context_line":"            expected_value\u003d\u00272\u0027"},{"line_number":830,"context_line":"        )"},{"line_number":831,"context_line":""},{"line_number":832,"context_line":"    def test_mysql_binary(self):"},{"line_number":833,"context_line":"        self._run_dupe_constraint_test("},{"line_number":834,"context_line":"            \"mysql\","},{"line_number":835,"context_line":"            \"(1062, \\\u0027Duplicate entry \""}],"source_content_type":"text/x-python","patch_set":4,"id":"a279ba3e_d534955a","line":832,"range":{"start_line":832,"start_character":8,"end_line":832,"end_character":25},"updated":"2021-05-26 10:35:20.000000000","message":"the same as above - this test MUST remain unchanged.","commit_id":"fe7fed67f822e471d399df77879c91f84f604752"}]}
