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 {
" THEN 1 ELSE 0 END," .
" CASE WHEN groups.id IN($grouplist) THEN 1 ELSE 0 END," .
" isactive, membercontrol, othercontrol" .
" FROM groups" .
" FROM `groups`" .
" LEFT JOIN bug_group_map" .
" ON bug_group_map.group_id = groups.id" .
" AND bug_id = ?" .
......
......@@ -127,7 +127,7 @@ sub _load_from_db {
return if $id > MAX_INT_32;
$object_data = $dbh->selectrow_hashref(qq{
SELECT $columns FROM $table
SELECT $columns FROM `$table`
WHERE $id_field = ?}, undef, $id);
} else {
unless (defined $param->{name} || (defined $param->{'condition'}
......@@ -154,7 +154,7 @@ sub _load_from_db {
map { trick_taint($_) } @values;
$object_data = $dbh->selectrow_hashref(
"SELECT $columns FROM $table WHERE $condition", undef, @values);
"SELECT $columns FROM `$table` WHERE $condition", undef, @values);
}
return $object_data;
}
......@@ -387,7 +387,7 @@ sub _do_list_select {
}
if (!$objects) {
my $sql = "SELECT $cols FROM $table";
my $sql = "SELECT $cols FROM `$table`";
if (defined $where) {
$sql .= " WHERE $where ";
}
......@@ -528,7 +528,7 @@ sub update {
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;
Bugzilla::Hook::process('object_end_of_update',
......@@ -561,7 +561,7 @@ sub remove_from_db {
my $dbh = Bugzilla->dbh;
$dbh->bz_start_transaction();
$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();
if ($self->USE_MEMCACHED) {
Bugzilla->memcached->clear({ table => $table, id => $self->id });
......@@ -638,7 +638,7 @@ sub any_exist {
my $table = $class->DB_TABLE;
my $dbh = Bugzilla->dbh;
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;
}
......@@ -739,7 +739,7 @@ sub insert_create_data {
my $qmarks = '?,' x @field_names;
chop($qmarks);
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);
my $id = $dbh->bz_last_key($table, $class->ID_FIELD);
......
......@@ -580,7 +580,7 @@ sub group_controls {
# Include name to the list, to allow us sorting data more easily.
my $query = qq{SELECT id, name, entry, membercontrol, othercontrol,
canedit, editcomponents, editbugs, canconfirm
FROM groups
FROM `groups`
LEFT JOIN group_control_map
ON id = group_id
$where_or_and product_id = ?
......
......@@ -1641,7 +1641,7 @@ sub derive_regexp_groups {
# add derived records for any matching regexps
$sth = $dbh->prepare("SELECT id, userregexp, user_group_map.group_id
FROM groups
FROM `groups`
LEFT JOIN user_group_map
ON groups.id = user_group_map.group_id
AND user_group_map.user_id = ?
......
......@@ -683,7 +683,7 @@ sub userDataToVars {
) THEN 1 ELSE 0 END)
AS derivedmember,
COUNT(directbless.group_id) AS directbless
FROM groups
FROM `groups`
LEFT JOIN user_group_map AS directmember
ON directmember.group_id = 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