Now if I call the procedure as follows:
it still returns no errors.
It only returns an error if the condition in IF evaluates to true:
This behavior makes it very difficult to design stored procedures.
The error should happen during CREATE PROCEDURE time.
In this context, x can only be a variable. It cannot be a column because no tables are involved.