From 62eecf24480520e204ab0057f8f7845c13f37c13 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Sat, 19 Feb 2005 00:01:47 +0000 Subject: Bug 280494: Replace "SELECT LAST_INSERT_ID()" with Bugzilla::DB function call Patch By Tomas Kopal r=mkanat, a=justdave --- Bugzilla/Auth/Login/WWW/CGI.pm | 2 +- Bugzilla/Auth/Login/WWW/Env.pm | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'Bugzilla/Auth') diff --git a/Bugzilla/Auth/Login/WWW/CGI.pm b/Bugzilla/Auth/Login/WWW/CGI.pm index 10eb85f60..98999a368 100644 --- a/Bugzilla/Auth/Login/WWW/CGI.pm +++ b/Bugzilla/Auth/Login/WWW/CGI.pm @@ -72,7 +72,7 @@ sub login { VALUES (?, ?, NOW())", undef, $userid, $ipaddr); - my $logincookie = $dbh->selectrow_array("SELECT LAST_INSERT_ID()"); + my $logincookie = $dbh->bz_last_key('logincookies', 'cookie'); # Remember cookie only if admin has told so # or admin didn't forbid it and user told to remember. diff --git a/Bugzilla/Auth/Login/WWW/Env.pm b/Bugzilla/Auth/Login/WWW/Env.pm index abd176315..54e202bbf 100644 --- a/Bugzilla/Auth/Login/WWW/Env.pm +++ b/Bugzilla/Auth/Login/WWW/Env.pm @@ -116,9 +116,7 @@ sub login { "realname, disabledtext " . ") VALUES ( ?, ?, ?, '' )"); $sth->execute($env_email, '*', $env_realname); - $sth = $dbh->prepare("SELECT last_insert_id()"); - $sth->execute(); - $matched_userid = $sth->fetch->[0]; + $matched_userid = $dbh->bz_last_key('profiles', 'userid'); } } } -- cgit v1.2.3-24-g4f1b