Syntax\n------\n\nSET STATEMENT var1=value1 [, var2=value2, ...] \n  FOR <statement>\n\nDescription\n-----------\n\nSET STATEMENT var1=value1 FOR stmt\n\nis roughly equivalent to\n\n``sql\nSET @save_value=@@var1;\nSET SESSION var1=value1;\nstmt;\nSET SESSION var1=@save_value;\n``\n\nThe server parses the whole statement before executing it, so any variables set in this fashion that affect the parser may not have the expected effect. Examples include the charset variables, sql_mode=ansi_quotes, etc.\n\nExamples\n--------\n\nSET STATEMENT max_statement_time=1000 FOR SELECT ... ;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-statement