Appendix E. Restrictions and Limits
Table of Contents
E.1. Restrictions on Stored Programs ....................................................................................... 2981
E.2. Restrictions on Server-Side Cursors .................................................................................. 2983
E.3. Restrictions on Subqueries ............................................................................................... 2984
E.4. Restrictions on Views ....................................................................................................... 2985
E.5. Restrictions on XA Transactions ....................................................................................... 2987
E.6. Restrictions on Character Sets ......................................................................................... 2988
E.7. Limits in MySQL .............................................................................................................. 2988
E.7.1. Limits of Joins ....................................................................................................... 2988
E.7.2. Limits on Number of Databases and Tables ............................................................ 2988
E.7.3. Limits on Table Size .............................................................................................. 2989
E.7.4. Limits on Table Column Count and Row Size ......................................................... 2990
E.7.5. Limits Imposed by
E.7.6. Windows Platform Limitations ................................................................................ 2992
The discussion here describes restrictions that apply to the use of MySQL features such as subqueries
or views.
E.1. Restrictions on Stored Programs
Some of the restrictions noted here apply to all stored routines; that is, both to stored procedures and
stored functions. Some of these restrictions apply to stored functions but not to stored procedures.
The restrictions for stored functions also apply to triggers.
Stored routines cannot contain arbitrary SQL statements. The following statements are not permitted:
• The table-maintenance statements
beginning with MySQL 5.0.17.
• The locking statements
•
VIEW. (Before MySQL 5.0.46, this restriction is enforced only for stored functions.)
ALTER
•
LOAD DATA
• SQL prepared statements (PREPARE, EXECUTE,
use dynamic SQL within stored routines (where you construct dynamically statements as strings and
then execute them). This restriction is lifted as of MySQL 5.0.13 for stored procedures; it still applies
to stored functions and triggers.
Generally, statements not permitted in SQL prepared statements are also not permitted in stored
programs. For a list of statements supported as prepared statements, see
for Prepared
• Because local variables are in scope only during stored program execution, references to them
are not permitted in prepared statements created within a stored program. Prepared statement
scope is the current session, not the stored program, so the statement could be executed after the
program ends, at which point the variables would no longer be in scope. For example,
INTO local_var
procedure and function parameters. See
• Inserts cannot be delayed.
normal INSERT.
.frm
LOCK TABLES
and
LOAD
TABLE.
Statements".
cannot be used as a prepared statement. This restriction also applies to stored
INSERT DELAYED
File Structure ................................................................... 2991
and
CHECK TABLE
OPTIMIZE
and
UNLOCK
TABLES.
DEALLOCATE
Section 13.5.1,
"PREPARE
syntax is accepted but the statement is handled as a
2981
TABLE. This restriction is lifted
PREPARE). Implication: You cannot
Section 13.5, "SQL Syntax
Syntax".
SELECT ...
Need help?
Do you have a question about the 5.0 and is the answer not in the manual?
Questions and answers