let $success= 1; --echo # The next two variants do not expand the content of $success --echo # I would call this a bug --echo # Execute: --echo # success: $success --echo # success: $success --echo # Execute: echo # success: $success ; echo # success: $success ; --echo # The next two variants work fine and expand the content of $success --echo # Execute: --echo $success --echo $success --echo # Execute: echo $success ; echo $success ; --echo # The workaround with "eval SELECT ... $success is uncomfortable, because --echo # - the statement itself is not of interest --echo # --> temporary suppress protocolling with "--disable_query_log" --echo # - a running server is needed --echo # - the statement causes annoying activities when we somebody executes the test --echo # within a debugger --echo # - the statement might cause printouts in some logs --echo # Execute: eval SELECT "# check success: $success" AS ''; --disable_query_log eval SELECT "# check success: $success" AS ''; --enable_query_log