2981
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
.frm
File Structure ................................................................... 2991
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
CHECK TABLE
and
OPTIMIZE TABLE
. This restriction is lifted
beginning with MySQL 5.0.17.
• The locking statements
LOCK TABLES
and
UNLOCK TABLES
.
•
ALTER VIEW
. (Before MySQL 5.0.46, this restriction is enforced only for stored functions.)
•
LOAD DATA
and
LOAD TABLE
.
• SQL prepared statements (
PREPARE
,
EXECUTE
,
DEALLOCATE PREPARE
). Implication: You cannot
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
Section 13.5, “SQL Syntax
for Prepared Statements”
.
• 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,
SELECT ...
INTO local_var
cannot be used as a prepared statement. This restriction also applies to stored
procedure and function parameters. See
Section 13.5.1, “
PREPARE
Syntax”
.
• Inserts cannot be delayed.
INSERT DELAYED
syntax is accepted but the statement is handled as a
normal
INSERT
.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...