>>>>> "Joseph" == Joseph Lukas <jlukas79@stripped> writes:
Joseph> I am having last minute issues with these 2 statements. I have spent
Joseph> most of the day looking at the issue but have not had any luck solving
Joseph> it. If the prepared statements contain a SET STATEMENT they will work
Joseph> However when you put something like SET STATEMENT var1 = X FOR EXECUTE
Joseph> mystatement1; I get errors/crash. After working on it for most of
Joseph> the day I have determined that the error is caused by the Items being
Joseph> removed. The pointers become invalid and forces a crash. The set_var,
Joseph> and sys_var's both stay valid from my set_var list used by the reset
Joseph> function only the Items containing the values disappear.
The reason for this is that MySQL automaticly deletes all items after
the end of the statement.
Can you provide us with what exactly goes wrong ?
In your case, there is some things you can do:
- Ensure that you don't call free_items() in the middle of a statement.
- If you want to remember items over several statements, like we do
with prepare, you need to provide your own memroot for the duration
of your items. See Prepared_statement::prepare().