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
28618aea
Commit
28618aea
authored
Sep 06, 2008
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 364161: Inefficient SQL: Selecting subclass from setting table
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent
6780793b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
Setting.pm
Bugzilla/User/Setting.pm
+12
-11
No files found.
Bugzilla/User/Setting.pm
View file @
28618aea
...
...
@@ -99,15 +99,12 @@ sub new {
}
}
else
{
(
$subclass
)
=
$dbh
->
selectrow_array
(
q{SELECT subclass FROM setting WHERE name = ?}
,
undef
,
$setting_name
);
# If the values were passed in, simply assign them and return.
$self
->
{
'is_enabled'
}
=
shift
;
$self
->
{
'default_value'
}
=
shift
;
$self
->
{
'value'
}
=
shift
;
$self
->
{
'is_default'
}
=
shift
;
$subclass
=
shift
;
}
if
(
$subclass
)
{
eval
(
'require '
.
$class
.
'::'
.
$subclass
);
...
...
@@ -172,7 +169,7 @@ sub get_all_settings {
my
$dbh
=
Bugzilla
->
dbh
;
my
$sth
=
$dbh
->
prepare
(
q{SELECT name, default_value, is_enabled, setting_value
q{SELECT name, default_value, is_enabled, setting_value
, subclass
FROM setting
LEFT JOIN profile_setting
ON setting.name = profile_setting.setting_name
...
...
@@ -180,8 +177,9 @@ sub get_all_settings {
ORDER BY name}
);
$sth
->
execute
(
$user_id
);
while
(
my
(
$name
,
$default_value
,
$is_enabled
,
$value
)
=
$sth
->
fetchrow_array
())
{
while
(
my
(
$name
,
$default_value
,
$is_enabled
,
$value
,
$subclass
)
=
$sth
->
fetchrow_array
())
{
my
$is_default
;
...
...
@@ -194,7 +192,7 @@ sub get_all_settings {
$settings
->
{
$name
}
=
new
Bugzilla::User::
Setting
(
$name
,
$user_id
,
$is_enabled
,
$default_value
,
$value
,
$is_default
);
$default_value
,
$value
,
$is_default
,
$subclass
);
}
return
$settings
;
...
...
@@ -207,14 +205,17 @@ sub get_defaults {
$user_id
||=
0
;
my
$sth
=
$dbh
->
prepare
(
q{SELECT name, default_value, is_enabled
my
$sth
=
$dbh
->
prepare
(
q{SELECT name, default_value, is_enabled
, subclass
FROM setting
ORDER BY name}
);
$sth
->
execute
();
while
(
my
(
$name
,
$default_value
,
$is_enabled
)
=
$sth
->
fetchrow_array
())
{
while
(
my
(
$name
,
$default_value
,
$is_enabled
,
$subclass
)
=
$sth
->
fetchrow_array
())
{
$default_settings
->
{
$name
}
=
new
Bugzilla::User::
Setting
(
$name
,
$user_id
,
$is_enabled
,
$default_value
,
$default_value
,
1
);
$name
,
$user_id
,
$is_enabled
,
$default_value
,
$default_value
,
1
,
$subclass
);
}
return
$default_settings
;
...
...
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