Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
9162305e
Commit
9162305e
authored
Nov 04, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 359234: missing indexes on the cc and profiles table cause upgrades to fail
Patch By Noel Cragg <noel@red-bean.com> r=mkanat, a=myk
parent
394a014b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
DB.pm
Bugzilla/Install/DB.pm
+10
-4
No files found.
Bugzilla/Install/DB.pm
View file @
9162305e
...
...
@@ -13,6 +13,7 @@
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org>
# Noel Cragg <noel@red-bean.com>
package
Bugzilla::Install::
DB
;
...
...
@@ -184,12 +185,16 @@ sub update_table_definitions {
# 2000-03-24 Added unique indexes into the cc and keyword tables. This
# prevents certain database inconsistencies, and, moreover, is required for
# new generalized list code to work.
if
(
!
$dbh
->
bz_index_info
(
'cc'
,
'cc_bug_id_idx'
)
->
{
TYPE
})
{
if
(
!
$dbh
->
bz_index_info
(
'cc'
,
'cc_bug_id_idx'
)
||
!
$dbh
->
bz_index_info
(
'cc'
,
'cc_bug_id_idx'
)
->
{
TYPE
})
{
$dbh
->
bz_drop_index
(
'cc'
,
'cc_bug_id_idx'
);
$dbh
->
bz_add_index
(
'cc'
,
'cc_bug_id_idx'
,
{
TYPE
=>
'UNIQUE'
,
FIELDS
=>
[
qw(bug_id who)
]});
}
if
(
!
$dbh
->
bz_index_info
(
'keywords'
,
'keywords_bug_id_idx'
)
->
{
TYPE
})
{
if
(
!
$dbh
->
bz_index_info
(
'keywords'
,
'keywords_bug_id_idx'
)
||
!
$dbh
->
bz_index_info
(
'keywords'
,
'keywords_bug_id_idx'
)
->
{
TYPE
})
{
$dbh
->
bz_drop_index
(
'keywords'
,
'keywords_bug_id_idx'
);
$dbh
->
bz_add_index
(
'keywords'
,
'keywords_bug_id_idx'
,
{
TYPE
=>
'UNIQUE'
,
FIELDS
=>
[
qw(bug_id keywordid)
]});
...
...
@@ -752,8 +757,9 @@ sub _add_unique_login_name_index_to_profiles {
# declared to be unique. Sure enough, somehow, I got 22 duplicated entries
# in my database. This code detects that, cleans up the duplicates, and
# then tweaks the table to declare the field to be unique. What a pain.
if
(
!
$dbh
->
bz_index_info
(
'profiles'
,
'profiles_login_name_idx'
)
||
!
$dbh
->
bz_index_info
(
'profiles'
,
'profiles_login_name_idx'
)
->
{
TYPE
})
{
if
(
!
$dbh
->
bz_index_info
(
'profiles'
,
'profiles_login_name_idx'
)
||
!
$dbh
->
bz_index_info
(
'profiles'
,
'profiles_login_name_idx'
)
->
{
TYPE
})
{
print
"Searching for duplicate entries in the profiles table...\n"
;
while
(
1
)
{
# This code is weird in that it loops around and keeps doing this
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment