While working on the task MDEV-16708 (Unsupported commands for prepared statements)
I hit the bug caused by incorrect handling of the ' SET STATEMENT' clause when the whole statement, containing the 'SET STATEMENT' clause, is executed in prepared statement mode.
The following test case shows the incorrect behavior:
It's expected that the output from the command SHOW CREATE TABLE t1 shows
`c1` varchar(3) CHARACTER SET utf8 NOT NULL
for the column c1 as it takes place in case this statement is run as a regular statement.
Instead, SHOW CREATE TABLE t1 outputs the following data
`c1` varchar(3) CHARACTER SET utf8 DEFAULT NULL
as a definition of the column c1