Deterministic expression is an expression that doesn't use non-deterministic functions.
Non-deterministic function is a function that for equal input sets returns the same result set.
E.g.: LENGTH() function of VARCHAR fields.
'a' = 'a '
LENGTH('a') = 1 != 2 = LENGTH('a ')
So, for equal input variables LENGTH() function returns different results.
Therefore, LENGTH() of VARCHARs is non-deterministic.
This task is a subtask for MDEV-11588.
Non-deterministic expressions of GROUP BY fields are not functionally dependent on GROUP BY fields. Therefore, can't be used in SELECT list, HAVING and ORDER BY clauses.