← 输入框|github.com|刷新
Skip to content

ORA-00001: unique constraint (UT.UT_OUTPUT_BUFFER_TMP_PK) violated #1254

Closed

Description

@jeffreykemp

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

  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.

Activity

  1. jeffreykemp commented on May 23, 2023

    @jeffreykemp
    Author

    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.

  2. jgebal commented on May 27, 2023

    @jgebal
    Member

    Thanks @jeffreykemp for reporting this.
    I'll look into it.
    It could be related to #1128

  3. jgebal commented on May 27, 2023

    @jgebal
    Member

    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.
  4. jeffreykemp commented on May 27, 2023

    @jeffreykemp
    Author

    Thanks. The test case I was running would have involved a number of tests with multibyte strings.

  5. added a commit that references this issue on May 28, 2023
    8b45b0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions