Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,475
Community Members
 
Community Events
184
Community Groups

ActiveObject framework does not handle new MySQL reserved keywords

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

1 answer

0 votes
Jack Nolddor [Sweet Bananas]
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Apr 14, 2021

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. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events