Author: paul
Date: 2007-01-10 18:12:16 +0100 (Wed, 10 Jan 2007)
New Revision: 4437
Log:
r14371@frost: paul | 2007-01-10 09:50:56 -0600
Document SHOW PROCEDURE/FUNCTION CODE. (WL#3563)
Modified:
trunk/refman-5.0/news-5.0.xml
trunk/refman-5.0/sql-syntax.xml
trunk/refman-5.1/news-5.1.xml
trunk/refman-5.1/sql-syntax.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:17897
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:14282
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:13015
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:17897
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:14371
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:13015
Modified: trunk/refman-5.0/news-5.0.xml
===================================================================
--- trunk/refman-5.0/news-5.0.xml 2007-01-10 16:08:11 UTC (rev 4436)
+++ trunk/refman-5.0/news-5.0.xml 2007-01-10 17:12:16 UTC (rev 4437)
Changed blocks: 1, Lines Added: 9, Lines Deleted: 0; 657 bytes
@@ -7831,6 +7831,15 @@
</para>
</listitem>
+ <listitem>
+ <para>
+ Added the <literal>SHOW FUNCTION CODE</literal> and
+ <literal>SHOW PROCEDURE CODE</literal> statements (available
+ only for servers that have been built with debugging support).
+ See <xref linkend="show-procedure-code"/>.
+ </para>
+ </listitem>
+
</itemizedlist>
<para>
Modified: trunk/refman-5.0/sql-syntax.xml
===================================================================
--- trunk/refman-5.0/sql-syntax.xml 2007-01-10 16:08:11 UTC (rev 4436)
+++ trunk/refman-5.0/sql-syntax.xml 2007-01-10 17:12:16 UTC (rev 4437)
Changed blocks: 8, Lines Added: 116, Lines Deleted: 8; 7411 bytes
@@ -9281,8 +9281,8 @@
Subqueries in the <literal>FROM</literal> clause can return a
scalar, column, row, or table. Subqueries in the
<literal>FROM</literal> clause cannot be correlated
- subqueries, unless used within the <literal>ON</literal> clause of
a
- <literal>JOIN</literal> operation.
+ subqueries, unless used within the <literal>ON</literal>
+ clause of a <literal>JOIN</literal> operation.
</para>
<para>
@@ -10817,13 +10817,13 @@
is standard SQL syntax and is the recommended way to start an
ad-hoc transaction.
</para>
-
+
<para>
<emphasis role="bold">Important</emphasis>: Many APIs used for
writing MySQL client applications (such as JDBC) provide their
own methods for starting transactions that can (and sometimes
should) be used instead of sending a <literal>START
- TRANSACTION</literal> statement from the client. See
+ TRANSACTION</literal> statement from the client. See
<xref linkend="apis"/>, or the documentation for your API, for
more information.
</para>
@@ -15803,6 +15803,10 @@
</indexterm>
<indexterm>
+ <primary>SHOW FUNCTION CODE</primary>
+ </indexterm>
+
+ <indexterm>
<primary>SHOW FUNCTION STATUS</primary>
</indexterm>
@@ -15835,6 +15839,10 @@
</indexterm>
<indexterm>
+ <primary>SHOW PROCEDURE CODE</primary>
+ </indexterm>
+
+ <indexterm>
<primary>SHOW PROCEDURE STATUS</primary>
</indexterm>
@@ -15901,10 +15909,12 @@
SHOW ENGINE <replaceable>engine_name</replaceable> {LOGS | STATUS }
SHOW [STORAGE] ENGINES
SHOW ERRORS [LIMIT [<replaceable>offset</replaceable>,]
<replaceable>row_count</replaceable>]
+SHOW FUNCTION CODE <replaceable>sp_name</replaceable>
SHOW FUNCTION STATUS [LIKE '<replaceable>pattern</replaceable>']
SHOW GRANTS FOR <replaceable>user</replaceable>
SHOW INDEX FROM <replaceable>tbl_name</replaceable> [FROM
<replaceable>db_name</replaceable>]
SHOW INNODB STATUS
+SHOW PROCEDURE CODE <replaceable>sp_name</replaceable>
SHOW PROCEDURE STATUS [LIKE '<replaceable>pattern</replaceable>']
SHOW [BDB] LOGS
SHOW MUTEX STATUS
@@ -16254,9 +16264,12 @@
<remark role="help-description-begin"/>
<para>
- This statement is a MySQL extension. Similar to <literal>SHOW
- CREATE TABLE</literal>, it returns the exact string that can
- be used to re-create the named routine.
+ These statements are MySQL extensions. Similar to
+ <literal>SHOW CREATE TABLE</literal>, they return the exact
+ string that can be used to re-create the named routine. The
+ statements require that you be the owner of the routine or
+ have <literal>SELECT</literal> access to the
+ <literal>mysql.proc</literal> table.
</para>
<remark role="help-description-end"/>
@@ -17478,6 +17491,101 @@
</section>
+ <section id="show-procedure-code">
+
+ <title><literal>SHOW PROCEDURE CODE</literal> and
<literal>SHOW FUNCTION
+ CODE</literal> Syntax</title>
+
+ <indexterm>
+ <primary>SHOW PROCEDURE CODE</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>SHOW FUNCTION CODE</primary>
+ </indexterm>
+
+ <remark role="help-topic" condition="SHOW PROCEDURE CODE"/>
+
+ <remark role="help-keywords">
+ SHOW PROCEDURE FUNCTION CODE
+ </remark>
+
+ <remark role="help-syntax"/>
+
+<programlisting>
+SHOW {PROCEDURE | FUNCTION} CODE <replaceable>sp_name</replaceable>
+</programlisting>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ These statements are MySQL extensions that are available only
+ for servers that have been built with debugging support. They
+ display a representation of the internal implementation of the
+ named routine. The statements require that you be the owner of
+ the routine or have <literal>SELECT</literal> access to the
+ <literal>mysql.proc</literal> table.
+ </para>
+
+ <para>
+ If the named routine is available, each statement produces a
+ result set. Each row in the result set corresponds to one
+ <quote>instruction</quote> in the routine. The first column is
+ <literal>Pos</literal>, which is an ordinal number beginning
+ with 0. The second column is <literal>Instruction</literal>,
+ which contains an SQL statement (usually changed from the
+ original source), or a directive which has meaning only to the
+ stored-routine handler.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>DELIMITER //</userinput>
+mysql> <userinput>CREATE PROCEDURE p1 ()</userinput>
+ -> <userinput>BEGIN</userinput>
+ -> <userinput>DECLARE fanta INT DEFAULT 55;</userinput>
+ -> <userinput>DROP TABLE t2;</userinput>
+ -> <userinput>LOOP</userinput>
+ -> <userinput>INSERT INTO t3 VALUES (fanta);</userinput>
+ -> <userinput>END LOOP;</userinput>
+ -> <userinput>END//</userinput>
+Query OK, 0 rows affected (0.00 sec)
+
+mysql> <userinput>SHOW PROCEDURE CODE p1//</userinput>
++-----+----------------------------------------+
+| Pos | Instruction |
++-----+----------------------------------------+
+| 0 | set fanta@0 55 |
+| 1 | stmt 9 "DROP TABLE t2" |
+| 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |
+| 3 | jump 2 |
++-----+----------------------------------------+
+4 rows in set (0.00 sec)
+</programlisting>
+
+ <para>
+ In this example, the non-executable <literal>BEGIN</literal>
+ and <literal>END</literal> statements have disappeared, and
+ for the <literal>DECLARE
+ <replaceable>variable_name</replaceable></literal> statement,
+ only the executable part appears (the part where the default
+ is assigned). For each statement that is taken from source,
+ there is a code word <literal>stmt</literal> followed by a
+ type (9 means <literal>DROP</literal>, 5 means
+ <literal>INSERT</literal>, and so on). The final row contains
+ an instruction <literal>jump 2</literal>, meaning
+ <literal>GOTO instruction #2</literal>.
+ </para>
+
+ <para>
+ These statements were added in MySQL 5.0.17.
+ </para>
+
+ </section>
+
<section id="show-procedure-status">
<title><literal>SHOW PROCEDURE STATUS</literal> and
<literal>SHOW FUNCTION
@@ -17506,7 +17614,7 @@
<remark role="help-description-begin"/>
<para>
- This statement is a MySQL extension. It returns
+ These statements are MySQL extensions. They return
characteristics of routines, such as the database, name, type,
creator, and creation and modification dates. If no pattern is
specified, the information for all stored procedures or all
Modified: trunk/refman-5.1/news-5.1.xml
===================================================================
--- trunk/refman-5.1/news-5.1.xml 2007-01-10 16:08:11 UTC (rev 4436)
+++ trunk/refman-5.1/news-5.1.xml 2007-01-10 17:12:16 UTC (rev 4437)
Changed blocks: 1, Lines Added: 9, Lines Deleted: 0; 659 bytes
@@ -13561,6 +13561,15 @@
</para>
</listitem>
+ <listitem>
+ <para>
+ Added the <literal>SHOW FUNCTION CODE</literal> and
+ <literal>SHOW PROCEDURE CODE</literal> statements (available
+ only for servers that have been built with debugging support).
+ See <xref linkend="show-procedure-code"/>.
+ </para>
+ </listitem>
+
</itemizedlist>
<para>
Modified: trunk/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/refman-5.1/sql-syntax.xml 2007-01-10 16:08:11 UTC (rev 4436)
+++ trunk/refman-5.1/sql-syntax.xml 2007-01-10 17:12:16 UTC (rev 4437)
Changed blocks: 10, Lines Added: 121, Lines Deleted: 13; 8453 bytes
@@ -10655,8 +10655,8 @@
Subqueries in the <literal>FROM</literal> clause can return a
scalar, column, row, or table. Subqueries in the
<literal>FROM</literal> clause cannot be correlated
- subqueries, unless used within the <literal>ON</literal> clause of
a
- <literal>JOIN</literal> operation.
+ subqueries, unless used within the <literal>ON</literal>
+ clause of a <literal>JOIN</literal> operation.
</para>
<para>
@@ -12174,13 +12174,13 @@
is standard SQL syntax and is the recommended way to start an
ad-hoc transaction.
</para>
-
+
<para>
<emphasis role="bold">Important</emphasis>: Many APIs used for
writing MySQL client applications (such as JDBC) provide their
own methods for starting transactions that can (and sometimes
should) be used instead of sending a <literal>START
- TRANSACTION</literal> statement from the client. See
+ TRANSACTION</literal> statement from the client. See
<xref linkend="apis"/>, or the documentation for your API, for
more information.
</para>
@@ -12216,7 +12216,7 @@
consistent snapshot only if the current isolation level is one
that allows consistent read (<literal>REPEATABLE READ</literal>
or <literal>SERIALIZABLE</literal>).
- </para>
+ </para>
<para>
Beginning a transaction causes any pending transaction to be
@@ -12354,10 +12354,10 @@
FUNCTION</literal>, <literal>DROP INDEX</literal>,
<literal>DROP PROCEDURE</literal>, <literal>DROP
TABLE</literal>, <literal>LOAD DATA INFILE</literal>
- <literal>LOCK TABLES</literal>, <literal>RENAME
TABLE</literal>,
- <literal>SET AUTOCOMMIT=1</literal>, <literal>START
- TRANSACTION</literal>, <literal>TRUNCATE TABLE</literal>,
- <literal>UNLOCK TABLES</literal>.
+ <literal>LOCK TABLES</literal>, <literal>RENAME
+ TABLE</literal>, <literal>SET AUTOCOMMIT=1</literal>,
+ <literal>START TRANSACTION</literal>, <literal>TRUNCATE
+ TABLE</literal>, <literal>UNLOCK TABLES</literal>.
</para>
</listitem>
@@ -17098,6 +17098,10 @@
</indexterm>
<indexterm>
+ <primary>SHOW FUNCTION CODE</primary>
+ </indexterm>
+
+ <indexterm>
<primary>SHOW FUNCTION STATUS</primary>
</indexterm>
@@ -17130,6 +17134,10 @@
</indexterm>
<indexterm>
+ <primary>SHOW PROCEDURE CODE</primary>
+ </indexterm>
+
+ <indexterm>
<primary>SHOW PROCEDURE STATUS</primary>
</indexterm>
@@ -17208,10 +17216,12 @@
SHOW [STORAGE] ENGINES
SHOW ERRORS [LIMIT [<replaceable>offset</replaceable>,]
<replaceable>row_count</replaceable>]
SHOW [FULL] EVENTS
+SHOW FUNCTION CODE <replaceable>sp_name</replaceable>
SHOW FUNCTION STATUS [LIKE '<replaceable>pattern</replaceable>']
SHOW GRANTS FOR <replaceable>user</replaceable>
SHOW INDEX FROM <replaceable>tbl_name</replaceable> [FROM
<replaceable>db_name</replaceable>]
SHOW INNODB STATUS
+SHOW PROCEDURE CODE <replaceable>sp_name</replaceable>
SHOW PROCEDURE STATUS [LIKE '<replaceable>pattern</replaceable>']
SHOW PLUGINS
SHOW PRIVILEGES
@@ -17691,9 +17701,12 @@
<remark role="help-description-begin"/>
<para>
- This statement is a MySQL extension. Similar to <literal>SHOW
- CREATE TABLE</literal>, it returns the exact string that can
- be used to re-create the named routine.
+ These statements are MySQL extensions. Similar to
+ <literal>SHOW CREATE TABLE</literal>, they return the exact
+ string that can be used to re-create the named routine. The
+ statements require that you be the owner of the routine or
+ have <literal>SELECT</literal> access to the
+ <literal>mysql.proc</literal> table.
</para>
<remark role="help-description-end"/>
@@ -19091,6 +19104,101 @@
</section>
+ <section id="show-procedure-code">
+
+ <title><literal>SHOW PROCEDURE CODE</literal> and
<literal>SHOW FUNCTION
+ CODE</literal> Syntax</title>
+
+ <indexterm>
+ <primary>SHOW PROCEDURE CODE</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>SHOW FUNCTION CODE</primary>
+ </indexterm>
+
+ <remark role="help-topic" condition="SHOW PROCEDURE CODE"/>
+
+ <remark role="help-keywords">
+ SHOW PROCEDURE FUNCTION CODE
+ </remark>
+
+ <remark role="help-syntax"/>
+
+<programlisting>
+SHOW {PROCEDURE | FUNCTION} CODE <replaceable>sp_name</replaceable>
+</programlisting>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ These statements are MySQL extensions that are available only
+ for servers that have been built with debugging support. They
+ display a representation of the internal implementation of the
+ named routine. The statements require that you be the owner of
+ the routine or have <literal>SELECT</literal> access to the
+ <literal>mysql.proc</literal> table.
+ </para>
+
+ <para>
+ If the named routine is available, each statement produces a
+ result set. Each row in the result set corresponds to one
+ <quote>instruction</quote> in the routine. The first column is
+ <literal>Pos</literal>, which is an ordinal number beginning
+ with 0. The second column is <literal>Instruction</literal>,
+ which contains an SQL statement (usually changed from the
+ original source), or a directive which has meaning only to the
+ stored-routine handler.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>DELIMITER //</userinput>
+mysql> <userinput>CREATE PROCEDURE p1 ()</userinput>
+ -> <userinput>BEGIN</userinput>
+ -> <userinput>DECLARE fanta INT DEFAULT 55;</userinput>
+ -> <userinput>DROP TABLE t2;</userinput>
+ -> <userinput>LOOP</userinput>
+ -> <userinput>INSERT INTO t3 VALUES (fanta);</userinput>
+ -> <userinput>END LOOP;</userinput>
+ -> <userinput>END//</userinput>
+Query OK, 0 rows affected (0.00 sec)
+
+mysql> <userinput>SHOW PROCEDURE CODE p1//</userinput>
++-----+----------------------------------------+
+| Pos | Instruction |
++-----+----------------------------------------+
+| 0 | set fanta@0 55 |
+| 1 | stmt 9 "DROP TABLE t2" |
+| 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |
+| 3 | jump 2 |
++-----+----------------------------------------+
+4 rows in set (0.00 sec)
+</programlisting>
+
+ <para>
+ In this example, the non-executable <literal>BEGIN</literal>
+ and <literal>END</literal> statements have disappeared, and
+ for the <literal>DECLARE
+ <replaceable>variable_name</replaceable></literal> statement,
+ only the executable part appears (the part where the default
+ is assigned). For each statement that is taken from source,
+ there is a code word <literal>stmt</literal> followed by a
+ type (9 means <literal>DROP</literal>, 5 means
+ <literal>INSERT</literal>, and so on). The final row contains
+ an instruction <literal>jump 2</literal>, meaning
+ <literal>GOTO instruction #2</literal>.
+ </para>
+
+ <para>
+ These statements were added in MySQL 5.1.3.
+ </para>
+
+ </section>
+
<section id="show-procedure-status">
<title><literal>SHOW PROCEDURE STATUS</literal> and
<literal>SHOW FUNCTION
@@ -19119,7 +19227,7 @@
<remark role="help-description-begin"/>
<para>
- This statement is a MySQL extension. It returns
+ These statements are MySQL extensions. They return
characteristics of routines, such as the database, name, type,
creator, and creation and modification dates. If no pattern is
specified, the information for all stored procedures or all
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r4437 - in trunk: . refman-5.0 refman-5.1 | paul | 10 Jan |