{DEALLOCATE | DROP} PREPARE stmt_name
要释放通过 PREPARE 生成的预处理语句,请使用引用该预处理语句名称的 DEALLOCATE PREPARE 语句。在释放预处理语句后尝试执行它会导致错误。如果创建了太多预处理语句且没有通过 DEALLOCATE PREPARE 语句或会话结束释放,你可能会遇到由 max_prepared_stmt_count 系统变量强制执行的上限。To deallocate a prepared statement produced with
PREPARE, use a
DEALLOCATE PREPARE statement that
refers to the prepared statement name. Attempting to execute a
prepared statement after deallocating it results in an error. If
too many prepared statements are created and not deallocated by
either the DEALLOCATE PREPARE statement or the
end of the session, you might encounter the upper limit enforced
by the max_prepared_stmt_count
system variable.
示例请参见 第 15.5 节,“预处理语句”。For examples, see Section 15.5, “Prepared Statements”.