Deterministic functions are described with "always returns the same result set"
What does it mean? If function will always (no matter what) return a value of defined type? If yes, than should I make this function as deterministic?
FUNCTION AccToID(Acc VARCHAR)
RETURNS INT
BEGIN
RETURN (SELECT `ID` FROM account WHERE accountName=Acc);
END
It can return null (an empty set?) or INT, so I guess it's non-deterministic function
I am confused with this, if I will mark this function as deterministic and it will return null value then it's undefined behaviour?
Maybe I can add a condition to reverse NULL into -1, but this is selfkilling idea