why NULL not error in new session?
concerning @s_var1 variable, why in a new session there is an output NULL, not an error = "we don't have such a variable"? Was its name saved somewhere?
Thanks for reaching out.
We cannot use this variable in another session because we defined it as a session variable. This is because it is NULL. There is no error, MySQL just displays NULL. You can test with another variable:
@s_var2 and the result will be the same.
Hope this helps.