You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a test fails with "ORA-00001: unique constraint (UT.UT_OUTPUT_BUFFER_TMP_PK) violated"
utPLSQL v3.1.12.3589
Oracle DB 19.17
SQLDeveloper; with DBMS Output enabled.
BEGIN ut.run('my_test'); END;
Error report -
ORA-00001: unique constraint (UT.UT_OUTPUT_BUFFER_TMP_PK) violated
ORA-06512: at "UT.UT_OUTPUT_TABLE_BUFFER", line 29
ORA-06512: at "UT.UT_OUTPUT_REPORTER_BASE", line 85
ORA-06512: at "UT.UT_REPORTER_BASE", line 213
ORA-06512: at "UT.UT_EVENT_MANAGER", line 70
ORA-06512: at "UT.UT_EVENT_MANAGER", line 80
ORA-06512: at "UT.UT_RUNNER", line 26
ORA-06512: at "UT.UT_RUNNER", line 149
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "UT.UT_UTILS", line 470
ORA-06512: at "UT.UT_OUTPUT_TABLE_BUFFER", line 40
ORA-06512: at "UT.UT_OUTPUT_REPORTER_BASE", line 53
ORA-06512: at "UT.UT_DOCUMENTATION_REPORTER", line 53
ORA-06512: at "UT.UT_CONSOLE_REPORTER_BASE", line 26
ORA-06512: at "UT.UT_DOCUMENTATION_REPORTER", line 120
ORA-06512: at "UT.UT_DOCUMENTATION_REPORTER", line 137
ORA-06512: at "UT.UT_DOCUMENTATION_REPORTER", line 150
ORA-06512: at "UT.UT_DOCUMENTATION_REPORTER", line 163
ORA-06512: at "UT.UT_DOCUMENTATION_REPORTER", line 203
ORA-06512: at "UT.UT_REPORTER_BASE", line 193
ORA-06512: at "UT.UT_EVENT_MANAGER", line 70
ORA-06512: at "UT.UT_EVENT_MANAGER", line 80
ORA-06512: at "UT.UT_RUN", line 66
ORA-06512: at "UT.UT_SUITE_ITEM", line 50
ORA-06512: at "UT.UT_RUNNER", line 144
ORA-06512: at "UT.UT", line 139
ORA-06512: at "UT.UT", line 493
ORA-06512: at "UT.UT", line 628
ORA-06512: at line 1
00000 - "unique constraint (%s.%s) violated"
*Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
For Trusted Oracle configured in DBMS MAC mode, you may see
this message if a duplicate entry exists at a different level.
*Action: Either remove the unique restriction or do not insert the key.
Note: before the test, the UT_BUFFER_OUTPUT_TMP table is empty; after the test, the table has some rows with a partial set of output from the test.
Also, after I resolved the unit test failures, the problem no longer occurs.
I think that the output of one of failing tests contained data that is multibyte.
There is a bug with multibyte conversion for display purposes in UT_UTILS.
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "UT.UT_UTILS", line 470
ORA-06512: at "UT.UT_OUTPUT_TABLE_BUFFER", line 40
So this failure problem indicates 2 separate problems.
the multibyte substring failing due to use of substr instead of substrb with 4000 limit
the UT_OUTPUT_BUFFER_TMP_PK violation that should not really happen.
Activity
jeffreykemp commentedon May 23, 2023
Note: before the test, the UT_BUFFER_OUTPUT_TMP table is empty; after the test, the table has some rows with a partial set of output from the test.
Also, after I resolved the unit test failures, the problem no longer occurs.
jgebal commentedon May 27, 2023
Thanks @jeffreykemp for reporting this.
I'll look into it.
It could be related to #1128
jgebal commentedon May 27, 2023
I think that the output of one of failing tests contained data that is multibyte.
There is a bug with multibyte conversion for display purposes in UT_UTILS.
So this failure problem indicates 2 separate problems.
substrinstead ofsubstrbwith 4000 limitUT_OUTPUT_BUFFER_TMP_PKviolation that should not really happen.jeffreykemp commentedon May 27, 2023
Thanks. The test case I was running would have involved a number of tests with multibyte strings.
Fix output length error and output buffer.