I want to run this command when I start a MySQL session:
SET SESSION MAX_EXECUTION_TIME = 1000
But I am running this on two different MySQL versions, and one of them doesn't support MAX_EXECUTION_TIME
so I get this error:
Unknown system variable 'MAX_EXECUTION_TIME'
I want to do something like
IF MAX_EXECUTION_TIME EXISTS THEN
SET SESSION MAX_EXECUTION_TIME = 1000
END IF
I have tried searching for things like "check if variable exists", "check if system variable exists", and "set system variable only if it exists" but I haven't found anything.
What is the right syntax for this?