Closed Bug 290403 Opened 20 years ago Closed 20 years ago

Slight cleanup of Bugzilla::DB index code

Categories

(Bugzilla :: Installation & Upgrading, enhancement, P2)

2.19.2
enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

This is part of bug 285722. I'm going to add a bz_add_index_raw and
bz_drop_index_raw to eliminate a lot of code duplication inside of the
index-renaming code, and in case we ever need these functions again anyhow.
Attached patch Index Cleanup (obsolete) — Splinter Review
OK, this is a pretty simple patch. No real functionality change, except that
the messages printed when the index-renaming drops indexes have changed,
slightly.

It's just a code cleanup, for the most part.
Attachment #180757 - Flags: review?(Tomas.Kopal)
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.20
Comment on attachment 180757 [details] [diff] [review]
Index Cleanup

>-        my @statements = $self->_bz_real_schema->get_add_index_ddl(
>-            $table, $name, $definition);
>+    my @statements = $self->_bz_schema->get_add_index_ddl(
>+        $table, $name, $definition);

>-        my @statements = $self->_bz_real_schema->get_drop_index_ddl(
>-            $table, $name);
>+    my @statements = $self->_bz_schema->get_drop_index_ddl(
>+        $table, $name);

There is a change in functionality. It's r+ if you explain why you are changing
_bz_real_schema to _bz_schema here. Frankly, I am not clear if it makes
difference or not :-(.
(In reply to comment #2)
> There is a change in functionality. It's r+ if you explain why you are changing
> _bz_real_schema to _bz_schema here. Frankly, I am not clear if it makes
> difference or not :-(.

  Yeah, it doesn't make a different. It always should have been _bz_schema. The
problem is that when _raw functions are being called, there's a good chance that
_bz_real_schema doesn't actually exist in the DB yet.
Comment on attachment 180757 [details] [diff] [review]
Index Cleanup

(In reply to comment #3)
> (In reply to comment #2)
> > There is a change in functionality. It's r+ if you explain why you are changing
> > _bz_real_schema to _bz_schema here. Frankly, I am not clear if it makes
> > difference or not :-(.
> 
>   Yeah, it doesn't make a different. It always should have been _bz_schema. The
> problem is that when _raw functions are being called, there's a good chance that
> _bz_real_schema doesn't actually exist in the DB yet.

OK, makes sense.
Attachment #180757 - Flags: review?(Tomas.Kopal) → review+
Flags: approval?
I realized that the checkin of bug 290402 would bitrot this patch, so I fixed
the bitrot in advance. This now depends on bug 290402. :-)
Attachment #180757 - Attachment is obsolete: true
Attachment #180854 - Flags: review+
Depends on: 290402
Flags: approval? → approval+
Checking in Bugzilla/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB.pm,v  <--  DB.pm
new revision: 1.48; previous revision: 1.47
done
Checking in Bugzilla/DB/Mysql.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm,v  <--  Mysql.pm
new revision: 1.15; previous revision: 1.14
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: