Details
-
Bug
-
Resolution: Fixed
-
Low
-
5.11.3, 5.11.4.1, 5.13.2
-
9
-
Severity 2 - Major
-
1
-
Description
Summary
Import into Oracle fail when there is truncated data for FAILURE_REASON in MERGE_RESULT table.
Steps to Reproduce
- Setup Bamboo using HSQLDB
- Create a plan with auto merge enabled in its branch plan
- Replicate a conflict merge so that the git error message has more than 4000 characters.
- Run the branch plan. The build should fail with a long failure reason in Branch Integration Details
- Create a export with the build results
- Import the export into a instance connected to Oracle DB
Expected Results
Import successful as the failure reason message should have been truncated as per the fix --BAM-12128
Actual Results
The below exception is thrown in the atlassian-bamboo.log file:
2016-05-31 15:31:22,472 ERROR [http-nio-8085-exec-7] [JDBCExceptionReporter] ORA-01461: can bind a LONG value only for insert into a LONG column
Notes
- Possible that the horizontal ellipsis … character that is added after data truncation is stored as more than 1 byte in the DB.
- Error only occurs in Oracle DB. Import works for MySQL db.
- … is stored as 3 bytes in the database. MySQL returns a length of 3 but a char_length of 1 for …. However, this value is only accurate if the query from the columns. length("…") returns 1.
- Check if VARCHAR2 columns in Oracle database have length defined in characters and not bytes, e.g. the MERGE_RESULT.FAILURE_REASON should have:
"FAILURE_REASON" VARCHAR2(4000 CHAR)
Workaround
- Stop Bamboo
- Edit the database and remove any occurrence of … (\u2026 in HSQLDB) in the merge_result table
Always take a dump or backup of the database before attempting manual edit - Perform the export