Revision 873a9a83
Von Moritz Bunkus vor fast 11 Jahren hinzugefügt
SL/CVar.pm | ||
---|---|---|
589 | 589 |
|
590 | 590 |
my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); |
591 | 591 |
|
592 |
my $query = qq|SELECT COUNT(*) FROM custom_variables_validity WHERE config_id = ? AND trans_id = ?|;
|
|
592 |
my $query = qq|SELECT id FROM custom_variables_validity WHERE config_id = ? AND trans_id = ? LIMIT 1|;
|
|
593 | 593 |
|
594 | 594 |
my ($invalid) = selectfirst_array_query($form, $dbh, $query, conv_i($params{config_id}), conv_i($params{trans_id})); |
595 | 595 |
|
... | ... | |
611 | 611 |
|
612 | 612 |
my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); |
613 | 613 |
|
614 |
my $query = qq|SELECT config_id, COUNT(*) FROM custom_variables_validity WHERE trans_id = ? GROUP BY config_id|;
|
|
614 |
my $query = qq|SELECT DISTINCT config_id FROM custom_variables_validity WHERE trans_id = ?|;
|
|
615 | 615 |
|
616 |
my %invalids = selectall_as_map($form, $dbh, $query, 'config_id', 'count', $params{trans_id});
|
|
616 |
my %invalids = map { +($_->{config_id} => 1) } selectall_hashref_query($form, $dbh, $query, $params{trans_id});
|
|
617 | 617 |
|
618 | 618 |
$main::lxdebug->leave_sub(2); |
619 | 619 |
|
Auch abrufbar als: Unified diff
Benutzerdefinierte Variablen: weniger kostende Queries zur Gültigkeitsabfrage verwenden
Die Anzahl der Einträge in custom_variables_validity ist irrelevant,
die Existenz mindestens eines Eintrags hingegen gefragt.