Details
-
Bug
-
Resolution: Answered
-
Low
-
None
-
3.0.2, 3.2.1, 3.3
-
None
Description
Steps to reproduce:
- Create a page
- Insert the following text in Rich-Text Editor:
[this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. thissssss is 256 character:test123]
- Save the page
- User will get a System Error page with the following error:
org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.links.OutgoingLink#4784133]; SQL []; Data truncation: Data too long for column 'DESTSPACEKEY' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'DESTSPACEKEY' at row 1 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110) caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'DESTSPACEKEY' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3561)
Workaround
- Add a space after the opening square bracket '[' or before the closing square bracket '['
or, - Replace the colon ':' with:
:
or,
- Insert the text inside Noformat Macro or Code Block Macro.
Findings
I think this happens because Rich-Text Editor will take square brackets '[ ]' as a link. So any characters before the colon ':' within the square brackets '[ ]' will be considered as a Space Key. If there are more than 255 characters for that part - ie. before colon ':' within the square brackets '[ ]', this will cause an error because DESTSPACEKEY column in LINKS table can only hold 255 characters value as shown below:
mysql> desc links; +---------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+-------+ | LINKID | bigint(20) | NO | PRI | NULL | | | DESTPAGETITLE | varchar(255) | YES | | NULL | | | DESTSPACEKEY | varchar(255) | NO | MUL | NULL | | | CONTENTID | bigint(20) | NO | MUL | NULL | | | CREATOR | varchar(255) | YES | | NULL | | | CREATIONDATE | datetime | YES | | NULL | | | LASTMODIFIER | varchar(255) | YES | | NULL | | | LASTMODDATE | datetime | YES | | NULL | | +---------------+--------------+------+-----+---------+-------+
This bug has been tested in MySQL, Postgre and SQL Server. But it seems to be not an issue in HSQL.
Attachments
Issue Links
- is related to
-
CONFSERVER-18883 Transaction error from colon placement when using Doc Import
- Closed