There is a function:
BEGIN DECLARE check_id BIGINT(20); SELECT id INTO check_id FROM answers WHERE id=data_id; check_while: WHILE ISNULL(check_id) DO SELECT id INTO check_id FROM answers WHERE id=data_id; END WHILE check_while; RETURN check_id; END Let the records in the answers table at the moment 4pcs. id: 1, 2, 3, 4.
I launch function with data_id = 5.
Then in the table of answers I add one more entry with id 5.
The cycle does not stop and I do not get an answer 5. What is the problem?
answers.id? - Akina