If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Replace "SELECT LAST_INSERT_ID()" with Bugzilla::DB function call

RESOLVED FIXED in Bugzilla 2.20

Status

()

Bugzilla
Bugzilla-General
--
enhancement
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: Tomas Kopal, Assigned: Tomas Kopal)

Tracking

unspecified
Bugzilla 2.20
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

9.61 KB, patch
Max Kanat-Alexander
: review+
Details | Diff | Splinter Review
(Assignee)

Description

13 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050110 Firefox/1.0 (Debian package 1.0+dfsg.1-2)
Build Identifier: 

"SELECT LAST_INSERT_ID()" is MySQL specific and should be replaced with DB
agnostic call to function in the DB compatibility layer.

Reproducible: Always

Steps to Reproduce:
(Assignee)

Updated

13 years ago
Blocks: 280493
(Assignee)

Comment 1

13 years ago
Created attachment 173951 [details] [diff] [review]
V1

Patch replacing LAST_INSERT_ID() SQL function with DB compatibility module
call.
Attachment #173951 - Flags: review?

Updated

13 years ago
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → Bugzilla 2.20

Updated

13 years ago
Assignee: general → Tomas.Kopal
Status: ASSIGNED → NEW
Comment on attachment 173951 [details] [diff] [review]
V1

r=wurblzap by inspection.
Attachment #173951 - Flags: review? → review+

Comment 3

13 years ago
Comment on attachment 173951 [details] [diff] [review]
V1

Actually, I don't think this can be approved just by inspection. The DBI 1.43
changelog says:

"Fixed last_insert_id(...) thanks to Rudy Lippan."

We currently only require DBI 1.36. We have to see if bz_last_key actually
works properly on the version of DBI that we require.
Attachment #173951 - Flags: review?

Comment 4

13 years ago
Comment on attachment 173951 [details] [diff] [review]
V1

Yes, in fact, here's the DBI 1.38 changelog:

"Added $dbh->last_insert_id method."
Attachment #173951 - Flags: review? → review-
(In reply to comment #3)
(In reply to comment #4)

I don't get it... Shouldn't then get the patch on bug 237862 get the r-, and
this one r+?

Comment 6

13 years ago
Well... that's an interesting question. I'll address it in bug 237862. I think
you're probably right, though.
Status: NEW → ASSIGNED
(Assignee)

Comment 7

13 years ago
(In reply to comment #6)
> Well... that's an interesting question. I'll address it in bug 237862. I think
> you're probably right, though.

Ok, so is this r+ or r- from you? :-)

Comment 8

13 years ago
(In reply to comment #7)
> Ok, so is this r+ or r- from you? :-)

r-. See bug 237862. I've also discovered that only the cutting-edge version of
DBD::mysql supports last_insert_id, and only a development version of DBD::Pg
supports it. So at this point, we really shouldn't use it for our db compat
layer. :-)

Comment 9

13 years ago
Comment on attachment 173951 [details] [diff] [review]
V1

Oh, nevermind! :-) Tomas has explained that bz_last_key does in fact work, and
it's overridden in the subclasses. :-)
Attachment #173951 - Flags: review- → review+
(Assignee)

Comment 10

13 years ago
Created attachment 174559 [details] [diff] [review]
V1.1, unbitrotted
Attachment #173951 - Attachment is obsolete: true
Attachment #174559 - Flags: review?

Comment 11

13 years ago
Comment on attachment 174559 [details] [diff] [review]
V1.1, unbitrotted

r=mkanat by inspection and by assuring that there are no LAST_INSERT_ID
statements left after this.
Attachment #174559 - Flags: review? → review+

Updated

13 years ago
Flags: approval?
Here goes nothing.

Someone better be prepared to hit landfill/bugzilla-tip an hour or two after
this lands and play with it like crazy :)
Flags: approval? → approval+

Comment 13

13 years ago
Checking in attachment.cgi;
/cvsroot/mozilla/webtools/bugzilla/attachment.cgi,v  <--  attachment.cgi
new revision: 1.70; previous revision: 1.69
done
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.344; previous revision: 1.343
done
Checking in editgroups.cgi;
/cvsroot/mozilla/webtools/bugzilla/editgroups.cgi,v  <--  editgroups.cgi
new revision: 1.47; previous revision: 1.46
done
Checking in editproducts.cgi;
/cvsroot/mozilla/webtools/bugzilla/editproducts.cgi,v  <--  editproducts.cgi
new revision: 1.70; previous revision: 1.69
done
Checking in editusers.cgi;
/cvsroot/mozilla/webtools/bugzilla/editusers.cgi,v  <--  editusers.cgi
new revision: 1.76; previous revision: 1.75
done
Checking in importxml.pl;
/cvsroot/mozilla/webtools/bugzilla/importxml.pl,v  <--  importxml.pl
new revision: 1.41; previous revision: 1.40
done
Checking in post_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v  <--  post_bug.cgi
new revision: 1.101; previous revision: 1.100
done
Checking in Bugzilla/Auth/Login/WWW/CGI.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/WWW/CGI.pm,v  <--  CGI.pm
new revision: 1.6; previous revision: 1.5
done
Checking in Bugzilla/Auth/Login/WWW/Env.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/WWW/Env.pm,v  <--  Env.pm
new revision: 1.2; previous revision: 1.1
done
Checking in contrib/bug_email.pl;
/cvsroot/mozilla/webtools/bugzilla/contrib/bug_email.pl,v  <--  bug_email.pl
new revision: 1.24; previous revision: 1.23
done
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.