This works now:

 

SELECT @a \\:= 1, @b \\:= 2, @a + @b

 

 

Thanks to Strong Liu's fix:

 

https://hibernate.onjira.com/browse/HHH-2697

 

However, you need to modify the query, which I don't like as it's not "native" then.

It should be fixed by looking ahead for the '='.

But that would be much more complex  - := is MySQL specific, and therefore implementing that would involve moving this exception to Dialect.