Skip to content
Extraits de code Groupes Projets
Valider 47ce4e49 rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

Fixes #24: !get id doesn't warn the user when repeated, it just repeat.

parent 1fc21153
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -43,6 +43,9 @@ sub get {
$result = $self->_get_next($query);
}
# if id was precised, we (and so the user) know there is no more results
$self->_clean($chan) if ($query->id >= 0);
return $result;
}
......@@ -66,11 +69,18 @@ sub get_rows {
sub _get_next {
my ($self, $query) = @_;
my $chan = $query->chan;
my $result = $self->_sth->{$chan}->fetch();
return $result if ($result);
# we come here only if there is no more data to fetch
$self->_clean($chan);
return undef;
}
sub _clean
{
my ($self, $chan) = @_;
# we take care of the db
delete $self->_sth->{$chan};
......@@ -78,8 +88,6 @@ sub _get_next {
# we remove the query
delete $self->_queries->{$chan};
return undef;
}
sub _init {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter