Consider the statements:
Mysql> drop function foo;
ERROR 1305 (420000): FUNCTION test, foo does not exist
Mysql > show warnings;
Mysql> get diagnostics condition 2 @msg=MESSAGE_TEXT;
What is the result of the final statement?
A.
An empty result is returned.@msg is set to message of the warning.
B.
A warning message is generated that adds error 1758 (invalid condition number) to the
diagnostics area.
C.
A line will be an output to the error log that contains the warning message details from the
failed command.
D.
An error is generated as only one condition can exist in the diagnostics area.
Tested and it’s C.
This is my Test:
drop function foo;
ERROR 1305 (42000): FUNCTION tk_check.foo does not exist
get diagnostics condition 2 @msg=MESSAGE_TEXT;
Query OK, 0 rows affected, 1 warning (0.02 sec)
show warnings;
+——-+——+————————————–+
| Level | Code | Message |
+——-+——+————————————–+
| Error | 1305 | FUNCTION tk_check.foo does not exist |
| Error | 1758 | Invalid condition number |
+——-+——+————————————–+
So it must be B !!!!
I agree with B
B, I tested