web/modules/rhn/RHN/DB/Channel.pm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
New commits:
commit 9dde64d8c3301a671f1026dac890db81a0865520
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Oct 6 10:24:39 2010 +0200
Use the utility sequence_nextval method instead of direct rhn_channel_id_seq.nextval,
to allow portable nextval operation.
diff --git a/web/modules/rhn/RHN/DB/Channel.pm b/web/modules/rhn/RHN/DB/Channel.pm
index 5eb6e32..d1c0c01 100644
--- a/web/modules/rhn/RHN/DB/Channel.pm
+++ b/web/modules/rhn/RHN/DB/Channel.pm
@@ -81,11 +81,8 @@ sub commit {
if ($self->id == -1) {
my $dbh = $transaction || RHN::DB->connect;
- my $sth = $dbh->prepare("SELECT rhn_channel_id_seq.nextval FROM DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- die "No new channel id from seq rhn_channel_id_seq (possible error: " .
$sth->errstr . ")" unless $id;
- $sth->finish;
+ my $id = $dbh->sequence_nextval('rhn_channel_id_seq');
+ die "No new channel id from seq rhn_channel_id_seq" unless $id;
$self->{":modified:"}->{id} = 1;
$self->{__id__} = $id;
Show replies by date