User-defined variables not working ONLY on first query in chained replication

2013-07-16 Thread Matthew Ward
I've noticed a weird issue in our chained replication environment where when setting user-defined variables, the first time the variable is used in a session the value is NULL, but all uses thereafter work correctly. The environment is such: we have a master (master1), which has a slave which

Re: User-defined variables not working ONLY on first query in chained replication

2013-07-16 Thread Jesper Wisborg Krogh
Hi Matthew, On 16/07/2013 21:21, Matthew Ward wrote: I've noticed a weird issue in our chained replication environment where when setting user-defined variables, the first time the variable is used in a session the value is NULL, but all uses thereafter work correctly. snip The first time I

Re: User defined Variables

2011-10-17 Thread Kailash R
Thank you Dan. Great find !! That was the answer. group_concat was truncating my results and it caused my prepared sql to error out. I change the server variable dynamically whenever the 1260 warning is issued to accommodate larger and larger strings for the group by operation and it works well.

Re: User defined Variables

2011-10-16 Thread Kailash R
if there is a way to increase the size of user defined variables ? I am not able to attribute a type to them and when I assign @sql = 'a_text _field' , 'a_text_field' gets truncated if it exceeds the size of @sql. This is not wholesome as I am using @sql in a subsequent prepare statement

Re: User defined Variables

2011-10-16 Thread Dan Nelson
In the last episode (Oct 16), Kailash R said: Nice input Dan. Let me run some checks. My query is as follows: select group_concat(Field1), field2, field3 from table1 group by field2, field3 into str; @sql = concat(select blah ... where field1 in ' ,str); prepare stmt from @sql; execute

User defined Variables

2011-10-15 Thread Kailash R
I was wondering if there is a way to increase the size of user defined variables ? I am not able to attribute a type to them and when I assign @sql = 'a_text _field' , 'a_text_field' gets truncated if it exceeds the size of @sql. This is not wholesome as I am using @sql in a subsequent prepare

Re: User defined Variables

2011-10-15 Thread Dan Nelson
In the last episode (Oct 15), Kailash R said: I was wondering if there is a way to increase the size of user defined variables ? I am not able to attribute a type to them and when I assign @sql = 'a_text _field' , 'a_text_field' gets truncated if it exceeds the size of @sql