Details
-
Bug
-
Resolution: Timed out
-
Low
-
None
-
4.3.4
-
Oracle (any version)
-
4.03
-
Severity 3 - Minor
-
-
Description
This issue affects Jira installations that use Oracle for their backend.
When Jira starts, it checks to see if the Jira tables exist in the database. If they don't exist, it attempts to create new ones. The table names are being incorrectly referenced so Jira thinks that the tables don't exist, and tries to create new ones but is denied because they do already exist.
As an example, this is in my log file for the JIRAACTION table:
2011-07-21 13:46:46,683 main WARN [core.entity.jdbc.DatabaseUtil] Entity "Action" has no table in the database
2011-07-21 13:46:46,852 main ERROR [core.entity.jdbc.DatabaseUtil] Could not create table "JIRA.jiraaction"
2011-07-21 13:46:46,853 main ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
CREATE TABLE JIRA.jiraaction (ID NUMBER(18,0) NOT NULL, issueid NUMBER(18,0), AUTHOR VARCHAR2(255), actiontype VARCHAR2(255), actionlevel VARCHAR2(255), rolelevel NUMBER(18,0), actionbody CLOB, CREATED DATE, UPDATEAUTHOR VARCHAR2(255), UPDATED DATE, actionnum NUMBER(18,0), CONSTRAINT PK_jiraaction PRIMARY KEY (ID))
Error was: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
...
2011-07-21 13:46:46,932 main WARN [core.entity.jdbc.DatabaseUtil] Table named "JIRAACTION" exists in the database but has no corresponding entity
It seems like Jira might be looking up the JIRAACTION table in SYS.ALL_TABLES using lower case (jiraaction) which is incorrect in Oracle - it stores all table names as upper case when referenced as a part of a string (inside quotes).
i.e. SELECT * FROM SYS.ALL_TABLES WHERE TABLE_NAME = 'JIRAACTION' AND OWNER = 'JIRA'
Only when referencing a table directly is case-sensitivity not important.
I'm not certain that SYS.ALL_TABLES is the method you use to look up tables however there is definitely a problem here with case.