Oracle fails with "ORA-04043: object T_GROUP_CONCAT does not exist" when installing Bugzilla for the first time

RESOLVED FIXED in Bugzilla 4.2

Status

()

Bugzilla
Installation & Upgrading
--
critical
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

({regression})

4.2.4
Bugzilla 4.2
regression
Bug Flags:
approval +
approval4.4 +
blocking4.4 +
approval4.2 +
blocking4.2.6 +

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
This is a regression due to bug 780053, affecting Bugzilla 4.2.4 and newer. The first time you install Bugzilla using Oracle, T_GROUP_CONCAT doesn't exist yet and so "DROP TYPE T_GROUP_CONCAT" fails:

DBD::Oracle::db do failed: ORA-04043: object T_GROUP_CONCAT does not exist (DBD ERROR: OCIStmtExecute) [for Statement "DROP TYPE T_GROUP_CONCAT"] at Bugzilla/DB/Oracle.pm line 387, <DATA> line 577.
        Bugzilla::DB::Oracle::do(undef, 'DROP TYPE T_GROUP_CONCAT') called at Bugzilla/DB/Oracle.pm line 534
        Bugzilla::DB::Oracle::bz_setup_database('Bugzilla::DB::Oracle=HASH(0xab02468)') called at ./checksetup.pl line 118

So we need a conditional DROP, i.e. only execute this command if T_GROUP_CONCAT exists.
Flags: blocking4.4+
Flags: blocking4.2.6+
(Assignee)

Comment 1

4 years ago
Created attachment 734228 [details] [diff] [review]
patch, v1
Assignee: installation → LpSolit
Status: NEW → ASSIGNED
Attachment #734228 - Flags: review?(dkl)

Comment 2

4 years ago
An alternative could be to just catching the exception:

BEGIN
   EXECUTE IMMEDIATE 'DROP TYPE T_GROUP_CONCAT';
EXCEPTION
   WHEN OTHERS THEN IF SQLCODE != -4043 THEN RAISE; END IF;
END;

But since "CREATE OR REPLACE TYPE" is used, is the drop even needed?
(Assignee)

Comment 3

4 years ago
(In reply to andershol from comment #2)
> But since "CREATE OR REPLACE TYPE" is used, is the drop even needed?

That's a question for you. You wrote that code, see bug 780053 comment 5:

"Adds the "MAP MEMBER FUNCTION" (copied from David), and makes the "CREATE OR REPLACE TYPE T_CLOB_DELIM" run on every run to update old installations, but this made it nessesary to add a "DROP TYPE T_GROUP_CONCAT" since this type depended on T_CLOB_DELIM."

Comment 4

4 years ago
(In reply to Frédéric Buclin from comment #3)
> (In reply to andershol from comment #2)
> > But since "CREATE OR REPLACE TYPE" is used, is the drop even needed?
> That's a question for you. You wrote that code, see bug 780053 comment 5:

This bug is evidence that I was wrong in that bug, so I guess I was just wondering how wrong I was (and I believe I had overlooked the "OR REPLACE" at the time). Anyway, it seems safer to drop it first as you did in your patch, so I shouldn't have been intervening with "micro-optimizations", sorry.

Comment 5

4 years ago
The CREATE OR REPLACE TYPE T_CLOB_DELIM is unrelated, and looks fine.

The DROP is for a different type, T_GROUP_CONCAT, that references T_CLOB_DELIM.  As it won't exist in a new install, it needs to be conditional (or the exception caught as you said).

The patch looks sensible to me...
Comment on attachment 734228 [details] [diff] [review]
patch, v1

Review of attachment 734228 [details] [diff] [review]:
-----------------------------------------------------------------

Works as expected. r=dkl
Attachment #734228 - Flags: review?(dkl) → review+
(Assignee)

Updated

4 years ago
Flags: approval4.4+
Flags: approval4.2+
Flags: approval+
(Assignee)

Comment 7

4 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/DB/Oracle.pm
Committed revision 8613.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified Bugzilla/DB/Oracle.pm
Committed revision 8546.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/DB/Oracle.pm
Committed revision 8208.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.