You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Steps to reproduce the bug.
1. Take any Jira server/DC with following DB setup:
8.0.22-0ubuntu0.20.04.3
MySQL Connector/J mysql-connector-java-8.0.21 (Revision: 33f65445a1bcc544eb0120491926484da168f199)
utf8mb4_bin
All these are btw supported on your web
2. Install SoftComply Risk Manager app and you will see errors in log:
2021-01-18 17:50:08,807+0000 active-objects-init-JiraTenantImpl{id=‘system’}-0 ERROR CStichweh [n.java.ao.sql] Exception executing SQL update <CREATE TABLE AO_0EF072_RMCELL_AO (COLUMN
INTEGER,
ID INTEGER AUTO_INCREMENT NOT NULL,
RISK_CLASS_ID INTEGER,
RISK_MATRIX_ID INTEGER,
ROW INTEGER,
CONSTRAINT fk_ao_0ef072_rmcell_ao_risk_class_id FOREIGN KEY (RISK_CLASS_ID) REFERENCES AO_0EF072_RISK_CLASS_AO(ID),
CONSTRAINT fk_ao_0ef072_rmcell_ao_risk_matrix_id FOREIGN KEY (RISK_MATRIX_ID) REFERENCES AO_0EF072_RISK_MATRIX_AO(ID),
PRIMARY KEY(ID)
) ENGINE=InnoDB>
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ROW INTEGER,
CONSTRAINT fk_ao_0ef072_rmcell_ao_risk_class_id FOREIGN KEY (RI’ at line 6
We have a table with column names “ROW” and “COLUMN”. Both are reserved keywords in MySQL and should be handled properly (i.e. escaped). Now COLUMN is reserved word for a long time, but ROW is reserved only recently (https://dev.mysql.com/doc/refman/8.0/en/keywords.html)
Now if the Atlassian framework creates table, it first created SQL from our Java object, and then executes it. What happens now is that the SQL is generated with not the latest information.
You can see below that on line 2 the COLUMN is handled properly, but on line 6 ROW is not surrounded with quotes. And that causes error.
Expected Result
App works and reserved keywords are escaped properly by AO framework
Actual Result
Error in SQL
Try to ask at Dev Community:
https://community.developer.atlassian.com/
The request was posted there on March 11 and remains there nicely unnoticed, unread and unprocessed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.