Commit b717465b authored by Vitaly Lipatov's avatar Vitaly Lipatov Committed by System Administrator

quota groups table name and $table

parent dd4a1b9b
...@@ -3875,7 +3875,7 @@ sub groups { ...@@ -3875,7 +3875,7 @@ sub groups {
" THEN 1 ELSE 0 END," . " THEN 1 ELSE 0 END," .
" CASE WHEN groups.id IN($grouplist) THEN 1 ELSE 0 END," . " CASE WHEN groups.id IN($grouplist) THEN 1 ELSE 0 END," .
" isactive, membercontrol, othercontrol" . " isactive, membercontrol, othercontrol" .
" FROM groups" . " FROM `groups`" .
" LEFT JOIN bug_group_map" . " LEFT JOIN bug_group_map" .
" ON bug_group_map.group_id = groups.id" . " ON bug_group_map.group_id = groups.id" .
" AND bug_id = ?" . " AND bug_id = ?" .
......
...@@ -127,7 +127,7 @@ sub _load_from_db { ...@@ -127,7 +127,7 @@ sub _load_from_db {
return if $id > MAX_INT_32; return if $id > MAX_INT_32;
$object_data = $dbh->selectrow_hashref(qq{ $object_data = $dbh->selectrow_hashref(qq{
SELECT $columns FROM $table SELECT $columns FROM `$table`
WHERE $id_field = ?}, undef, $id); WHERE $id_field = ?}, undef, $id);
} else { } else {
unless (defined $param->{name} || (defined $param->{'condition'} unless (defined $param->{name} || (defined $param->{'condition'}
...@@ -154,7 +154,7 @@ sub _load_from_db { ...@@ -154,7 +154,7 @@ sub _load_from_db {
map { trick_taint($_) } @values; map { trick_taint($_) } @values;
$object_data = $dbh->selectrow_hashref( $object_data = $dbh->selectrow_hashref(
"SELECT $columns FROM $table WHERE $condition", undef, @values); "SELECT $columns FROM `$table` WHERE $condition", undef, @values);
} }
return $object_data; return $object_data;
} }
...@@ -387,7 +387,7 @@ sub _do_list_select { ...@@ -387,7 +387,7 @@ sub _do_list_select {
} }
if (!$objects) { if (!$objects) {
my $sql = "SELECT $cols FROM $table"; my $sql = "SELECT $cols FROM `$table`";
if (defined $where) { if (defined $where) {
$sql .= " WHERE $where "; $sql .= " WHERE $where ";
} }
...@@ -528,7 +528,7 @@ sub update { ...@@ -528,7 +528,7 @@ sub update {
my $columns = join(', ', map {"$_ = ?"} @update_columns); my $columns = join(', ', map {"$_ = ?"} @update_columns);
$dbh->do("UPDATE $table SET $columns WHERE $id_field = ?", undef, $dbh->do("UPDATE `$table` SET $columns WHERE $id_field = ?", undef,
@values, $self->id) if @values; @values, $self->id) if @values;
Bugzilla::Hook::process('object_end_of_update', Bugzilla::Hook::process('object_end_of_update',
...@@ -561,7 +561,7 @@ sub remove_from_db { ...@@ -561,7 +561,7 @@ sub remove_from_db {
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
$dbh->bz_start_transaction(); $dbh->bz_start_transaction();
$self->audit_log(AUDIT_REMOVE) if $self->AUDIT_REMOVES; $self->audit_log(AUDIT_REMOVE) if $self->AUDIT_REMOVES;
$dbh->do("DELETE FROM $table WHERE $id_field = ?", undef, $self->id); $dbh->do("DELETE FROM `$table` WHERE $id_field = ?", undef, $self->id);
$dbh->bz_commit_transaction(); $dbh->bz_commit_transaction();
if ($self->USE_MEMCACHED) { if ($self->USE_MEMCACHED) {
Bugzilla->memcached->clear({ table => $table, id => $self->id }); Bugzilla->memcached->clear({ table => $table, id => $self->id });
...@@ -638,7 +638,7 @@ sub any_exist { ...@@ -638,7 +638,7 @@ sub any_exist {
my $table = $class->DB_TABLE; my $table = $class->DB_TABLE;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $any_exist = $dbh->selectrow_array( my $any_exist = $dbh->selectrow_array(
"SELECT 1 FROM $table " . $dbh->sql_limit(1)); "SELECT 1 FROM `$table` " . $dbh->sql_limit(1));
return $any_exist ? 1 : 0; return $any_exist ? 1 : 0;
} }
...@@ -739,7 +739,7 @@ sub insert_create_data { ...@@ -739,7 +739,7 @@ sub insert_create_data {
my $qmarks = '?,' x @field_names; my $qmarks = '?,' x @field_names;
chop($qmarks); chop($qmarks);
my $table = $class->DB_TABLE; my $table = $class->DB_TABLE;
$dbh->do("INSERT INTO $table (" . join(', ', @field_names) $dbh->do("INSERT INTO `$table` (" . join(', ', @field_names)
. ") VALUES ($qmarks)", undef, @values); . ") VALUES ($qmarks)", undef, @values);
my $id = $dbh->bz_last_key($table, $class->ID_FIELD); my $id = $dbh->bz_last_key($table, $class->ID_FIELD);
......
...@@ -580,7 +580,7 @@ sub group_controls { ...@@ -580,7 +580,7 @@ sub group_controls {
# Include name to the list, to allow us sorting data more easily. # Include name to the list, to allow us sorting data more easily.
my $query = qq{SELECT id, name, entry, membercontrol, othercontrol, my $query = qq{SELECT id, name, entry, membercontrol, othercontrol,
canedit, editcomponents, editbugs, canconfirm canedit, editcomponents, editbugs, canconfirm
FROM groups FROM `groups`
LEFT JOIN group_control_map LEFT JOIN group_control_map
ON id = group_id ON id = group_id
$where_or_and product_id = ? $where_or_and product_id = ?
......
...@@ -1641,7 +1641,7 @@ sub derive_regexp_groups { ...@@ -1641,7 +1641,7 @@ sub derive_regexp_groups {
# add derived records for any matching regexps # add derived records for any matching regexps
$sth = $dbh->prepare("SELECT id, userregexp, user_group_map.group_id $sth = $dbh->prepare("SELECT id, userregexp, user_group_map.group_id
FROM groups FROM `groups`
LEFT JOIN user_group_map LEFT JOIN user_group_map
ON groups.id = user_group_map.group_id ON groups.id = user_group_map.group_id
AND user_group_map.user_id = ? AND user_group_map.user_id = ?
......
...@@ -683,7 +683,7 @@ sub userDataToVars { ...@@ -683,7 +683,7 @@ sub userDataToVars {
) THEN 1 ELSE 0 END) ) THEN 1 ELSE 0 END)
AS derivedmember, AS derivedmember,
COUNT(directbless.group_id) AS directbless COUNT(directbless.group_id) AS directbless
FROM groups FROM `groups`
LEFT JOIN user_group_map AS directmember LEFT JOIN user_group_map AS directmember
ON directmember.group_id = id ON directmember.group_id = id
AND directmember.user_id = ? AND directmember.user_id = ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment