List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:May 13 2008 3:04pm
Subject:Re: Lifetime of statement-based storage engine resources
View as plain text  
Hi!

>>>>> "Sergei" == Sergei Golubchik <serg@stripped> writes:

Sergei> Hi!
Sergei> On May 09, Timothy P Clark wrote:
>> 
>> As it is, I'm having to scatter code to clean up resources across
>> several of these functions. Then it's a process of trial and error
>> while I figure out what is being freed too early and what is leaking.
>> What I need is a single handler method that MySQL calls to say, "This
>> statement is done; results have been sent to the user; whatever
>> resources you needed internally to accomplish this operation may now
>> be freed." Am I missing something that already exists? Is there a
>> reliable way to do this with the current design?

Sergei> It's external_lock() at the moment (called with lock_type=F_UNLCK).

A better place is to do it in handler::reset(), called by
handler::ha_reset() which is called by close_thread_table() after each
statement.

The idea of the 'handler::reset()' is to set the handler to a state as
if we just had opened the table but not yet done anything with it.

Regards,
Monty
Thread
Lifetime of statement-based storage engine resourcesTimothy P Clark9 May
  • Re: Lifetime of statement-based storage engine resourcesSergei Golubchik9 May
    • Re: Lifetime of statement-based storage engine resourcesMichael Widenius13 May
      • Re: Lifetime of statement-based storage engine resourcesTimothy P Clark13 May