Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
Community showcase
Published in Marketplace Apps & Integrations

Staying organized with Jira: best practices for a better project management

Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...

233 views 2 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you