Permalink
Browse files

getLastInsertId() was taking two strings which weren't used by MySQL but

might have been used for other DBs.  Change that to a hashref.
  • Loading branch information...
1 parent 386488b commit 17b31c8c1dd1b519883805eaa6c4fc47e6743f08 @jamiemccarthy jamiemccarthy committed Jul 23, 2003
Showing with 6 additions and 6 deletions.
  1. +4 −4 Slash/DB/MySQL/MySQL.pm
  2. +1 −1 plugins/Journal/Journal.pm
  3. +1 −1 plugins/Messages/DB/MySQL/MySQL.pm
View
@@ -1295,7 +1295,7 @@ sub getSessionInstance {
last_sid => $last_sid,
last_subid => $last_subid
});
- $session_out = $self->getLastInsertId('sessions', 'session');
+ $session_out = $self->getLastInsertId({ table => 'sessions', prime => 'session' });
}
return $session_out;
@@ -1720,7 +1720,7 @@ sub createContentFilter {
err_message => ''
});
- my $filter_id = $self->getLastInsertId('content_filters', 'filter_id');
+ my $filter_id = $self->getLastInsertId({ table => 'content_filters', prime => 'filter_id' });
return $filter_id;
}
@@ -1758,7 +1758,7 @@ sub createUser {
passwd => encryptPassword(changePassword())
});
- my $uid = $self->getLastInsertId('users', 'uid');
+ my $uid = $self->getLastInsertId({ table => 'users', prime => 'uid' });
unless ($uid) {
$self->{_dbh}->rollback;
$self->{_dbh}->{AutoCommit} = 1;
@@ -7382,7 +7382,7 @@ sub createTemplate {
delete $hash->{version};
$self->sqlInsert('templates', $hash);
- my $tpid = $self->getLastInsertId('templates', 'tpid');
+ my $tpid = $self->getLastInsertId({ table => 'templates', prime => 'tpid' });
return $tpid;
}
@@ -135,7 +135,7 @@ sub create {
posttype => $posttype,
});
- my($id) = $self->getLastInsertId('journals', 'id');
+ my($id) = $self->getLastInsertId({ table => 'journals', prime => 'id' });
return unless $id;
$self->sqlInsert("journals_text", {
@@ -195,7 +195,7 @@ sub _create {
'send' => $send || 'now',
});
- my($msg_id) = $self->getLastInsertId($table, $prime);
+ my($msg_id) = $self->getLastInsertId({ table => $table, prime => $prime });
return $msg_id;
}

0 comments on commit 17b31c8

Please sign in to comment.