And it's not supposed to. I'm not sure how these made it in, but they need to not do so. Patch coming momentarily.

Comments

Crell’s picture

Status: Active » Needs review
StatusFileSize
new3.05 KB

OK, a bit more than a moment. Sorry. :-) There's 2 remaining db_query() calls in DatabaseConnection_mysql::nextIdDelete(), because it's static. I need to confirm with chx how we can remove those. That will come in a later patch, after we confirm how to do that safely.

Crell’s picture

Status: Needs review » Postponed

Well, this got rolled into #722912: db_index_exists() must conform schemaAPI indexExists() anyway. After that goes in we can use this issue for additional cleanup.

Crell’s picture

Status: Postponed » Needs review
StatusFileSize
new2.79 KB

OK, since everything from #1 got moved into another patch, here's the last bit. This still needs testing. The problem is that shutdown functions in PHP are all kindsa weird. However, making this method static breaks because then it will run on whatever connection happens to be active at the end of the request, not on the connection that generated the new ID. (We have no guarantee that those will be the same.) So this tries to move it to a dynamic method.

Someone who has PHP 5.3, please test this there as well. I fear the PHP devs broke shutdown functions there. Again. As always. *sigh*

Status: Needs review » Needs work

The last submitted patch, 726344-b-nextIdDelete.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new2.86 KB

We are already inside the connection class, no need to use $this->connection :)

Also changed the patch to use drupal_register_shutdown_function().

Let's try this...

Crell’s picture

Oh Crell you idiot...

#5 makes sense to me, with one predictable caveat. :-) Is there any way we can do it without the Drupal-specific shutdown register function? Please?

berdir’s picture

Yeah, I know, inheritance and stuff :)

The point of drupal_register_shutdown_function() is to be able to catch and report exceptions during shutdown functions. If we don't use it, we have to use the same catching as in http://api.drupal.org/api/function/_drupal_shutdown_function/7 or live with possible, untraceable "Exception thrown without strack trace in line 0" fatal errors.

Crell’s picture

Status: Needs review » Needs work

The odds of an exception here seem very slim. I am not really worried about that. Can we have a reroll without the dependency?

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new2.86 KB

Ok, untested re-roll.

Crell’s picture

Status: Needs review » Reviewed & tested by the community

The bot likes, I like, everybody likes. Thanks Berdir!

dries’s picture

Status: Reviewed & tested by the community » Fixed

Looks good. Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.