Closed Bug 280494 Opened 20 years ago Closed 20 years ago

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

Categories

(Bugzilla :: Bugzilla-General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: Tomas.Kopal, Assigned: Tomas.Kopal)

References

Details

Attachments

(1 file, 1 obsolete file)

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:
Blocks: 280493
Attached patch V1 (obsolete) — Splinter Review
Patch replacing LAST_INSERT_ID() SQL function with DB compatibility module call.
Attachment #173951 - Flags: review?
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → Bugzilla 2.20
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 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 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+?
Well... that's an interesting question. I'll address it in bug 237862. I think you're probably right, though.
Status: NEW → ASSIGNED
(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? :-)
(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 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+
Attachment #173951 - Attachment is obsolete: true
Attachment #174559 - Flags: review?
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+
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+
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
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: