All pages
Powered by GitBook
1 of 1

Loading...

SHOW PROCEDURE CODE

Display the internal instruction representation of a stored procedure. This debug statement shows the low-level opcodes of the routine.

Syntax

SHOW PROCEDURE CODE proc_name

Description

This statement is a MariaDB extension that is available only for servers that have been built with debugging support. It displays a representation of the internal implementation of the named . A similar statement, , displays information about .

Both statements require that you be the owner of the routine or have access to the table.

If the named routine is available, each statement produces a result set. Each row in the result set corresponds to one "instruction" in the routine. The first column is Pos, which is an ordinal number beginning with 0. The second column is Instruction, which contains an SQL statement (usually changed from the original source), or a directive which has meaning only to the stored-routine handler.

Examples

See Also

This page is licensed: GPLv2, originally from

SHOW CREATE PROCEDURE
  • SHOW PROCEDURE STATUS

  • Stored Routine Privileges

  • Information Schema ROUTINES Table

  • stored procedure
    SHOW FUNCTION CODE
    stored functions
    SELECT
    mysql.proc
    Stored Procedure Overview
    CREATE PROCEDURE
    ALTER PROCEDURE
    DROP PROCEDURE
    fill_help_tables.sql
    DELIMITER //
    
    CREATE PROCEDURE p1 ()
      BEGIN
        DECLARE fanta INT DEFAULT 55;
        DROP TABLE t2;
        LOOP
          INSERT INTO t3 VALUES (fanta);
          END LOOP;
      END//
    Query OK, 0 rows affected (0.00 sec)
    
    SHOW PROCEDURE CODE p1//
    +-----+----------------------------------------+
    | Pos | Instruction                            |
    +-----+----------------------------------------+
    |   0 | set fanta@0 55                         |
    |   1 | stmt 9 "DROP TABLE t2"                 |
    |   2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |
    |   3 | jump 2                                 |
    +-----+----------------------------------------+