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:
Created attachment 173951 [details] [diff] [review] V1 Patch replacing LAST_INSERT_ID() SQL function with DB compatibility module call.
Comment on attachment 173951 [details] [diff] [review] V1 r=wurblzap by inspection.
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.
Comment on attachment 173951 [details] [diff] [review] V1 Yes, in fact, here's the DBI 1.38 changelog: "Added $dbh->last_insert_id method."
(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.
(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. :-)
Created attachment 174559 [details] [diff] [review] V1.1, unbitrotted
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.
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 :)
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