← Back to team overview

maria-developers team mailing list archive

Re: updating a string session variable from a storage engine


Hi, Rich!

On Sep 12, Rich Prohaska wrote:
> i have a MYSQL_THDVAR_STR session variable in my storage engine.  i
> want to update its value from the storage engine.  it was suggested
> that i use "THDVAR(x)=new_value" to do it.  i noticed that
> update_func_str is NOT called, so i wonder about the contract.  is the
> caller responsible for memory management?  i used PLUGIN_VAR_MEMALLOC
> for the var def.

Yes. When you assign from your code, it's just a normal assignment.
You can assign anything you want.

The update function is called when a value is assigned from SQL, like

  SET @@session.engine_x = new_value


Follow ups