Error
Error Code:
1308
MariaDB Error 1308: Stored Program Label Mismatch
Description
This error occurs in MariaDB when a `LEAVE` or `ITERATE` statement within a stored procedure, function, or trigger refers to a label that does not exist or is not in the current scope. It indicates a logical or syntactical error in how labels are defined and referenced within your stored program blocks.
Error Message
%s with no matching label: %s
Known Causes
4 known causesUndefined Label Reference
A `LEAVE` or `ITERATE` statement attempts to jump to a label that has not been explicitly defined for any enclosing `BEGIN...END` block.
Mismatched Label Name
The label specified in a `LEAVE` or `ITERATE` statement does not exactly match the label of the intended block, often due to a typo or case sensitivity.
Label Out of Scope
A `LEAVE` or `ITERATE` statement tries to reference a label from an outer block that is no longer active or in the current execution scope.
Missing Block Label
A `LEAVE` or `ITERATE` statement is used, but the `BEGIN...END` block it's meant to control was not given an explicit label.
Solutions
Coming SoonGeneral Troubleshooting Tips
- Check the error message carefully for specific details
- Review recent changes that might have caused the error
- Search for the exact error code in the official documentation
- Check log files for additional context
- Try restarting the application or service